|
@@ -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
|
})
|