diff --git a/pages-home/home/active.vue b/pages-home/home/active.vue index a33ac92..7467561 100644 --- a/pages-home/home/active.vue +++ b/pages-home/home/active.vue @@ -18,7 +18,9 @@ - + + + diff --git a/pages-order/orderList/orderList.vue b/pages-order/orderList/orderList.vue index d8195a9..18d5d24 100644 --- a/pages-order/orderList/orderList.vue +++ b/pages-order/orderList/orderList.vue @@ -11,40 +11,43 @@ - - - - 订单编号:{{ item.orderNo }} + + + + + 订单编号:{{ item.orderNo }} + + + {{ getStatus(item.orderStatus) }} + - - {{ getStatus(item.orderStatus) }} - - - - - {{ item.goodsTitle }} - - - - {{ item.tenantName || "蓝安-中鑫之宝" }} - - - - 共计 - - {{ item.payMoney }} + + + {{ item.goodsTitle }} + + + + {{ item.tenantName || "蓝安-中鑫之宝" }} + + + + 共计 + + {{ item.payMoney }} + + {{ formatTimestamp(item.createTime) }} + + + 支付 + 查看订单 + 评价订单 - {{ formatTimestamp(item.createTime) }} - - 支付 - 查看订单 - 评价订单 + + - - - - + @@ -78,8 +81,6 @@ export default { return { payShow: false, activeKey: 0, - pageNum: 1, - totalPages: 0, imageUrl: '', tabList: [{ id: 0, @@ -95,24 +96,18 @@ export default { }, ], orderList: [], + pageNo: 1, + pageSize: 10, + total: 0, + //下来刷新状态 + isTriggered:false, changeActive: false } }, - onShow() { + onLoad() { this.orderList = [] this.getList() }, - onReachBottom() { - if (this.pageNum >= this.totalPages) { - uni.showToast({ - title: '没有下一页数据', - icon: 'none' - }) - } else { - this.pageNum++ - this.getList() - } - }, methods: { formatTimestamp(timestamp) { // 将时间戳转换为Date对象 @@ -127,10 +122,34 @@ export default { // 组合成日期时间字符串 return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; }, + /** + * 上滑加载数据 + */ + onReachBottom() { + //判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕 + if (this.pageNo * this.pageSize >= this.total) { + uni.$u.toast('没有更多数据了') + return + } + //页码+1,调用获取数据的方法获取第二页数据 + this.pageNo++ + //此处调用自己获取数据列表的方法 + this.getList() + }, + /** + * 下拉刷新数据 + */ + onRefresherrefresh(){ + this.isTriggered = true + this.pageNo = 1 + this.total = 0 + this.messageList = [] + this.getList() + }, async getList() { let data = { - pageSize: 20, - pageNo: this.pageNum + pageSize: this.pageSize, + pageNo: this.pageNo } switch (this.activeKey) { case 0: @@ -149,20 +168,29 @@ export default { } this.changeActive = false await request({ - url: '/userClient/order/page', + url: '/app-api/repair/order-info/page', method: 'get', - params: data + params: data, + tenantIdFlag:false }).then((res) => { if (res.code === 200) { - this.orderList = this.orderList.concat(res.rows) - let total = res.total - this.totalPages = Math.ceil(total / this.pageSize); + //判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据 + if (this.pageNo != 1) { + this.orderList = this.orderList.concat(res.data.records) + } else { + this.orderList = res.data.records + } + //将获取的总条数赋值 + this.total = res.data.total + this.isTriggered = false } }) }, changeTabFun(id) { this.activeKey = id this.changeActive = true + this.pageNo = 1 + this.total = 0 this.getList() }, getStatus(status) { @@ -253,8 +281,8 @@ export default { .body { flex: 1; - height: 0; - padding: 24rpx 32rpx; + height: 100%; + padding: 0 32rpx; overflow: auto; } @@ -294,8 +322,10 @@ export default { display: flex; flex-direction: column; row-gap: 20rpx; + height: calc(100% - 65px); .orderItem { + margin-bottom:10rpx; padding: 30rpx; background: #FFFFFF; border-radius: 12rpx 12rpx 12rpx 12rpx; diff --git a/pages/guideList/guideDetail.vue b/pages/guideList/guideDetail.vue index 8986c3b..d48ede9 100644 --- a/pages/guideList/guideDetail.vue +++ b/pages/guideList/guideDetail.vue @@ -1,24 +1,32 @@ @@ -34,13 +42,14 @@ height: 0; margin: 32rpx; padding: 30rpx; - + display: flex; flex-direction: column; row-gap: 20rpx; - + .title { text-align: center; + font-size: 20px; } } } diff --git a/pages/guideList/guideList.vue b/pages/guideList/guideList.vue index 1ddaf40..d39db65 100644 --- a/pages/guideList/guideList.vue +++ b/pages/guideList/guideList.vue @@ -2,27 +2,98 @@ - - 如何在小程序上下单车辆维修 - - + + + {{ item.title }} + + + + + + @@ -49,12 +114,12 @@ align-items: center; column-gap: 20rpx; border-bottom: 1rpx solid #EEEEEE; - + .messageIcon { width: 80rpx; height: 80rpx; } - + .messageContent { flex: 1; width: 0; @@ -68,7 +133,7 @@ font-weight: 500; font-size: 28rpx; color: #858BA0; - + overflow: hidden; white-space: nowrap; text-overflow: ellipsis;