diff --git a/package1/order/orderList.vue b/package1/order/orderList.vue index d0843f1..f578afc 100644 --- a/package1/order/orderList.vue +++ b/package1/order/orderList.vue @@ -66,7 +66,7 @@ - + 待支付 @@ -175,7 +175,7 @@ --> - + @@ -187,22 +187,26 @@ loadStatus: 'more', tab1Checked: 'quanbu', tab2Checked: 'quanbu', - userId:uni.getStorageSync('id'), - userId:JSON.parse(uni.getStorageSync('area')).id, - loadStatus: 'more', totalPages: 1, + pageNum:1, + orderList:[], + searchForm:{ + pageNum:1, + pageSize:10, + userId:uni.getStorageSync('id'), + regionId:JSON.parse(uni.getStorageSync('area')).id + }, menuButtonInfo: {} } }, onReachBottom() { - if (this.searchForm.pageNumber >= this.totalPages) return; + if (this.searchForm.pageNum >= this.totalPages) return; // this.status = 'loading'; - this.searchForm.pageNumber++; - this.getShopList(); - + this.searchForm.pageNum++; + this.getOrderList(); }, onLoad(option) { - + this.getOrderList() }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() @@ -215,24 +219,24 @@ this.tab2Checked = type }, getOrderList(){ - this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => { - uni.hideLoading(); - if (res.success && res.result) { - let orderId = res.result.id; - let totalAmount = res.result.totalAmount; - this.backendTotalAmount = totalAmount; - this.currentOrderId = orderId; - this.createdOrderInfo = res.result; - this.$refs.payPopup.open('bottom'); + this.loadStatus = 'loading' + let that = this + that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => { + that.loadStatus = 'nomore'; + if (res.code == 200) { + if (that.searchForm.pageNum == 1) { + that.orderList = res.result.records; + } else { + that.orderList = [...that.orderList, ...res.result.records] + } + that.totalPages = res.result.pages; // pages = 总页数 + that.$forceUpdate(); } else { - uni.showToast({ - title: res.message || '下单失败', - icon: 'none' - }); + that.tui.toast(res.message); + return; } - }).catch(err => { uni.hideLoading(); - }); + }).catch((res) => {}); }, back() { uni.navigateBack()