Browse Source

绑定手机号

cr 3 years ago
parent
commit
be0b161c6e
3 changed files with 48 additions and 4 deletions
  1. 4 2
      src/pages/order/afterSaleApply.vue
  2. 1 1
      src/pages/user/index.vue
  3. 43 1
      src/pages/user/setting.vue

+ 4 - 2
src/pages/order/afterSaleApply.vue

@@ -340,8 +340,10 @@ export default {
340 340
             } else if (self.refundPriceText) {
341 341
                 self.fn.showToast("退款金额不正确");
342 342
             } else {
343
-                if (this.refundType === "1" && this.orderStatus != "20") {
344
-                    return self.fn.showToast("退货必须上传图片");
343
+                if (this.refundType === "1" || this.orderStatus != "20") {
344
+                    if(self.imageList.length===0){
345
+                        return self.fn.showToast("退货必须上传图片");
346
+                    }
345 347
                 }
346 348
 
347 349
                 let type = self.refundType === "1" ? 4 : 5;

+ 1 - 1
src/pages/user/index.vue

@@ -279,7 +279,7 @@
279 279
         </div>
280 280
 
281 281
         <div class="web-support">
282
-            <p class="text">0.0.987</p>
282
+            <p class="text">0.0.988</p>
283 283
             <!-- <div class="num" @click="makeCall">400-629-6782</div> -->
284 284
         </div>
285 285
     </div>

+ 43 - 1
src/pages/user/setting.vue

@@ -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
             }