USER-20230908AJ\Administrator před 1 rokem
rodič
revize
11c5169dc9

+ 31 - 24
page_subpack/system_setting/system_setting.vue

@@ -182,33 +182,40 @@
 					tools.error("手机号码格式错误")
 					return;
 				}
-				commonSend({
-					'phone': this.memberData.phone,
-					'send_type': 'retrieve'
-				}).then((res) => {
-					if (res.code === 1) {
-						tools.success(res.msg);
-						this.timeNum = 60;
-						this.timer = setInterval(() => {
-							this.timeNum--;
-							if (this.timeNum <= 0) {
-								clearInterval(this.timer);
-							}
-						}, 1000);
-					} else {
-						tools.error(res.msg);
-					}
-				})
-			}
-		}
-	}
+        uni.login({
+          provider: "weixin",
+          success: (loginRes) => {
+            commonSend({
+              'phone': this.memberData.phone,
+              'send_type': 'retrieve',
+              'wxCode':loginRes.code
+            }).then((res) => {
+              if (res.code === 1) {
+                tools.success(res.msg);
+                this.timeNum = 60;
+                this.timer = setInterval(() => {
+                  this.timeNum--;
+                  if (this.timeNum <= 0) {
+                    clearInterval(this.timer);
+                  }
+                }, 1000);
+              } else {
+                tools.error(res.msg);
+              }
+            })
+          }
+        })
+      }
+
+    }
+  }
 </script>
 
 <style lang="scss" scoped>
-	.input-text {
-		display: block;
-		width: 120rpx;
-		text-align: right;
+.input-text {
+  display: block;
+  width: 120rpx;
+  text-align: right;
 	}
 
 	.input-item {

+ 20 - 14
pages/login/forget.vue

@@ -162,21 +162,27 @@ export default {
         tools.error("手机号码格式错误")
         return;
       }
-      commonSend({
-        'phone': this.accountData.phone,
-        'send_type': 'register'
-      }).then((res) => {
-        if (res.code === 1) {
-          tools.success(res.msg);
-          this.timeNum = 60;
-          this.timer = setInterval(() => {
-            this.timeNum--;
-            if (this.timeNum <= 0) {
-              clearInterval(this.timer);
+      uni.login({
+        provider: "weixin",
+        success: (loginRes) => {
+          commonSend({
+            'phone': this.accountData.phone,
+            'send_type': 'register',
+            'wxCode':loginRes.code
+          }).then((res) => {
+            if (res.code === 1) {
+              tools.success(res.msg);
+              this.timeNum = 60;
+              this.timer = setInterval(() => {
+                this.timeNum--;
+                if (this.timeNum <= 0) {
+                  clearInterval(this.timer);
+                }
+              }, 1000);
+            } else {
+              tools.error(res.msg);
             }
-          }, 1000);
-        } else {
-          tools.error(res.msg);
+          })
         }
       })
     },

+ 23 - 17
pages/login/index.vue

@@ -240,23 +240,29 @@
 					tools.error("手机号码格式错误")
 					return;
 				}
-				commonSend({
-					'phone': this.loginData.phone,
-					'send_type': 'retrieve'
-				}).then((res) => {
-					if (res.code === 1) {
-						tools.success(res.msg);
-						this.timeNum = 60;
-						this.timer = setInterval(() => {
-							this.timeNum--;
-							if (this.timeNum <= 0) {
-								clearInterval(this.timer);
-							}
-						}, 1000);
-					} else {
-						tools.error(res.msg);
-					}
-				})
+        uni.login({
+          provider: "weixin",
+          success: (loginRes) => {
+            commonSend({
+              'phone': this.loginData.phone,
+              'send_type': 'retrieve',
+              'wxCode':loginRes.code
+            }).then((res) => {
+              if (res.code === 1) {
+                tools.success(res.msg);
+                this.timeNum = 60;
+                this.timer = setInterval(() => {
+                  this.timeNum--;
+                  if (this.timeNum <= 0) {
+                    clearInterval(this.timer);
+                  }
+                }, 1000);
+              } else {
+                tools.error(res.msg);
+              }
+            })
+          }
+        })
 			},
 			setIsConsent() {
 				this.isConsent = !this.isConsent

+ 21 - 14
pages/login/register.vue

@@ -258,23 +258,30 @@ export default {
         tools.error("手机号码格式错误")
         return;
       }
-      commonSend({
-        'phone': this.accountData.phone,
-        'send_type': 'register'
-      }).then((res) => {
-        if (res.code === 1) {
-          tools.success(res.msg);
-          this.timeNum = 60;
-          this.timer = setInterval(() => {
-            this.timeNum--;
-            if (this.timeNum <= 0) {
-              clearInterval(this.timer);
+      uni.login({
+        provider: "weixin",
+        success: (loginRes) => {
+          commonSend({
+            'phone': this.accountData.phone,
+            'send_type': 'register',
+            'wxCode':loginRes.code
+          }).then((res) => {
+            if (res.code === 1) {
+              tools.success(res.msg);
+              this.timeNum = 60;
+              this.timer = setInterval(() => {
+                this.timeNum--;
+                if (this.timeNum <= 0) {
+                  clearInterval(this.timer);
+                }
+              }, 1000);
+            } else {
+              tools.error(res.msg);
             }
-          }, 1000);
-        } else {
-          tools.error(res.msg);
+          })
         }
       })
+
     },
   }
 }