...
|
...
|
@@ -99,7 +99,7 @@ Page(Object.assign({ |
|
|
]
|
|
|
},
|
|
|
animation: null,
|
|
|
shareFlag:false
|
|
|
shareFlag: false
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -196,6 +196,7 @@ Page(Object.assign({ |
|
|
this._init().then(() => {
|
|
|
wx.stopPullDownRefresh();
|
|
|
})
|
|
|
this._getMineCode()
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -227,13 +228,6 @@ Page(Object.assign({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
goLogin() {
|
|
|
const event = global.event;
|
|
|
event.emit('user-is-login', {logged: this.logged, loginSuccess: this.loginSuccess});
|
...
|
...
|
@@ -249,26 +243,28 @@ Page(Object.assign({ |
|
|
_getMineCode() {
|
|
|
if (this.data.uid) {
|
|
|
this.service.fetchMyPrizeList({uid: this.data.uid, actPrizeId: this.data.actPrizeId}).then(res => {
|
|
|
let len = res.data.length;
|
|
|
let animation = wx.createAnimation({
|
|
|
duration: 400 * len,
|
|
|
})
|
|
|
this.setData({
|
|
|
codeList: res.data,
|
|
|
})
|
|
|
this.animation = animation
|
|
|
setTimeout(function () {
|
|
|
let query = wx.createSelectorQuery();
|
|
|
query.select('.code-list-item-container').boundingClientRect();
|
|
|
query.exec((res) => {
|
|
|
animation.height(res[0].height - 63).step();
|
|
|
this.setData({
|
|
|
animation: animation.export()
|
|
|
})
|
|
|
let len = res.data.length > 3 ? 3 : res.data.length;
|
|
|
if (len) {
|
|
|
let animation = wx.createAnimation({
|
|
|
duration: 400 * len,
|
|
|
})
|
|
|
this.setData({
|
|
|
codeList: res.data,
|
|
|
})
|
|
|
this.animation = animation
|
|
|
setTimeout(function () {
|
|
|
let query = wx.createSelectorQuery();
|
|
|
query.select('.code-list-item-container').boundingClientRect();
|
|
|
query.exec((res) => {
|
|
|
console.log(res[0].height)
|
|
|
animation.height(res[0].height - 63).step();
|
|
|
this.setData({
|
|
|
animation: animation.export()
|
|
|
})
|
|
|
})
|
|
|
|
|
|
}.bind(this), 400);
|
|
|
|
|
|
}.bind(this), 400);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -337,10 +333,6 @@ Page(Object.assign({ |
|
|
|
|
|
let participantCount = r1.code === 200 ? r1.data.joinNum : 0;
|
|
|
|
|
|
// if (product.status >= ACTIVITY.END) {
|
|
|
// participantCount = product.limit;
|
|
|
// }
|
|
|
|
|
|
this.setData({
|
|
|
product: product,
|
|
|
recommends: r2.code === 200 ? r2.data : [],
|
...
|
...
|
@@ -365,12 +357,6 @@ Page(Object.assign({ |
|
|
}).catch((e) => {
|
|
|
console.error(e);
|
|
|
wx.hideLoading();
|
|
|
|
|
|
// wx.showModal({
|
|
|
// title: "出错了",
|
|
|
// content: '请重新加载!',
|
|
|
// showCancel: false
|
|
|
// })
|
|
|
});
|
|
|
},
|
|
|
|
...
|
...
|
@@ -457,6 +443,7 @@ Page(Object.assign({ |
|
|
mask: true
|
|
|
});
|
|
|
this._init();
|
|
|
this._getMineCode();
|
|
|
},
|
|
|
|
|
|
share(event) {
|
...
|
...
|
@@ -465,11 +452,6 @@ Page(Object.assign({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
requireAuth() {
|
|
|
// this.setData({
|
|
|
// showAuth: true
|
|
|
// })
|
|
|
},
|
|
|
_jumpBanner() {
|
|
|
if (this.data.bannerUrl == null) {
|
|
|
return;
|
...
|
...
|
@@ -530,45 +512,27 @@ Page(Object.assign({ |
|
|
onShareAppMessage(res) {
|
|
|
let params = {
|
|
|
TITLE: `【0元抽奖】点一下,免费拿走${this.data.product.name}`,
|
|
|
DESC: '我在YO!LUCK发现一个不错的商品赶快来看看吧!'
|
|
|
DESC: '我在YO!LUCK发现一个不错的商品赶快来看看1吧!'
|
|
|
};
|
|
|
this.setData({
|
|
|
shareFlag: true
|
|
|
})
|
|
|
setTimeout(function () {
|
|
|
this.setData({shareFlag: false});
|
|
|
}.bind(this), 600);
|
|
|
if (res.from === 'menu') {
|
|
|
// 用户点击右上角分享
|
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}`,
|
|
|
success: ()=> {
|
|
|
this.setData({
|
|
|
shareFlag: false
|
|
|
})
|
|
|
},
|
|
|
fail: ()=> {
|
|
|
this.setData({
|
|
|
shareFlag: false
|
|
|
})
|
|
|
}
|
|
|
path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}`
|
|
|
};
|
|
|
} else if (res.from === 'button') {
|
|
|
// 用户点击分享按钮
|
|
|
|
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `/pages/zeroSell/detail?actPrizeId=${this.data.product.id}&shareUid=${app.getUid()}`,
|
|
|
success: ()=> {
|
|
|
this.setData({
|
|
|
shareFlag: false
|
|
|
})
|
|
|
},
|
|
|
fail: ()=> {
|
|
|
this.setData({
|
|
|
shareFlag: false
|
|
|
})
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
},
|
...
|
...
|
|