From 476787cbff0e4326284b543509ee02d033a854d3 Mon Sep 17 00:00:00 2001 From: nige Date: Fri, 21 Jul 2023 10:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/orderList/index.js | 30 +++++++++++++++++++++++------- pages/order/orderList/index.wxml | 4 ++-- 2 files changed, 25 insertions(+), 9 deletions(-) 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}} 下一步