|
@@ -1,6 +1,7 @@
|
|
// pages/groupPage/collage-details/collage-details.js
|
|
// pages/groupPage/collage-details/collage-details.js
|
|
import httpRequestApi from '../../../utils/APIClient';
|
|
import httpRequestApi from '../../../utils/APIClient';
|
|
import util from '../../../utils/util';
|
|
import util from '../../../utils/util';
|
|
|
|
+const app = getApp()
|
|
Page({
|
|
Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -16,18 +17,17 @@ Page({
|
|
productId: '',
|
|
productId: '',
|
|
orderId: '',
|
|
orderId: '',
|
|
groupId: '',
|
|
groupId: '',
|
|
- content: [
|
|
|
|
- {
|
|
|
|
- text: "转发给自己的朋友们,分享好课,",
|
|
|
|
- color: "#000"
|
|
|
|
|
|
+ content: [{
|
|
|
|
+ text: "转发给自己的朋友们,分享好课,",
|
|
|
|
+ color: "#000"
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- text: " 追随您一起学习进步。您的魅力不是吹的!",
|
|
|
|
- color: "#000"
|
|
|
|
|
|
+ text: " 追随您一起学习进步。您的魅力不是吹的!",
|
|
|
|
+ color: "#000"
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
|
|
|
|
- color: "#FF4600"
|
|
|
|
|
|
+ text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
|
|
|
|
+ color: "#FF4600"
|
|
}
|
|
}
|
|
],
|
|
],
|
|
read: false,
|
|
read: false,
|
|
@@ -36,14 +36,14 @@ Page({
|
|
},
|
|
},
|
|
//显示分享页
|
|
//显示分享页
|
|
openShare: function () {
|
|
openShare: function () {
|
|
- if(this.data.read){
|
|
|
|
|
|
+ if (this.data.read) {
|
|
const productId = this.data.productId;
|
|
const productId = this.data.productId;
|
|
const id = this.data.orderId;
|
|
const id = this.data.orderId;
|
|
const groupId = this.data.groupId;
|
|
const groupId = this.data.groupId;
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `/pages/groupPage/grade-details/grade-details?productId=${productId}&id=${id}&groupId=${groupId}&share=true`
|
|
url: `/pages/groupPage/grade-details/grade-details?productId=${productId}&id=${id}&groupId=${groupId}&share=true`
|
|
})
|
|
})
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
const data = {
|
|
const data = {
|
|
avatar: this.data.organizer.avatar,
|
|
avatar: this.data.organizer.avatar,
|
|
@@ -61,31 +61,40 @@ Page({
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
- if(options.read) {
|
|
|
|
|
|
+ if (app.globalData.isIOS) {
|
|
|
|
+ wx.redirectTo({
|
|
|
|
+ url: '../../index/index'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (options.read) {
|
|
this.setData({
|
|
this.setData({
|
|
read: options.read
|
|
read: options.read
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- options.scene = 'QR1541862338777268';
|
|
|
|
|
|
+ // options.scene = 'QR1541862338777268';
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
title: '拼团详情'
|
|
title: '拼团详情'
|
|
})
|
|
})
|
|
|
|
+ console.log(options);
|
|
console.log(options.orderId);
|
|
console.log(options.orderId);
|
|
- if(!options.orderId) {
|
|
|
|
|
|
+ const orderId = options.orderId ? options.orderId : options.scene.replace('QR', '');
|
|
|
|
+ if (options.orderId) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- const orderId = options.orderId ? options.orderId : options.scene.replace('QR', '');
|
|
|
|
|
|
+
|
|
|
|
+ console.log(orderId)
|
|
this.setData({
|
|
this.setData({
|
|
orderId
|
|
orderId
|
|
})
|
|
})
|
|
- httpRequestApi.getMygroupInfo(orderId).success( res => {
|
|
|
|
|
|
+ httpRequestApi.getMygroupInfo(orderId).success(res => {
|
|
console.log(res);
|
|
console.log(res);
|
|
const groupOrder = res.data.data.groupPurchaseOrder;
|
|
const groupOrder = res.data.data.groupPurchaseOrder;
|
|
const surplusNum = groupOrder.headcount - groupOrder.joinCount;
|
|
const surplusNum = groupOrder.headcount - groupOrder.joinCount;
|
|
this.setData({
|
|
this.setData({
|
|
organizerUid: groupOrder.organizer,
|
|
organizerUid: groupOrder.organizer,
|
|
})
|
|
})
|
|
- for(var i = 0; i < surplusNum; i++) {
|
|
|
|
|
|
+ for (var i = 0; i < surplusNum; i++) {
|
|
this.data.surplusList.push(1);
|
|
this.data.surplusList.push(1);
|
|
}
|
|
}
|
|
//console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
|
|
//console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
|
|
@@ -103,7 +112,7 @@ Page({
|
|
productId: groupOrder.productId,
|
|
productId: groupOrder.productId,
|
|
groupId: groupOrder.groupId
|
|
groupId: groupOrder.groupId
|
|
})
|
|
})
|
|
- if(groupOrder.groupType === 'PROMOTION'){
|
|
|
|
|
|
+ if (groupOrder.groupType === 'PROMOTION') {
|
|
//this.data.joinUserList.unshift(res.data.data.organizer);
|
|
//this.data.joinUserList.unshift(res.data.data.organizer);
|
|
this.setData({
|
|
this.setData({
|
|
colonelName: res.data.data.organizer.wechatName
|
|
colonelName: res.data.data.organizer.wechatName
|
|
@@ -112,7 +121,7 @@ Page({
|
|
joinUserList: this.data.joinUserList,
|
|
joinUserList: this.data.joinUserList,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }).fail( error => {
|
|
|
|
|
|
+ }).fail(error => {
|
|
console.log('错误', error)
|
|
console.log('错误', error)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -122,7 +131,7 @@ Page({
|
|
*/
|
|
*/
|
|
onReady: function () {
|
|
onReady: function () {
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|