diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js index 7e4956c..efeb85c 100644 --- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js +++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js @@ -1605,16 +1605,19 @@ Page({ }).then(res => { if (res.data.code == 0) { var ord_prom = res.data.data; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(quan_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } }) @@ -1955,16 +1958,20 @@ Page({ var order_prom_id = 0; if (th.data.order_prom[th.data.bn_pick]) { var ord_prom = th.data.order_prom[th.data.bn_pick]; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + + //么有使用券,或者活动没有限制使用优惠券 + if(coupon_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } //--订单优惠的显示-- diff --git a/packageC/pages/payForAnother/payForAnother.js b/packageC/pages/payForAnother/payForAnother.js index b1ad6f5..7c3cffd 100644 --- a/packageC/pages/payForAnother/payForAnother.js +++ b/packageC/pages/payForAnother/payForAnother.js @@ -1508,16 +1508,19 @@ Page({ }).then(res => { if (res.data.code == 0) { var ord_prom = res.data.data; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(quan_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } }) @@ -1855,16 +1858,19 @@ Page({ var order_prom_id = 0; if (th.data.order_prom[th.data.bn_pick]) { var ord_prom = th.data.order_prom[th.data.bn_pick]; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(coupon_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } //--订单优惠的显示-- diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 6ffa3a9..9374ed6 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -700,10 +700,13 @@ Page({ } } //--订单优惠的显示-- + var order_prom_txt1 = "order_prom_id"; + var order_prom_txt2 = "order_prom_amount"; if (order_prom_id > 0) { - var order_prom_txt1 = "order_prom_id"; - var order_prom_txt2 = "order_prom_amount"; th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) + }else{ + o_condition1=ord_price; + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) } o_condition1=parseFloat(o_condition1)-parseFloat(th.data.presell.presell_deposit); @@ -1826,18 +1829,21 @@ Page({ var order_m=0; if (th.data.order_prom[bn_pick]) { var ord_prom = th.data.order_prom[bn_pick]; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (ord_price - order_m).toFixed(2); - break; - case 1: - order_m = ord_price - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(quan_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (ord_price - order_m).toFixed(2); + break; + case 1: + order_m = ord_price - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } + ord_price = order_m; } - ord_price=order_m; } //--订单优惠的显示-- diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 53971ab..7d7f38c 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1724,16 +1724,19 @@ Page({ }).then(res => { if (res.data.code == 0) { var ord_prom = res.data.data; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(quan_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } }) @@ -2079,16 +2082,19 @@ Page({ var order_prom_id = 0; if (th.data.order_prom[th.data.bn_pick]) { var ord_prom = th.data.order_prom[th.data.bn_pick]; - order_prom_id = ord_prom['id']; - switch (ord_prom['type']) { - case 0: - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 - order_prom_amount = (o_condition - order_m).toFixed(2); - break; - case 1: - order_m = o_condition - ord_prom['expression'];//满额优惠金额 - order_prom_amount = ord_prom['expression']; - break; + //么有使用券,或者活动没有限制使用优惠券 + if(coupon_price<=0 || !ord_prom.is_xz_yh) { + order_prom_id = ord_prom['id']; + switch (ord_prom['type']) { + case 0: + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 + order_prom_amount = (o_condition - order_m).toFixed(2); + break; + case 1: + order_m = o_condition - ord_prom['expression'];//满额优惠金额 + order_prom_amount = ord_prom['expression']; + break; + } } } //--订单优惠的显示-- diff --git a/pages/index/index/index.js b/pages/index/index/index.js index 66e466b..419e6b2 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -83,18 +83,39 @@ Page({ sec_show: 3, //倒计时的秒数 full_ad: null, //全屏广告 full_screen: 0, //全屏广告 + is_ok_h5:0, //判断要不要显示关注二维码 }, onLoad: async function (tt) { // onLoad生命周期内判断 let obj = wx.getLaunchOptionsSync(); - console.log(obj.scene,'launch_scene'); - if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || - obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038) { - this.setData({is_ok_h5:1}) + //扫码登陆,强行 + if(tt.scancode_time){ + this.setData({is_ok_h5:1}) + wx.setStorageSync('launch', obj.scene); + }else{ + var cache_scene= wx.setStorageSync('launch'); + //看一下有没有缓存,没有缓存,或者缓存的值不一样,就开始判断公众号关注组件 + if(!cache_scene || cache_scene!=obj.scene){ + if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || + obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038 || tt.scancode_time) { + this.setData({is_ok_h5:1}) + wx.setStorageSync('launch', obj.scene); + }else{ + this.setData({is_ok_h5:0}) + wx.setStorageSync('launch',0); + } + }else{ + this.setData({is_ok_h5:0}) + wx.setStorageSync('launch',0); + } + } + + + var th = this; var first_leader = tt.first_leader; if (!first_leader && tt.scene) {