...
|
...
|
@@ -175,9 +175,8 @@ Page( |
|
|
isLogin: app.isLogin(),
|
|
|
uid,
|
|
|
});
|
|
|
this._getMineCode();
|
|
|
this._getUser();
|
|
|
this._getGroupList();
|
|
|
// this._getGroupList();
|
|
|
|
|
|
if (this.data.shareUid && this.data.scene) {
|
|
|
this._init();
|
...
|
...
|
@@ -213,7 +212,6 @@ Page( |
|
|
this._init().then(() => {
|
|
|
wx.stopPullDownRefresh();
|
|
|
});
|
|
|
this._getMineCode();
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -227,15 +225,15 @@ Page( |
|
|
page,
|
|
|
loading: true,
|
|
|
});
|
|
|
this._loadGroupList(page);
|
|
|
// this._loadGroupList(page);
|
|
|
},
|
|
|
|
|
|
_getMineCode() {
|
|
|
if (this.data.uid && this.data.actPrizeId) {
|
|
|
_getMineCode(actPrizeId) {
|
|
|
if (this.data.uid) {
|
|
|
this.service
|
|
|
.fetchMyPrizeList({
|
|
|
uid: this.data.uid,
|
|
|
actPrizeId: this.data.actPrizeId,
|
|
|
actPrizeId,
|
|
|
})
|
|
|
.then(res => {
|
|
|
let len = res.data.length;
|
...
|
...
|
@@ -324,23 +322,21 @@ Page( |
|
|
let params = {
|
|
|
actPrizeId: this.data.actPrizeId,
|
|
|
};
|
|
|
const promises = [this.service.getYohoodDetail(params)];
|
|
|
if(this.data.actPrizeId) {
|
|
|
promises.push(this.service.getRecentAvatars(params))
|
|
|
}else {
|
|
|
promises.push(Promise.resolve({}))
|
|
|
}
|
|
|
return Promise.all(promises)
|
|
|
.then(([r1, r2]) => {
|
|
|
|
|
|
return this.service.getYohoodDetail(params)
|
|
|
.then((r1) => {
|
|
|
wx.hideLoading();
|
|
|
if (r1.code === 200 && r1.data) {
|
|
|
let product = r1.data;
|
|
|
|
|
|
|
|
|
let qrcode = this.service.getQrCode({
|
|
|
shareUid: app.getUid(),
|
|
|
actPrizeId: this.data.actPrizeId || product.id || '',
|
|
|
});
|
|
|
|
|
|
this._getMineCode(product.id);
|
|
|
|
|
|
let snapData = {
|
|
|
product_name: product.name,
|
|
|
default_image: product.cover_img,
|
...
|
...
|
@@ -351,11 +347,6 @@ Page( |
|
|
this.setData({
|
|
|
product: product,
|
|
|
actPrizeId: this.data.actPrizeId || product.id || '',
|
|
|
avatars: (r2.code === 200 ? r2.data : []).map(i => {
|
|
|
i.user_name = wrapperName(i.user_name);
|
|
|
i.user_thumb = formatImageUrl(i.user_thumb, 200, 200);
|
|
|
return i;
|
|
|
}),
|
|
|
|
|
|
myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0,
|
|
|
snapData,
|
...
|
...
|
@@ -363,6 +354,14 @@ Page( |
|
|
lottery: JSON.parse(product.lottery_info || '{}'),
|
|
|
});
|
|
|
|
|
|
this.service.getRecentAvatars({actPrizeId: product.id}).then( r2 => {
|
|
|
this.setData({avatars: (r2.code === 200 ? r2.data : []).map(i => {
|
|
|
i.user_name = wrapperName(i.user_name);
|
|
|
i.user_thumb = formatImageUrl(i.user_thumb, 200, 200);
|
|
|
return i;
|
|
|
}),});
|
|
|
})
|
|
|
|
|
|
this._setActionStatus();
|
|
|
} else {
|
|
|
return Promise.reject();
|
...
|
...
|
@@ -434,7 +433,6 @@ Page( |
|
|
mask: true,
|
|
|
});
|
|
|
this._init();
|
|
|
this._getMineCode();
|
|
|
},
|
|
|
|
|
|
share(event) {
|
...
|
...
|
|