From 1e61215b48e59e94c1ed98e4ef956227d689d6bc Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 06 Nov 2023 08:48:39 +0800
Subject: [PATCH] fix:小程序订阅消息

---
 pages/login/login.vue |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/pages/login/login.vue b/pages/login/login.vue
index 04a8c27..9a59fea 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -29,6 +29,7 @@
 				<u-button @click="submit">������</u-button>
 			</view>
 		</view>
+		<ws-wx-privacy id="privacy-popup" enableAutoProtocol></ws-wx-privacy>
 	</view>
 </template>
 <script>
@@ -41,9 +42,13 @@
 		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'
 				},
@@ -81,9 +86,32 @@
 			uni.hideHomeButton()
 		},
 		methods: {
+			// ���������������������������
+			async aClick() {
+				let data = await subScribeMsg()
+				console.log('data', data)
+				if (data['YNqUZ1MgMvwY3G-NENVbcmIBR5dUotSdnwcz96CWrho'] === 'accept') { // ���������������������
+				} else {
+					console.log('������')
+				}
+			},
+			doRequire() {
+				uni.requirePrivacyAuthorize({
+					success: () => {
+						console.log('������')
+						// ������������������
+						// ���������������������
+						this.getlogin()
+					},
+					fail: () => {
+						console.log('������')
+					}, // ������������������
+					complete: () => {}
+				})
+			},
 			submit() {
 				this.$refs.uForm.validate().then(res => {
-					this.getlogin()
+					this.doRequire()
 				}).catch(errors => {})
 			},
 			//������
@@ -91,8 +119,8 @@
 				const value = uni.getStorageSync('openId')
 				console.log('openId', value)
 				if (value) {
+					this.aClick()
 					this.logining(value)
-					console.log('openId', openId)
 				}
 			},
 			logining(openId) {

--
Gitblit v1.8.0