From 4282e1cc35d85e2f84fe37b7f51fde22b374c7c9 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 24 二月 2026 11:27:18 +0800
Subject: [PATCH] 合并

---
 mini-program/pages/login/login.vue |   62 ++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/mini-program/pages/login/login.vue b/mini-program/pages/login/login.vue
index 391c0ef..2aa3441 100644
--- a/mini-program/pages/login/login.vue
+++ b/mini-program/pages/login/login.vue
@@ -14,7 +14,7 @@
 				<view class="icon">
 					<image src="/static/icon/login_ic_password@2x.png" mode="widthFix"></image>
 				</view>
-				<input :focus='focus1' @blur="focus1=false"    type="safe-password" v-model="form.password" placeholder="璇疯緭鍏ュ瘑鐮�" />
+				<input :focus='focus1' @blur="focus1=false"    type="password" v-model="form.password" placeholder="璇疯緭鍏ュ瘑鐮�" />
 			</view>
 		</view>
 		<view class="login-btn" @click="submitDo">绔嬪嵆鐧诲綍</view>
@@ -22,7 +22,7 @@
 			<image src="/static/icon/ic_agree@2x.png" v-if="!radio" @click="changeRadio()" mode="widthFix"></image>
 			<image src="/static/icon/ic_agree_sel@2x.png" v-if="radio" @click="changeRadio()"  mode="widthFix"></image>
 			<view class="login-info-text">
-				鎴戝凡闃呰骞跺悓鎰�<text>銆婇紟鍏冪鎶�鐢ㄦ埛鏈嶅姟鍗忚銆�</text>鍙�<text>銆婇紟鍏冪鎶�鐢ㄦ埛闅愮鏀跨瓥銆�</text>
+				鎴戝凡闃呰骞跺悓鎰�<text @click="jumpService(4)">銆婇紟鍏冪鎶�鐢ㄦ埛鏈嶅姟鍗忚銆�</text>鍙�<text  @click="jumpService(5)">銆婇紟鍏冪鎶�鐢ㄦ埛闅愮鏀跨瓥銆�</text>
 			</view>
 		</view>
 	</view>
@@ -48,23 +48,50 @@
 				radio:false
 			};
 		},
-		onShow() {
+		async onLoad() {
+		},
+		async onShow() {
+			await this.$onLaunched;
 			this.focus=false
 			this.focus1=false
 			this.form.openid=this.openid
-			this.checkLogin()
+			this.checkShopLogin()
 		},
 		methods:{
-			checkLogin(){
-				if( !this.shopInfo && !this.shopToken){
-					let res = await that.$u.api.getUserInfo()
-					if (res.code === 200) {
-						await that.$store.commit('setUserInfo', res.data)
-						await that.$store.commit('setOpenId', res.data.openId)
-						this.jumpShopIndex()
-					}
-				}
+			jumpService(flag) {
+				uni.navigateTo({
+					url: '/pagesA/pages/rich-text-page/rich-text-page?flag='+flag
+				})
 			},
+		    async checkShopLogin(){
+				uni.showLoading( )
+				var that =this
+				if( this.shopInfo !=null && this.shopInfo.id!=null && (this.shopToken!=null &&this.shopToken!='')){
+					//楠岃瘉token鏄惁鏈夋晥
+					let res = await that.$u.api.getShopInfo({tokenType:1  })
+					if (res.code === 200) {
+						await that.$store.commit('setShopInfo', res.data) 
+						that.jumpShopIndex()
+					}else if( this.openid !=null && this.openid !=''){
+						let res = await that.$u.api.shopOpenidLogin(this.form)
+							if (res.code === 200 && res.data.shop!=null && res.data.token!=null) {
+							await that.$store.commit('setShopInfo', res.data.shop)
+							await that.$store.commit('setShopToken', res.data.token)
+							that.jumpShopIndex()
+						}
+					}
+				}else if( this.openid !=null && this.openid !=''){
+					let res = await that.$u.api.shopOpenidLogin(this.form)
+						if (res.code === 200 && res.data.shop!=null && res.data.token!=null) {
+						await that.$store.commit('setShopInfo', res.data.shop)
+						await that.$store.commit('setShopToken', res.data.token)
+						that.jumpShopIndex()
+					}
+				} 
+				setTimeout(function () {
+					uni.hideLoading();
+				}, 1000);
+			},  
 			changeRadio(){
 				this.radio = !this.radio
 			},
@@ -92,17 +119,18 @@
 					this.loading=false
 					return
 				}
+				var that =this
 				this.$u.api.shopPasswordLogin(this.form)
 					.then(res => {
 						if (res.code === 200) { 
-							await that.$store.commit('setShopInfo', res.data.member)
-							await that.$store.commit('setShopToken', res.data.token)
-							this.jumpShopIndex()
+							that.$store.commit('setShopInfo', res.data.shop)
+							that.$store.commit('setShopToken', res.data.token)
+							that.jumpShopIndex()
 						}
 					})
 			},
 			jumpShopIndex() {
-				uni.navigateTo({
+				uni.redirectTo({
 					url: '/pages/distributor/distributor'
 				})
 			}

--
Gitblit v1.9.3