...
|
...
|
@@ -83,6 +83,7 @@ Page(Object.assign({ |
|
|
avatarList: [],
|
|
|
uid: '',
|
|
|
originUid: '',
|
|
|
originUnionID: '',
|
|
|
|
|
|
limitProductType: LIMIT_TYPE.ASSIS,
|
|
|
showStatus: SHOW_STATUS.SHARE,
|
...
|
...
|
@@ -117,6 +118,7 @@ Page(Object.assign({ |
|
|
onLoad: function(options) {
|
|
|
let limitProductCode = options.limitProductCode ? options.limitProductCode : '';
|
|
|
let originUid = options.originUid ? options.originUid : '';
|
|
|
let originUnionID = options.originUnionID ? options.originUnionID : '';
|
|
|
|
|
|
let uid = app.getUid();
|
|
|
|
...
|
...
|
@@ -127,6 +129,7 @@ Page(Object.assign({ |
|
|
limitProductCode,
|
|
|
originUid,
|
|
|
uid,
|
|
|
originUnionID
|
|
|
});
|
|
|
|
|
|
this.productInfo().then(() => {
|
...
|
...
|
@@ -160,7 +163,7 @@ Page(Object.assign({ |
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `/pages/product/detail/detail?limitProductCode=${this.data.limitProductCode}&originUid=${app.getUid()}`,
|
|
|
path: `/pages/product/detail/detail?limitProductCode=${this.data.limitProductCode}&originUid=${app.getUid()}&originUnionID=${app.getUnionID()}`,
|
|
|
imageUrl: this.data.snapData.default_image,
|
|
|
success: function() {
|
|
|
params.SHARE_RESUIL = 1;
|
...
|
...
|
@@ -237,7 +240,8 @@ Page(Object.assign({ |
|
|
|
|
|
let params = {
|
|
|
originUid: app.getUid(),
|
|
|
llimitProductCode: this.data.limitProductCode
|
|
|
llimitProductCode: this.data.limitProductCode,
|
|
|
originUnionID: app.getUnionID(),
|
|
|
};
|
|
|
|
|
|
let product_qrCode = config.domains.api + `/wechat/miniapp/img-check.jpg?param=${JSON.stringify(params)}&miniapp_type=4&miniQrType=11`; // eslint-disable-line
|
...
|
...
|
@@ -252,7 +256,11 @@ Page(Object.assign({ |
|
|
|
|
|
let productSourceType = PRODUCT_SOURCE_TYPE.ORIGIN;
|
|
|
|
|
|
if (this.data.originUid) {
|
|
|
if (this.data.originUnionID && this.data.originUnionID === app.getUnionID()) {
|
|
|
productSourceType = PRODUCT_SOURCE_TYPE.ORIGIN;
|
|
|
} else if (!this.data.originUnionID && !this.data.originUid) {
|
|
|
productSourceType = PRODUCT_SOURCE_TYPE.ORIGIN;
|
|
|
} else if (this.data.originUnionID && this.data.originUnionID !== app.getUnionID()) {
|
|
|
productSourceType = PRODUCT_SOURCE_TYPE.SHARE;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -289,13 +297,15 @@ Page(Object.assign({ |
|
|
if (this.data.assisLimit === result.data.list.length) {
|
|
|
assisStatus = ASSIS_STATUS.ASSIS_FULL;
|
|
|
} else {
|
|
|
if (this.data.originUid && this.data.uid !== this.data.originUid) {
|
|
|
// 不是发起者
|
|
|
if (this.data.originUid && this.data.originUnionID && this.data.originUnionID !== app.getUnionID()) {
|
|
|
assisStatus = ASSIS_STATUS.ASSIS_ACTION;
|
|
|
} else {
|
|
|
assisStatus = ASSIS_STATUS.UN_ASSIS;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 判断当前用户是否已经助力
|
|
|
let index = (result.data.list || []).findIndex((i) => i.helpUserId === app.getUnionID());
|
|
|
|
|
|
if (index !== -1) {
|
...
|
...
|
@@ -316,29 +326,42 @@ Page(Object.assign({ |
|
|
|
|
|
});
|
|
|
} else if (this.data.limitProductType === LIMIT_TYPE.QUEUE) {
|
|
|
let queueType = this.data.queueType;
|
|
|
let queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
|
|
|
switch (queueType) {
|
|
|
case QUEUE_TYPE.READY:
|
|
|
queueStatus = QUEUE_STATUS.UN_QUEUE;
|
|
|
break;
|
|
|
case QUEUE_TYPE.START:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_START;
|
|
|
break;
|
|
|
case QUEUE_TYPE.ACTIVATE:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_PROCESSING;
|
|
|
break;
|
|
|
case QUEUE_TYPE.END:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
break;
|
|
|
default:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
break;
|
|
|
}
|
|
|
return detailModel.getAssistInfo(uid, this.data.limitProductCode).then(result => {
|
|
|
if (result.code !== 200) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
queueStatus,
|
|
|
let queueType = this.data.queueType;
|
|
|
let queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
|
|
|
switch (queueType) {
|
|
|
case QUEUE_TYPE.READY:
|
|
|
queueStatus = QUEUE_STATUS.UN_QUEUE;
|
|
|
break;
|
|
|
case QUEUE_TYPE.START:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_START;
|
|
|
break;
|
|
|
case QUEUE_TYPE.ACTIVATE:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_PROCESSING;
|
|
|
break;
|
|
|
case QUEUE_TYPE.END:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
break;
|
|
|
default:
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_END;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// 判断当前用户是否已经助力
|
|
|
let index = (result.data.list || []).findIndex((i) => i.helpUserId === app.getUnionID());
|
|
|
|
|
|
if (index !== -1) {
|
|
|
queueStatus = QUEUE_STATUS.QUEUE_HELP;
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
queueStatus,
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -389,13 +412,15 @@ Page(Object.assign({ |
|
|
return;
|
|
|
}
|
|
|
|
|
|
detailModel.addQueue({
|
|
|
detailModel.addAssist({
|
|
|
userId: this.data.originUid,
|
|
|
helpUserId: app.getUnionID(),
|
|
|
helpUserName: userInfo.nickName,
|
|
|
helpUserImgUrl: userInfo.avatarUrl,
|
|
|
limitProductCode: this.data.limitProductCode,
|
|
|
activityId: this.data.activityId
|
|
|
}).then(() => {
|
|
|
return detailModel.addQueue(this.data.originUid, this.data.activityId, app.getUnionID());
|
|
|
}).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.setData({
|
...
|
...
|
@@ -462,6 +487,10 @@ Page(Object.assign({ |
|
|
data.limitProductCode = this.data.limitProductCode;
|
|
|
}
|
|
|
|
|
|
if (this.data.originUnionID) {
|
|
|
data.originUnionID = this.data.originUnionID;
|
|
|
}
|
|
|
|
|
|
let referer = `/pages/product/detail/detail?${stringify(data)}`;
|
|
|
|
|
|
router.go('userCenter', {
|
...
|
...
|
@@ -481,7 +510,5 @@ Page(Object.assign({ |
|
|
refreshText: '下拉刷新'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
}, Actionsheet)); |
|
|
\ No newline at end of file |
...
|
...
|
|