|
@@ -15,7 +15,8 @@ Page({
|
|
|
productId: '',
|
|
|
orderId: '',
|
|
|
groupId: '',
|
|
|
- closeFlag: true
|
|
|
+ closeFlags: [],
|
|
|
+ ind: 0
|
|
|
},
|
|
|
|
|
|
collageDetails: function ({currentTarget}) {
|
|
@@ -24,16 +25,17 @@ Page({
|
|
|
const groupId = currentTarget.dataset.groupid;
|
|
|
const uid = currentTarget.dataset.uid;
|
|
|
const num = currentTarget.dataset.num;
|
|
|
+ const ind = currentTarget.dataset.ind;
|
|
|
+ this.setData({
|
|
|
+ ind
|
|
|
+ })
|
|
|
console.log(num)
|
|
|
if(!num) {
|
|
|
wx.navigateTo({
|
|
|
url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
|
|
|
})
|
|
|
} else {
|
|
|
- this.setData({
|
|
|
- closeFlag: true
|
|
|
- })
|
|
|
- if(this.data.closeFlag) {
|
|
|
+ if(this.data.closeFlags[ind]) {
|
|
|
this.popup.close();
|
|
|
this.setData({
|
|
|
productId,
|
|
@@ -66,7 +68,15 @@ Page({
|
|
|
return
|
|
|
}
|
|
|
console.log('我的团', res.data.data.list)
|
|
|
+ res.data.data.list.forEach(element => {
|
|
|
+ if(element.status == 'SUCCESSED') {
|
|
|
+ this.data.closeFlags.push(true);
|
|
|
+ }else {
|
|
|
+ this.data.closeFlags.push(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
this.setData({
|
|
|
+ closeFlags: this.data.closeFlags,
|
|
|
myGroupList: res.data.data.list
|
|
|
})
|
|
|
}).fail( error => {
|
|
@@ -126,9 +136,12 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
close: function () {
|
|
|
+ const ind = this.data.ind;
|
|
|
+ this.data.closeFlags[ind] = false;
|
|
|
this.setData({
|
|
|
- closeFlag: false
|
|
|
+ closeFlags: this.data.closeFlags
|
|
|
})
|
|
|
+ console.log(this.data.closeFlags)
|
|
|
},
|
|
|
|
|
|
|
|
@@ -137,6 +150,7 @@ Page({
|
|
|
const productId = this.data.productId;
|
|
|
const groupId = this.data.groupId;
|
|
|
const id = this.data.orderId;
|
|
|
+ debugger;
|
|
|
|
|
|
httpRequestApi.SendGroupPurchas({
|
|
|
productId,
|
|
@@ -156,10 +170,7 @@ Page({
|
|
|
wx.navigateTo({
|
|
|
url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
|
|
|
})
|
|
|
-
|
|
|
- this.setData({
|
|
|
- closeFlag: false
|
|
|
- })
|
|
|
+ this.close();
|
|
|
}).fail((error) => {
|
|
|
|
|
|
})
|
|
@@ -212,5 +223,17 @@ Page({
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
+ },
|
|
|
+ onPullDownRefresh: function () {
|
|
|
+ this.onLoad();
|
|
|
+
|
|
|
+ wx.showNavigationBarLoading()
|
|
|
+
|
|
|
+ setTimeout(function()
|
|
|
+ {
|
|
|
+
|
|
|
+ wx.hideNavigationBarLoading()
|
|
|
+ wx.stopPullDownRefresh()
|
|
|
+ },1500);
|
|
|
}
|
|
|
})
|