From 4878c435711ec7d7bbcba2c056acab9e5ed74ccd Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Wed, 15 Jan 2025 13:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Adocs=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E6=8A=8A=E8=AE=A2=E5=8D=95=20=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=83=BD=E6=94=BE=E5=88=B0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=9A=84order=E7=9B=AE=E5=BD=95=20=E3=80=90=E8=BF=87=20=20?= =?UTF-8?q?=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D?= =?UTF-8?q?=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- components/orderItem/orderItem.vue | 10 --- pages/index/index.vue | 4 +- pages/{main/order.vue => order/index.vue} | 0 pages/{shop => order}/refund.vue | 75 +++++++++++++++++++++++ pages/shop/confirm.vue | 2 +- pages/shop/pay.vue | 6 +- 6 files changed, 81 insertions(+), 16 deletions(-) rename pages/{main/order.vue => order/index.vue} (100%) rename pages/{shop => order}/refund.vue (79%) diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue index 44d0639..0677347 100644 --- a/components/orderItem/orderItem.vue +++ b/components/orderItem/orderItem.vue @@ -154,14 +154,4 @@ .priceBox { margin-top: 85rpx; } - - .numberBut { - width: 130rpx; - height: 48rpx; - } - - .nullBut { - width: 159rpx; - height: 48rpx; - } \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index dc166f4..062762a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -13,7 +13,7 @@ - + 订单 @@ -31,7 +31,7 @@ - + diff --git a/pages/main/order.vue b/pages/order/index.vue similarity index 100% rename from pages/main/order.vue rename to pages/order/index.vue diff --git a/pages/shop/refund.vue b/pages/order/refund.vue similarity index 79% rename from pages/shop/refund.vue rename to pages/order/refund.vue index 3fca826..0359663 100644 --- a/pages/shop/refund.vue +++ b/pages/order/refund.vue @@ -109,6 +109,16 @@ + + + + 联系客服 + + + 确认 + + @@ -130,6 +140,8 @@ currentRemark: -1, // 当前选中的退款有缘索引 refund_remarkValue: '', // 退款说明 其他输入的内容 txtmaxlength: 30, //退款说明 其他文本框最多字数限制 + + isPressed: false, //提交按钮是否锁定 } }, @@ -164,6 +176,69 @@ this.requestRefund_price = Number(this.fullPrice) } }, + //提交订单 + handleSubmit() { + if (this.isPressed) { //防止提交订单按钮重复点击 + return + } + + this.isPressed = true + + //提交前检查 + if(!this.refund_remarkDescription){ + uni.showToast({ + title: '请填写退款说明', + icon: 'error' + }) + this.isPressed = false + return + } + if(Number(this.requestRefund_price)===0){ + uni.showToast({ + title: '请填写退款额', + icon: 'error' + }) + this.isPressed = false + return + } + + //提交 + uni.$u.http.post('/Api/Check/refundOrder', { + order_sn:this.order_sn, //订单号 + shop_id: this.$store.state.shop_id, //商铺id + apply_price:Number(this.requestRefund_price), //申请价格 + refund_remark:this.refund_remarkDescription //退款说明 + }, { + header: { + 'Token': this.$store.state.userInfo.token, + 'Content-Type': 'application/x-www-form-urlencoded' + } + }).then(res => { + //成功申请退款 + if (res.data.status === 1) { + //跳转到订单 退款tab页面 + // uni.navigateTo({ + // url: `/pages/shop/pay?order_sn=${res.data.order_sn}&fullPrice=${fullPrice}` + // }) + } else if (res.data.status === -1) { + uni.removeStorage({ //清除用户信息 跳转首页 + key: 'userInfo', + success: (res) => { + this.$store.commit('clearUserInfo') + uni.redirectTo({ + url: '/pages/index/index' + }) + } + }) + } else { + uni.showToast({ + title: res.data.msg, + icon: 'error' + }) + this.isPressed = false + } + }) + } }, filters: { parseTime, //日期 格式化 diff --git a/pages/shop/confirm.vue b/pages/shop/confirm.vue index 15924f3..602d311 100644 --- a/pages/shop/confirm.vue +++ b/pages/shop/confirm.vue @@ -290,7 +290,7 @@ //购物车没有信息 跳转到订单查询页面 if (this.$store.state.cartList.length === 0) { uni.redirectTo({ - url: '/pages/main/order' + url: '/pages/order/index' }) } } diff --git a/pages/shop/pay.vue b/pages/shop/pay.vue index 2f57bf5..be764bb 100644 --- a/pages/shop/pay.vue +++ b/pages/shop/pay.vue @@ -136,7 +136,7 @@ // 延迟跳转到首页 setTimeout(() => { uni.reLaunch({ - url: '/pages/main/order', + url: '/pages/order/index', }) }, 1500) // 1.5秒后跳转 console.error(res.data.msg) @@ -160,7 +160,7 @@ // 延迟跳转到首页 setTimeout(() => { uni.reLaunch({ - url: '/pages/main/order', + url: '/pages/order/index', }) }, 1500) // 1.5秒后跳转 }, @@ -173,7 +173,7 @@ // 延迟跳转到首页 setTimeout(() => { uni.reLaunch({ - url: '/pages/main/order', + url: '/pages/order/index', }) }, 1500) // 1.5秒后跳转 }