فهرست منبع

第一次登录默认不选中隐私协议

xiaohaizhao 2 سال پیش
والد
کامیت
f477cee63f
4فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 1 0
      pages/login/modules/agreement.js
  2. 1 0
      pages/login/modules/login.js
  3. 6 2
      pages/login/phone.js
  4. 1 0
      pages/login/phone.json

+ 1 - 0
pages/login/modules/agreement.js

@@ -23,6 +23,7 @@ Component({
                 isAgree
             })
             this.triggerEvent("callBack", isAgree)
+            wx.setStorageSync('isAgree', isAgree);
         },
         checkTheAgreement() {
             wx.showLoading({

+ 1 - 0
pages/login/modules/login.js

@@ -55,6 +55,7 @@ function query_userauth() {
     }).then(res => {
         console.log("查询是否隐私金额", res)
         if (res.msg == '成功') wx.setStorageSync('hidePrice', res.data.length == 0 ? 0 : 1);
+        console.log(wx.getStorageSync('hidePrice'))
     })
 }
 /* 查询站点数据 */

+ 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/login/phone.json

@@ -4,6 +4,7 @@
         "Agreement": "./modules/agreement",
         "van-divider": "@vant/weapp/divider/index",
         "account": "./modules/account",
+        "van-toast": "@vant/weapp/toast/index",
         "phone": "./modules/phone"
     }
 }