chenxiaofeng 6 anni fa
parent
commit
b19122ac4e

+ 15 - 7
app.js

@@ -37,12 +37,13 @@ App({
37 37
     } else if (wx.getStorageSync('wx_id')) {  //是否授权
38 38
       wx.reLaunch({
39 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 52
   onLaunch: function (options) {
52 53
     var _this = this;
54
+    // 查看是否授权
55
+ 
53 56
 
54 57
     wx.getLocation({
55 58
 
@@ -107,7 +110,12 @@ App({
107 110
       header: { 'Content-Type': 'application/x-www-form-urlencoded' },
108 111
       dataType: 'json',
109 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 119
         return typeof callback == "function" && callback(res.data)
112 120
       },
113 121
       fail: function (err) {

+ 2 - 1
app.json

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

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

@@ -12,28 +12,16 @@ Page({
12 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 20
   bindGetUserInfo(e) {
36 21
     var that = this;
22
+    app.showLoading();
23
+
24
+
37 25
 
38 26
     wx.login({
39 27
       success: function (res) {
@@ -71,6 +59,7 @@ Page({
71 59
               app.postRequest(p_url, p_data, function (res) {    
72 60
                 console.log(res);
73 61
                 if (res.code==201){
62
+                  app.cancelLoading();
74 63
                   if (res.data.openid && res.data.wx_id){
75 64
                           wx.navigateTo({
76 65
                             url: '/pages/Landpage/Land/Land'

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

@@ -23,12 +23,30 @@ Page({
23 23
     setTimeout(function () {
24 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 47
   Telephone: function (e) {
30 48
     var user = e.detail.value;
31
-    console.log(user);
49
+    // console.log(user);
32 50
     this.setData({
33 51
       user: user
34 52
     });
@@ -37,7 +55,7 @@ Page({
37 55
   //获取密码
38 56
   password: function (e) {
39 57
     var password = e.detail.value;
40
-    console.log(password);
58
+    // console.log(password);
41 59
     this.setData({
42 60
       password: password
43 61
     });

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

@@ -62,5 +62,12 @@ Page({
62 62
    */
63 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 71
                       <image src='/image/m_core2.png' mode="widthFix"></image>
72 72
                       <text>设置</text>
73 73
               </view>
74
-              <view class='data_list_r'>注册用户可见</view>
74
+              <view class='data_list_r'></view>
75 75
         </navigator>
76 76
 
77 77
 </view>

+ 1 - 1
project.config.json

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