|
|
@@ -30,7 +30,8 @@ Page({ |
|
|
|
showTime: true, |
|
|
|
limitCondition: "", |
|
|
|
minLimit: 0, |
|
|
|
maxLimit: 0 |
|
|
|
maxLimit: 0, |
|
|
|
spellGroupOrder:false |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@@ -168,12 +169,73 @@ Page({ |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获得未支付的订单 |
|
|
|
getUnPaidOrder(couponId) { |
|
|
|
let that = this; |
|
|
|
Http.get({ |
|
|
|
url: config.api.getUnPaidOrder, |
|
|
|
data: { |
|
|
|
couponId: couponId |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
that.setData({ |
|
|
|
disOrderNumber: res.data.orderNumber, |
|
|
|
}) |
|
|
|
|
|
|
|
// 拼团订单 |
|
|
|
if (res.data.payment/100 != Number(that.data.data.price)) { |
|
|
|
that.setData({ |
|
|
|
spellGroupOrder: true |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 原价购买订单 |
|
|
|
that.setData({ |
|
|
|
spellGroupOrder: false |
|
|
|
}) |
|
|
|
} |
|
|
|
if (that.data.spellGroupOrder) { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: "您有未支付拼团订单,请先进行支付", |
|
|
|
confirmText: "去支付", |
|
|
|
success: function (res) { |
|
|
|
if (res.confirm) { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '您有未支付订单,请先进行支付', |
|
|
|
confirmText: "去支付", |
|
|
|
success: function (res) { |
|
|
|
if (res.confirm) { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.log(error) |
|
|
|
wx.showToast({ |
|
|
|
title: error.message, |
|
|
|
icon:"none", |
|
|
|
duration:3000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 发起拼团 |
|
|
|
*/ |
|
|
|
gotoSpell() { |
|
|
|
gotoSpell(e) { |
|
|
|
this.setData({ |
|
|
|
canSpell: false |
|
|
|
canSpell: false, |
|
|
|
formId: e.detail.formId |
|
|
|
}) |
|
|
|
this.orderFunc(0) |
|
|
|
}, |
|
|
@@ -411,10 +473,11 @@ Page({ |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == 3012) { |
|
|
|
wx.showToast({ |
|
|
|
title: err.message, |
|
|
|
icon: "none" |
|
|
|
}) |
|
|
|
// wx.showToast({ |
|
|
|
// title: err.message, |
|
|
|
// icon: "none" |
|
|
|
// }) |
|
|
|
that.getUnPaidOrder(that.data.data.couponId); |
|
|
|
} else if (err.code == 11005) { |
|
|
|
/** |
|
|
|
* 将值传到用户手机号授权的页面 |
|
|
|