fengjiajia 3 ngày trước cách đây
mục cha
commit
db89918aa1

+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "",
+        "appid" : "wx97b71d70f5b2d51f",
         "setting" : {
             "urlCheck" : false
         },

+ 209 - 26
pages/login/login.vue

@@ -10,7 +10,9 @@
 				<input class="login-input" type="text" placeholder="请输入手机号" v-model="phone" />
 				<view class="code-row">
 					<input class="login-input code-input" type="text" placeholder="请输入验证码" v-model="code" />
-					<button class="code-btn" @click="sendCode">获取验证码</button>
+					<button class="code-btn" @click="sendCode" :disabled="loginCodeTimer > 0 || isSendingLoginCode">
+						{{ loginCodeTimer > 0 ? loginCodeTimer + 's' : '获取验证码' }}
+					</button>
 				</view>
 			</view>
 			<view v-else class="login-form">
@@ -45,7 +47,9 @@
 				<input class="login-input" type="text" placeholder="请输入手机号" v-model="regPhone" />
 				<view class="code-row">
 					<input class="login-input code-input" type="text" placeholder="请输入验证码" v-model="regCode" />
-					<button class="code-btn" @click="sendRegCode">获取验证码</button>
+					<button class="code-btn" @click="sendRegCode" :disabled="regCodeTimer > 0 || isSendingRegCode">
+						{{ regCodeTimer > 0 ? regCodeTimer + 's' : '获取验证码' }}
+					</button>
 				</view>
 				<input class="login-input" type="text" placeholder="请输入账号" v-model="regUsername" />
 				<input class="login-input" type="password" password placeholder="请输入密码" v-model="regPassword" />
@@ -76,79 +80,163 @@
 				regCode: '',
 				regUsername: '',
 				regPassword: '',
+				regCodeTimer: 0, // Countdown timer for registration code
+				isSendingRegCode: false, // Flag to prevent multiple requests
+				loginCodeTimer: 0, // Countdown timer for login code
+				isSendingLoginCode: false, // Flag to prevent multiple requests
 			}
 		},
 		methods: {
 			// 处理微信登录
 			async oneClickLogin() {
-				if (this.isLoading) return
-				this.isLoading = true
-				try {
-					// 1. 先获取用户信息
+				console.log('WeChat login button clicked');
+				// 1. 先获取用户信息
 					uni.getUserProfile({
 						desc: '用于完善用户资料',
 						lang: 'zh_CN',
 						success: (userRes) => {
+							console.log(userRes)
 							// 2. 获取微信登录凭证
 							uni.showLoading({ title: '登录中...', mask: true })
 							uni.login({
 								provider: 'weixin',
 								success: wx_res => {
 									// 3. 发送登录请求,参数按后端WeLogin类
-									console.log(userRes)
+									console.log('uni.getUserProfile success:', userRes);
+									console.log('uni.login success, got code:', wx_res.code);
 									uni.request({
 										url: 'http://localhost:3333/WeChart/login',
 										method: 'POST',
 										data: {
 											code: wx_res.code,
-											wxLoginDto: userRes.userInfo,
-											encryptedData: userRes.encryptedData || '',
-											iv: userRes.iv || ''
+											weChatLoginDto: userRes.userInfo,
+											
 										},
 										header: { 'content-type': 'application/json' },
 										success: (res) => {
 											uni.hideLoading()
 											if (res.statusCode === 200 && res.data) {
+												console.log('Backend login success:', res.data);
 												uni.showToast({ title: '登录成功', icon: 'success' })
 												setTimeout(() => {
 													uni.switchTab({ url: '/pages/home/index' })
 												}, 1500)
 											} else {
+												console.error('Backend login failed:', res);
 												uni.showToast({ title: res.data?.message || '登录失败', icon: 'none' })
 											}
 										},
 										fail: (err) => {
 											uni.hideLoading()
+											console.error('Backend request failed:', err);
 											uni.showToast({ title: '微信登录失败', icon: 'none' })
 										}
 									})
 								},
 								fail: (err) => {
 									uni.hideLoading()
+									console.error('uni.login failed:', err);
 									uni.showToast({ title: '微信登录失败', icon: 'none' })
 								}
 							})
 						},
 						fail: (err) => {
+							console.error('uni.getUserProfile failed:', err);
 							uni.showToast({ title: '获取用户信息失败', icon: 'none' })
 						}
-					})
-				} catch (error) {
-					uni.showToast({ title: error.message || '登录失败', icon: 'none', duration: 2000 })
-				} finally {
-					this.isLoading = false
-					uni.hideLoading()
-				}
+					})	
 			},
