Commit 2d90d4d3828b8bdf27bf712996fb87f14c21a730
1 parent
766d333f
组合购使用优惠券问题
Showing
6 changed files
with
107 additions
and
109 deletions
custom-tab-bar/index.js
@@ -12,7 +12,6 @@ Component({ | @@ -12,7 +12,6 @@ Component({ | ||
12 | 12 | ||
13 | lifetimes: { | 13 | lifetimes: { |
14 | attached: function() { | 14 | attached: function() { |
15 | - | ||
16 | var th=this; | 15 | var th=this; |
17 | getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ | 16 | getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ |
18 | var dis=rs.data.data; | 17 | var dis=rs.data.data; |
@@ -99,7 +98,7 @@ Component({ | @@ -99,7 +98,7 @@ Component({ | ||
99 | //设置自定义页面的列表 | 98 | //设置自定义页面的列表 |
100 | set_list:function(data){ | 99 | set_list:function(data){ |
101 | var itemList = data.data; | 100 | var itemList = data.data; |
102 | - itemList = JSON.parse(itemList); | 101 | + itemList = JSON.parse(itemList); |
103 | this.setData({ | 102 | this.setData({ |
104 | list:itemList, | 103 | list:itemList, |
105 | backgroundColor: data.bkcolor, | 104 | backgroundColor: data.bkcolor, |
pages/cart/cart2/cart2.js
@@ -3855,15 +3855,20 @@ Page({ | @@ -3855,15 +3855,20 @@ Page({ | ||
3855 | if (prom_pt_json) { | 3855 | if (prom_pt_json) { |
3856 | for (let oj in prom_pt_json) { | 3856 | for (let oj in prom_pt_json) { |
3857 | let item_j = prom_pt_json[oj]; | 3857 | let item_j = prom_pt_json[oj]; |
3858 | - | ||
3859 | //要对一下阶梯优惠促销的功能 | 3858 | //要对一下阶梯优惠促销的功能 |
3860 | if (item_j.ladder_prom_id) { | 3859 | if (item_j.ladder_prom_id) { |
3861 | - | ||
3862 | //看一下要不要限制使用优惠券 | 3860 | //看一下要不要限制使用优惠券 |
3863 | if (th.data.ladder_map[item_j.ladder_prom_id] && th.data.ladder_map[item_j.ladder_prom_id].is_usecoupon) { | 3861 | if (th.data.ladder_map[item_j.ladder_prom_id] && th.data.ladder_map[item_j.ladder_prom_id].is_usecoupon) { |
3864 | continue; | 3862 | continue; |
3865 | } | 3863 | } |
3866 | - | 3864 | + cut_price += parseFloat(item_j.dis); |
3865 | + } | ||
3866 | + //要对一下组合购促销的功能 | ||
3867 | + if (item_j.zhprom_id) { | ||
3868 | + //看一下要不要限制使用优惠券 | ||
3869 | + if (th.data.zhhe_act_map[item_j.zhprom_id] && th.data.zhhe_act_map[item_j.zhprom_id].is_xz_yh) { | ||
3870 | + continue; | ||
3871 | + } | ||
3867 | cut_price += parseFloat(item_j.dis); | 3872 | cut_price += parseFloat(item_j.dis); |
3868 | } | 3873 | } |
3869 | } | 3874 | } |
pages/goods/search/g_filter.wxs
1 | var g_filters = { | 1 | var g_filters = { |
2 | - //-- 判断是不是有等级价 -- | ||
3 | - is_has_rank:function(rank_switch,item){ | ||
4 | - if(!rank_switch) return false; | ||
5 | - if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} | ||
6 | - return false; | ||
7 | - }, | ||
8 | - | ||
9 | - //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | ||
10 | - get_card_price:function(goods,all_card,type){ | ||
11 | - var price1=parseFloat(goods['cardprice1']); | ||
12 | - var price2=parseFloat(goods['cardprice2']); | ||
13 | - var price3=parseFloat(goods['cardprice3']); | ||
14 | - if(!all_card){ | ||
15 | - if(type==0) return 0; | ||
16 | - return ""; | ||
17 | - } | ||
18 | - | ||
19 | - var arr=[]; | ||
20 | - var min_price= 0; | ||
21 | - var min_name=""; | ||
22 | - | ||
23 | - var min_price=null; | ||
24 | - var min_name=null; | ||
25 | - //---设置对应的价格名字---- | ||
26 | - for(var i=0;i<3;i++) { | ||
27 | - var vl=all_card[i]; | ||
28 | - if(!vl) continue; | ||
29 | - if(vl['CorrPrice']=="Price1" && price1>0) | ||
30 | - { | ||
31 | - if(min_price==null) { | ||
32 | - min_price=price1;min_name=vl['CardName']; | ||
33 | - } | ||
34 | - else if(price1<min_price) { | ||
35 | - min_price=price1;min_name=vl['CardName']; | ||
36 | - } | ||
37 | - } | ||
38 | - if(vl['CorrPrice']=="Price2" && price2>0) | ||
39 | - { | ||
40 | - if(min_price==null) { | ||
41 | - min_price=price2;min_name=vl['CardName']; | ||
42 | - } | ||
43 | - else if(price2<min_price) { | ||
44 | - min_price=price2;min_name=vl['CardName']; | ||
45 | - } | ||
46 | - } | ||
47 | - | ||
48 | - if(vl['CorrPrice']=="Price3" && price3>0) | ||
49 | - { | ||
50 | - if(min_price==null) { | ||
51 | - min_price=price3;min_name=vl['CardName']; | ||
52 | - } | ||
53 | - else if(price3<min_price) { | ||
54 | - min_price=price3;min_name=vl['CardName']; | ||
55 | - } | ||
56 | - } | ||
57 | - | ||
58 | - } | ||
59 | - if(min_price==null){ | ||
60 | - if(type==0) return 0; | ||
61 | - return ""; | ||
62 | - } | ||
63 | - | ||
64 | - //if(type==0) return arr.length; | ||
65 | - //--进行排序,升序--- | ||
66 | - /*--- | ||
67 | - arr.sort(function(a,b){ | ||
68 | - if (a.price < b.price) { | ||
69 | - return -1; | ||
70 | - } else if (a.fee == b.fee) { | ||
71 | - return 0; | ||
72 | - } else { | ||
73 | - return 1; | ||
74 | - } | ||
75 | - })--*/ | ||
76 | - //-- 获取最下价钱,和相应的卡的名称 -- | ||
77 | - //min_price=min.price; | ||
78 | - //min_name=min.name; | ||
79 | - if(type==0) return min_price.toFixed(2); | ||
80 | - if(min_name.length>7 ) min_name=min_name.substring(0, 8); | ||
81 | - return min_name; | ||
82 | - }, | 2 | + //-- 判断是不是有等级价 -- |
3 | + is_has_rank: function (rank_switch, item) { | ||
4 | + if (!rank_switch) return false; | ||
5 | + if (item.cardprice1 || item.cardprice2 || item.cardprice3) { return true } | ||
6 | + return false; | ||
7 | + }, | ||
83 | 8 | ||
9 | + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | ||
10 | + get_card_price: function (goods, all_card, type) { | ||
11 | + var price1 = parseFloat(goods['cardprice1']); | ||
12 | + var price2 = parseFloat(goods['cardprice2']); | ||
13 | + var price3 = parseFloat(goods['cardprice3']); | ||
14 | + if (!all_card) { | ||
15 | + if (type == 0) return 0; | ||
16 | + return ""; | ||
17 | + } | ||
84 | 18 | ||
85 | - get_goods_url:function(item){ | 19 | + var arr = []; |
20 | + var min_price = 0; | ||
21 | + var min_name = ""; | ||
86 | 22 | ||
87 | - var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id | ||
88 | - // 预售活动 | ||
89 | - if(item.prom_type==8){ | ||
90 | - url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id | ||
91 | - } | ||
92 | - // 如果是幸运购活动商品 | ||
93 | - if(item.prom_type == 9){ | ||
94 | - url1 = "/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=" + item.goods_id + "&group_id=" + item.prom_id | ||
95 | - } | ||
96 | - | ||
97 | - if(item.prom_type==1 && item.prom_id>0){ | ||
98 | - url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1"; | ||
99 | - } | ||
100 | - return url1; | ||
101 | - } | 23 | + var min_price = null; |
24 | + var min_name = null; | ||
25 | + //---设置对应的价格名字---- | ||
26 | + for (var i = 0; i < 3; i++) { | ||
27 | + var vl = all_card[i]; | ||
28 | + if (!vl) continue; | ||
29 | + if (vl['CorrPrice'] == "Price1" && price1 > 0) { | ||
30 | + if (min_price == null) { | ||
31 | + min_price = price1; min_name = vl['CardName']; | ||
32 | + } | ||
33 | + else if (price1 < min_price) { | ||
34 | + min_price = price1; min_name = vl['CardName']; | ||
35 | + } | ||
36 | + } | ||
37 | + if (vl['CorrPrice'] == "Price2" && price2 > 0) { | ||
38 | + if (min_price == null) { | ||
39 | + min_price = price2; min_name = vl['CardName']; | ||
40 | + } | ||
41 | + else if (price2 < min_price) { | ||
42 | + min_price = price2; min_name = vl['CardName']; | ||
43 | + } | ||
44 | + } | ||
45 | + | ||
46 | + if (vl['CorrPrice'] == "Price3" && price3 > 0) { | ||
47 | + if (min_price == null) { | ||
48 | + min_price = price3; min_name = vl['CardName']; | ||
49 | + } | ||
50 | + else if (price3 < min_price) { | ||
51 | + min_price = price3; min_name = vl['CardName']; | ||
52 | + } | ||
53 | + } | ||
54 | + | ||
55 | + } | ||
56 | + if (min_price == null) { | ||
57 | + if (type == 0) return 0; | ||
58 | + return ""; | ||
59 | + } | ||
60 | + | ||
61 | + //if(type==0) return arr.length; | ||
62 | + //--进行排序,升序--- | ||
63 | + /*--- | ||
64 | + arr.sort(function(a,b){ | ||
65 | + if (a.price < b.price) { | ||
66 | + return -1; | ||
67 | + } else if (a.fee == b.fee) { | ||
68 | + return 0; | ||
69 | + } else { | ||
70 | + return 1; | ||
71 | + } | ||
72 | + })--*/ | ||
73 | + //-- 获取最下价钱,和相应的卡的名称 -- | ||
74 | + //min_price=min.price; | ||
75 | + //min_name=min.name; | ||
76 | + if (type == 0) return min_price.toFixed(2); | ||
77 | + if (min_name.length > 7) min_name = min_name.substring(0, 8); | ||
78 | + return min_name; | ||
79 | + }, | ||
80 | + | ||
81 | + | ||
82 | + get_goods_url: function (item) { | ||
83 | + | ||
84 | + var url1 = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id | ||
85 | + // 预售活动 | ||
86 | + if (item.prom_type == 8) { | ||
87 | + url1 = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + item.goods_id + "&prom_id=" + item.prom_id | ||
88 | + } | ||
89 | + // 如果是幸运购活动商品 | ||
90 | + if (item.prom_type == 9) { | ||
91 | + url1 = "/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=" + item.goods_id + "&group_id=" + item.prom_id | ||
92 | + } | ||
93 | + | ||
94 | + if (item.prom_type == 1 && item.prom_id > 0) { | ||
95 | + url1 = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id + "&prom_id=" + item.prom_id + "&prom_type=1"; | ||
96 | + } | ||
97 | + return url1; | ||
98 | + } | ||
102 | } | 99 | } |
103 | 100 | ||
104 | module.exports = { | 101 | module.exports = { |
105 | - is_has_rank:g_filters.is_has_rank, | ||
106 | - get_card_price:g_filters.get_card_price, | ||
107 | - get_goods_url:g_filters.get_goods_url | 102 | + is_has_rank: g_filters.is_has_rank, |
103 | + get_card_price: g_filters.get_card_price, | ||
104 | + get_goods_url: g_filters.get_goods_url | ||
108 | } | 105 | } |
109 | \ No newline at end of file | 106 | \ No newline at end of file |
pages/index/index/index.js
pages/user/address_list/address_list.js
@@ -56,10 +56,8 @@ Page({ | @@ -56,10 +56,8 @@ Page({ | ||
56 | var arr1 = e.data.addresses; | 56 | var arr1 = e.data.addresses; |
57 | var arr2 = t.data.data.pageData; | 57 | var arr2 = t.data.data.pageData; |
58 | var arr3 = [...arr1, ...arr2]; | 58 | var arr3 = [...arr1, ...arr2]; |
59 | - | ||
60 | var ismore = 0; | 59 | var ismore = 0; |
61 | if (arr3.length == t.data.data.total) ismore = 1 | 60 | if (arr3.length == t.data.data.total) ismore = 1 |
62 | - | ||
63 | e.setData({ | 61 | e.setData({ |
64 | addresses: arr3, total: t.data.data.total, ismore: ismore, | 62 | addresses: arr3, total: t.data.data.total, ismore: ismore, |
65 | is_address_read:1 | 63 | is_address_read:1 |
pages/user/address_list/address_list.wxml
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | <view class="address-box"> | 32 | <view class="address-box"> |
33 | 33 | ||
34 | <!-- 单个收货地址框架 --> | 34 | <!-- 单个收货地址框架 --> |
35 | - <view class="address-user" wx:for="{{addresses}}" wx:key="{{index}}"> | 35 | + <view class="address-user" wx:for="{{addresses}}" wx:key="index"> |
36 | <!-- 选择icon | 36 | <!-- 选择icon |
37 | <view class="icon"> | 37 | <view class="icon"> |
38 | <icon type="success" color="red" size="33rpx" wx:if="{{item.is_pickup==1}}" bindtap="add_is_pickup" data-icon="{{index}}"></icon> | 38 | <icon type="success" color="red" size="33rpx" wx:if="{{item.is_pickup==1}}" bindtap="add_is_pickup" data-icon="{{index}}"></icon> |