|
@@ -34,7 +34,7 @@ Page(Object.assign({ |
|
@@ -34,7 +34,7 @@ Page(Object.assign({ |
34
|
}, {
|
34
|
}, {
|
35
|
page: 1,
|
35
|
page: 1,
|
36
|
products: []
|
36
|
products: []
|
37
|
- },{
|
37
|
+ }, {
|
38
|
page: 1,
|
38
|
page: 1,
|
39
|
products: []
|
39
|
products: []
|
40
|
}],
|
40
|
}],
|
|
@@ -71,12 +71,12 @@ Page(Object.assign({ |
|
@@ -71,12 +71,12 @@ Page(Object.assign({ |
71
|
openType: 'share',
|
71
|
openType: 'share',
|
72
|
image_src: '../../images/share_wechat@2x.png',
|
72
|
image_src: '../../images/share_wechat@2x.png',
|
73
|
},
|
73
|
},
|
74
|
- {
|
|
|
75
|
- name: '生成海报分享',
|
|
|
76
|
- className: 'action-class',
|
|
|
77
|
- loading: false,
|
|
|
78
|
- image_src: '../../images/share_wxpeng@2x.png'
|
|
|
79
|
- }]
|
74
|
+ {
|
|
|
75
|
+ name: '生成海报分享',
|
|
|
76
|
+ className: 'action-class',
|
|
|
77
|
+ loading: false,
|
|
|
78
|
+ image_src: '../../images/share_wxpeng@2x.png'
|
|
|
79
|
+ }]
|
80
|
},
|
80
|
},
|
81
|
},
|
81
|
},
|
82
|
|
82
|
|
|
@@ -101,12 +101,9 @@ Page(Object.assign({ |
|
@@ -101,12 +101,9 @@ Page(Object.assign({ |
101
|
this.setData({
|
101
|
this.setData({
|
102
|
tabIndex: Number(options.tabIndex)
|
102
|
tabIndex: Number(options.tabIndex)
|
103
|
})
|
103
|
})
|
104
|
- this._init(options.tabIndex);
|
|
|
105
|
- } else {
|
|
|
106
|
- this._init();
|
|
|
107
|
}
|
104
|
}
|
108
|
new app.WeToast();
|
105
|
new app.WeToast();
|
109
|
- if(options && (Number(options.reload) !== 0)) {
|
106
|
+ if (options && (Number(options.reload) !== 0)) {
|
110
|
this._getResouceCode()
|
107
|
this._getResouceCode()
|
111
|
}
|
108
|
}
|
112
|
this._getBottomBanner();
|
109
|
this._getBottomBanner();
|
|
@@ -115,6 +112,11 @@ Page(Object.assign({ |
|
@@ -115,6 +112,11 @@ Page(Object.assign({ |
115
|
|
112
|
|
116
|
onShow() {
|
113
|
onShow() {
|
117
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
114
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
|
|
115
|
+ if (this.data.tabIndex) {
|
|
|
116
|
+ this._init(this.data.tabIndex);
|
|
|
117
|
+ } else {
|
|
|
118
|
+ this._init();
|
|
|
119
|
+ }
|
118
|
|
120
|
|
119
|
this.setData({
|
121
|
this.setData({
|
120
|
hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
|
122
|
hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
|
|
@@ -144,10 +146,10 @@ Page(Object.assign({ |
|
@@ -144,10 +146,10 @@ Page(Object.assign({ |
144
|
let page = this.data.list[tabIndex].page;
|
146
|
let page = this.data.list[tabIndex].page;
|
145
|
let pageKey = `list[${tabIndex}].page`;
|
147
|
let pageKey = `list[${tabIndex}].page`;
|
146
|
let productsKey = `list[${tabIndex}].products`
|
148
|
let productsKey = `list[${tabIndex}].products`
|
147
|
-
|
149
|
+
|
148
|
this._getPage(page).then((list) => {
|
150
|
this._getPage(page).then((list) => {
|
149
|
let oldList = this.data.list[tabIndex].products;
|
151
|
let oldList = this.data.list[tabIndex].products;
|
150
|
-
|
152
|
+
|
151
|
if (list.length > 0) {
|
153
|
if (list.length > 0) {
|
152
|
this.setData({
|
154
|
this.setData({
|
153
|
[productsKey]: oldList.concat(list),
|
155
|
[productsKey]: oldList.concat(list),
|
|
@@ -213,7 +215,7 @@ Page(Object.assign({ |
|
@@ -213,7 +215,7 @@ Page(Object.assign({ |
213
|
|
215
|
|
214
|
_getUser() {
|
216
|
_getUser() {
|
215
|
const userInfo = app.getUserInfo();
|
217
|
const userInfo = app.getUserInfo();
|
216
|
-
|
218
|
+
|
217
|
if (app.isLogin() && (!userInfo || !userInfo.nickName)) {
|
219
|
if (app.isLogin() && (!userInfo || !userInfo.nickName)) {
|
218
|
return this.service.getUserProfile({uid: app.getUid()}).then(json => {
|
220
|
return this.service.getUserProfile({uid: app.getUid()}).then(json => {
|
219
|
if (json && json.code && json.code === 200) {
|
221
|
if (json && json.code && json.code === 200) {
|
|
@@ -229,28 +231,28 @@ Page(Object.assign({ |
|
@@ -229,28 +231,28 @@ Page(Object.assign({ |
229
|
|
231
|
|
230
|
_getResouceCode() {
|
232
|
_getResouceCode() {
|
231
|
this.commonService.getResourceCode('194ffd46254d6ad20e6c538bea4d89d7')
|
233
|
this.commonService.getResourceCode('194ffd46254d6ad20e6c538bea4d89d7')
|
232
|
- .then(data => {
|
|
|
233
|
- this.setData({
|
|
|
234
|
- dialogSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2),
|
|
|
235
|
- dialogUrl: data.url
|
234
|
+ .then(data => {
|
|
|
235
|
+ this.setData({
|
|
|
236
|
+ dialogSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2),
|
|
|
237
|
+ dialogUrl: data.url
|
|
|
238
|
+ })
|
|
|
239
|
+ this.dialog.showDialog();
|
236
|
})
|
240
|
})
|
237
|
- this.dialog.showDialog();
|
|
|
238
|
- })
|
|
|
239
|
- .catch(error => {
|
|
|
240
|
- })
|
|
|
241
|
-
|
241
|
+ .catch(error => {
|
|
|
242
|
+ })
|
|
|
243
|
+
|
242
|
},
|
244
|
},
|
243
|
_getBottomBanner() {
|
245
|
_getBottomBanner() {
|
244
|
this.commonService.getResourceCode('5a2203f5656fbc9788bd8af70f2823d3')
|
246
|
this.commonService.getResourceCode('5a2203f5656fbc9788bd8af70f2823d3')
|
245
|
- .then(data => {
|
|
|
246
|
- // console.log(data)
|
|
|
247
|
- this.setData({
|
|
|
248
|
- bannerSrc: formatImageUrl(data.src, 750, 234, 2),
|
|
|
249
|
- bannerUrl: data.url
|
247
|
+ .then(data => {
|
|
|
248
|
+ // console.log(data)
|
|
|
249
|
+ this.setData({
|
|
|
250
|
+ bannerSrc: formatImageUrl(data.src, 750, 234, 2),
|
|
|
251
|
+ bannerUrl: data.url
|
|
|
252
|
+ })
|
|
|
253
|
+ })
|
|
|
254
|
+ .catch(error => {
|
250
|
})
|
255
|
})
|
251
|
- })
|
|
|
252
|
- .catch(error => {
|
|
|
253
|
- })
|
|
|
254
|
},
|
256
|
},
|
255
|
|
257
|
|
256
|
_getProceedingData() {
|
258
|
_getProceedingData() {
|
|
@@ -273,7 +275,7 @@ Page(Object.assign({ |
|
@@ -273,7 +275,7 @@ Page(Object.assign({ |
273
|
},
|
275
|
},
|
274
|
|
276
|
|
275
|
_getReleaseData(my_page) {
|
277
|
_getReleaseData(my_page) {
|
276
|
- if (!this.data.isLogin) {
|
278
|
+ if (!this.data.isLogin) {
|
277
|
return;
|
279
|
return;
|
278
|
}
|
280
|
}
|
279
|
let type = 1;
|
281
|
let type = 1;
|
|
@@ -309,7 +311,7 @@ Page(Object.assign({ |
|
@@ -309,7 +311,7 @@ Page(Object.assign({ |
309
|
let oldData = my_zero_list[type].data;
|
311
|
let oldData = my_zero_list[type].data;
|
310
|
let key = `my_zero_list[${type}].data`;
|
312
|
let key = `my_zero_list[${type}].data`;
|
311
|
let keyPage = `my_zero_list[${type}].page`;
|
313
|
let keyPage = `my_zero_list[${type}].page`;
|
312
|
- this.service.getMyList({ type, page }).then(res => {
|
314
|
+ this.service.getMyList({type, page}).then(res => {
|
313
|
let data = []
|
315
|
let data = []
|
314
|
if (res && res.code === 200) {
|
316
|
if (res && res.code === 200) {
|
315
|
data = res.data;
|
317
|
data = res.data;
|
|
@@ -331,7 +333,7 @@ Page(Object.assign({ |
|
@@ -331,7 +333,7 @@ Page(Object.assign({ |
331
|
return;
|
333
|
return;
|
332
|
}
|
334
|
}
|
333
|
jumpByUrl(this.data.bannerUrl);
|
335
|
jumpByUrl(this.data.bannerUrl);
|
334
|
-
|
336
|
+
|
335
|
},
|
337
|
},
|
336
|
|
338
|
|
337
|
onTabChange({detail}) {
|
339
|
onTabChange({detail}) {
|
|
@@ -347,10 +349,10 @@ Page(Object.assign({ |
|
@@ -347,10 +349,10 @@ Page(Object.assign({ |
347
|
this._init();
|
349
|
this._init();
|
348
|
},
|
350
|
},
|
349
|
|
351
|
|
350
|
- getUserInfo: function(e) {
|
352
|
+ getUserInfo: function (e) {
|
351
|
var that = this;
|
353
|
var that = this;
|
352
|
if (e.detail.errMsg === 'getUserInfo:ok') {
|
354
|
if (e.detail.errMsg === 'getUserInfo:ok') {
|
353
|
- decodeUnionId(app.getWechatThirdSession(), e, function(response) {
|
355
|
+ decodeUnionId(app.getWechatThirdSession(), e, function (response) {
|
354
|
if (response.isHaveUnionID) {
|
356
|
if (response.isHaveUnionID) {
|
355
|
that.setData({
|
357
|
that.setData({
|
356
|
hasUnionID: true,
|
358
|
hasUnionID: true,
|
|
@@ -358,27 +360,28 @@ Page(Object.assign({ |
|
@@ -358,27 +360,28 @@ Page(Object.assign({ |
358
|
}
|
360
|
}
|
359
|
});
|
361
|
});
|
360
|
} else {
|
362
|
} else {
|
361
|
- openAuthorizeSettings(function(response) {
|
363
|
+ openAuthorizeSettings(function (response) {
|
362
|
if (response.isHaveUnionID) {
|
364
|
if (response.isHaveUnionID) {
|
363
|
that.setData({
|
365
|
that.setData({
|
364
|
hasUnionID: true,
|
366
|
hasUnionID: true,
|
365
|
})
|
367
|
})
|
366
|
- };
|
368
|
+ }
|
|
|
369
|
+ ;
|
367
|
});
|
370
|
});
|
368
|
}
|
371
|
}
|
369
|
},
|
372
|
},
|
370
|
|
373
|
|
371
|
- getPhoneNumber: function(e) {
|
374
|
+ getPhoneNumber: function (e) {
|
372
|
var that = this;
|
375
|
var that = this;
|
373
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
376
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
374
|
- decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function(result) {
|
377
|
+ decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) {
|
375
|
// console.log('!!!!result',result)
|
378
|
// console.log('!!!!result',result)
|
376
|
if (result.code != 200) {
|
379
|
if (result.code != 200) {
|
377
|
that.wetoast.toast({
|
380
|
that.wetoast.toast({
|
378
|
title: result.message,
|
381
|
title: result.message,
|
379
|
titleClassName: 'wetoast-title',
|
382
|
titleClassName: 'wetoast-title',
|
380
|
duration: 1000,
|
383
|
duration: 1000,
|
381
|
- success: function() {
|
384
|
+ success: function () {
|
382
|
that.loginAndRegisterTapped()
|
385
|
that.loginAndRegisterTapped()
|
383
|
}.bind(that)
|
386
|
}.bind(that)
|
384
|
});
|
387
|
});
|
|
@@ -386,7 +389,7 @@ Page(Object.assign({ |
|
@@ -386,7 +389,7 @@ Page(Object.assign({ |
386
|
if (result.is_register) {
|
389
|
if (result.is_register) {
|
387
|
that.showZanToast({
|
390
|
that.showZanToast({
|
388
|
title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收',
|
391
|
title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收',
|
389
|
- success: function() {
|
392
|
+ success: function () {
|
390
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
393
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
391
|
that.setData({
|
394
|
that.setData({
|
392
|
uid,
|
395
|
uid,
|
|
@@ -427,13 +430,13 @@ Page(Object.assign({ |
|
@@ -427,13 +430,13 @@ Page(Object.assign({ |
427
|
content: '检测到您未打开微信用户信息授权,开启后即可进行登录',
|
430
|
content: '检测到您未打开微信用户信息授权,开启后即可进行登录',
|
428
|
confirmText: "去开启",
|
431
|
confirmText: "去开启",
|
429
|
confirmColor: "#000000",
|
432
|
confirmColor: "#000000",
|
430
|
- success: function(res) {
|
433
|
+ success: function (res) {
|
431
|
if (res.confirm) {
|
434
|
if (res.confirm) {
|
432
|
wx.openSetting({
|
435
|
wx.openSetting({
|
433
|
success: (res) => {
|
436
|
success: (res) => {
|
434
|
// console.log(res.authSetting["scope.userInfo"])
|
437
|
// console.log(res.authSetting["scope.userInfo"])
|
435
|
if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) {
|
438
|
if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) {
|
436
|
- getUnionID(app.getWechatThirdSession(), function(response) {
|
439
|
+ getUnionID(app.getWechatThirdSession(), function (response) {
|
437
|
// console.log(response)
|
440
|
// console.log(response)
|
438
|
})
|
441
|
})
|
439
|
}
|
442
|
}
|
|
@@ -450,7 +453,7 @@ Page(Object.assign({ |
|
@@ -450,7 +453,7 @@ Page(Object.assign({ |
450
|
wx.navigateTo({
|
453
|
wx.navigateTo({
|
451
|
url: '/pages/bindPhoneNumber/bindPhoneNumber'
|
454
|
url: '/pages/bindPhoneNumber/bindPhoneNumber'
|
452
|
});
|
455
|
});
|
453
|
- }
|
456
|
+ }
|
454
|
}
|
457
|
}
|
455
|
})
|
458
|
})
|
456
|
} else {
|
459
|
} else {
|
|
@@ -465,18 +468,18 @@ Page(Object.assign({ |
|
@@ -465,18 +468,18 @@ Page(Object.assign({ |
465
|
let union_id = wx.getStorageSync('union_id');
|
468
|
let union_id = wx.getStorageSync('union_id');
|
466
|
let res = await getSettingPromise();
|
469
|
let res = await getSettingPromise();
|
467
|
|
470
|
|
468
|
- if (res.authSetting["scope.userInfo"] !== null &&
|
|
|
469
|
- res.authSetting["scope.userInfo"] !== undefined &&
|
|
|
470
|
- res.authSetting["scope.userInfo"] === true) {
|
|
|
471
|
- if (union_id) {
|
|
|
472
|
- this.setData({
|
|
|
473
|
- openType: 'none-open-type',
|
|
|
474
|
- })
|
|
|
475
|
- } else {
|
|
|
476
|
- this.setData({
|
|
|
477
|
- openType: 'getUserInfo'
|
|
|
478
|
- })
|
|
|
479
|
- }
|
471
|
+ if (res.authSetting["scope.userInfo"] !== null &&
|
|
|
472
|
+ res.authSetting["scope.userInfo"] !== undefined &&
|
|
|
473
|
+ res.authSetting["scope.userInfo"] === true) {
|
|
|
474
|
+ if (union_id) {
|
|
|
475
|
+ this.setData({
|
|
|
476
|
+ openType: 'none-open-type',
|
|
|
477
|
+ })
|
|
|
478
|
+ } else {
|
|
|
479
|
+ this.setData({
|
|
|
480
|
+ openType: 'getUserInfo'
|
|
|
481
|
+ })
|
|
|
482
|
+ }
|
480
|
} else {
|
483
|
} else {
|
481
|
this.setData({
|
484
|
this.setData({
|
482
|
openType: 'getUserInfo'
|
485
|
openType: 'getUserInfo'
|
|
@@ -485,7 +488,7 @@ Page(Object.assign({ |
|
@@ -485,7 +488,7 @@ Page(Object.assign({ |
485
|
},
|
488
|
},
|
486
|
|
489
|
|
487
|
loginChangeStatus(params) {
|
490
|
loginChangeStatus(params) {
|
488
|
- let { openType } = params;
|
491
|
+ let {openType} = params;
|
489
|
this.setData({
|
492
|
this.setData({
|
490
|
openType
|
493
|
openType
|
491
|
})
|
494
|
})
|
|
@@ -513,20 +516,20 @@ Page(Object.assign({ |
|
@@ -513,20 +516,20 @@ Page(Object.assign({ |
513
|
});
|
516
|
});
|
514
|
},
|
517
|
},
|
515
|
|
518
|
|
516
|
- share({ detail }) {
|
519
|
+ share({detail}) {
|
517
|
this.setData({
|
520
|
this.setData({
|
518
|
'actionsheet.show': true,
|
521
|
'actionsheet.show': true,
|
519
|
'shareProduct': detail
|
522
|
'shareProduct': detail
|
520
|
})
|
523
|
})
|
521
|
},
|
524
|
},
|
522
|
|
525
|
|
523
|
- handleZanActionsheetCancel({ componentId }) {
|
526
|
+ handleZanActionsheetCancel({componentId}) {
|
524
|
this.setData({
|
527
|
this.setData({
|
525
|
'actionsheet.show': false
|
528
|
'actionsheet.show': false
|
526
|
})
|
529
|
})
|
527
|
},
|
530
|
},
|
528
|
|
531
|
|
529
|
- handleZanActionsheetClick({ componentId, index }) {
|
532
|
+ handleZanActionsheetClick({componentId, index}) {
|
530
|
this.setData({
|
533
|
this.setData({
|
531
|
'actionsheet.show': false
|
534
|
'actionsheet.show': false
|
532
|
});
|
535
|
});
|
|
@@ -545,7 +548,8 @@ Page(Object.assign({ |
|
@@ -545,7 +548,8 @@ Page(Object.assign({ |
545
|
product_qrCode: qrcode
|
548
|
product_qrCode: qrcode
|
546
|
});
|
549
|
});
|
547
|
}
|
550
|
}
|
548
|
- };
|
551
|
+ }
|
|
|
552
|
+ ;
|
549
|
},
|
553
|
},
|
550
|
onShareAppMessage(res) {
|
554
|
onShareAppMessage(res) {
|
551
|
let params = {
|
555
|
let params = {
|