Commit 4e956944131a889e7efc99d112ac54b660126dd9
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
5 changed files
with
123 additions
and
77 deletions
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -1605,16 +1605,19 @@ Page({ | @@ -1605,16 +1605,19 @@ Page({ | ||
1605 | }).then(res => { | 1605 | }).then(res => { |
1606 | if (res.data.code == 0) { | 1606 | if (res.data.code == 0) { |
1607 | var ord_prom = res.data.data; | 1607 | var ord_prom = res.data.data; |
1608 | - order_prom_id = ord_prom['id']; | ||
1609 | - switch (ord_prom['type']) { | ||
1610 | - case 0: | ||
1611 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1612 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1613 | - break; | ||
1614 | - case 1: | ||
1615 | - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1616 | - order_prom_amount = ord_prom['expression']; | ||
1617 | - break; | 1608 | + //么有使用券,或者活动没有限制使用优惠券 |
1609 | + if(quan_price<=0 || !ord_prom.is_xz_yh) { | ||
1610 | + order_prom_id = ord_prom['id']; | ||
1611 | + switch (ord_prom['type']) { | ||
1612 | + case 0: | ||
1613 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1614 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1615 | + break; | ||
1616 | + case 1: | ||
1617 | + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1618 | + order_prom_amount = ord_prom['expression']; | ||
1619 | + break; | ||
1620 | + } | ||
1618 | } | 1621 | } |
1619 | } | 1622 | } |
1620 | }) | 1623 | }) |
@@ -1955,16 +1958,20 @@ Page({ | @@ -1955,16 +1958,20 @@ Page({ | ||
1955 | var order_prom_id = 0; | 1958 | var order_prom_id = 0; |
1956 | if (th.data.order_prom[th.data.bn_pick]) { | 1959 | if (th.data.order_prom[th.data.bn_pick]) { |
1957 | var ord_prom = th.data.order_prom[th.data.bn_pick]; | 1960 | var ord_prom = th.data.order_prom[th.data.bn_pick]; |
1958 | - order_prom_id = ord_prom['id']; | ||
1959 | - switch (ord_prom['type']) { | ||
1960 | - case 0: | ||
1961 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1962 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1963 | - break; | ||
1964 | - case 1: | ||
1965 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1966 | - order_prom_amount = ord_prom['expression']; | ||
1967 | - break; | 1961 | + |
1962 | + //么有使用券,或者活动没有限制使用优惠券 | ||
1963 | + if(coupon_price<=0 || !ord_prom.is_xz_yh) { | ||
1964 | + order_prom_id = ord_prom['id']; | ||
1965 | + switch (ord_prom['type']) { | ||
1966 | + case 0: | ||
1967 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1968 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1969 | + break; | ||
1970 | + case 1: | ||
1971 | + order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1972 | + order_prom_amount = ord_prom['expression']; | ||
1973 | + break; | ||
1974 | + } | ||
1968 | } | 1975 | } |
1969 | } | 1976 | } |
1970 | //--订单优惠的显示-- | 1977 | //--订单优惠的显示-- |
packageC/pages/payForAnother/payForAnother.js
@@ -1508,16 +1508,19 @@ Page({ | @@ -1508,16 +1508,19 @@ Page({ | ||
1508 | }).then(res => { | 1508 | }).then(res => { |
1509 | if (res.data.code == 0) { | 1509 | if (res.data.code == 0) { |
1510 | var ord_prom = res.data.data; | 1510 | var ord_prom = res.data.data; |
1511 | - order_prom_id = ord_prom['id']; | ||
1512 | - switch (ord_prom['type']) { | ||
1513 | - case 0: | ||
1514 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1515 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1516 | - break; | ||
1517 | - case 1: | ||
1518 | - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1519 | - order_prom_amount = ord_prom['expression']; | ||
1520 | - break; | 1511 | + //么有使用券,或者活动没有限制使用优惠券 |
1512 | + if(quan_price<=0 || !ord_prom.is_xz_yh) { | ||
1513 | + order_prom_id = ord_prom['id']; | ||
1514 | + switch (ord_prom['type']) { | ||
1515 | + case 0: | ||
1516 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1517 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1518 | + break; | ||
1519 | + case 1: | ||
1520 | + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1521 | + order_prom_amount = ord_prom['expression']; | ||
1522 | + break; | ||
1523 | + } | ||
1521 | } | 1524 | } |
1522 | } | 1525 | } |
1523 | }) | 1526 | }) |
@@ -1855,16 +1858,19 @@ Page({ | @@ -1855,16 +1858,19 @@ Page({ | ||
1855 | var order_prom_id = 0; | 1858 | var order_prom_id = 0; |
1856 | if (th.data.order_prom[th.data.bn_pick]) { | 1859 | if (th.data.order_prom[th.data.bn_pick]) { |
1857 | var ord_prom = th.data.order_prom[th.data.bn_pick]; | 1860 | var ord_prom = th.data.order_prom[th.data.bn_pick]; |
1858 | - order_prom_id = ord_prom['id']; | ||
1859 | - switch (ord_prom['type']) { | ||
1860 | - case 0: | ||
1861 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1862 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1863 | - break; | ||
1864 | - case 1: | ||
1865 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1866 | - order_prom_amount = ord_prom['expression']; | ||
1867 | - break; | 1861 | + //么有使用券,或者活动没有限制使用优惠券 |
1862 | + if(coupon_price<=0 || !ord_prom.is_xz_yh) { | ||
1863 | + order_prom_id = ord_prom['id']; | ||
1864 | + switch (ord_prom['type']) { | ||
1865 | + case 0: | ||
1866 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1867 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1868 | + break; | ||
1869 | + case 1: | ||
1870 | + order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1871 | + order_prom_amount = ord_prom['expression']; | ||
1872 | + break; | ||
1873 | + } | ||
1868 | } | 1874 | } |
1869 | } | 1875 | } |
1870 | //--订单优惠的显示-- | 1876 | //--订单优惠的显示-- |
packageC/pages/presell/cart/cart.js
@@ -700,10 +700,13 @@ Page({ | @@ -700,10 +700,13 @@ Page({ | ||
700 | } | 700 | } |
701 | } | 701 | } |
702 | //--订单优惠的显示-- | 702 | //--订单优惠的显示-- |
703 | + var order_prom_txt1 = "order_prom_id"; | ||
704 | + var order_prom_txt2 = "order_prom_amount"; | ||
703 | if (order_prom_id > 0) { | 705 | if (order_prom_id > 0) { |
704 | - var order_prom_txt1 = "order_prom_id"; | ||
705 | - var order_prom_txt2 = "order_prom_amount"; | ||
706 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) | 706 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) |
707 | + }else{ | ||
708 | + o_condition1=ord_price; | ||
709 | + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) | ||
707 | } | 710 | } |
708 | 711 | ||
709 | o_condition1=parseFloat(o_condition1)-parseFloat(th.data.presell.presell_deposit); | 712 | o_condition1=parseFloat(o_condition1)-parseFloat(th.data.presell.presell_deposit); |
@@ -1826,18 +1829,21 @@ Page({ | @@ -1826,18 +1829,21 @@ Page({ | ||
1826 | var order_m=0; | 1829 | var order_m=0; |
1827 | if (th.data.order_prom[bn_pick]) { | 1830 | if (th.data.order_prom[bn_pick]) { |
1828 | var ord_prom = th.data.order_prom[bn_pick]; | 1831 | var ord_prom = th.data.order_prom[bn_pick]; |
1829 | - order_prom_id = ord_prom['id']; | ||
1830 | - switch (ord_prom['type']) { | ||
1831 | - case 0: | ||
1832 | - order_m = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 | ||
1833 | - order_prom_amount = (ord_price - order_m).toFixed(2); | ||
1834 | - break; | ||
1835 | - case 1: | ||
1836 | - order_m = ord_price - ord_prom['expression'];//满额优惠金额 | ||
1837 | - order_prom_amount = ord_prom['expression']; | ||
1838 | - break; | 1832 | + //么有使用券,或者活动没有限制使用优惠券 |
1833 | + if(quan_price<=0 || !ord_prom.is_xz_yh) { | ||
1834 | + order_prom_id = ord_prom['id']; | ||
1835 | + switch (ord_prom['type']) { | ||
1836 | + case 0: | ||
1837 | + order_m = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 | ||
1838 | + order_prom_amount = (ord_price - order_m).toFixed(2); | ||
1839 | + break; | ||
1840 | + case 1: | ||
1841 | + order_m = ord_price - ord_prom['expression'];//满额优惠金额 | ||
1842 | + order_prom_amount = ord_prom['expression']; | ||
1843 | + break; | ||
1844 | + } | ||
1845 | + ord_price = order_m; | ||
1839 | } | 1846 | } |
1840 | - ord_price=order_m; | ||
1841 | } | 1847 | } |
1842 | 1848 | ||
1843 | //--订单优惠的显示-- | 1849 | //--订单优惠的显示-- |
pages/cart/cart2/cart2.js
@@ -1724,16 +1724,19 @@ Page({ | @@ -1724,16 +1724,19 @@ Page({ | ||
1724 | }).then(res => { | 1724 | }).then(res => { |
1725 | if (res.data.code == 0) { | 1725 | if (res.data.code == 0) { |
1726 | var ord_prom = res.data.data; | 1726 | var ord_prom = res.data.data; |
1727 | - order_prom_id = ord_prom['id']; | ||
1728 | - switch (ord_prom['type']) { | ||
1729 | - case 0: | ||
1730 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1731 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1732 | - break; | ||
1733 | - case 1: | ||
1734 | - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1735 | - order_prom_amount = ord_prom['expression']; | ||
1736 | - break; | 1727 | + //么有使用券,或者活动没有限制使用优惠券 |
1728 | + if(quan_price<=0 || !ord_prom.is_xz_yh) { | ||
1729 | + order_prom_id = ord_prom['id']; | ||
1730 | + switch (ord_prom['type']) { | ||
1731 | + case 0: | ||
1732 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1733 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
1734 | + break; | ||
1735 | + case 1: | ||
1736 | + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
1737 | + order_prom_amount = ord_prom['expression']; | ||
1738 | + break; | ||
1739 | + } | ||
1737 | } | 1740 | } |
1738 | } | 1741 | } |
1739 | }) | 1742 | }) |
@@ -2079,16 +2082,19 @@ Page({ | @@ -2079,16 +2082,19 @@ Page({ | ||
2079 | var order_prom_id = 0; | 2082 | var order_prom_id = 0; |
2080 | if (th.data.order_prom[th.data.bn_pick]) { | 2083 | if (th.data.order_prom[th.data.bn_pick]) { |
2081 | var ord_prom = th.data.order_prom[th.data.bn_pick]; | 2084 | var ord_prom = th.data.order_prom[th.data.bn_pick]; |
2082 | - order_prom_id = ord_prom['id']; | ||
2083 | - switch (ord_prom['type']) { | ||
2084 | - case 0: | ||
2085 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
2086 | - order_prom_amount = (o_condition - order_m).toFixed(2); | ||
2087 | - break; | ||
2088 | - case 1: | ||
2089 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
2090 | - order_prom_amount = ord_prom['expression']; | ||
2091 | - break; | 2085 | + //么有使用券,或者活动没有限制使用优惠券 |
2086 | + if(coupon_price<=0 || !ord_prom.is_xz_yh) { | ||
2087 | + order_prom_id = ord_prom['id']; | ||
2088 | + switch (ord_prom['type']) { | ||
2089 | + case 0: | ||
2090 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
2091 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
2092 | + break; | ||
2093 | + case 1: | ||
2094 | + order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
2095 | + order_prom_amount = ord_prom['expression']; | ||
2096 | + break; | ||
2097 | + } | ||
2092 | } | 2098 | } |
2093 | } | 2099 | } |
2094 | //--订单优惠的显示-- | 2100 | //--订单优惠的显示-- |
pages/index/index/index.js
@@ -83,18 +83,39 @@ Page({ | @@ -83,18 +83,39 @@ Page({ | ||
83 | sec_show: 3, //倒计时的秒数 | 83 | sec_show: 3, //倒计时的秒数 |
84 | full_ad: null, //全屏广告 | 84 | full_ad: null, //全屏广告 |
85 | full_screen: 0, //全屏广告 | 85 | full_screen: 0, //全屏广告 |
86 | + is_ok_h5:0, //判断要不要显示关注二维码 | ||
86 | 87 | ||
87 | }, | 88 | }, |
88 | 89 | ||
89 | onLoad: async function (tt) { | 90 | onLoad: async function (tt) { |
90 | // onLoad生命周期内判断 | 91 | // onLoad生命周期内判断 |
91 | let obj = wx.getLaunchOptionsSync(); | 92 | let obj = wx.getLaunchOptionsSync(); |
92 | - console.log(obj.scene,'launch_scene'); | ||
93 | - if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || | ||
94 | - obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038) { | ||
95 | - this.setData({is_ok_h5:1}) | 93 | + //扫码登陆,强行 |
94 | + if(tt.scancode_time){ | ||
95 | + this.setData({is_ok_h5:1}) | ||
96 | + wx.setStorageSync('launch', obj.scene); | ||
97 | + }else{ | ||
98 | + var cache_scene= wx.setStorageSync('launch'); | ||
99 | + //看一下有没有缓存,没有缓存,或者缓存的值不一样,就开始判断公众号关注组件 | ||
100 | + if(!cache_scene || cache_scene!=obj.scene){ | ||
101 | + if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || | ||
102 | + obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038 || tt.scancode_time) { | ||
103 | + this.setData({is_ok_h5:1}) | ||
104 | + wx.setStorageSync('launch', obj.scene); | ||
105 | + }else{ | ||
106 | + this.setData({is_ok_h5:0}) | ||
107 | + wx.setStorageSync('launch',0); | ||
108 | + } | ||
109 | + }else{ | ||
110 | + this.setData({is_ok_h5:0}) | ||
111 | + wx.setStorageSync('launch',0); | ||
112 | + } | ||
113 | + | ||
96 | } | 114 | } |
97 | 115 | ||
116 | + | ||
117 | + | ||
118 | + | ||
98 | var th = this; | 119 | var th = this; |
99 | var first_leader = tt.first_leader; | 120 | var first_leader = tt.first_leader; |
100 | if (!first_leader && tt.scene) { | 121 | if (!first_leader && tt.scene) { |