From 8d5f3a34166a487c5ff6c0834519fd1166ff7f9d Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 30 四月 2026 13:57:12 +0800
Subject: [PATCH] 支付宝支付dddadd

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

diff --git a/small-program/shop/pages/login/login.vue b/small-program/shop/pages/login/login.vue
index 79b3d35..2673499 100644
--- a/small-program/shop/pages/login/login.vue
+++ b/small-program/shop/pages/login/login.vue
@@ -26,9 +26,9 @@
 			<image class="agree-icon" :src="agreed ? '/static/icon/ic_accept_sel@2x.png' : '/static/icon/ic_accept@2x.png'" mode="aspectFit" @tap="agreed = !agreed"></image>
 			<view class="agreement-text-wrap">
 				<text class="agreement-text">鎴戝凡闃呰骞跺悓鎰�</text>
-				<text class="agreement-link" @click="goToService">銆婄敤鎴锋湇鍔″崗璁��</text>
+				<text class="agreement-link" @click="goToService(2)">銆婇棬搴楁湇鍔″崗璁��</text>
 				<text class="agreement-text">鍙�</text>
-				<text class="agreement-link" @click="goToPrivacy">銆婄敤鎴烽殣绉佹斂绛栥��</text>
+				<text class="agreement-link" @click="goToService(3)">銆婇棬搴楅殣绉佹斂绛栥��</text>
 			</view>
 		</view>
 	</view>
@@ -52,7 +52,6 @@
 		},
 		onLoad() {
 			// 闈欓粯鐧诲綍
-		
 			if (this.userInfo.bindShopId) {
 				uni.showLoading({
 					title:'鐧诲綍涓�...'
@@ -61,7 +60,7 @@
 					console.log(this.userType,"============================================")
 					this.$u.api.shopSilentLogin({})
 						.then( res => {
-							if (res.code === 200) {
+							if (res.code === 200 && res.data) {
 								this.$store.commit('setUserType', 1)
 								this.$store.commit('setShopToken', res.data.token)
 								// 鑾峰彇闂ㄥ簵淇℃伅
@@ -71,12 +70,13 @@
 									}
 									uni.hideLoading();
 									// setTimeout(() => {
-										uni.reLaunch({
+										uni.navigateTo({
 											url: '/shop/pages/store-home/store-home'
 										});
 									// }, 1000)
 								})
 							}
+							uni.hideLoading()
 						})
 				}catch(e){
 					uni.hideLoading()
@@ -87,14 +87,7 @@
 			}
 		},
 		methods: {
-			async handleLogin() {
-				if (!this.agreed) {
-					uni.showToast({
-						title: '璇峰厛闃呰骞跺悓鎰忓崗璁�',
-						icon: 'none'
-					})
-					return
-				}
+			handleLogin() {
 				if (!this.form.telephone) {
 					uni.showToast({
 						title: '璇疯緭鍏ヨ处鍙�',
@@ -109,14 +102,18 @@
 					})
 					return
 				}
-				uni.showLoading({ title: '鐧诲綍涓�...', mask: true })
-				try {
-					const res = await this.$u.api.shopLogin({
-						openid: this.openid,
-						password: this.form.password,
-						telephone: this.form.telephone
+				if (!this.agreed) {
+					uni.showToast({
+						title: '璇峰厛闃呰骞跺悓鎰忓崗璁�',
+						icon: 'none'
 					})
-					uni.hideLoading()
+					return
+				}
+				this.$u.api.shopLogin({
+					openid: this.openid,
+					password: this.form.password,
+					telephone: this.form.telephone
+				}).then(async res => {
 					if (res.code === 200) {
 						this.$store.commit('setUserType', 1)
 						this.$store.commit('setShopToken', res.data.token)
@@ -131,30 +128,14 @@
 								url: '/shop/pages/store-home/store-home'
 							});
 						}, 1500)
-					} else {
-						uni.showToast({
-							title: res.msg || '鐧诲綍澶辫触',
-							icon: 'none'
-						})
 					}
-				} catch (err) {
-					uni.hideLoading()
-					uni.showToast({
-						title: '鐧诲綍澶辫触',
-						icon: 'none'
-					})
-				}
-			},
-			goToService() {
-				uni.navigateTo({
-					url: '/pages/rich-text/rich-text?type=userAgreement'
 				})
 			},
-			goToPrivacy() {
+			goToService(type) {
 				uni.navigateTo({
-					url: '/pages/rich-text/rich-text?type=privacyPolicy'
+					url: '/pages/rich-text/rich-text?type='+type
 				})
-			}
+			} 
 		}
 	}
 </script>

--
Gitblit v1.9.3