Ver Fonte

登录查询轮播图

zhaoxiaohai há 3 anos atrás
pai
commit
0485090991
2 ficheiros alterados com 20 adições e 65 exclusões
  1. 18 5
      pages/login/modules/login.js
  2. 2 60
      pages/login/phone.js

+ 18 - 5
pages/login/modules/login.js

@@ -1,7 +1,6 @@
 const _Http = getApp().globalData.http;
-
 function loginMsg(res) {
-    wx.setStorageSync('account_list', res.account_list)
+    wx.setStorageSync('account_list', res.account_list);
     if (res.account_list.length == 1) {
         wx.setStorageSync('userMsg', res.account_list[0])
         query_userauth();
@@ -17,7 +16,10 @@ function query_userauth(i = 0) {
         title: '权限查询失败,请稍后再试',
         icon: "none"
     })
-    if (i == 0) querySite_Parameter();
+    if (i == 0) {
+        query_adspacelist();
+        querySite_Parameter();
+    }
     _Http.basic({
         "classname": "sysmanage.develop.userauth.userauth",
         "method": "query_userauth",
@@ -38,7 +40,7 @@ function query_userauth(i = 0) {
     if (!getApp().globalData.socketEstablish) getApp().initSocket();
     console.log(getApp().globalData.SocketTask)
 }
-
+/* 查询站点数据 */
 function querySite_Parameter(i = 0) {
     if (i == 5) return;
     _Http.basic({
@@ -50,7 +52,18 @@ function querySite_Parameter(i = 0) {
         wx.setStorageSync('siteP', res.data);
     })
 }
-
+/* 查询轮播图 */
+function query_adspacelist(i = 0) {
+    if (i == 5) return;
+    _Http.basic({
+        "classname": "common.adspace.adspace",
+        "method": "query_adspacelist",
+        "content": {}
+    }).then(res => {
+        if (res.msg != '成功') return query_adspacelist(i + 1);
+        console.log("轮播图", res)
+    })
+}
 /* 站点数据查询 */
 module.exports = {
     loginMsg,

+ 2 - 60
pages/login/phone.js

@@ -22,19 +22,11 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+        /* 恢复缓存中保存的账号密码 */
         this.setData({
             ...wx.getStorageSync('loginMsg')
         })
-        wx.getUserProfile({
-            desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-            success: (res) => {
-                console.log("用户信息", res)
-                /* this.setData({
-                    userInfo: res.userInfo,
-                    hasUserInfo: true
-                }) */
-            }
-        })
+        /* 验证登录条件 */
         this.allowOrNot()
     },
     /* 微信登录 */
@@ -50,7 +42,6 @@ Page({
                         wechat_code: res.code,
                         "systemclient": "wechatsaletool"
                     }).then(res => {
-                        console.log(res)
                         if (res.code == 0) return wx.showToast({
                             title: res.msg,
                             icon: "none"
@@ -81,7 +72,6 @@ Page({
             this.setData({
                 loading: false
             })
-            console.log("登录", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
                 icon: "none"
@@ -133,52 +123,4 @@ Page({
             memory: !this.data.memory
         })
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
-    }
 })