-			sendCode() {
-				uni.showToast({ title: '验证码已发送', icon: 'none' });
+			async sendCode() {
+				if (this.isSendingLoginCode || this.loginCodeTimer > 0) {
+					return;
+				}
+				if (!this.phone) {
+					uni.showToast({ title: '请输入手机号', icon: 'none' });
+					return;
+				}
+
+				this.isSendingLoginCode = true;
+				uni.showLoading({ title: '发送中...', mask: true });
+
+				try {
+					const res = await uni.request({
+						url: 'http://localhost:3333/user/code',
+						method: 'POST',
+						data: {
+							phone: this.phone
+						},
+						header: { 'content-type': 'application/json' }
+					});
+
+					uni.hideLoading();
+					this.isSendingLoginCode = false;
+
+					if (res.statusCode === 200 && res.data) {
+						console.log('Send login code success:', res.data);
+						uni.showToast({ title: '验证码已发送', icon: 'success' });
+
+						// Start countdown
+						this.loginCodeTimer = 60;
+						const timerInterval = setInterval(() => {
+							this.loginCodeTimer--;
+							if (this.loginCodeTimer <= 0) {
+								clearInterval(timerInterval);
+								this.loginCodeTimer = 0;
+							}
+						}, 1000);
+
+					} else {
+						console.error('Send login code failed:', res);
+						uni.showToast({ title: res.data?.message || '发送失败', icon: 'none' });
+					}
+				} catch (err) {
+					uni.hideLoading();
+					this.isSendingLoginCode = false;
+					console.error('Send login code request failed:', err);
+					uni.showToast({ title: '发送失败', icon: 'none' });
+				}
 			},
-			doLogin() {
+			async doLogin() {
 				if (!this.agreed) {
 					uni.showToast({ title: '请先同意协议', icon: 'none' });
 					return;
 				}
-				uni.showToast({ title: '登录成功', icon: 'success' });
+				if (!this.phone || !this.code) {
+					uni.showToast({ title: '请填写手机号和验证码', icon: 'none' });
+					return;
+				}
+
+				uni.showLoading({ title: '登录中...', mask: true });
+
+				try {
+					const res = await uni.request({
+						url: 'http://localhost:3333/user/login',
+						method: 'POST',
+						data: {
+							phone: this.phone,
+							code: this.code
+						},
+						header: { 'content-type': 'application/json' }
+					});
+
+					uni.hideLoading();
+
+					if (res.statusCode === 200 && res.data) {
+						console.log('Login success:', res.data);
+						uni.showToast({ title: '登录成功', icon: 'success' });
+						// Navigate to home page on success
+						setTimeout(() => {
+							uni.switchTab({ url: '/pages/home/index' });
+						}, 1500); // Delay slightly to show toast
+					} else {
+						console.error('Login failed:', res.data);
+						uni.showToast({ title: res.data?.message || '登录失败', icon: 'error' });
+					}
+				} catch (err) {
+					uni.hideLoading();
+					console.error('Login request failed:', err);
+					uni.showToast({ title: '登录失败', icon: 'none' });
+				}
 			},
 			toRegister() {
 				this.showRegisterPopup = true;
@@ -165,12 +253,107 @@
 			qqLogin() {
 				uni.showToast({ title: 'QQ登录', icon: 'none' });
 			},
-			sendRegCode() {
-				uni.showToast({ title: '注册验证码已发送', icon: 'none' });
+			async sendRegCode() {
+				// 如果正在发送或倒计时中,则不执行任何操作
+				if (this.isSendingRegCode || this.regCodeTimer > 0) {
+					return;
+				}
+				// 检查手机号是否已填写
+				if (!this.regPhone) {
+					uni.showToast({ title: '请输入手机号', icon: 'none' });
+					return;
+				}
+
+				// 设置状态,显示加载提示
+				this.isSendingRegCode = true;
+				uni.showLoading({ title: '发送中...', mask: true });
+
+				try {
+					// 发起POST请求到后端接口
+					const res = await uni.request({
+						url: 'http://localhost:3333/user/code',
+						method: 'POST',
+						data: {
+							phone: this.regPhone // 发送手机号参数
+						},
+						header: { 'content-type': 'application/json' }
+					});
+
+					// 隐藏加载提示,重置发送状态
+					uni.hideLoading();
+					this.isSendingRegCode = false;
+
+					// 根据后端响应处理结果
+					if (res.statusCode === 200 && res.data) {
+						console.log('Send registration code success:', res.data);
+						uni.showToast({ title: '验证码已发送', icon: 'success' });
+
+						// 开始60秒倒计时
+						this.regCodeTimer = 60;
+						const timerInterval = setInterval(() => {
+							this.regCodeTimer--;
+							if (this.regCodeTimer <= 0) {
+								clearInterval(timerInterval); // 倒计时结束时清除定时器
+								this.regCodeTimer = 0;
+							}
+						}, 1000); // 每秒更新
+					} else {
+						// 处理发送失败的情况
+						console.error('Send registration code failed:', res);
+						uni.showToast({ title: res.data?.message || '发送失败', icon: 'none' });
+					}
+				} catch (err) {
+					// 处理请求异常
+					uni.hideLoading();
+					this.isSendingRegCode = false;
+					console.error('Send registration code request failed:', err);
+					uni.showToast({ title: '发送失败', icon: 'none' });
+				}
 			},
-			doRegister() {
-				uni.showToast({ title: '注册成功', icon: 'success' });
-				this.showRegisterPopup = false;
+			async doRegister() {
+				if (!this.regPhone || !this.regCode || !this.regUsername || !this.regPassword) {
+					uni.showToast({ title: '请填写所有注册信息', icon: 'none' });
+					return;
+				}
+
+				uni.showLoading({ title: '注册中...', mask: true });
+
+				try {
+					const res = await uni.request({
+						url: 'http://localhost:3333/user/register',
+						method: 'POST',
+						data: {
+							phone: this.regPhone,
+							code: this.regCode,
+							username: this.regUsername,
+							password: this.regPassword
+						},
+						header: { 'content-type': 'application/json' }
+					});
+
+					uni.hideLoading();
+
+					if (res.statusCode === 200 && res.data) {
+						console.log('Registration success:', res.data);
+						uni.showToast({ title: '注册成功', icon: 'success' });
+						// Optionally, clear the form fields
+						this.regPhone = '';
+						this.regCode = '';
+						this.regUsername = '';
+						this.regPassword = '';
+						// Close the popup after successful registration
+						setTimeout(() => {
+							this.showRegisterPopup = false;
+						}, 1500); // Delay closing slightly to show toast
+					} else {
+						console.error('Registration failed:', res);
+						uni.showToast({ title: res.data?.message || '注册失败', icon: 'none' });
+					}
+				} catch (err) {
+					uni.hideLoading();
+					console.error('Registration request failed:', err);
+					uni.showToast({ title: '注册失败', icon: 'none' });
+				}
 			}
 		}
 	}

+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map

@@ -1 +1 @@
-{"version":3,"file":"login.js","sources":["../../../../../HBuilder/HBuilderX.4.55.2025030718/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbG9naW4vbG9naW4udnVl"],"sourcesContent":["import MiniProgramPage from 'D:/zhentao/项目/code/旅游项目/TourismApp/pages/login/login.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
+{"version":3,"file":"login.js","sources":["../../../../../HBuilder/HBuilderX.4.55.2025030718/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbG9naW4vbG9naW4udnVl"],"sourcesContent":["import MiniProgramPage from 'D:/zhentao/项目/code/旅游项目/TourismApp/pages/login/login.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}

+ 2 - 2
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -6841,9 +6841,9 @@ function initOnError() {
   };
 }
 function initRuntimeSocketService() {
-  const hosts = "192.168.190.1,192.168.192.1,192.168.157.179,127.0.0.1";
+  const hosts = "192.168.190.1,192.168.192.1,127.0.0.1";
   const port = "8090";
-  const id = "mp-weixin_8Dw25O";
+  const id = "mp-weixin__TVxDl";
   const lazy = typeof swan !== "undefined";
   let restoreError = lazy ? () => {
   } : initOnError();

+ 256 - 41
unpackage/dist/dev/mp-weixin/pages/login/login.js

@@ -15,19 +15,155 @@ const _sfc_main = {
       regPhone: "",
       regCode: "",
       regUsername: "",
-      regPassword: ""
+      regPassword: "",
+      regCodeTimer: 0,
+      // Countdown timer for registration code
+      isSendingRegCode: false,
+      // Flag to prevent multiple requests
+      loginCodeTimer: 0,
+      // Countdown timer for login code
+      isSendingLoginCode: false
+      // Flag to prevent multiple requests
     };
   },
   methods: {
-    sendCode() {
-      common_vendor.index.showToast({ title: "验证码已发送", icon: "none" });
+    // 处理微信登录
+    async oneClickLogin() {
+      common_vendor.index.__f__("log", "at pages/login/login.vue:92", "WeChat login button clicked");
+      common_vendor.index.getUserProfile({
+        desc: "用于完善用户资料",
+        lang: "zh_CN",
+        success: (userRes) => {
+          common_vendor.index.__f__("log", "at pages/login/login.vue:98", userRes);
+          common_vendor.index.showLoading({ title: "登录中...", mask: true });
+          common_vendor.index.login({
+            provider: "weixin",
+            success: (wx_res) => {
+              common_vendor.index.__f__("log", "at pages/login/login.vue:105", "uni.getUserProfile success:", userRes);
+              common_vendor.index.__f__("log", "at pages/login/login.vue:106", "uni.login success, got code:", wx_res.code);
+              common_vendor.index.request({
+                url: "http://localhost:3333/WeChart/login",
+                method: "POST",
+                data: {
+                  code: wx_res.code,
+                  weChatLoginDto: userRes.userInfo
+                },
+                header: { "content-type": "application/json" },
+                success: (res) => {
+                  var _a;
+                  common_vendor.index.hideLoading();
+                  if (res.statusCode === 200 && res.data) {
+                    common_vendor.index.__f__("log", "at pages/login/login.vue:119", "Backend login success:", res.data);
+                    common_vendor.index.showToast({ title: "登录成功", icon: "success" });
+                    setTimeout(() => {
+                      common_vendor.index.switchTab({ url: "/pages/home/index" });
+                    }, 1500);
+                  } else {
+                    common_vendor.index.__f__("error", "at pages/login/login.vue:125", "Backend login failed:", res);
+                    common_vendor.index.showToast({ title: ((_a = res.data) == null ? void 0 : _a.message) || "登录失败", icon: "none" });
+                  }
+                },
+                fail: (err) => {
+                  common_vendor.index.hideLoading();
+                  common_vendor.index.__f__("error", "at pages/login/login.vue:131", "Backend request failed:", err);
+                  common_vendor.index.showToast({ title: "微信登录失败", icon: "none" });
+                }
+              });
+            },
+            fail: (err) => {
+              common_vendor.index.hideLoading();
+              common_vendor.index.__f__("error", "at pages/login/login.vue:138", "uni.login failed:", err);
+              common_vendor.index.showToast({ title: "微信登录失败", icon: "none" });
+            }
+          });
+        },
+        fail: (err) => {
+          common_vendor.index.__f__("error", "at pages/login/login.vue:144", "uni.getUserProfile failed:", err);
+          common_vendor.index.showToast({ title: "获取用户信息失败", icon: "none" });
+        }
+      });
     },
-    doLogin() {
+    async sendCode() {
+      var _a;
+      if (this.isSendingLoginCode || this.loginCodeTimer > 0) {
+        return;
+      }
+      if (!this.phone) {
+        common_vendor.index.showToast({ title: "请输入手机号", icon: "none" });
+        return;
+      }
+      this.isSendingLoginCode = true;
+      common_vendor.index.showLoading({ title: "发送中...", mask: true });
+      try {
+        const res = await common_vendor.index.request({
+          url: "http://localhost:3333/user/code",
+          method: "POST",
+          data: {
+            phone: this.phone
+          },
+          header: { "content-type": "application/json" }
+        });
+        common_vendor.index.hideLoading();
+        this.isSendingLoginCode = false;
+        if (res.statusCode === 200 && res.data) {
+          common_vendor.index.__f__("log", "at pages/login/login.vue:175", "Send login code success:", res.data);
+          common_vendor.index.showToast({ title: "验证码已发送", icon: "success" });
+          this.loginCodeTimer = 60;
+          const timerInterval = setInterval(() => {
+            this.loginCodeTimer--;
+            if (this.loginCodeTimer <= 0) {
+              clearInterval(timerInterval);
+              this.loginCodeTimer = 0;
+            }
+          }, 1e3);
+        } else {
+          common_vendor.index.__f__("error", "at pages/login/login.vue:189", "Send login code failed:", res);
+          common_vendor.index.showToast({ title: ((_a = res.data) == null ? void 0 : _a.message) || "发送失败", icon: "none" });
+        }
+      } catch (err) {
+        common_vendor.index.hideLoading();
+        this.isSendingLoginCode = false;
+        common_vendor.index.__f__("error", "at pages/login/login.vue:195", "Send login code request failed:", err);
+        common_vendor.index.showToast({ title: "发送失败", icon: "none" });
+      }
+    },
+    async doLogin() {
+      var _a;
       if (!this.agreed) {
         common_vendor.index.showToast({ title: "请先同意协议", icon: "none" });
         return;
       }
-      common_vendor.index.showToast({ title: "登录成功", icon: "success" });
+      if (!this.phone || !this.code) {
+        common_vendor.index.showToast({ title: "请填写手机号和验证码", icon: "none" });
+        return;
+      }
+      common_vendor.index.showLoading({ title: "登录中...", mask: true });
+      try {
+        const res = await common_vendor.index.request({
+          url: "http://localhost:3333/user/login",
+          method: "POST",
+          data: {
+            phone: this.phone,
+            code: this.code
+          },
+          header: { "content-type": "application/json" }
+        });
+        common_vendor.index.hideLoading();
+        if (res.statusCode === 200 && res.data) {
+          common_vendor.index.__f__("log", "at pages/login/login.vue:225", "Login success:", res.data);
+          common_vendor.index.showToast({ title: "登录成功", icon: "success" });
+          setTimeout(() => {
+            common_vendor.index.switchTab({ url: "/pages/home/index" });
+          }, 1500);
+        } else {
+          common_vendor.index.__f__("error", "at pages/login/login.vue:232", "Login failed:", res.data);
+          common_vendor.index.showToast({ title: ((_a = res.data) == null ? void 0 : _a.message) || "登录失败", icon: "error" });
+        }
+      } catch (err) {
+        common_vendor.index.hideLoading();
+        common_vendor.index.__f__("error", "at pages/login/login.vue:237", "Login request failed:", err);
+        common_vendor.index.showToast({ title: "登录失败", icon: "none" });
+      }
     },
     toRegister() {
       this.showRegisterPopup = true;
@@ -41,18 +177,93 @@ const _sfc_main = {
     openPrivacy() {
       common_vendor.index.navigateTo({ url: "/pages/privacy/privacy" });
     },
-    oneClickLogin() {
-      common_vendor.index.showToast({ title: "一键登录", icon: "none" });
-    },
     qqLogin() {
       common_vendor.index.showToast({ title: "QQ登录", icon: "none" });
     },
-    sendRegCode() {
-      common_vendor.index.showToast({ title: "注册验证码已发送", icon: "none" });
+    async sendRegCode() {
+      var _a;
+      if (this.isSendingRegCode || this.regCodeTimer > 0) {
+        return;
+      }
+      if (!this.regPhone) {
+        common_vendor.index.showToast({ title: "请输入手机号", icon: "none" });
+        return;
+      }
+      this.isSendingRegCode = true;
+      common_vendor.index.showLoading({ title: "发送中...", mask: true });
+      try {
+        const res = await common_vendor.index.request({
+          url: "http://localhost:3333/user/code",
+          method: "POST",
+          data: {
+            phone: this.regPhone
+            // 发送手机号参数
+          },
+          header: { "content-type": "application/json" }
+        });
+        common_vendor.index.hideLoading();
+        this.isSendingRegCode = false;
+        if (res.statusCode === 200 && res.data) {
+          common_vendor.index.__f__("log", "at pages/login/login.vue:288", "Send registration code success:", res.data);
+          common_vendor.index.showToast({ title: "验证码已发送", icon: "success" });
+          this.regCodeTimer = 60;
+          const timerInterval = setInterval(() => {
+            this.regCodeTimer--;
+            if (this.regCodeTimer <= 0) {
+              clearInterval(timerInterval);
+              this.regCodeTimer = 0;
+            }
+          }, 1e3);
+        } else {
+          common_vendor.index.__f__("error", "at pages/login/login.vue:302", "Send registration code failed:", res);
+          common_vendor.index.showToast({ title: ((_a = res.data) == null ? void 0 : _a.message) || "发送失败", icon: "none" });
+        }
+      } catch (err) {
+        common_vendor.index.hideLoading();
+        this.isSendingRegCode = false;
+        common_vendor.index.__f__("error", "at pages/login/login.vue:309", "Send registration code request failed:", err);
+        common_vendor.index.showToast({ title: "发送失败", icon: "none" });
+      }
     },
-    doRegister() {
-      common_vendor.index.showToast({ title: "注册成功", icon: "success" });
-      this.showRegisterPopup = false;
+    async doRegister() {
+      var _a;
+      if (!this.regPhone || !this.regCode || !this.regUsername || !this.regPassword) {
+        common_vendor.index.showToast({ title: "请填写所有注册信息", icon: "none" });
+        return;
+      }
+      common_vendor.index.showLoading({ title: "注册中...", mask: true });
+      try {
+        const res = await common_vendor.index.request({
+          url: "http://localhost:3333/user/register",
+          method: "POST",
+          data: {
+            phone: this.regPhone,
+            code: this.regCode,
+            username: this.regUsername,
+            password: this.regPassword
+          },
+          header: { "content-type": "application/json" }
+        });
+        common_vendor.index.hideLoading();
+        if (res.statusCode === 200 && res.data) {
+          common_vendor.index.__f__("log", "at pages/login/login.vue:337", "Registration success:", res.data);
+          common_vendor.index.showToast({ title: "注册成功", icon: "success" });
+          this.regPhone = "";
+          this.regCode = "";
+          this.regUsername = "";
+          this.regPassword = "";
+          setTimeout(() => {
+            this.showRegisterPopup = false;
+          }, 1500);
+        } else {
+          common_vendor.index.__f__("error", "at pages/login/login.vue:349", "Registration failed:", res);
+          common_vendor.index.showToast({ title: ((_a = res.data) == null ? void 0 : _a.message) || "注册失败", icon: "none" });
+        }
+      } catch (err) {
+        common_vendor.index.hideLoading();
+        common_vendor.index.__f__("error", "at pages/login/login.vue:354", "Registration request failed:", err);
+        common_vendor.index.showToast({ title: "注册失败", icon: "none" });
+      }
     }
   }
 };
@@ -68,37 +279,41 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
     g: common_vendor.o(($event) => $data.phone = $event.detail.value),
     h: $data.code,
     i: common_vendor.o(($event) => $data.code = $event.detail.value),
-    j: common_vendor.o((...args) => $options.sendCode && $options.sendCode(...args))
+    j: common_vendor.t($data.loginCodeTimer > 0 ? $data.loginCodeTimer + "s" : "获取验证码"),
+    k: common_vendor.o((...args) => $options.sendCode && $options.sendCode(...args)),
+    l: $data.loginCodeTimer > 0 || $data.isSendingLoginCode
   } : {
-    k: $data.username,
-    l: common_vendor.o(($event) => $data.username = $event.detail.value),
-    m: $data.password,
-    n: common_vendor.o(($event) => $data.password = $event.detail.value),
-    o: common_vendor.o((...args) => $options.toRegister && $options.toRegister(...args)),
-    p: common_vendor.o((...args) => $options.toForgot && $options.toForgot(...args))
+    m: $data.username,
+    n: common_vendor.o(($event) => $data.username = $event.detail.value),
+    o: $data.password,
+    p: common_vendor.o(($event) => $data.password = $event.detail.value),
+    q: common_vendor.o((...args) => $options.toRegister && $options.toRegister(...args)),
+    r: common_vendor.o((...args) => $options.toForgot && $options.toForgot(...args))
   }, {
-    q: !$data.agreed,
-    r: common_vendor.o((...args) => $options.doLogin && $options.doLogin(...args)),
-    s: $data.agreed,
-    t: common_vendor.o(($event) => $data.agreed = !$data.agreed),
-    v: common_vendor.o((...args) => $options.openAgreement && $options.openAgreement(...args)),
-    w: common_vendor.o((...args) => $options.openPrivacy && $options.openPrivacy(...args)),
-    x: common_assets._imports_0$1,
-    y: common_vendor.o((...args) => $options.oneClickLogin && $options.oneClickLogin(...args)),
-    z: $data.showRegisterPopup
+    s: !$data.agreed,
+    t: common_vendor.o((...args) => $options.doLogin && $options.doLogin(...args)),
+    v: $data.agreed,
+    w: common_vendor.o(($event) => $data.agreed = !$data.agreed),
+    x: common_vendor.o((...args) => $options.openAgreement && $options.openAgreement(...args)),
+    y: common_vendor.o((...args) => $options.openPrivacy && $options.openPrivacy(...args)),
+    z: common_assets._imports_0$1,
+    A: common_vendor.o((...args) => $options.oneClickLogin && $options.oneClickLogin(...args)),
+    B: $data.showRegisterPopup
   }, $data.showRegisterPopup ? {
-    A: $data.regPhone,
-    B: common_vendor.o(($event) => $data.regPhone = $event.detail.value),
-    C: $data.regCode,
-    D: common_vendor.o(($event) => $data.regCode = $event.detail.value),
-    E: common_vendor.o((...args) => $options.sendRegCode && $options.sendRegCode(...args)),
-    F: $data.regUsername,
-    G: common_vendor.o(($event) => $data.regUsername = $event.detail.value),
-    H: $data.regPassword,
-    I: common_vendor.o(($event) => $data.regPassword = $event.detail.value),
-    J: common_vendor.o((...args) => $options.doRegister && $options.doRegister(...args)),
-    K: common_assets._imports_1,
-    L: common_vendor.o(($event) => $data.showRegisterPopup = false)
+    C: $data.regPhone,
+    D: common_vendor.o(($event) => $data.regPhone = $event.detail.value),
+    E: $data.regCode,
+    F: common_vendor.o(($event) => $data.regCode = $event.detail.value),
+    G: common_vendor.t($data.regCodeTimer > 0 ? $data.regCodeTimer + "s" : "获取验证码"),
+    H: common_vendor.o((...args) => $options.sendRegCode && $options.sendRegCode(...args)),
+    I: $data.regCodeTimer > 0 || $data.isSendingRegCode,
+    J: $data.regUsername,
+    K: common_vendor.o(($event) => $data.regUsername = $event.detail.value),
+    L: $data.regPassword,
+    M: common_vendor.o(($event) => $data.regPassword = $event.detail.value),
+    N: common_vendor.o((...args) => $options.doRegister && $options.doRegister(...args)),
+    O: common_assets._imports_1,
+    P: common_vendor.o(($event) => $data.showRegisterPopup = false)
   } : {});
 }
 const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/login/login.wxml


+ 2 - 2
unpackage/dist/dev/mp-weixin/project.config.json

@@ -18,8 +18,8 @@
         }
     },
     "compileType": "miniprogram",
-    "libVersion": "3.8.4",
-    "appid": "touristappid",
+    "libVersion": "",
+    "appid": "wx97b71d70f5b2d51f",
     "projectname": "TourismApp",
     "condition": {},
     "editorSetting": {

+ 2 - 1
unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -3,5 +3,6 @@
     "projectname": "TourismApp",
     "setting": {
         "compileHotReLoad": true
-    }
+    },
+    "libVersion": "2.25.4"
 }

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác