From 7952797c47a0a5149435d448eafd268091732e74 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Fri, 08 Mar 2024 13:09:22 +0800
Subject: [PATCH] fix:整改附件必填

---
 pages/login/login.vue |   71 +++++++++++++++++++++++++++--------
 1 files changed, 55 insertions(+), 16 deletions(-)

diff --git a/pages/login/login.vue b/pages/login/login.vue
index 147529c..d253f90 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -21,32 +21,38 @@
 				</u-form>
 			</view>
 			<view class="loginContent">
-				<p>
+				<!-- <p>
 					<navigator style="display: inline-block;" url="/pages/login/register/register">
 						<text style="text-decoration: underline">������������</text>
 					</navigator>
-				</p>
+				</p> -->
 				<u-button @click="submit">������</u-button>
 			</view>
 		</view>
+		<ws-wx-privacy id="privacy-popup" enableAutoProtocol></ws-wx-privacy>
 	</view>
 </template>
 <script>
 	import {
 		login,
-		getUserInfor,
 		getDic
 	} from '@/utils/login.js' // ������������
 	import {
 		httpPost,
 		httpGet
 	} from '@/utils/http.js'
+	import store from '@/store/index.js'
+	import {
+		subScribeMsg
+	} from '@/utils/subscribe.js'
 	export default {
 		data() {
 			return {
+				titlePrivacy: '������������������������',
 				labelStyle: {
 					color: '#fff'
 				},
+				title: '������������',
 				passwordIcon: false,
 				form: {
 					account: '',
@@ -71,38 +77,71 @@
 			//onReady ���uni-app���������������������������
 			this.$refs.uForm.setRules(this.rules)
 		},
+		async onLoad(option) {
+			//������������������	
+			await this.$onLaunched
+			// ������������������
+		},
+		async onShow() {
+			uni.hideHomeButton()
+		},
 		methods: {
+			// ���������������������������
+			async aClick() {
+				let data = await subScribeMsg()
+				console.log('data', data)
+				if (data['YNqUZ1MgMvwY3G-NENVbcmIBR5dUotSdnwcz96CWrho'] === 'accept') { // ���������������������
+					this.doRequire()
+				} else {
+					this.doRequire()
+				}
+			},
+			doRequire() {
+				uni.requirePrivacyAuthorize({
+					success: () => {
+						console.log('������')
+						// ������������������
+						// ���������������������
+						this.getlogin()
+					},
+					fail: () => {
+						console.log('������')
+					}, // ������������������
+					complete: () => {}
+				})
+			},
 			submit() {
 				this.$refs.uForm.validate().then(res => {
-					this.getlogin()
-				}).catch(errors => {
-					uni.$u.toast('������������')
-				})
+					this.aClick()
+				}).catch(errors => {})
 			},
 			//������
 			getlogin() {
-				let openId = this.$storage.get('openId')
+				const value = uni.getStorageSync('openId')
+				console.log('openId', value)
+				if (value) {
+					this.logining(value)
+				}
+			},
+			logining(openId) {
 				login({
 					...this.form,
 					openId
 				}).then(response => {
-					this.$storage.set('token', response.data.token)
+					uni.setStorageSync('userInfor', JSON.stringify(response.data))
+					uni.setStorageSync('tonken', response.data.token)
 					getDic()
-					getUserInfor(response.data.token)
 					uni.hideLoading()
-					uni.switchTab({
-						url: '/pages/actionChange/agencyPage/index',
+					uni.navigateTo({
+						url: '/pages/index/index',
 					})
-					// this.$storage.setJson("accountInFor", this.form);
-					// console.log('this.$store', this.$store)
-					// this.$store.commit('token', token)
 				}).catch(errors => {
 					uni.showToast({
 						title: errors,
 						icon: 'none',
 					})
 				})
-			},
+			}
 		},
 	}
 </script>

--
Gitblit v1.8.0