|
@@ -208,12 +208,54 @@ export default {
|
208
|
208
|
userId: self.user.userId,
|
209
|
209
|
mobile: self.phone,
|
210
|
210
|
})
|
|
211
|
+ .then((res) => {
|
|
212
|
+ if (res.success) {
|
|
213
|
+ self.fn.showToast("修改成功");
|
|
214
|
+ self.getUserInfo();
|
|
215
|
+ } else {
|
|
216
|
+ self.fn
|
|
217
|
+ .showModal({
|
|
218
|
+ content: res.message,
|
|
219
|
+ })
|
|
220
|
+ .then((res) => {
|
|
221
|
+ if (
|
|
222
|
+ res.confirm &&
|
|
223
|
+ res.message.indexOf("已绑定") !== -1
|
|
224
|
+ ) {
|
|
225
|
+ this.setPhone2();
|
|
226
|
+ }
|
|
227
|
+ });
|
|
228
|
+ }
|
|
229
|
+ });
|
|
230
|
+ }
|
|
231
|
+ },
|
|
232
|
+ setPhone2() {
|
|
233
|
+ const self = this;
|
|
234
|
+ let phoneReg = /^[1][1-9][0-9]{9}$/;
|
|
235
|
+
|
|
236
|
+ if (!self.phone) {
|
|
237
|
+ self.fn.showToast("请输入手机号");
|
|
238
|
+ } else if (!phoneReg.test(self.phone)) {
|
|
239
|
+ self.fn.showToast("手机号码不正确");
|
|
240
|
+ } else {
|
|
241
|
+ self.api
|
|
242
|
+ .get("/User/BindShopWechat", {
|
|
243
|
+ mobile: self.phone,
|
|
244
|
+ })
|
211
|
245
|
.then((res) => {
|
212
|
246
|
if (res.data) {
|
213
|
247
|
self.fn.showToast("修改成功");
|
214
|
248
|
self.getUserInfo();
|
215
|
249
|
} else {
|
216
|
|
- self.fn.showToast(res.message);
|
|
250
|
+ self.fn
|
|
251
|
+ .showModal({
|
|
252
|
+ content: res.message,
|
|
253
|
+ })
|
|
254
|
+ .then((res) => {
|
|
255
|
+ // if(res.confirm){
|
|
256
|
+ // this.setPhone2();
|
|
257
|
+ // }
|
|
258
|
+ });
|
217
|
259
|
}
|
218
|
260
|
});
|
219
|
261
|
}
|