...
|
...
|
@@ -34,7 +34,7 @@ Page(Object.assign({ |
|
|
}, {
|
|
|
page: 1,
|
|
|
products: []
|
|
|
},{
|
|
|
}, {
|
|
|
page: 1,
|
|
|
products: []
|
|
|
}],
|
...
|
...
|
@@ -101,12 +101,9 @@ Page(Object.assign({ |
|
|
this.setData({
|
|
|
tabIndex: Number(options.tabIndex)
|
|
|
})
|
|
|
this._init(options.tabIndex);
|
|
|
} else {
|
|
|
this._init();
|
|
|
}
|
|
|
new app.WeToast();
|
|
|
if(options && (Number(options.reload) !== 0)) {
|
|
|
if (options && (Number(options.reload) !== 0)) {
|
|
|
this._getResouceCode()
|
|
|
}
|
|
|
this._getBottomBanner();
|
...
|
...
|
@@ -115,6 +112,11 @@ Page(Object.assign({ |
|
|
|
|
|
onShow() {
|
|
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
|
|
if (this.data.tabIndex) {
|
|
|
this._init(this.data.tabIndex);
|
|
|
} else {
|
|
|
this._init();
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
|
...
|
...
|
@@ -309,7 +311,7 @@ Page(Object.assign({ |
|
|
let oldData = my_zero_list[type].data;
|
|
|
let key = `my_zero_list[${type}].data`;
|
|
|
let keyPage = `my_zero_list[${type}].page`;
|
|
|
this.service.getMyList({ type, page }).then(res => {
|
|
|
this.service.getMyList({type, page}).then(res => {
|
|
|
let data = []
|
|
|
if (res && res.code === 200) {
|
|
|
data = res.data;
|
...
|
...
|
@@ -347,10 +349,10 @@ Page(Object.assign({ |
|
|
this._init();
|
|
|
},
|
|
|
|
|
|
getUserInfo: function(e) {
|
|
|
getUserInfo: function (e) {
|
|
|
var that = this;
|
|
|
if (e.detail.errMsg === 'getUserInfo:ok') {
|
|
|
decodeUnionId(app.getWechatThirdSession(), e, function(response) {
|
|
|
decodeUnionId(app.getWechatThirdSession(), e, function (response) {
|
|
|
if (response.isHaveUnionID) {
|
|
|
that.setData({
|
|
|
hasUnionID: true,
|
...
|
...
|
@@ -358,27 +360,28 @@ Page(Object.assign({ |
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
openAuthorizeSettings(function(response) {
|
|
|
openAuthorizeSettings(function (response) {
|
|
|
if (response.isHaveUnionID) {
|
|
|
that.setData({
|
|
|
hasUnionID: true,
|
|
|
})
|
|
|
};
|
|
|
}
|
|
|
;
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
getPhoneNumber: function(e) {
|
|
|
getPhoneNumber: function (e) {
|
|
|
var that = this;
|
|
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
|
|
decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function(result) {
|
|
|
decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) {
|
|
|
// console.log('!!!!result',result)
|
|
|
if (result.code != 200) {
|
|
|
that.wetoast.toast({
|
|
|
title: result.message,
|
|
|
titleClassName: 'wetoast-title',
|
|
|
duration: 1000,
|
|
|
success: function() {
|
|
|
success: function () {
|
|
|
that.loginAndRegisterTapped()
|
|
|
}.bind(that)
|
|
|
});
|
...
|
...
|
@@ -386,7 +389,7 @@ Page(Object.assign({ |
|
|
if (result.is_register) {
|
|
|
that.showZanToast({
|
|
|
title: '欢迎加入Yoho!Family!新人礼包已发放到个人中心-优惠券,请注意查收',
|
|
|
success: function() {
|
|
|
success: function () {
|
|
|
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
|
|
|
that.setData({
|
|
|
uid,
|
...
|
...
|
@@ -427,13 +430,13 @@ Page(Object.assign({ |
|
|
content: '检测到您未打开微信用户信息授权,开启后即可进行登录',
|
|
|
confirmText: "去开启",
|
|
|
confirmColor: "#000000",
|
|
|
success: function(res) {
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
|
wx.openSetting({
|
|
|
success: (res) => {
|
|
|
// console.log(res.authSetting["scope.userInfo"])
|
|
|
if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) {
|
|
|
getUnionID(app.getWechatThirdSession(), function(response) {
|
|
|
getUnionID(app.getWechatThirdSession(), function (response) {
|
|
|
// console.log(response)
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -485,7 +488,7 @@ Page(Object.assign({ |
|
|
},
|
|
|
|
|
|
loginChangeStatus(params) {
|
|
|
let { openType } = params;
|
|
|
let {openType} = params;
|
|
|
this.setData({
|
|
|
openType
|
|
|
})
|
...
|
...
|
@@ -513,20 +516,20 @@ Page(Object.assign({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
share({ detail }) {
|
|
|
share({detail}) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': true,
|
|
|
'shareProduct': detail
|
|
|
})
|
|
|
},
|
|
|
|
|
|
handleZanActionsheetCancel({ componentId }) {
|
|
|
handleZanActionsheetCancel({componentId}) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
handleZanActionsheetClick({ componentId, index }) {
|
|
|
handleZanActionsheetClick({componentId, index}) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': false
|
|
|
});
|
...
|
...
|
@@ -545,7 +548,8 @@ Page(Object.assign({ |
|
|
product_qrCode: qrcode
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
;
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
let params = {
|
...
|
...
|
|