From ea2fb93a0dfcde8f5b66825b20f9d9b835a28acc Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 22 五月 2026 10:54:09 +0800
Subject: [PATCH] 提交

---
 small-program/shop/pages/login/login.vue |   47 +++++++++++++++++++++++++++--------------------
 1 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/small-program/shop/pages/login/login.vue b/small-program/shop/pages/login/login.vue
index 954e918..481dda0 100644
--- a/small-program/shop/pages/login/login.vue
+++ b/small-program/shop/pages/login/login.vue
@@ -15,7 +15,10 @@
 
 			<view class="input-row password-row">
 				<u-icon name="lock" size="30" color="#B8B8B8"></u-icon>
-				<input v-model="form.password" class="input-field" password type="text" placeholder="璇疯緭鍏ュ瘑鐮�" placeholder-style="color: #999999;" />
+				<input v-model="form.password" class="input-field" :password="!showPassword" placeholder="璇疯緭鍏ュ瘑鐮�" placeholder-style="color: #999999;" />
+				<view class="password-toggle" @click="showPassword = !showPassword">
+					<u-icon :name="showPassword ? 'eye' : 'eye-off'" size="20" color="#B8B8B8"></u-icon>
+				</view>
 			</view>
 			<view class="input-divider"></view>
 		</view>
@@ -44,6 +47,7 @@
 		data() {
 			return {
 				agreed: false,
+				showPassword: false,
 				form: {
 					telephone: '',
 					password: ''
@@ -87,7 +91,7 @@
 			}
 		},
 		methods: {
-			async handleLogin() {
+			handleLogin() {
 				if (!this.form.telephone) {
 					uni.showToast({
 						title: '璇疯緭鍏ヨ处鍙�',
@@ -109,28 +113,27 @@
 					})
 					return
 				}
-				uni.showLoading({ title: '鐧诲綍涓�...', mask: true })
-				const res = await this.$u.api.shopLogin({
+				this.$u.api.shopLogin({
 					openid: this.openid,
 					password: this.form.password,
 					telephone: this.form.telephone
-				})
-				uni.hideLoading()
-				if (res.code === 200) {
-					this.$store.commit('setUserType', 1)
-					this.$store.commit('setShopToken', res.data.token)
-					// 鑾峰彇闂ㄥ簵淇℃伅
-					const shopInfoRes = await this.$u.api.getShopInfo({})
-					if (shopInfoRes.code === 200) {
-						this.$store.commit('setShopInfo', shopInfoRes.data)
+				}).then(async res => {
+					if (res.code === 200) {
+						this.$store.commit('setUserType', 1)
+						this.$store.commit('setShopToken', res.data.token)
+						// 鑾峰彇闂ㄥ簵淇℃伅
+						const shopInfoRes = await this.$u.api.getShopInfo({})
+						if (shopInfoRes.code === 200) {
+							this.$store.commit('setShopInfo', shopInfoRes.data)
+						}
+						uni.showToast({ title: '鐧诲綍鎴愬姛', icon: 'success' })
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/shop/pages/store-home/store-home'
+							});
+						}, 1500)
 					}
-					uni.showToast({ title: '鐧诲綍鎴愬姛', icon: 'success' })
-					setTimeout(() => {
-						uni.reLaunch({
-							url: '/shop/pages/store-home/store-home'
-						});
-					}, 1500)
-				}
+				})
 			},
 			goToService(type) {
 				uni.navigateTo({
@@ -181,6 +184,10 @@
 	.password-row {
 		margin-top: 18rpx;
 	}
+	
+	.password-toggle {
+		padding: 10rpx;
+	}
 
 	.input-field {
 		flex: 1;

--
Gitblit v1.9.3