yunlingyin 7 years ago
parent
commit
c188eec9e3
4 changed files with 30 additions and 12 deletions
  1. 1 1
      pages/feedback/feedback.js
  2. 21 9
      pages/mine/mine.js
  3. 1 1
      pages/mine/mine.wxml
  4. 7 1
      project.config.json

+ 1 - 1
pages/feedback/feedback.js

@@ -18,7 +18,7 @@ Page({
18 18
     })
19 19
   },
20 20
   bindFormSubmit: function (e) {
21
-    var that = this, token = wx.getStorageSync('token'), value = e.detail.value.textarea;
21
+    var that = this, token = wx.getStorageSync('user').token, value = e.detail.value.textarea;
22 22
     console.log(token)
23 23
     wx.request({
24 24
       url: app.globalData.HOST + '/user/wx/addMessage',

+ 21 - 9
pages/mine/mine.js

@@ -9,32 +9,32 @@ Page({
9 9
   onLoad: function () {
10 10
     this.initInfo();
11 11
   },
12
-  initInfo () {
12
+  initInfo() {
13 13
     var token = wx.getStorageSync('user').token, data = {}, that = this;
14 14
     console.log(token);
15 15
     if (token) {
16 16
       that.getInfo(token)
17
-    }else{
17
+    } else {
18 18
       app.login(that.getInfo);
19 19
     }
20 20
   },
21
-  getInfo (token) {
21
+  getInfo(token) {
22 22
     var that = this, token = token || wx.getStorageSync('user').token, data = null;
23 23
     console.log(token);
24 24
     wx.request({
25 25
       url: app.globalData.HOST + '/user/wx/personalCenter',
26 26
       method: 'POST',
27
-      data: {token: token},
27
+      data: { token: token },
28 28
       success: function (res) {
29
-        if (res.data.errno == '0'){
29
+        if (res.data.errno == '0') {
30 30
           data = res.data.rst
31
-          that.setData({userInfo: data})
32
-        }else if(res.data.errno == '90001'){
31
+          that.setData({ userInfo: data })
32
+        } else if (res.data.errno == '90001') {
33 33
         }
34 34
       }
35 35
     });
36 36
   },
37
-  goApplication () {
37
+  goApplication() {
38 38
     var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0';
39 39
     console.log(user_id);
40 40
     console.log(tel);
@@ -42,7 +42,19 @@ Page({
42 42
       wx.navigateTo({
43 43
         url: "/pages/application/application"
44 44
       })
45
-    }else{
45
+    } else {
46
+      wx.navigateTo({
47
+        url: "/pages/getPhone/getPhone?from=mine"
48
+      })
49
+    }
50
+  },
51
+  click: function (e) {
52
+    var tel = wx.getStorageSync('tel') || '0', user_id = wx.getStorageSync('user').user_id || '0';
53
+    if (tel != '0' || user_id != '0') {
54
+      wx.navigateTo({
55
+        url: "/pages/getPhone/getPhone?from=mine"
56
+      })
57
+    } else {
46 58
       wx.navigateTo({
47 59
         url: "/pages/getPhone/getPhone?from=mine"
48 60
       })

+ 1 - 1
pages/mine/mine.wxml

@@ -25,7 +25,7 @@
25 25
       </navigator>
26 26
     </view>
27 27
     <view class='my_applisation border_top_hr'>
28
-      <navigator url="/pages/feedback/feedback" hover-class="navigator-hover">
28
+      <navigator  hover-class="navigator-hover"  bindtap='click'>
29 29
         <icon class='icon my_list_03'></icon>
30 30
         <view class='my_list_text'>意见反馈</view>
31 31
       </navigator>

+ 7 - 1
project.config.json

@@ -24,7 +24,7 @@
24 24
 			"list": []
25 25
 		},
26 26
 		"miniprogram": {
27
-			"current": 9,
27
+			"current": 4,
28 28
 			"list": [
29 29
 				{
30 30
 					"id": -1,
@@ -115,6 +115,12 @@
115 115
 					"name": "register_phon",
116 116
 					"pathName": "pages/register_phon/register_phon",
117 117
 					"query": ""
118
+				},
119
+				{
120
+					"id": -1,
121
+					"name": "feedback",
122
+					"pathName": "pages/feedback/feedback",
123
+					"query": ""
118 124
 				}
119 125
 			]
120 126
 		}