From a25c7697644a40d3aa3a9746085a9a7618dd098a Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期二, 10 十月 2023 08:15:09 +0800
Subject: [PATCH] 修改称重提示错误 修改判断

---
 pages/login/login.vue |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/pages/login/login.vue b/pages/login/login.vue
index d697aee..f2af9b5 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -12,8 +12,13 @@
 				type="primary"
 				text="寰俊涓�閿櫥褰�"></u-button>
 		</view>
+		<!-- <view class="loginBtn">
+			<u-button @click.stop="jumpBindBack"
+				type="primary"
+				text="涓�閿粦瀹氭祴璇�"></u-button>
+		</view> -->
 		<view class="register"
-			@click="registerClick"><text>娉ㄥ唽</text></view>
+			@click="PrivacyAgreementHandle"><text>娉ㄥ唽</text></view>
 		<view class="login-bottom-box">
 			<view class="copyright">鍐�涓兘婧愭棤浜哄�煎畧寰俊灏忕▼搴�</view>
 			<view class="copyright">灏忕▼搴忎粎渚涘凡鎷ユ湁绯荤粺璐﹀彿鐗瑰畾鍐呴儴浜哄憳浣跨敤</view>
@@ -68,7 +73,9 @@
 				// 缁戝畾寰俊妯℃�佹
 				bindWxModelShow: false,
 				bindWxModelTitle: '鎻愮ず',
-				bindWxContent: '濡傛灉宸叉嫢鏈夌郴缁熻处鍙凤紝鍙互鐩存帴璺宠浆缁戝畾寰俊椤甸潰'
+				bindWxContent: '濡傛灉宸叉嫢鏈夌郴缁熻处鍙凤紝鍙互鐩存帴璺宠浆缁戝畾寰俊椤甸潰',
+				appid: "",
+				secret: "",
 			};
 		},
 		components: {
@@ -76,9 +83,16 @@
 		},
 		methods: {
 			...mapMutations(['setUserTabbar', 'changeisLogin']),
+			getAppidAndSercet() {
+				this.$reqGet('getAppidAndSercet').then(res => {
+					this.appid = res.data.appid;
+					this.secret = res.data.secret
+				})
+			},
 			// 璁块棶wx.login,鑾峰彇code
 			beforeLoginEvent() {
 				this.loginPopupShow = true;
+				this.getAppidAndSercet();
 			},
 			wxLogin() {
 				// 鑾峰彇鐧诲綍鐢ㄦ埛code
@@ -103,8 +117,9 @@
 					title: '鍔犺浇涓�...'
 				});
 				wx.request({
-					url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`,
+					url: `https://api.weixin.qq.com/sns/jscode2session?appid=${this.appid}&secret=${this.secret}&js_code=${code}&grant_type=authorization_code`,
 					success(res) {
+						console.log(res, 'openid');
 						uni.setStorageSync('openid', res.data.openid);
 						// uni.showToast({
 						// 	title: '鎴愬姛鑾峰彇娴嬭瘯openid',
@@ -125,6 +140,8 @@
 							this.$reqGet('getUserEntity').then(res => {
 								this.setUserTabbar(res.data.type);
 								uni.setStorageSync('roleType', res.data.type);
+								uni.setStorageSync("userId", res.data.userId)
+								uni.setStorageSync("carNo", res.data.carNo)
 								setCustomerId(res.data.customerid);
 								uni.hideLoading();
 								//璺宠浆椤甸潰
@@ -156,11 +173,11 @@
 			openPopup() {
 				console.log('鎵撳紑浜�');
 			},
-			registerClick() {
+			PrivacyAgreementHandle() {
 				uni.navigateTo({
-					url: '/pages/register/register'
-				});
-			}
+					url: '/pages/login/PrivacyAgreementText/PrivacyAgreementText'
+				})
+			},
 		}
 	};
 </script>
@@ -168,6 +185,10 @@
 <style lang="scss">
 	@import 'index.scss';
 
+	.PrivacyAgreement {
+		color: rgb(60, 156, 255)
+	}
+
 	.login {
 		// height: 100vh;
 		// display: flex;

--
Gitblit v1.9.1