|
@@ -30,7 +30,8 @@ Page({
|
|
text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
|
|
text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
|
|
color: "#FF4600"
|
|
color: "#FF4600"
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ read: false
|
|
},
|
|
},
|
|
|
|
|
|
//规则页显示和隐藏
|
|
//规则页显示和隐藏
|
|
@@ -41,22 +42,36 @@ Page({
|
|
},
|
|
},
|
|
//显示分享页
|
|
//显示分享页
|
|
openShare: function () {
|
|
openShare: function () {
|
|
- this.shareDialog = this.selectComponent("#share-dialog");
|
|
|
|
- const data = {
|
|
|
|
- avatar: this.data.organizer.avatar,
|
|
|
|
- author: this.data.organizer.wechatName,
|
|
|
|
- iconImg: this.data.groupPurchaseInfo.bgImg,
|
|
|
|
- title: this.data.groupPurchaseInfo.productTitle,
|
|
|
|
- path: `pages/groupPage/collage-details/collage-details`,
|
|
|
|
- scene: `QR${this.data.orderId}`,
|
|
|
|
- groupPurchaseInfo: this.data.groupPurchaseInfo
|
|
|
|
|
|
+ if(this.data.read){
|
|
|
|
+ const productId = this.data.productId;
|
|
|
|
+ const id = this.data.orderId;
|
|
|
|
+ const groupId = this.data.groupId;
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/groupPage/grade-details/grade-details?productId=${productId}&id=${id}&groupId=${groupId}&share=true`
|
|
|
|
+ })
|
|
|
|
+ }else {
|
|
|
|
+ this.shareDialog = this.selectComponent("#share-dialog");
|
|
|
|
+ const data = {
|
|
|
|
+ avatar: this.data.organizer.avatar,
|
|
|
|
+ author: this.data.organizer.wechatName,
|
|
|
|
+ iconImg: this.data.groupPurchaseInfo.bgImg,
|
|
|
|
+ title: this.data.groupPurchaseInfo.productTitle,
|
|
|
|
+ path: `pages/groupPage/collage-details/collage-details`,
|
|
|
|
+ scene: `QR${this.data.orderId}`,
|
|
|
|
+ groupPurchaseInfo: this.data.groupPurchaseInfo
|
|
|
|
+ }
|
|
|
|
+ this.shareDialog.share(data);
|
|
}
|
|
}
|
|
- this.shareDialog.share(data);
|
|
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
|
|
+ if(options.read) {
|
|
|
|
+ this.setData({
|
|
|
|
+ read: options.read
|
|
|
|
+ })
|
|
|
|
+ }
|
|
options.scene = 'QR1541862338777268';
|
|
options.scene = 'QR1541862338777268';
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
title: '拼团详情'
|
|
title: '拼团详情'
|
|
@@ -70,8 +85,9 @@ Page({
|
|
orderId
|
|
orderId
|
|
})
|
|
})
|
|
httpRequestApi.getMygroupInfo(orderId).success( res => {
|
|
httpRequestApi.getMygroupInfo(orderId).success( res => {
|
|
|
|
+ console.log(res);
|
|
const groupOrder = res.data.data.groupPurchaseOrder;
|
|
const groupOrder = res.data.data.groupPurchaseOrder;
|
|
- const surplusNum = groupOrder.headcount - groupOrder.joinCount - 1;
|
|
|
|
|
|
+ const surplusNum = groupOrder.headcount - groupOrder.joinCount;
|
|
for(var i = 0; i < surplusNum; i++) {
|
|
for(var i = 0; i < surplusNum; i++) {
|
|
this.data.surplusList.push(1);
|
|
this.data.surplusList.push(1);
|
|
}
|
|
}
|
|
@@ -79,7 +95,7 @@ Page({
|
|
//时间转换
|
|
//时间转换
|
|
const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
|
|
const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
|
|
console.log(timeList)
|
|
console.log(timeList)
|
|
- res.data.data.joinUserList.unshift(res.data.data.organizer);
|
|
|
|
|
|
+ //res.data.data.joinUserList.unshift(res.data.data.organizer);
|
|
this.setData({
|
|
this.setData({
|
|
groupPurchaseInfo: res.data.data.groupPurchaseInfo,
|
|
groupPurchaseInfo: res.data.data.groupPurchaseInfo,
|
|
organizer: res.data.data.organizer,
|
|
organizer: res.data.data.organizer,
|
|
@@ -90,6 +106,12 @@ Page({
|
|
productId: groupOrder.productId,
|
|
productId: groupOrder.productId,
|
|
groupId: groupOrder.groupId
|
|
groupId: groupOrder.groupId
|
|
})
|
|
})
|
|
|
|
+ if(groupOrder.groupType === 'PROMOTION'){
|
|
|
|
+ this.data.joinUserList.unshift(res.data.data.organizer);
|
|
|
|
+ this.setData({
|
|
|
|
+ joinUserList: this.data.joinUserList,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}).fail( error => {
|
|
}).fail( error => {
|
|
console.log('错误', error)
|
|
console.log('错误', error)
|
|
})
|
|
})
|