Commit 4da76168324f5d04a48374177c6c8128f7736b85
1 parent
0e0c2148
要退款中提示优化
Showing
1 changed file
with
15 additions
and
4 deletions
pages/user/return_goods_info/return_goods_info.js
@@ -11,6 +11,7 @@ Page({ | @@ -11,6 +11,7 @@ Page({ | ||
11 | resourceUrl: r.imghost, | 11 | resourceUrl: r.imghost, |
12 | return_goods: null, | 12 | return_goods: null, |
13 | goods: null, | 13 | goods: null, |
14 | + loading:0, //是不是在处理中,避免重复点击 | ||
14 | }, | 15 | }, |
15 | onLoad: function(e) { | 16 | onLoad: function(e) { |
16 | if (e.order_id!=undefined){ | 17 | if (e.order_id!=undefined){ |
@@ -130,8 +131,14 @@ Page({ | @@ -130,8 +131,14 @@ Page({ | ||
130 | }); | 131 | }); |
131 | }, | 132 | }, |
132 | cancelReturn: function() { | 133 | cancelReturn: function() { |
134 | + | ||
135 | + | ||
133 | var e = this, | 136 | var e = this, |
134 | - id = this.data.return_goods.id; | 137 | + id = this.data.return_goods.id; |
138 | + | ||
139 | + if(this.data.loading) return false; | ||
140 | + this.data.loading=1; | ||
141 | + | ||
135 | wx.showModal({ | 142 | wx.showModal({ |
136 | title: "确定取消售后服务?", | 143 | title: "确定取消售后服务?", |
137 | success: function(r) { | 144 | success: function(r) { |
@@ -143,14 +150,18 @@ Page({ | @@ -143,14 +150,18 @@ Page({ | ||
143 | remark:'客户取消' | 150 | remark:'客户取消' |
144 | }, | 151 | }, |
145 | success: function(r) { | 152 | success: function(r) { |
153 | + | ||
146 | if(r.data.code==0){ | 154 | if(r.data.code==0){ |
147 | getApp().showWarning('取消成功'); | 155 | getApp().showWarning('取消成功'); |
148 | setTimeout(function(){ | 156 | setTimeout(function(){ |
149 | wx.setStorageSync("user:return_goods_list:update", !0), e.requestReturnGoods(id); | 157 | wx.setStorageSync("user:return_goods_list:update", !0), e.requestReturnGoods(id); |
150 | },1000) | 158 | },1000) |
151 | - } | ||
152 | - | ||
153 | - | 159 | + }else{ |
160 | + | ||
161 | + e.data.loading=0; | ||
162 | + s.m_toast(r.data.msg); | ||
163 | + } | ||
164 | + | ||
154 | } | 165 | } |
155 | }); | 166 | }); |
156 | } | 167 | } |