feat(search): 添加分页功能并更新版本号至1.3.26
在搜索页面添加分页控件,包括上一页/下一页按钮和分页信息显示 更新应用版本号至1.3.26,涉及config.js、manifest.json等文件
This commit is contained in:
@@ -9,7 +9,7 @@ module.exports = {
|
|||||||
// 应用名称
|
// 应用名称
|
||||||
name: "ruoyi-app",
|
name: "ruoyi-app",
|
||||||
// 应用版本
|
// 应用版本
|
||||||
version: "1.3.25",
|
version: "1.3.26",
|
||||||
// 应用logo
|
// 应用logo
|
||||||
logo: "/static/logo.jpg",
|
logo: "/static/logo.jpg",
|
||||||
// 官方网站
|
// 官方网站
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name" : "科伦普",
|
"name" : "科伦普",
|
||||||
"appid" : "__UNI__E781B49",
|
"appid" : "__UNI__E781B49",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.3.25",
|
"versionName" : "1.3.26",
|
||||||
"versionCode" : 1,
|
"versionCode" : 1,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -105,6 +105,30 @@
|
|||||||
<view class="empty-list" v-else>
|
<view class="empty-list" v-else>
|
||||||
<text>暂无符合条件的钢卷数据</text>
|
<text>暂无符合条件的钢卷数据</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 分页控件 -->
|
||||||
|
<view class="pagination" v-if="total > 0">
|
||||||
|
<view class="pagination-info">
|
||||||
|
<text>共 {{ total }} 条 / 共 {{ totalPages }} 页</text>
|
||||||
|
<text>当前第 {{ pager.pageNum }} 页</text>
|
||||||
|
</view>
|
||||||
|
<view class="pagination-btns">
|
||||||
|
<button
|
||||||
|
class="page-btn"
|
||||||
|
@click="prevPage"
|
||||||
|
:disabled="pager.pageNum <= 1"
|
||||||
|
>
|
||||||
|
上一页
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="page-btn"
|
||||||
|
@click="nextPage"
|
||||||
|
:disabled="pager.pageNum >= totalPages"
|
||||||
|
>
|
||||||
|
下一页
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 钢卷详情弹窗 -->
|
<!-- 钢卷详情弹窗 -->
|
||||||
@@ -214,14 +238,26 @@
|
|||||||
itemManufacturer: '',
|
itemManufacturer: '',
|
||||||
grossWeight: '',
|
grossWeight: '',
|
||||||
netWeight: '',
|
netWeight: '',
|
||||||
length: ''
|
length: '',
|
||||||
},
|
},
|
||||||
|
pager: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
coilDetail: {}, // 钢卷详情数据
|
coilDetail: {}, // 钢卷详情数据
|
||||||
list: [], // 钢卷列表数据
|
list: [], // 钢卷列表数据
|
||||||
loading: false,
|
loading: false,
|
||||||
currentView: 'search' // 视图切换:search=查询页,list=列表页
|
currentView: 'search' // 视图切换:search=查询页,list=列表页
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 计算总页数
|
||||||
|
totalPages() {
|
||||||
|
if (this.total === 0) return 0;
|
||||||
|
return Math.ceil(this.total / this.pager.pageSize);
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// ✅ 新增:封装通用滚动到顶部方法,uniapp全端兼容
|
// ✅ 新增:封装通用滚动到顶部方法,uniapp全端兼容
|
||||||
scrollToPageTop() {
|
scrollToPageTop() {
|
||||||
@@ -244,22 +280,26 @@
|
|||||||
|
|
||||||
// 查询钢卷列表(原有方法优化+✅新增滚动到顶部)
|
// 查询钢卷列表(原有方法优化+✅新增滚动到顶部)
|
||||||
async searchCoilList() {
|
async searchCoilList() {
|
||||||
|
// 重置页码为1
|
||||||
|
this.pager.pageNum = 1;
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在查询,请稍后'
|
title: '正在查询,请稍后'
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const res = await listMaterialCoil({
|
const res = await listMaterialCoil({
|
||||||
...this.form,
|
...this.form,
|
||||||
pageNum: 1,
|
...this.pager,
|
||||||
pageSize: 20,
|
|
||||||
selectType: this.form.itemType
|
selectType: this.form.itemType
|
||||||
});
|
});
|
||||||
this.list = res.rows || [];
|
this.list = res.rows || [];
|
||||||
|
this.total = res.total || 0;
|
||||||
console.log(this.list)
|
console.log(this.list)
|
||||||
this.currentView = 'list'
|
this.currentView = 'list'
|
||||||
// ✅ 切换视图后,滚动到页面顶部
|
// ✅ 切换视图后,滚动到页面顶部
|
||||||
this.scrollToPageTop()
|
this.scrollToPageTop()
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.error('查询钢卷列表失败:', err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '查询失败,检查网络后重试',
|
title: '查询失败,检查网络后重试',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -270,6 +310,46 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 上一页
|
||||||
|
async prevPage() {
|
||||||
|
if (this.pager.pageNum <= 1) return;
|
||||||
|
this.pager.pageNum -= 1;
|
||||||
|
await this.loadPageData();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 下一页
|
||||||
|
async nextPage() {
|
||||||
|
if (this.pager.pageNum >= this.totalPages) return;
|
||||||
|
this.pager.pageNum += 1;
|
||||||
|
await this.loadPageData();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 加载指定页码的数据
|
||||||
|
async loadPageData() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const res = await listMaterialCoil({
|
||||||
|
...this.form,
|
||||||
|
...this.pager,
|
||||||
|
selectType: this.form.itemType
|
||||||
|
});
|
||||||
|
this.list = res.rows || [];
|
||||||
|
// 滚动到列表顶部
|
||||||
|
this.scrollToPageTop();
|
||||||
|
} catch (err) {
|
||||||
|
console.error('加载分页数据失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '加载失败,请重试',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 回到查询页面(原有方法+✅新增滚动到顶部)
|
// 回到查询页面(原有方法+✅新增滚动到顶部)
|
||||||
backToSearch() {
|
backToSearch() {
|
||||||
this.currentView = 'search';
|
this.currentView = 'search';
|
||||||
@@ -314,6 +394,49 @@
|
|||||||
color: #999;
|
color: #999;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 分页样式
|
||||||
|
.pagination {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.pagination-info {
|
||||||
|
display: flex;
|
||||||
|
gap: 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
|
||||||
|
text {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination-btns {
|
||||||
|
display: flex;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.page-btn {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
background: #f0f7ff;
|
||||||
|
border: 1rpx solid #007aff;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #007aff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-color: #ddd;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 核心新增:悬浮按钮样式(全局通用)
|
// ✅ 核心新增:悬浮按钮样式(全局通用)
|
||||||
@@ -509,7 +632,7 @@
|
|||||||
color: #007aff;
|
color: #007aff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // ✅ 修复:补全card-title的闭合大括号
|
||||||
|
|
||||||
/* 信息网格 */
|
/* 信息网格 */
|
||||||
.info-grid {
|
.info-grid {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ function checkStorageSpace() {
|
|||||||
function checkUpdate(forceCheck = false) {
|
function checkUpdate(forceCheck = false) {
|
||||||
// 1. 准备本地版本信息
|
// 1. 准备本地版本信息
|
||||||
const localVersion = plus.runtime.version; // 基座版本
|
const localVersion = plus.runtime.version; // 基座版本
|
||||||
const staticVersion = '1.3.25'; // 静态默认版本
|
const staticVersion = '1.3.26'; // 静态默认版本
|
||||||
// const localWgtVersion = staticVersion;
|
// const localWgtVersion = staticVersion;
|
||||||
const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认)
|
const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认)
|
||||||
const currentVersion = compareVersion(localWgtVersion, localVersion) > 0
|
const currentVersion = compareVersion(localWgtVersion, localVersion) > 0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "klp 1.3.25",
|
"version": "klp 1.3.26",
|
||||||
"wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt",
|
"wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt",
|
||||||
"apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk"
|
"apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user