|
@@ -32,7 +32,14 @@ Page({
|
|
|
isIPX: app.globalData.isIPX,
|
|
|
bookList: [],
|
|
|
sendGroupFlag: true,
|
|
|
- selectFlag: []
|
|
|
+ selectFlag: [],
|
|
|
+ flag: true
|
|
|
+ },
|
|
|
+ //tab切换
|
|
|
+ tabSwitch: function () {
|
|
|
+ this.setData({
|
|
|
+ flag: !this.data.flag
|
|
|
+ })
|
|
|
},
|
|
|
jurisdiction: function () {
|
|
|
//隐藏弹框
|
|
@@ -68,52 +75,56 @@ Page({
|
|
|
this.data.selectFlag.forEach( (item ,index) => {
|
|
|
if(!item) {
|
|
|
const productId = this.data.bookList[index].id;
|
|
|
+ const title = this.data.bookList[index].title
|
|
|
this.setData({
|
|
|
sendGroupFlag: !this.data.sendGroupFlag
|
|
|
})
|
|
|
- this.openGroup(productId)
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/pages/groupPage/grade-details/grade-details?productId=${productId}&title=${title}`
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
|
|
|
},
|
|
|
//开团
|
|
|
- openGroup: function (productId) {
|
|
|
- //const productId = this.data.productId;
|
|
|
- const groupId = this.data.groupId;
|
|
|
- //开始发起团购
|
|
|
- httpRequestApi.SendGroupPurchas({
|
|
|
- productId,
|
|
|
- groupId
|
|
|
- }).success((res) => {
|
|
|
- console.log('发起团购', res);
|
|
|
- if (res.data.message) {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: res.data.message,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- console.log('用户点击确定')
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // openGroup: function (productId) {
|
|
|
+ // //const productId = this.data.productId;
|
|
|
+ // const groupId = this.data.groupId;
|
|
|
+ // //开始发起团购
|
|
|
+ // httpRequestApi.SendGroupPurchas({
|
|
|
+ // productId,
|
|
|
+ // groupId
|
|
|
+ // }).success((res) => {
|
|
|
+ // console.log('发起团购', res);
|
|
|
+ // if (res.data.message) {
|
|
|
+ // wx.showModal({
|
|
|
+ // title: '提示',
|
|
|
+ // content: res.data.message,
|
|
|
+ // success(res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // console.log('用户点击确定')
|
|
|
+ // } else if (res.cancel) {
|
|
|
+ // console.log('用户点击取消')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
|
|
|
- if (res.data.data.groupPurchaseOrder.groupType === 'BASE') {
|
|
|
- //掉起支付
|
|
|
- this.prePayMap(res.data.data.prePayMap, 'create');
|
|
|
- }else {
|
|
|
- wx.navigateTo({
|
|
|
- url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (res.data.data.groupPurchaseOrder.groupType === 'BASE') {
|
|
|
+ // debugger;
|
|
|
+ // //掉起支付
|
|
|
+ // this.prePayMap(res.data.data.prePayMap, 'create');
|
|
|
+ // }else {
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
|
|
|
+ // })
|
|
|
+ // }
|
|
|
|
|
|
- }).fail((error) => {
|
|
|
+ // }).fail((error) => {
|
|
|
|
|
|
- })
|
|
|
- },
|
|
|
+ // })
|
|
|
+ // },
|
|
|
//参团
|
|
|
jionGroup: function () {
|
|
|
const orderId = this.data.orderId;
|
|
@@ -182,6 +193,7 @@ Page({
|
|
|
},
|
|
|
//拼团详情
|
|
|
jionSuccess: function (orderId, type) {
|
|
|
+ debugger;
|
|
|
httpRequestApi.getMygroupInfo(orderId).success(res => {
|
|
|
console.log('拼团详情', res.data.data);
|
|
|
const groupOrder = res.data.data.groupPurchaseOrder;
|
|
@@ -189,17 +201,19 @@ Page({
|
|
|
this.setData({
|
|
|
organizer: groupOrder.organizer,
|
|
|
})
|
|
|
+ debugger
|
|
|
if (type === 'join') {
|
|
|
this.data.surplusList.pop();
|
|
|
- debugger;
|
|
|
if (groupOrder.status === 'SUCCESSED') {
|
|
|
this.showSuccess(groupOrder.organizer, groupOrder.organizerPrice)
|
|
|
} else {
|
|
|
this.goToDetail(groupOrder.id)
|
|
|
}
|
|
|
- } if (type = 'create') {
|
|
|
- debugger;
|
|
|
+ } else if (type === 'create') {
|
|
|
this.showSuccess(groupOrder.organizer, groupOrder.organizerPrice)
|
|
|
+ this.setData({
|
|
|
+ orderId: groupOrder.id
|
|
|
+ })
|
|
|
} else {
|
|
|
for (var i = 0; i < surplusNum; i++) {
|
|
|
this.data.surplusList.push(1);
|
|
@@ -309,20 +323,20 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- //拼团是否成功并弹窗
|
|
|
- // groupSuccess: function (orderId, detailId) {
|
|
|
- // httpRequestApi.groupSuccess(orderId).success(res => {
|
|
|
- // console.log('团购是否成功', res.data.data)
|
|
|
- // const status = res.data.data.status;
|
|
|
- // const uid = res.data.data.uid;
|
|
|
- // }).fail(error => {
|
|
|
- // console.log('错误', eroor)
|
|
|
- // })
|
|
|
- // },
|
|
|
-
|
|
|
//再次发起团
|
|
|
group: function () {
|
|
|
- this.openGroup();
|
|
|
+ const orderId = this.data.orderId;
|
|
|
+ this.goToDetail(orderId);
|
|
|
+ //拼团是否成功并弹窗
|
|
|
+ // httpRequestApi.groupSuccess(orderId).success(res => {
|
|
|
+ // console.log('团购是否成功', res.data.data)
|
|
|
+ // debugger;
|
|
|
+ // const status = res.data.data.status;
|
|
|
+ // const uid = res.data.data.uid;
|
|
|
+ // }).fail(error => {
|
|
|
+ // console.log('错误', eroor)
|
|
|
+ // })
|
|
|
+ //this.openGroup();
|
|
|
},
|
|
|
|
|
|
/**
|