From bc5d79cdd957fcee510d7a1cee07f6775af65596 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 03 三月 2026 10:04:46 +0800
Subject: [PATCH] 合并

---
 mini-program/components/login/login.vue |   55 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/mini-program/components/login/login.vue b/mini-program/components/login/login.vue
index 876992d..8363ae2 100644
--- a/mini-program/components/login/login.vue
+++ b/mini-program/components/login/login.vue
@@ -2,26 +2,44 @@
 	<u-popup :show="show" round="15" :safeAreaInsetBottom="false" :closeable="true" mode="bottom" @close="show = false">
 		<view class="login">
 			<image src="/static/images/logo@2x.png" mode="widthFix"></image>
-			<view class="login-info">
-				<image src="/static/icon/ic_agree@2x.png" mode="widthFix"></image>
+			<view class="login-info" @click="isAuth = !isAuth">
+				<image src="/static/icon/ic_agree@2x.png" mode="widthFix" v-if="!isAuth"></image>
+				<image src="/static/icon/cart_ic_sel@2x.png" mode="widthFix" v-else></image>
 				<view class="login-info-text">
-					鎴戝凡闃呰骞跺悓鎰�<text>銆婇紟鍏冪鎶�鐢ㄦ埛鏈嶅姟鍗忚銆�</text>鍙�<text>銆婇紟鍏冪鎶�鐢ㄦ埛闅愮鏀跨瓥銆�</text>
+					鎴戝凡闃呰骞跺悓鎰�<text @click.stop="jumpService(4)">銆婇紟鍏冪鎶�鐢ㄦ埛鏈嶅姟鍗忚銆�</text>鍙�<text @click.stop="jumpService(5)">銆婇紟鍏冪鎶�鐢ㄦ埛闅愮鏀跨瓥銆�</text>
 				</view>
 			</view>
-			<button class="login-btn" open-type="getPhoneNumber" @getphonenumber="getphonenumber">鎵嬫満鍙峰揩鎹风櫥褰�</button>
+			<button class="login-btn" @click="tishi" v-if="!isAuth">鎵嬫満鍙峰揩鎹风櫥褰�</button>
+			<button class="login-btn" open-type="getPhoneNumber" @getphonenumber="getphonenumber" v-else>鎵嬫満鍙峰揩鎹风櫥褰�</button>
 		</view>
 	</u-popup>
 </template>
 
 <script>
+	import { mapState } from 'vuex'
 	export default {
 		name: "login",
 		data() {
 			return {
-				show: false
+				show: false,
+				isAuth: false,
 			};
 		},
+		computed: {
+			...mapState(['openid', 'recshopid', 'recuserid'])
+		},
 		methods: {
+			tishi() {
+				uni.showToast({
+					title: '璇峰厛鍕鹃�夊悓鎰忓崗璁�',
+					icon: 'none'
+				})
+			},
+			jumpService(flag) {
+				uni.navigateTo({
+					url: '/pagesA/pages/rich-text-page/rich-text-page?flag='+flag
+				})
+			},
 			open() {
 				this.show = true
 			},
@@ -29,7 +47,32 @@
 				this.show = false
 			},
 			getphonenumber(e) {
-				console.log(e)
+				var that = this;
+				if (e.detail.errMsg === 'getPhoneNumber:ok') {
+					uni.login({
+						provider: 'weixin',
+						success: async function (loginRes) {
+							let { code } = loginRes;
+							let res = await that.$u.api.wxLogin({ code })
+							if (res.code === 200) {
+								that.$u.api.wxPhone({
+									code: e.detail.code,
+									shopId:that.recshopid,
+									recId:that.recuserid,
+									openid: res.data.openid
+								}).then(res => {
+									if (res.code === 200) {
+										that.$store.commit('setUserInfo', res.data.member)
+										that.$store.commit('setToken', res.data.token)
+										that.$store.commit('setRecShopId','')
+										that.$store.commit('setRecUserId','')
+										that.close()
+									}
+								})
+							}
+						}
+					});
+				}
 			}
 		}
 	}

--
Gitblit v1.9.3