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); + } + } }); }