roose 4 năm trước cách đây
mục cha
commit
dcf3707a39

+ 2 - 3
app.js

@@ -1,9 +1,8 @@
-
 App({
   globalData: {
     showAnimation: true,
     id: null,
-    name:null,
+    name: null,
   },
   onLaunch(options) {
     // if (wx.getStorageSync('openId')) {
@@ -15,7 +14,7 @@ App({
     //     },
     //     success: (res) => {
     //       console.log(res, "000000000000000000");
-    //       if(res.data.code == 0){
+    //       if (res.data.code == 0) {
     //         wx.switchTab({
     //           url: '/pages/index/index',
     //         })

+ 3 - 3
app.json

@@ -1,13 +1,13 @@
 {
   "pages": [
-    "pages/login/login",
     "pages/index/index",
+    "pages/login/login",
+    "pages/visitandinfo/visitandinfo",
+    "pages/notice/notice",
     "pages/paiming/paiming",
     "pages/personInfo/personInfo",
     "pages/finishInfo/finishInfo",
     "pages/updatepassword/updatepassword",
-   
-    "pages/visitandinfo/visitandinfo",
     "pages/collectInfo/collectInfo"
   ],
   "window": {

+ 14 - 3
pages/login/login.js

@@ -31,9 +31,10 @@ Page({
       },
       success: (res) => {
         if (res.data.code == 0) {
-          wx.switchTab({
-            url: '/pages/index/index',
-          })
+          // wx.switchTab({
+          //   url: '/pages/index/index',
+          // })
+          wx.setStorageSync('user', 'user')
         }
       }
     })
@@ -55,6 +56,16 @@ Page({
             // 获取到用户的 openid
             console.log("用户的openid:" + res.data.openid);
             wx.setStorageSync('openId', res.data.openid)
+            wx.request({
+              url: app.globalData.publicUrl + '/applet/isExist',
+              method: "GET",
+              data: {
+                appletsId: wx.getStorageSync('openId')
+              },
+              success: (res) => {
+
+              }
+            })
           }
         });
       }

+ 8 - 3
pages/personInfo/personInfo.js

@@ -36,8 +36,13 @@ Page({
     })
   },
 
-  onLoad() {
-
-
+  onShow() {
+    console.log(wx.getStorageSync('user'), "打印");
+    if (wx.getStorageSync('user') == '') {
+      wx.switchTab({
+        url: '/pages/index/index'
+      })
+    }
   }
+
 })

+ 5 - 24
pages/updatepassword/updatepassword.js

@@ -58,15 +58,14 @@ Page({
     console.log(e.detail, "daying");
     var password = e.detail.value.pwd;
     wx.request({
-      url: app.globalData.publicUrl + '/applet/bing',
+      url: app.globalData.publicUrl + '/applet/updatePwd',
       method: "GET",
-      data: {
-        name: e.detail.value.name,
-        pwd: util.hexMD5(password),
+      header: {
         appletsId: wx.getStorageSync('openId')
       },
+      data: e.detail.value,
       success: (res) => {
-
+       
       }
     })
     // wx.switchTab({
@@ -74,25 +73,7 @@ Page({
     // })
   },
   onLoad: function () {
-    var that = this;
-    wx.login({
-      success: res => {
-        // 获取到用户的 code 之后:res.code
-        console.log("用户的code:" + res.code);
-        const appid = "wx1c015df104db7030"
-        const secret = "d1956c1b5d3601657c98b0dc80a006f7"
-        let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' + res.code + '&grant_type=authorization_code';
-        wx.request({
-          // 自行补上自己的 APPID 和 SECRET
-          url: url,
-          success: res => {
-            // 获取到用户的 openid
-            console.log("用户的openid:" + res.data.openid);
-            wx.setStorageSync('openId', res.data.openid)
-          }
-        });
-      }
-    });
+
 
   },
 })

+ 1 - 1
pages/updatepassword/updatepassword.wxml

@@ -10,7 +10,7 @@
 		<view class="box">
 			<view class="name" style=" margin-top: 20rpx;">
 				<image src="/images/pwd.png" style="width: 40rpx; height: 40rpx;"> </image>
-				<input name='pwd' class="weui-input" password='{{passwordType1}}' placeholder="请输入原密码" />
+				<input name='oldPwd' class="weui-input" password='{{passwordType1}}' placeholder="请输入原密码" />
 				<image src='{{defaultType1? "/images/eye_close.png": "/images/eye_open.png"}}' class='eye-image' bindtap='eyeStatus1'></image>
 			</view>
 			<view class="name" style=" margin-top: 20rpx;">

+ 8 - 0
pages/visitandinfo/visitandinfo.js

@@ -161,5 +161,13 @@ Page({
     this.oldInfo();
     this.visitInfo();
   },
+  onShow() {
+    console.log(wx.getStorageSync('user'), "打印");
+    if (wx.getStorageSync('user') == '') {
+      wx.switchTab({
+        url: '/pages/index/index'
+      })
+    }
+  }
 
 })