Commit 4e839bd6ca149c4d26ed10e4af96b1ac7fe9133d
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
10 changed files
with
174 additions
and
85 deletions
packageA/pages/checkin/checkin.wxml
1 | -<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | |
1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | |
2 | 2 | <wxs module="g_filter" src="g_filter.wxs"></wxs> |
3 | 3 | <wxs src="checkin.wxs" module="myUtil"></wxs> |
4 | 4 | <view class="checkin-container"> |
... | ... | @@ -7,9 +7,7 @@ |
7 | 7 | <view class="points" bindtap="goto" data-url="/pages/user/integral/integral"> |
8 | 8 | <image class="coin" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/coins.png"></image>我的积分 |
9 | 9 | </view> |
10 | - | |
11 | 10 | </view> |
12 | - | |
13 | 11 | <view class="list flex" wx:if="{{res}}"> |
14 | 12 | <view class="list-item active}}"> |
15 | 13 | <view class="circle">+{{res.cday1}}</view> | ... | ... |
packageA/pages/checkin/g_filter.wxs
0 → 100644
1 | +var g_filters = { | |
2 | + has_char:function(url,key){ | |
3 | + if(!url) return -1; | |
4 | + return url.indexOf(key); | |
5 | + }, | |
6 | + beg_time:function(beg_date){ | |
7 | + var fmt1 = beg_date.substring(0, 19); | |
8 | + var reg = getRegExp("-", "g"); | |
9 | + var fmt2 = fmt1.replace(reg, '/'); | |
10 | + var t1 = getDate(fmt2); | |
11 | + var tnow=getDate(); | |
12 | + if(t1<=tnow) return 1; | |
13 | + return 0; | |
14 | + }, | |
15 | + end_time:function(end_date){ | |
16 | + var fmt1 = end_date.substring(0, 19); | |
17 | + var reg = getRegExp("-", "g"); | |
18 | + var fmt2 = fmt1.replace(reg, '/'); | |
19 | + var t1 = getDate(fmt2); | |
20 | + var tnow=getDate(); | |
21 | + if(t1>=tnow) return 1; | |
22 | + return 0; | |
23 | + }, | |
24 | + goToUrl: function(type, id, name) { | |
25 | + if (type == 1) { | |
26 | + return "/packageB/pages/zuhegou/index/index?id="+id+"&title="+name | |
27 | + } else { | |
28 | + return "/packageB/pages/zuhegou/preIndex/index?id="+id+"&title="+name | |
29 | + } | |
30 | + }, | |
31 | + | |
32 | +} | |
33 | +module.exports = { | |
34 | + has_char: g_filters.has_char, | |
35 | + beg_time: g_filters.beg_time, | |
36 | + end_time: g_filters.end_time, | |
37 | + goToUrl: g_filters.goToUrl, | |
38 | +} | |
0 | 39 | \ No newline at end of file | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... | ... | @@ -1605,16 +1605,19 @@ Page({ |
1605 | 1605 | }).then(res => { |
1606 | 1606 | if (res.data.code == 0) { |
1607 | 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 | 1958 | var order_prom_id = 0; |
1956 | 1959 | if (th.data.order_prom[th.data.bn_pick]) { |
1957 | 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 | 1508 | }).then(res => { |
1509 | 1509 | if (res.data.code == 0) { |
1510 | 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 | 1858 | var order_prom_id = 0; |
1856 | 1859 | if (th.data.order_prom[th.data.bn_pick]) { |
1857 | 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 | 700 | } |
701 | 701 | } |
702 | 702 | //--订单优惠的显示-- |
703 | + var order_prom_txt1 = "order_prom_id"; | |
704 | + var order_prom_txt2 = "order_prom_amount"; | |
703 | 705 | if (order_prom_id > 0) { |
704 | - var order_prom_txt1 = "order_prom_id"; | |
705 | - var order_prom_txt2 = "order_prom_amount"; | |
706 | 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 | 712 | o_condition1=parseFloat(o_condition1)-parseFloat(th.data.presell.presell_deposit); |
... | ... | @@ -1826,18 +1829,21 @@ Page({ |
1826 | 1829 | var order_m=0; |
1827 | 1830 | if (th.data.order_prom[bn_pick]) { |
1828 | 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/activity/seckill_list/seckill_list.js
pages/cart/cart2/cart2.js
... | ... | @@ -1733,16 +1733,19 @@ Page({ |
1733 | 1733 | }).then(res => { |
1734 | 1734 | if (res.data.code == 0) { |
1735 | 1735 | var ord_prom = res.data.data; |
1736 | - order_prom_id = ord_prom['id']; | |
1737 | - switch (ord_prom['type']) { | |
1738 | - case 0: | |
1739 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | |
1740 | - order_prom_amount = (o_condition - order_m).toFixed(2); | |
1741 | - break; | |
1742 | - case 1: | |
1743 | - //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
1744 | - order_prom_amount = ord_prom['expression']; | |
1745 | - break; | |
1736 | + //么有使用券,或者活动没有限制使用优惠券 | |
1737 | + if(quan_price<=0 || !ord_prom.is_xz_yh) { | |
1738 | + order_prom_id = ord_prom['id']; | |
1739 | + switch (ord_prom['type']) { | |
1740 | + case 0: | |
1741 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | |
1742 | + order_prom_amount = (o_condition - order_m).toFixed(2); | |
1743 | + break; | |
1744 | + case 1: | |
1745 | + //order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
1746 | + order_prom_amount = ord_prom['expression']; | |
1747 | + break; | |
1748 | + } | |
1746 | 1749 | } |
1747 | 1750 | } |
1748 | 1751 | }) |
... | ... | @@ -2088,16 +2091,19 @@ Page({ |
2088 | 2091 | var order_prom_id = 0; |
2089 | 2092 | if (th.data.order_prom[th.data.bn_pick]) { |
2090 | 2093 | var ord_prom = th.data.order_prom[th.data.bn_pick]; |
2091 | - order_prom_id = ord_prom['id']; | |
2092 | - switch (ord_prom['type']) { | |
2093 | - case 0: | |
2094 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | |
2095 | - order_prom_amount = (o_condition - order_m).toFixed(2); | |
2096 | - break; | |
2097 | - case 1: | |
2098 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
2099 | - order_prom_amount = ord_prom['expression']; | |
2100 | - break; | |
2094 | + //么有使用券,或者活动没有限制使用优惠券 | |
2095 | + if(coupon_price<=0 || !ord_prom.is_xz_yh) { | |
2096 | + order_prom_id = ord_prom['id']; | |
2097 | + switch (ord_prom['type']) { | |
2098 | + case 0: | |
2099 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | |
2100 | + order_prom_amount = (o_condition - order_m).toFixed(2); | |
2101 | + break; | |
2102 | + case 1: | |
2103 | + order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
2104 | + order_prom_amount = ord_prom['expression']; | |
2105 | + break; | |
2106 | + } | |
2101 | 2107 | } |
2102 | 2108 | } |
2103 | 2109 | //--订单优惠的显示-- | ... | ... |
pages/index/index/index.js
... | ... | @@ -83,18 +83,39 @@ Page({ |
83 | 83 | sec_show: 3, //倒计时的秒数 |
84 | 84 | full_ad: null, //全屏广告 |
85 | 85 | full_screen: 0, //全屏广告 |
86 | + is_ok_h5:0, //判断要不要显示关注二维码 | |
86 | 87 | |
87 | 88 | }, |
88 | 89 | |
89 | 90 | onLoad: async function (tt) { |
90 | 91 | // onLoad生命周期内判断 |
91 | 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 | 119 | var th = this; |
99 | 120 | var first_leader = tt.first_leader; |
100 | 121 | if (!first_leader && tt.scene) { | ... | ... |
pages/user/coupons/coupons.wxml
... | ... | @@ -81,7 +81,8 @@ |
81 | 81 | </view> |
82 | 82 | </view> |
83 | 83 | <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> |
84 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?',不包邮地区:'+detail.title:''}}</text> | |
84 | + <!--<text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?',不包邮地区:'+detail.title:''}}</text>--> | |
85 | + <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}"><text style="margin-right: 15rpx">使用说明:</text>购买礼包得优惠券【消费满{{time.toFix(detail.condition,2)}}元可用】</text> | |
85 | 86 | </view> |
86 | 87 | </block> |
87 | 88 | |
... | ... | @@ -107,8 +108,8 @@ |
107 | 108 | </view> |
108 | 109 | </view> |
109 | 110 | <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> |
110 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1}}">{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</text> | |
111 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else>使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}</text> | |
111 | + <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1!=''}}"><text style="margin-right: 15rpx">使用说明:</text>{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}}</view> | |
112 | + <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else><text style="margin-right: 15rpx">使用说明:</text> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}</view> | |
112 | 113 | </view> |
113 | 114 | </block> |
114 | 115 | </view> | ... | ... |