Commit bc36244f2534cd905667d804b96a0077b79b717a
1 parent
6e1a4f66
更换手机的点击打转转优化
Showing
1 changed file
with
16 additions
and
0 deletions
packageB/pages/user/Change_phone/Change_phone.js
| ... | ... | @@ -21,6 +21,9 @@ Page({ |
| 21 | 21 | code: "", //验证码 |
| 22 | 22 | change_phone: "", //新手机号码 |
| 23 | 23 | send: 1, //发送类型 |
| 24 | + | |
| 25 | + changing:0 | |
| 26 | + | |
| 24 | 27 | }, |
| 25 | 28 | /** |
| 26 | 29 | * 生命周期函数--监听页面加载 |
| ... | ... | @@ -127,6 +130,11 @@ Page({ |
| 127 | 130 | } |
| 128 | 131 | }, |
| 129 | 132 | change_phone: function() { |
| 133 | + | |
| 134 | + if(this.data.changing) return false; | |
| 135 | + this.data.changing=1; | |
| 136 | + | |
| 137 | + | |
| 130 | 138 | var th = this; |
| 131 | 139 | var code = th.data.code; |
| 132 | 140 | var mobile = th.data.mobile; |
| ... | ... | @@ -136,19 +144,27 @@ Page({ |
| 136 | 144 | } |
| 137 | 145 | |
| 138 | 146 | if(!change_phone){ |
| 147 | + this.data.changing=0; | |
| 139 | 148 | return getApp().my_warnning("请输入手机号", 0, th); |
| 140 | 149 | } |
| 141 | 150 | |
| 142 | 151 | var ob=util.check_mobile(change_phone); |
| 143 | 152 | if(ob.code==-1){ |
| 153 | + this.data.changing=0; | |
| 144 | 154 | return getApp().my_warnning(ob.title, 0, th); |
| 145 | 155 | } |
| 146 | 156 | |
| 147 | 157 | if(!code){ |
| 158 | + this.data.changing=0; | |
| 148 | 159 | return getApp().my_warnning("请输入验证码", 0, th); |
| 149 | 160 | } |
| 161 | + | |
| 162 | + wx.showLoading(); | |
| 150 | 163 | getApp().request.put("/api/weshop/users/updateMobile/" + r.stoid + '/' + o.user_id + '/' + code + '/' + mobile, { |
| 151 | 164 | success: function(res) { |
| 165 | + th.data.changing=0; | |
| 166 | + wx.hideLoading(); | |
| 167 | + | |
| 152 | 168 | if (res.data.code == 0) { |
| 153 | 169 | var url = "/packageG/pages/user/userinfo/userinfo?change_phone" + change_phone |
| 154 | 170 | getApp().globalData.userInfo.mobile = mobile; | ... | ... |