Quellcode durchsuchen

第一次进入不选中隐私协议

xiaohaizhao vor 2 Jahren
Ursprung
Commit
6e2126165c
3 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. 3 2
      pages/login/modules/agreement.js
  2. 6 2
      pages/login/phone.js
  3. 1 0
      pages/tabbar/mine/index.js

+ 3 - 2
pages/login/modules/agreement.js

@@ -22,7 +22,8 @@ Component({
             this.setData({
                 isAgree
             })
-            this.triggerEvent("callBack", isAgree)
+            this.triggerEvent("callBack", isAgree);
+            wx.setStorageSync('isAgree', isAgree);
         },
         checkTheAgreement() {
             wx.showLoading({
@@ -33,7 +34,7 @@ Component({
                 success: (res) => {
                     wx.openDocument({
                         filePath: res.tempFilePath,
-                        success:(s)=>{
+                        success: (s) => {
                             wx.hideLoading();
 
                         },

+ 6 - 2
pages/login/phone.js

@@ -7,11 +7,15 @@ Page({
      * 页面的初始数据
      */
     data: {
-        isAgree: true,
+        isAgree: false,
         disabled: true, //是否禁用
         loading: false, //登陆中
     },
-    onLoad(options) {},
+    onLoad(options) {
+        if (wx.getStorageSync('isAgree')) this.setData({
+            isAgree: wx.getStorageSync('isAgree')
+        })
+    },
     /* 微信登录 */
     wechatLogin() {
         if (!this.data.isAgree) return Toast({

+ 1 - 0
pages/tabbar/mine/index.js

@@ -76,6 +76,7 @@ Page({
                 let loginMsg = wx.getStorageSync("loginMsg");
                 wx.clearStorageSync();
                 wx.setStorageSync('loginMsg', loginMsg)
+                wx.setStorageSync('isAgree', true)
                 setTimeout(() => {
                     wx.reLaunch({
                         url: '/pages/login/phone',