diff --git a/pages/order/orderList/index.js b/pages/order/orderList/index.js
index 220d57c..0ae9234 100644
--- a/pages/order/orderList/index.js
+++ b/pages/order/orderList/index.js
@@ -17,7 +17,7 @@ Page({
gp_id: null,
showPrice: 0,
postFee: 0,
- coupon:null,
+ coupon:app.globalData.couponInfo,
select_allowance: false,
allowance_data: null,
allowance_price: 0,
@@ -35,8 +35,6 @@ Page({
gp_id: app.globalData.gp_id || app.globalData.team_id,
flag:options.flag
})
- console.log(this.data.flag);
- console.log(app.globalData);
let price = 0, sku_id = [] ,postFee= 0;
app.globalData.postProduct.map(item => {
if (!app.globalData.kjId && !this.data.gp_id) {
@@ -107,14 +105,32 @@ Page({
item.remark = e.detail.value;
}
})
- },
+ },
+ //获取最高优惠券
+ getNewCoupon(e){
+ this.setData({
+ coupon:e.detail
+ })
+ },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
- this.setData({
- coupon: app.globalData.couponInfo
- })
+ try {
+ if (Object.keys(app.globalData.couponInfo).length!=0) {
+ this.setData({
+ coupon: app.globalData.couponInfo
+ })
+ }else{
+ this.setData({
+ coupon:null
+ })
+ }
+ } catch (error) {
+ this.setData({
+ coupon:null
+ })
+ }
},
/**
diff --git a/pages/order/orderList/index.wxml b/pages/order/orderList/index.wxml
index b9a3b52..2e1cc30 100644
--- a/pages/order/orderList/index.wxml
+++ b/pages/order/orderList/index.wxml
@@ -52,11 +52,11 @@
订单备注:
-
+
- 合计:
+ 合计:
¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}
下一步