From 4da76168324f5d04a48374177c6c8128f7736b85 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sat, 5 Aug 2023 14:09:57 +0800 Subject: [PATCH] 要退款中提示优化 --- pages/user/return_goods_info/return_goods_info.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pages/user/return_goods_info/return_goods_info.js b/pages/user/return_goods_info/return_goods_info.js index 4480a49..80bdb89 100644 --- a/pages/user/return_goods_info/return_goods_info.js +++ b/pages/user/return_goods_info/return_goods_info.js @@ -11,6 +11,7 @@ Page({ resourceUrl: r.imghost, return_goods: null, goods: null, + loading:0, //是不是在处理中,避免重复点击 }, onLoad: function(e) { if (e.order_id!=undefined){ @@ -130,8 +131,14 @@ Page({ }); }, cancelReturn: function() { + + var e = this, - id = this.data.return_goods.id; + id = this.data.return_goods.id; + + if(this.data.loading) return false; + this.data.loading=1; + wx.showModal({ title: "确定取消售后服务?", success: function(r) { @@ -143,14 +150,18 @@ Page({ remark:'客户取消' }, success: function(r) { + if(r.data.code==0){ getApp().showWarning('取消成功'); setTimeout(function(){ wx.setStorageSync("user:return_goods_list:update", !0), e.requestReturnGoods(id); },1000) - } - - + }else{ + + e.data.loading=0; + s.m_toast(r.data.msg); + } + } }); } -- libgit2 0.21.4