|
|
@@ -8,22 +8,37 @@ Page({
|
|
8
|
8
|
},
|
|
9
|
9
|
onLoad: function (options) {
|
|
10
|
10
|
var that = this;
|
|
|
11
|
+
|
|
11
|
12
|
if (options && options.type && options.type == "bebound") {
|
|
|
13
|
+ var bBind = 0;
|
|
|
14
|
+ //console.log("userSource3:" + app.globalData.userSource);
|
|
12
|
15
|
|
|
13
|
|
- if (app.globalData.userSource == "1044" || app.globalData.userSource == "1008"){
|
|
14
|
|
- wx.showModal({
|
|
15
|
|
- title: '抱歉',
|
|
16
|
|
- content: '绑定功能只能用于朋友单聊',
|
|
17
|
|
- showCancel: false,
|
|
18
|
|
- confirmText: "知道了",
|
|
19
|
|
- success: function () {
|
|
20
|
|
- wx.reLaunch({
|
|
21
|
|
- url: '../index/index',
|
|
22
|
|
- })
|
|
|
16
|
+
|
|
|
17
|
+ var arrUserSource = [1007, 1037, 1089, 1006, 1001, 1005, 1048, 1012, 1024, 1042, 1011, 1106, 1035, 1047, 1020, 1013, 1053];
|
|
|
18
|
+ for (var i = 0; i < arrUserSource.length; i++) {
|
|
|
19
|
+ if (app.globalData.userSource == arrUserSource[i]) {
|
|
|
20
|
+ bBind = 1;
|
|
|
21
|
+ break;
|
|
|
22
|
+ }
|
|
|
23
|
+ }
|
|
|
24
|
+ if (options && options.BindTime) {
|
|
|
25
|
+ var time = new Date(options.BindTime);
|
|
|
26
|
+ var timeNow = new Date();
|
|
|
27
|
+ var sub = common.diffDate("s", time, timeNow);
|
|
|
28
|
+
|
|
|
29
|
+ if (app.globalData.userSource==1006) {
|
|
|
30
|
+ if (sub > 86400) {
|
|
|
31
|
+ bBind = -1;
|
|
23
|
32
|
}
|
|
24
|
|
- });
|
|
|
33
|
+ }
|
|
|
34
|
+ else{
|
|
|
35
|
+ if (sub > 180) {
|
|
|
36
|
+ bBind = -1;
|
|
|
37
|
+ }
|
|
|
38
|
+ }
|
|
25
|
39
|
}
|
|
26
|
|
- else{
|
|
|
40
|
+
|
|
|
41
|
+ if (bBind == 1) {
|
|
27
|
42
|
that.setData({
|
|
28
|
43
|
ShowPanel: "bebound",
|
|
29
|
44
|
ParentUserID: options.ParentUserID,
|
|
|
@@ -31,16 +46,44 @@ Page({
|
|
31
|
46
|
});
|
|
32
|
47
|
that.download(options.AvatarUrl);
|
|
33
|
48
|
}
|
|
|
49
|
+ else {
|
|
|
50
|
+ if (bBind == -1) {
|
|
|
51
|
+ wx.showModal({
|
|
|
52
|
+ title: '请求时间过期',
|
|
|
53
|
+ content: '请联系邀请人,再次私聊发给您。',
|
|
|
54
|
+ showCancel: false,
|
|
|
55
|
+ confirmText: "知道了",
|
|
|
56
|
+ success: function () {
|
|
|
57
|
+ wx.reLaunch({
|
|
|
58
|
+ url: '../index/index',
|
|
|
59
|
+ });
|
|
|
60
|
+ }
|
|
|
61
|
+ });
|
|
|
62
|
+ }
|
|
|
63
|
+ else {
|
|
|
64
|
+ wx.showModal({
|
|
|
65
|
+ title: '无效邀请',
|
|
|
66
|
+ content: '发群无效。请联系邀请人,单独私聊发给您。',
|
|
|
67
|
+ showCancel: false,
|
|
|
68
|
+ confirmText: "知道了",
|
|
|
69
|
+ success: function () {
|
|
|
70
|
+ wx.reLaunch({
|
|
|
71
|
+ url: '../index/index',
|
|
|
72
|
+ });
|
|
|
73
|
+ }
|
|
|
74
|
+ });
|
|
|
75
|
+ }
|
|
|
76
|
+ }
|
|
34
|
77
|
}
|
|
35
|
78
|
else {
|
|
36
|
79
|
main.getData("GetUserBindingList?UserID=" + app.globalData.userInfo.UserID, function (data) {
|
|
37
|
|
- if (data && data.length>0){
|
|
|
80
|
+ if (data && data.length > 0) {
|
|
38
|
81
|
that.setData({
|
|
39
|
|
- List:data,
|
|
|
82
|
+ List: data,
|
|
40
|
83
|
ShowPanel: "unbinding",
|
|
41
|
84
|
});
|
|
42
|
85
|
}
|
|
43
|
|
- else{
|
|
|
86
|
+ else {
|
|
44
|
87
|
that.setData({
|
|
45
|
88
|
ShowPanel: "binding",
|
|
46
|
89
|
});
|
|
|
@@ -52,10 +95,10 @@ Page({
|
|
52
|
95
|
Containnerheight: main.getWindowHeight(),
|
|
53
|
96
|
});
|
|
54
|
97
|
},
|
|
55
|
|
- download: function (avatarUrl){
|
|
56
|
|
- var that=this;
|
|
|
98
|
+ download: function (avatarUrl) {
|
|
|
99
|
+ var that = this;
|
|
57
|
100
|
wx.downloadFile({
|
|
58
|
|
- url: avatarUrl,
|
|
|
101
|
+ url: avatarUrl,
|
|
59
|
102
|
success(res) {
|
|
60
|
103
|
if (res.statusCode === 200) {
|
|
61
|
104
|
that.setData({
|
|
|
@@ -65,9 +108,9 @@ Page({
|
|
65
|
108
|
}
|
|
66
|
109
|
});
|
|
67
|
110
|
},
|
|
68
|
|
- onShow: function () {
|
|
|
111
|
+ onShow: function (options) {
|
|
69
|
112
|
var that = this;
|
|
70
|
|
- if (app.globalData.userInfo.IsShow==1){
|
|
|
113
|
+ if (app.globalData.userInfo.IsShow == 1) {
|
|
71
|
114
|
wx.getSetting({
|
|
72
|
115
|
success(res) {
|
|
73
|
116
|
if (res.authSetting['scope.userInfo']) {
|
|
|
@@ -83,14 +126,14 @@ Page({
|
|
83
|
126
|
}
|
|
84
|
127
|
},
|
|
85
|
128
|
shareFinished: function () {
|
|
86
|
|
- setTimeout(function(){
|
|
|
129
|
+ setTimeout(function () {
|
|
87
|
130
|
wx.showModal({
|
|
88
|
131
|
title: '等待对方接受邀请',
|
|
89
|
132
|
content: '请尽快与对方联系确认邀请',
|
|
90
|
133
|
showCancel: false,
|
|
91
|
134
|
confirmText: "知道了",
|
|
92
|
135
|
});
|
|
93
|
|
- },3000);
|
|
|
136
|
+ }, 3000);
|
|
94
|
137
|
},
|
|
95
|
138
|
gotoBinding: function () {
|
|
96
|
139
|
var that = this;
|
|
|
@@ -110,14 +153,15 @@ Page({
|
|
110
|
153
|
},
|
|
111
|
154
|
onShareAppMessage: function () {
|
|
112
|
155
|
if (this.data.ShowPanel == "binding") {
|
|
113
|
|
- var path = '/pages/index/index?type=bebound&ParentUserID=' + app.globalData.userInfo.UserID;
|
|
|
156
|
+ var time = common.formatTime(new Date());
|
|
|
157
|
+ var path = '/pages/index/index?type=bebound&ParentUserID=' + app.globalData.userInfo.UserID + '&BindTime=' + time;
|
|
114
|
158
|
path += "&NickName=" + app.globalData.userInfo.NickName;
|
|
115
|
159
|
path += "&AvatarUrl=" + app.globalData.userInfo.AvatarUrl;
|
|
116
|
|
- var time = common.formatTime(new Date());
|
|
|
160
|
+ //console.log(path);
|
|
117
|
161
|
return {
|
|
118
|
|
- title: "帐号绑定 "+time,
|
|
|
162
|
+ title: "帐号绑定 " + time,
|
|
119
|
163
|
path: path,
|
|
120
|
|
- imageUrl: app.globalData.uploadImageUrl +"web/program_screenshot_bindaccount.png",
|
|
|
164
|
+ imageUrl: app.globalData.uploadImageUrl + "web/program_screenshot_bindaccount.png",
|
|
121
|
165
|
}
|
|
122
|
166
|
}
|
|
123
|
167
|
},
|