chenxiaofeng 6 years ago
parent
commit
b19122ac4e

+ 15 - 7
app.js

@@ -37,12 +37,13 @@ App({
37
     } else if (wx.getStorageSync('wx_id')) {  //是否授权
37
     } else if (wx.getStorageSync('wx_id')) {  //是否授权
38
       wx.reLaunch({
38
       wx.reLaunch({
39
         url: '/pages/Landpage/Land/Land'    //授权过 进入登陆页
39
         url: '/pages/Landpage/Land/Land'    //授权过 进入登陆页
40
-      })
41
-    } else {
42
-      wx.reLaunch({
43
-        url: '/pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction'   //未授权  进入授权页
44
-      })
45
-    }
40
+      })  
41
+    } 
42
+    // else {
43
+    //   wx.reLaunch({
44
+    //     url: '/pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction'   //未授权  进入授权页
45
+    //   })
46
+    // }
46
 
47
 
47
 
48
 
48
   },
49
   },
@@ -50,6 +51,8 @@ App({
50
   
51
   
51
   onLaunch: function (options) {
52
   onLaunch: function (options) {
52
     var _this = this;
53
     var _this = this;
54
+    // 查看是否授权
55
+ 
53
 
56
 
54
     wx.getLocation({
57
     wx.getLocation({
55
 
58
 
@@ -107,7 +110,12 @@ App({
107
       header: { 'Content-Type': 'application/x-www-form-urlencoded' },
110
       header: { 'Content-Type': 'application/x-www-form-urlencoded' },
108
       dataType: 'json',
111
       dataType: 'json',
109
       success: function (res) {
112
       success: function (res) {
110
-
113
+          if(res.data.code == "401"){
114
+            wx.clearStorageSync();
115
+            wx.navigateTo({
116
+              url: '/pages/Landpage/Land/Land'
117
+            });
118
+          }
111
         return typeof callback == "function" && callback(res.data)
119
         return typeof callback == "function" && callback(res.data)
112
       },
120
       },
113
       fail: function (err) {
121
       fail: function (err) {

+ 2 - 1
app.json

@@ -1,5 +1,6 @@
1
 {
1
 {
2
   "pages": [
2
   "pages": [
3
+        "pages/Landpage/Land/Land",
3
   "pages/zheo_More/zheo_More",
4
   "pages/zheo_More/zheo_More",
4
   "pages/details_More/details_More",
5
   "pages/details_More/details_More",
5
    "pages/personal_core/personaldata/personaldata",
6
    "pages/personal_core/personaldata/personaldata",
@@ -22,7 +23,7 @@
22
     "pages/index_details/index_details",
23
     "pages/index_details/index_details",
23
     "pages/index/index",
24
     "pages/index/index",
24
     "pages/index_screen/index_screen",
25
     "pages/index_screen/index_screen",
25
-    "pages/Landpage/Land/Land",
26
+
26
     "pages/Landpage/Retrievepassword/Retrievepassword",
27
     "pages/Landpage/Retrievepassword/Retrievepassword",
27
     "pages/register/fillTel/fillTel",
28
     "pages/register/fillTel/fillTel",
28
     "pages/register/OwnData/OwnData",
29
     "pages/register/OwnData/OwnData",

+ 5 - 16
pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction.js

@@ -12,28 +12,16 @@ Page({
12
       wx.hideLoading()
12
       wx.hideLoading()
13
     })
13
     })
14
 
14
 
15
-    // 查看是否授权
16
-    wx.getSetting({
17
-         success(res) {
18
-                  if (res.authSetting['scope.userInfo']) {
19
-
20
-                    console.log('已经授权');
21
-              
22
-
23
-                  }else{
24
-
25
-                    console.log('没有授权');
26
-                    
27
-                  }
28
-          }
29
-    })
30
-
15
+   
31
   },
16
   },
32
 
17
 
33
 
18
 
34
 
19
 
35
   bindGetUserInfo(e) {
20
   bindGetUserInfo(e) {
36
     var that = this;
21
     var that = this;
22
+    app.showLoading();
23
+
24
+
37
 
25
 
38
     wx.login({
26
     wx.login({
39
       success: function (res) {
27
       success: function (res) {
@@ -71,6 +59,7 @@ Page({
71
               app.postRequest(p_url, p_data, function (res) {    
59
               app.postRequest(p_url, p_data, function (res) {    
72
                 console.log(res);
60
                 console.log(res);
73
                 if (res.code==201){
61
                 if (res.code==201){
62
+                  app.cancelLoading();
74
                   if (res.data.openid && res.data.wx_id){
63
                   if (res.data.openid && res.data.wx_id){
75
                           wx.navigateTo({
64
                           wx.navigateTo({
76
                             url: '/pages/Landpage/Land/Land'
65
                             url: '/pages/Landpage/Land/Land'

+ 20 - 2
pages/Landpage/Land/Land.js

@@ -23,12 +23,30 @@ Page({
23
     setTimeout(function () {
23
     setTimeout(function () {
24
       wx.hideLoading()
24
       wx.hideLoading()
25
     })
25
     })
26
+
27
+    wx.getSetting({
28
+      success(res) {
29
+        if (res.authSetting['scope.userInfo']) {
30
+
31
+          // wx.reLaunch({
32
+          //   url: '/pages/Landpage/Land/Land'
33
+          // });
34
+          console.log('已经授权');
35
+
36
+        } else {
37
+      wx.reLaunch({
38
+        url: '/pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction'   //未授权  进入授权页
39
+      })
40
+          console.log('没有授权');
41
+        }
42
+      }
43
+    })
26
   },
44
   },
27
 
45
 
28
   //获取账号
46
   //获取账号
29
   Telephone: function (e) {
47
   Telephone: function (e) {
30
     var user = e.detail.value;
48
     var user = e.detail.value;
31
-    console.log(user);
49
+    // console.log(user);
32
     this.setData({
50
     this.setData({
33
       user: user
51
       user: user
34
     });
52
     });
@@ -37,7 +55,7 @@ Page({
37
   //获取密码
55
   //获取密码
38
   password: function (e) {
56
   password: function (e) {
39
     var password = e.detail.value;
57
     var password = e.detail.value;
40
-    console.log(password);
58
+    // console.log(password);
41
     this.setData({
59
     this.setData({
42
       password: password
60
       password: password
43
     });
61
     });

+ 7 - 0
pages/Setup/Setuplist/Setuplist.js

@@ -62,5 +62,12 @@ Page({
62
    */
62
    */
63
   onShareAppMessage: function () {
63
   onShareAppMessage: function () {
64
 
64
 
65
+  },
66
+  register:function(){
67
+    wx.clearStorageSync();
68
+    wx.navigateTo({
69
+      url: '/pages/Landpage/Land/Land'
70
+    });
71
+    console.log(111);
65
   }
72
   }
66
 })
73
 })

+ 1 - 1
pages/personal_core/home/home.wxml

@@ -71,7 +71,7 @@
71
                       <image src='/image/m_core2.png' mode="widthFix"></image>
71
                       <image src='/image/m_core2.png' mode="widthFix"></image>
72
                       <text>设置</text>
72
                       <text>设置</text>
73
               </view>
73
               </view>
74
-              <view class='data_list_r'>注册用户可见</view>
74
+              <view class='data_list_r'></view>
75
         </navigator>
75
         </navigator>
76
 
76
 
77
 </view>
77
 </view>

+ 1 - 1
project.config.json

@@ -13,7 +13,7 @@
13
 	"compileType": "miniprogram",
13
 	"compileType": "miniprogram",
14
 	"libVersion": "2.4.0",
14
 	"libVersion": "2.4.0",
15
 	"appid": "wx7b6ec4ec4b18da6a",
15
 	"appid": "wx7b6ec4ec4b18da6a",
16
-	"projectname": "ypsq",
16
+	"projectname": "yhb",
17
 	"debugOptions": {
17
 	"debugOptions": {
18
 		"hidedInDevtools": []
18
 		"hidedInDevtools": []
19
 	},
19
 	},