|
@@ -20,6 +20,9 @@ Page({
|
|
|
//跳转到团购详情页
|
|
|
collageDetails: function ({currentTarget}) {
|
|
|
const orderId = currentTarget.dataset.orderid;
|
|
|
+ const productId = currentTarget.dataset.productid;
|
|
|
+ const groupId = currentTarget.dataset.groupid;
|
|
|
+ const uid = currentTarget.dataset.uid;
|
|
|
const num = currentTarget.dataset.num;
|
|
|
console.log(num)
|
|
|
if(!num) {
|
|
@@ -27,8 +30,17 @@ Page({
|
|
|
url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
|
|
|
})
|
|
|
} else {
|
|
|
+ this.setData({
|
|
|
+ closeFlag: true
|
|
|
+ })
|
|
|
if(this.data.closeFlag) {
|
|
|
this.popup.close();
|
|
|
+ this.setData({
|
|
|
+ productId,
|
|
|
+ orderId,
|
|
|
+ groupId
|
|
|
+ })
|
|
|
+ this.dialog(uid);
|
|
|
}else {
|
|
|
wx.navigateTo({
|
|
|
url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}&read=true`
|
|
@@ -41,8 +53,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (option) {
|
|
|
- console.log(option.title);
|
|
|
- if (option.title) {
|
|
|
+ if (option && option.title) {
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: option.title//页面标题为路由参数
|
|
|
});
|
|
@@ -58,71 +69,62 @@ Page({
|
|
|
this.setData({
|
|
|
myGroupList: res.data.data.list
|
|
|
})
|
|
|
- res.data.data.list.forEach(element => {
|
|
|
- console.log(element.status)
|
|
|
- if(element.status == 'SUCCESSED') {
|
|
|
- this.setData({
|
|
|
- productId: element.productId,
|
|
|
- orderId: element.id,
|
|
|
- groupId: element.groupId
|
|
|
- })
|
|
|
- if(wx.getStorageSync('uid') == element.organizer) {
|
|
|
- this.setData({
|
|
|
- typeOf: 'success',
|
|
|
- title: '恭喜 !',
|
|
|
- headTextOne: '您发起的团购拼团成功',
|
|
|
- content: [
|
|
|
- {
|
|
|
- text: "领袖体质魅力无穷!",
|
|
|
- color: "#000"
|
|
|
- },
|
|
|
- {
|
|
|
- text: " 您可以继续发起新的团购,",
|
|
|
- color: "#000"
|
|
|
- },
|
|
|
- {
|
|
|
- text: " 不再需要支付本课程费用,拼团成功,",
|
|
|
- color: "#FF9B00"
|
|
|
- },
|
|
|
- {
|
|
|
- text: " 您将得到xxx元奖励。",
|
|
|
- color: "#FF0000"
|
|
|
- }
|
|
|
- ],
|
|
|
- })
|
|
|
- }else {
|
|
|
- this.setData({
|
|
|
- typeOf: 'success',
|
|
|
- title: '拼团成功 ! ',
|
|
|
- headTextOne: '您参与的团购拼团成功',
|
|
|
- headTextTwo: '订单号:12344',
|
|
|
- content: [
|
|
|
- {
|
|
|
- text: "感谢团长的分享",
|
|
|
- color: "#000"
|
|
|
- },
|
|
|
- {
|
|
|
- text: " 您也可以发起新的团购分享给需要的朋友们,",
|
|
|
- color: "#000"
|
|
|
- },
|
|
|
- {
|
|
|
- text: "作为新的发起人,您无需在支付本课程费用;",
|
|
|
- color: "#FF0000"
|
|
|
- },
|
|
|
- {
|
|
|
- text: "团购成功,您将得到xxx元奖励。",
|
|
|
- color: "#FF0000"
|
|
|
- }
|
|
|
- ],
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
}).fail( error => {
|
|
|
console.log('错误', error)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ dialog: function (uid) {
|
|
|
+ if(wx.getStorageSync('uid') == uid) {
|
|
|
+ this.setData({
|
|
|
+ typeOf: 'success',
|
|
|
+ title: '恭喜 !',
|
|
|
+ headTextOne: '您发起的团购拼团成功',
|
|
|
+ content: [
|
|
|
+ {
|
|
|
+ text: "领袖体质魅力无穷!",
|
|
|
+ color: "#000"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: " 您可以继续发起新的团购,",
|
|
|
+ color: "#000"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: " 不再需要支付本课程费用,拼团成功,",
|
|
|
+ color: "#FF9B00"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: " 您将得到xxx元奖励。",
|
|
|
+ color: "#FF0000"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.setData({
|
|
|
+ typeOf: 'success',
|
|
|
+ title: '拼团成功 ! ',
|
|
|
+ headTextOne: '您参与的团购拼团成功',
|
|
|
+ headTextTwo: '订单号:12344',
|
|
|
+ content: [
|
|
|
+ {
|
|
|
+ text: "感谢团长的分享",
|
|
|
+ color: "#000"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: " 您也可以发起新的团购分享给需要的朋友们,",
|
|
|
+ color: "#000"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "作为新的发起人,您无需在支付本课程费用;",
|
|
|
+ color: "#FF0000"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "团购成功,您将得到xxx元奖励。",
|
|
|
+ color: "#FF0000"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
close: function () {
|
|
|
this.setData({
|
|
|
closeFlag: false
|
|
@@ -131,6 +133,7 @@ Page({
|
|
|
|
|
|
//再次发起团
|
|
|
group: function () {
|
|
|
+ debugger;
|
|
|
const productId = this.data.productId;
|
|
|
const groupId = this.data.groupId;
|
|
|
const id = this.data.orderId;
|
|
@@ -140,6 +143,7 @@ Page({
|
|
|
groupId
|
|
|
}).success((res) => {
|
|
|
console.log('发起团购', res);
|
|
|
+ debugger;
|
|
|
if (res.data.message) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|