From cce741189bfa7063cf0ee83e0a11df1ab539958c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 21 四月 2026 20:27:44 +0800
Subject: [PATCH] 门店

---
 small-program/shop/pages/login/login.vue |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/small-program/shop/pages/login/login.vue b/small-program/shop/pages/login/login.vue
index de6bb48..230bd54 100644
--- a/small-program/shop/pages/login/login.vue
+++ b/small-program/shop/pages/login/login.vue
@@ -39,7 +39,7 @@
 
 	export default {
 		computed: {
-			...mapState(['openid'])
+			...mapState(['openid', 'userInfo'])
 		},
 		data() {
 			return {
@@ -48,6 +48,23 @@
 					telephone: '',
 					password: ''
 				}
+			}
+		},
+		onLoad() {
+			// 闈欓粯鐧诲綍
+			if (this.userInfo.bindShopId) {
+				this.$u.api.shopSilentLogin({})
+					.then(res => {
+						if (res.code === 200) {
+							this.$store.commit('setUserType', 1)
+							this.$store.commit('setShopToken', res.data.token)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/shop/pages/store-home/store-home'
+								});
+							}, 500)
+						}
+					})
 			}
 		},
 		methods: {
@@ -86,9 +103,9 @@
 						this.$store.commit('setShopToken', res.data.token)
 						uni.showToast({ title: '鐧诲綍鎴愬姛', icon: 'success' })
 						setTimeout(() => {
-							uni.switchTab({
-								url: '/pages/shop-index/shop-index'
-							})
+							uni.reLaunch({
+								url: '/shop/pages/store-home/store-home'
+							});
 						}, 1500)
 					} else {
 						uni.showToast({

--
Gitblit v1.9.3