From ec4b6e17fc7b4a450dbd39d2d9553f7b4010d351 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Fri, 3 Apr 2026 17:21:35 +0800 Subject: [PATCH] 1 --- package1/order/orderList.vue | 137 +++++++++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 30 deletions(-) diff --git a/package1/order/orderList.vue b/package1/order/orderList.vue index cac6206..af1587b 100644 --- a/package1/order/orderList.vue +++ b/package1/order/orderList.vue @@ -8,14 +8,14 @@ - - 全部订单 - + 全部 - + 待支付 - + 待成团 - + 待消费 - + 待接单 - + 待取货 - + 待送达 - + 已完成 - - 待商家同意退款 - + + 待退款 + 已退款 - + 已取消 @@ -172,7 +172,7 @@ - + 取消订单 @@ -206,7 +206,7 @@ 配送费(均摊) {{payData.deliveryFee}} 元 - 配送费 {{payData.deliveryFee}} 元 + 配送费 {{payData.deliveryFee}} 元 打包费 {{payData.packageFee}} 元 @@ -236,6 +236,19 @@ + + + + + 确定要取消订单吗 + 取消订单需要商家同意 + + + 确认取消 + + + + @@ -247,7 +260,7 @@ return { loadStatus: 'more', tab1Checked: 'quanbu', - tab2Checked: 'quanbu', + tab2Checked: 10, totalPages: 1, pageNum:1, payData:{}, @@ -255,6 +268,7 @@ searchForm:{ pageNum:1, pageSize:10, + shopName:'', searchType:0, userId:uni.getStorageSync('id'), regionId:JSON.parse(uni.getStorageSync('area')).id @@ -289,6 +303,52 @@ this.searchForm.pageNum = 1 this.getOrderList() }, + goSearch(){ + this.searchForm.pageNum = 1 + this.getOrderList() + }, + wxPayment() { + let that = this; + if (!this.payData.id || !this.payData.totalAmount) return; + + let amountInCents = Math.round(Number(this.payData.totalAmount) * 100); + + this.tui.request("/api/wechat/pay/unified-order", "POST", { + openid: uni.getStorageSync('miniProgramOpenid') || 'test-openid', + amount: amountInCents, + description: '拼团参与订单', + outTradeNo: this.payData.id + }, false, false).then((res) => { + if (res.code == 200) { + uni.requestPayment({ + provider: 'wxpay', + timeStamp: res.timeStamp, + nonceStr: res.nonceStr, + package: res.package, + signType: res.signType, + paySign: res.paySign, + success: function(res2) { + uni.showToast({ title: '支付成功', icon: 'success' }); + that.tui.request("/api/wechat/pay/paySuccess", "POST", { + outTradeNo: that.payData.id + }, false, false).then((res3) => { + if(res3.code == 200){ + uni.redirectTo({ + url: '/package1/order/orderDetail?id=' + that.payData.id + }); + }else{ + that.tui.toast("订单创建失败,请联系客服处理"); + } + }) + + }, + fail: function(err) { + that.tui.toast("支付失败或取消"); + } + }); + } + }) + }, orderStatus(item){ if(item.status == 0 || item.status == 10 || item.status == 2 || (item.status == 3 && item.deliveryType == 1) || (item.status == 3 && item.deliveryType == 2) || item.status == 4){ return true; @@ -296,7 +356,10 @@ return false; }, checkTabs2(type) { - this.tab2Checked = type + this.tab2Checked = type; + this.searchForm.searchStatus = type; + this.searchForm.pageNum = 1 + this.getOrderList(); }, payAgain(item){ this.payData = item; @@ -323,7 +386,13 @@ uni.hideLoading(); }).catch((res) => {}); }, - returnOrder(item){ + returnPopupProp(item){ + this.payData = item; + this.$refs.returnPopup.open('bottom'); + }, + returnOrder(){ + this.$refs.returnPopup.close(); + let item = this.payData let that = this that.tui.request("/mall/order/cancel", "POST", {orderId:item.id,userId:uni.getStorageSync('id')}, false, true).then((res) => { if (res.code == 200) { @@ -556,4 +625,12 @@ .vue-ref{ border-radius: 10px !important; } + .guize-list { + width: 600rpx; + padding: 20rpx; + overflow: scroll; + background: #fff; + border-radius: 20rpx; + max-height: 1000rpx; + } \ No newline at end of file