From 5898169ef430a99d4f6512f30d5ee4aafbd7b62a Mon Sep 17 00:00:00 2001 From: THK3121 Date: Fri, 8 Sep 2023 10:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logistiCard/logistiCard.vue | 5 +- pages/logistics/index.vue | 46 +++++++++++++++---- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/components/logistiComptent/logistiCard/logistiCard.vue b/components/logistiComptent/logistiCard/logistiCard.vue index 8b4a7d0..ded2b8b 100644 --- a/components/logistiComptent/logistiCard/logistiCard.vue +++ b/components/logistiComptent/logistiCard/logistiCard.vue @@ -12,10 +12,11 @@

收货人姓名:  {{fuzzyName(goodsInfo.receiver_name)}}

-

+

收货人姓名:  {{fuzzyName(goodsInfo.receiver_name)}} 已取消 -

+

diff --git a/pages/logistics/index.vue b/pages/logistics/index.vue index 95f4a72..a5b6cbf 100644 --- a/pages/logistics/index.vue +++ b/pages/logistics/index.vue @@ -11,10 +11,11 @@ - + + @@ -52,15 +53,15 @@ name: '已送达' }], curNow: 0, - orderlist: [] + orderlist: [], + id: "", + status: "loadmore", + page_num: 1, + flag: false + } }, methods: { - go() { - uni.navigateTo({ - url: "/pages/logistics/te" - }) - }, sectionChange(index) { this.curNow = index.index; @@ -85,10 +86,10 @@ }, getOrderList() { console.log("列表更新") - let id = JSON.parse(uni.getStorageSync('USER_INFO')).id + this.id = JSON.parse(uni.getStorageSync('USER_INFO')).id getList({ status: this.curNow, - user_id: id, + user_id: this.id, keywords: this.keywords, user_type: this.is_captain }).then(res => { @@ -98,7 +99,9 @@ } }, + onLoad() { + this.is_captain = JSON.parse(uni.getStorageSync('USER_INFO')).is_captain let that = this //#ifdef APP-PLUS @@ -111,11 +114,34 @@ that.notArr.push(result.messageID) }) // #endif + // window.addEventListener("scroll", this.scrolling); + }, + onShow() { this.getOrderList() - } + }, + onReachBottom() { + if (this.flag) return + this.status = "loading" + this.page_num += 1 + this.flag = true + getList({ + status: this.curNow, + user_id: this.id, + keywords: this.keywords, + user_type: this.is_captain, + page_num: this.page_num + }).then(res => { + this.orderlist = this.orderlist.concat(res.data.data) + this.flag = false + if (!res.data.data.length) { + this.status = "nomore" + this.flag = true + } + }) + }, }