Commit 3b65f194c0d310e50371417984bf5f0877c0dec2
1 parent
54e017d3
等级价显示的过滤器, 购物车价格变化的修复,购买等级卡, 首页的等级价显示, 我的收藏的等级价的显示
Showing
19 changed files
with
138 additions
and
151 deletions
components/goods_list/g_filter.wxs
@@ -8,9 +8,9 @@ var g_filters = { | @@ -8,9 +8,9 @@ var g_filters = { | ||
8 | 8 | ||
9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | 9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- |
10 | get_card_price:function(goods,all_card,type){ | 10 | get_card_price:function(goods,all_card,type){ |
11 | - var price1=parseInt(goods['cardprice1']); | ||
12 | - var price2=parseInt(goods['cardprice2']); | ||
13 | - var price3=parseInt(goods['cardprice3']); | 11 | + var price1=parseFloat(goods['cardprice1']); |
12 | + var price2 = parseFloat(goods['cardprice2']); | ||
13 | + var price3 = parseFloat(goods['cardprice3']); | ||
14 | if(!all_card){ | 14 | if(!all_card){ |
15 | if(type==0) return 0; | 15 | if(type==0) return 0; |
16 | return ""; | 16 | return ""; |
components/goods_list/goods_list.js
@@ -18,77 +18,87 @@ Component({ | @@ -18,77 +18,87 @@ Component({ | ||
18 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | 18 | // 这里定义了innerText属性,属性值可以在组件使用时指定 |
19 | }, | 19 | }, |
20 | ready: function () { | 20 | ready: function () { |
21 | - var th=this; | ||
22 | - getApp().getConfig2(function(e){ | ||
23 | - var swithc_list=e.switch_list; | ||
24 | - var sw_arr=JSON.parse(swithc_list); | ||
25 | - //---如果后台又开等级卡的开关--- | ||
26 | - if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){ | ||
27 | - th.setData({rank_switch:true}); | ||
28 | - var user=getApp().globalData.userInfo; | ||
29 | - var ti=setInterval(function(){ | ||
30 | - if(!user) return false; | ||
31 | - clearInterval(ti); | ||
32 | - //---回调卡的列表--- | ||
33 | - th.getPlusCardType(function(ob){ | ||
34 | - th.setData({card_list:ob.card_list}); | ||
35 | - if(user.card_field ){ | ||
36 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
37 | - var end = new Date(str); | ||
38 | - end = Date.parse(end) / 1000; | ||
39 | - var now = ut.gettimestamp(); | ||
40 | - | ||
41 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
42 | - if(user.card_field && now<end){ | ||
43 | - var card_name=ob.name_map.get(user.card_field); | ||
44 | - if(card_name.length>4) card_name=card_name.substring(0,4); | ||
45 | - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list}); | ||
46 | - } | ||
47 | - } | ||
48 | - }) | ||
49 | - },500) | ||
50 | - } | ||
51 | - }) | ||
52 | - | 21 | + |
53 | }, | 22 | }, |
54 | 23 | ||
24 | + methods: { | ||
25 | + init:function(){ | ||
26 | + var th = this; | ||
27 | + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { | ||
28 | + success: function (e) { | ||
29 | + getApp().globalData.userInfo = e.data.data; | ||
30 | + getApp().getConfig2(function (e) { | ||
31 | + var swithc_list = e.switch_list; | ||
32 | + var sw_arr = JSON.parse(swithc_list); | ||
33 | + //---如果后台又开等级卡的开关--- | ||
34 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
35 | + th.setData({ rank_switch: true }); | ||
36 | + var user = getApp().globalData.userInfo; | ||
37 | + var ti = setInterval(function () { | ||
38 | + if (!user) return false; | ||
39 | + clearInterval(ti); | ||
40 | + //---回调卡的列表--- | ||
41 | + th.getPlusCardType(function (ob) { | ||
42 | + th.setData({ card_list: ob.card_list }); | ||
43 | + if (user.card_field) { | ||
44 | + var str = user['card_expiredate'].replace(/-/g, '/'); | ||
45 | + var end = new Date(str); | ||
46 | + end = Date.parse(end) / 1000; | ||
47 | + var now = ut.gettimestamp(); | ||
55 | 48 | ||
56 | - methods: { | ||
57 | - | ||
58 | - get_list:function(){ | 49 | + //--- 判断是等级会员,且在有效期范围内 --- |
50 | + if (user.card_field && now < end) { | ||
51 | + var card_name = ob.name_map.get(user.card_field); | ||
52 | + if (card_name.length > 4) card_name = card_name.substring(0, 4); | ||
53 | + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); | ||
54 | + } | ||
55 | + } | ||
56 | + }) | ||
57 | + }, 500) | ||
58 | + } | ||
59 | + }) | ||
60 | + } | ||
61 | + }) | ||
62 | + | ||
63 | + }, | ||
64 | + | ||
65 | + | ||
66 | + get_list:function(){ | ||
59 | var that = this; | 67 | var that = this; |
60 | - if(that.data.is_no_more==0) return false; | 68 | + if (that.data.is_no_more == 0) return false; |
61 | var curPage = that.data.curPage; | 69 | var curPage = that.data.curPage; |
62 | - getApp().request.get('/api/weshop/goods/page?page',{ | ||
63 | - data: { is_mainshow: 1, isonsale: 1, | ||
64 | - is_recommend: 1, is_on_sale: 1, | 70 | + getApp().request.get('/api/weshop/goods/page?page', { |
71 | + data: { | ||
72 | + is_mainshow: 1, isonsale: 1, | ||
73 | + is_recommend: 1, is_on_sale: 1, | ||
65 | store_id: o.stoid, | 74 | store_id: o.stoid, |
66 | page: curPage, | 75 | page: curPage, |
67 | - pageSize:6, | ||
68 | - }, | ||
69 | - success: function (res){ | ||
70 | - var data=res.data; | ||
71 | - var total=data.data.total; | ||
72 | - if (total <= curPage*6){ | ||
73 | - that.setData({ is_no_more: 0 }); | ||
74 | - }else{ | ||
75 | - that.data.curPage++; | 76 | + pageSize: 6, |
77 | + }, | ||
78 | + success: function (res) { | ||
79 | + var data = res.data; | ||
80 | + var total = data.data.total; | ||
81 | + if (total <= curPage * 6) { | ||
82 | + that.setData({ is_no_more: 0 }); | ||
83 | + } else { | ||
84 | + that.data.curPage++; | ||
76 | } | 85 | } |
77 | - | 86 | + |
78 | //加载完成 | 87 | //加载完成 |
79 | if (data.data.pageData) { | 88 | if (data.data.pageData) { |
80 | - that.setData({load_complete:1}); | 89 | + that.setData({ load_complete: 1 }); |
81 | } | 90 | } |
82 | - if(that.data.recommend!=null){ | ||
83 | - var ra=that.data.recommend.concat(data.data.pageData); | 91 | + if (that.data.recommend != null) { |
92 | + var ra = that.data.recommend.concat(data.data.pageData); | ||
84 | that.setData({ recommend: ra }); | 93 | that.setData({ recommend: ra }); |
85 | - }else{ | ||
86 | - that.setData({recommend:data.data.pageData}); | 94 | + } else { |
95 | + that.setData({ recommend: data.data.pageData }); | ||
87 | } | 96 | } |
88 | - } | ||
89 | - }) | 97 | + } |
98 | + }) | ||
90 | }, | 99 | }, |
91 | - | 100 | + |
101 | + | ||
92 | bind_bnerr_xc: function (e) { | 102 | bind_bnerr_xc: function (e) { |
93 | var _errImg = e.target.dataset.errorimg; | 103 | var _errImg = e.target.dataset.errorimg; |
94 | var _errurl = e.target.dataset.url; | 104 | var _errurl = e.target.dataset.url; |
@@ -114,7 +124,7 @@ Component({ | @@ -114,7 +124,7 @@ Component({ | ||
114 | var name="card"+plusCard[i].CorrPrice.toLowerCase(); | 124 | var name="card"+plusCard[i].CorrPrice.toLowerCase(); |
115 | card_name_map.set(name,plusCard[i].CardName); | 125 | card_name_map.set(name,plusCard[i].CardName); |
116 | } | 126 | } |
117 | - | 127 | + |
118 | var ob={"card_list":plusCard,"name_map":card_name_map}; | 128 | var ob={"card_list":plusCard,"name_map":card_name_map}; |
119 | func(ob); | 129 | func(ob); |
120 | }) | 130 | }) |
pages/cart/cart/cart.js
@@ -705,10 +705,14 @@ Page({ | @@ -705,10 +705,14 @@ Page({ | ||
705 | if (g_arr[i].goods_id == val.goods_id) { | 705 | if (g_arr[i].goods_id == val.goods_id) { |
706 | 706 | ||
707 | //如果会员是等级会员,商品有等级价,且不是活动商品 | 707 | //如果会员是等级会员,商品有等级价,且不是活动商品 |
708 | - if(card_field && val[card_field]>0 && val.prom_type==0 ){ | ||
709 | - | 708 | + if(card_field && val[card_field]>0 && (val.prom_type==0 || val.prom_type==3 || val.prom_type==4 || val.prom_type==5) ){ |
709 | + if (g_arr[i].goods_price != val[card_field]){ | ||
710 | + isok = 0; | ||
711 | + gname = val.goods_name; | ||
712 | + throw "商品价格已经变化"; | ||
713 | + } | ||
710 | }else{ | 714 | }else{ |
711 | - if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) { | 715 | + if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) { |
712 | isok = 0; | 716 | isok = 0; |
713 | gname = val.goods_name; | 717 | gname = val.goods_name; |
714 | throw "商品价格已经变化"; | 718 | throw "商品价格已经变化"; |
pages/cart/cart2/cart2.js
@@ -414,6 +414,7 @@ Page({ | @@ -414,6 +414,7 @@ Page({ | ||
414 | case 2: | 414 | case 2: |
415 | case 3: | 415 | case 3: |
416 | case 4: | 416 | case 4: |
417 | + case 5: | ||
417 | case 6: | 418 | case 6: |
418 | //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的, | 419 | //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的, |
419 | // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券-- | 420 | // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券-- |
pages/goods/goodsInfo/g_filter.wxs
@@ -8,9 +8,9 @@ var g_filters = { | @@ -8,9 +8,9 @@ var g_filters = { | ||
8 | 8 | ||
9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | 9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- |
10 | get_card_price:function(goods,all_card,type){ | 10 | get_card_price:function(goods,all_card,type){ |
11 | - var price1=parseInt(goods['cardprice1']); | ||
12 | - var price2=parseInt(goods['cardprice2']); | ||
13 | - var price3=parseInt(goods['cardprice3']); | 11 | + var price1=parseFloat(goods['cardprice1']); |
12 | + var price2=parseFloat(goods['cardprice2']); | ||
13 | + var price3=parseFloat(goods['cardprice3']); | ||
14 | if(!all_card){ | 14 | if(!all_card){ |
15 | if(type==0) return 0; | 15 | if(type==0) return 0; |
16 | return ""; | 16 | return ""; |
pages/goods/goodsInfo/goodsInfo.js
@@ -202,7 +202,6 @@ Page({ | @@ -202,7 +202,6 @@ Page({ | ||
202 | canvasHidden: 1, | 202 | canvasHidden: 1, |
203 | 203 | ||
204 | //--推荐-- | 204 | //--推荐-- |
205 | - recommend_list: [], | ||
206 | store_config: null, | 205 | store_config: null, |
207 | is_show_pl: 0, //是否品类 | 206 | is_show_pl: 0, //是否品类 |
208 | is_show_pp: 0, //是否品牌 | 207 | is_show_pp: 0, //是否品牌 |
@@ -319,9 +318,7 @@ Page({ | @@ -319,9 +318,7 @@ Page({ | ||
319 | }) | 318 | }) |
320 | },500) | 319 | },500) |
321 | } | 320 | } |
322 | - | ||
323 | - | ||
324 | - | 321 | + |
325 | }); | 322 | }); |
326 | 323 | ||
327 | //获取用户设备信息,屏幕宽度 | 324 | //获取用户设备信息,屏幕宽度 |
@@ -496,12 +493,21 @@ Page({ | @@ -496,12 +493,21 @@ Page({ | ||
496 | mapurl: mapurl, | 493 | mapurl: mapurl, |
497 | }); | 494 | }); |
498 | 495 | ||
499 | - ee.requestRecommend(); | ||
500 | 496 | ||
501 | }, | 497 | }, |
502 | 498 | ||
503 | //---展示--- | 499 | //---展示--- |
504 | onShow: function() { | 500 | onShow: function() { |
501 | + var goods_list = null,th = this; | ||
502 | + var ui = setInterval(function () { | ||
503 | + goods_list = th.selectComponent("#goods_list"); | ||
504 | + if (goods_list) { | ||
505 | + clearInterval(ui); | ||
506 | + goods_list.init(); | ||
507 | + return false | ||
508 | + } | ||
509 | + }, 300) | ||
510 | + | ||
505 | 511 | ||
506 | this.data.is_timer = 1; | 512 | this.data.is_timer = 1; |
507 | var ee = this, | 513 | var ee = this, |
@@ -569,7 +575,7 @@ Page({ | @@ -569,7 +575,7 @@ Page({ | ||
569 | //获取门店 | 575 | //获取门店 |
570 | ee.get_sto(); | 576 | ee.get_sto(); |
571 | //获取统一条形码,普通商品和优惠促销的商品 | 577 | //获取统一条形码,普通商品和优惠促销的商品 |
572 | - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3) | 578 | + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5) |
573 | ee.get_sku(o.stoid, t.data.data.sku, gid); | 579 | ee.get_sku(o.stoid, t.data.data.sku, gid); |
574 | else { | 580 | else { |
575 | var gg = "", | 581 | var gg = "", |
@@ -638,6 +644,9 @@ Page({ | @@ -638,6 +644,9 @@ Page({ | ||
638 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); | 644 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); |
639 | 645 | ||
640 | 646 | ||
647 | + | ||
648 | + | ||
649 | + | ||
641 | 650 | ||
642 | }, | 651 | }, |
643 | enterAddress: function() { | 652 | enterAddress: function() { |
@@ -1555,13 +1564,16 @@ Page({ | @@ -1555,13 +1564,16 @@ Page({ | ||
1555 | if (this.data.activeCategoryId == 2){ | 1564 | if (this.data.activeCategoryId == 2){ |
1556 | if(!this.data.comments_no_more) this.requestComments_new(); | 1565 | if(!this.data.comments_no_more) this.requestComments_new(); |
1557 | } | 1566 | } |
1567 | + | ||
1568 | + var goods_list = this.selectComponent("#goods_list"); //组件的id | ||
1569 | + goods_list.get_list(); | ||
1558 | }, | 1570 | }, |
1559 | 1571 | ||
1560 | //--------检查是否活动,活动是否开始,或者是否结束------- | 1572 | //--------检查是否活动,活动是否开始,或者是否结束------- |
1561 | async check_prom(gid, prom_type, prom_id) { | 1573 | async check_prom(gid, prom_type, prom_id) { |
1562 | var ee = this, | 1574 | var ee = this, |
1563 | th = ee; | 1575 | th = ee; |
1564 | - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 4) { | 1576 | + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 4 || prom_type == 5) { |
1565 | this.setData({ | 1577 | this.setData({ |
1566 | prom_type: 0, | 1578 | prom_type: 0, |
1567 | isshow: 1, | 1579 | isshow: 1, |
@@ -2889,37 +2901,6 @@ Page({ | @@ -2889,37 +2901,6 @@ Page({ | ||
2889 | }, | 2901 | }, |
2890 | 2902 | ||
2891 | 2903 | ||
2892 | - //--加载更多商品-- | ||
2893 | - requestRecommend: function() { | ||
2894 | - var e = this, | ||
2895 | - t = '/api/weshop/goods/page?page=1'; | ||
2896 | - var th_recommend_list = e.data.recommend_list; | ||
2897 | - getApp().request.get(t, { | ||
2898 | - data: { | ||
2899 | - is_mainshow: 1, | ||
2900 | - isonsale: 1, | ||
2901 | - is_recommend: 1, | ||
2902 | - is_on_sale: 1, | ||
2903 | - store_id: os.stoid, | ||
2904 | - pageSize: 6 | ||
2905 | - }, | ||
2906 | - success: function(ee) { | ||
2907 | - var recommend_list = ee.data.data.pageData; | ||
2908 | - if (recommend_list && recommend_list.length > 0) { | ||
2909 | - var dd = [...th_recommend_list, ...recommend_list]; | ||
2910 | - e.setData({ | ||
2911 | - recommend_list, | ||
2912 | - dd | ||
2913 | - }); | ||
2914 | - e.data.currentPage++; | ||
2915 | - } else { | ||
2916 | - e.setData({ | ||
2917 | - nomore: 1 | ||
2918 | - }); | ||
2919 | - } | ||
2920 | - } | ||
2921 | - }) | ||
2922 | - }, | ||
2923 | 2904 | ||
2924 | //--获取头像的本地缓存,回调写法-- | 2905 | //--获取头像的本地缓存,回调写法-- |
2925 | get_head_temp: function(tt, func) { | 2906 | get_head_temp: function(tt, func) { |
pages/goods/goodsInfo/goodsInfo.json
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | "enablePullDownRefresh": false, | 3 | "enablePullDownRefresh": false, |
4 | "usingComponents": { | 4 | "usingComponents": { |
5 | "nav_box": "/components/nav_box/nav_box", | 5 | "nav_box": "/components/nav_box/nav_box", |
6 | - "warn": "/components/long_warn/long_warn" | 6 | + "warn": "/components/long_warn/long_warn", |
7 | + "goods_recommend": "/components/goods_list/goods_list" | ||
7 | } | 8 | } |
8 | } | 9 | } |
9 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -229,7 +229,7 @@ | @@ -229,7 +229,7 @@ | ||
229 | <view class="goods-price rel"> | 229 | <view class="goods-price rel"> |
230 | <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}"> | 230 | <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}"> |
231 | <view class="market-price" style="overflow: hidden"> | 231 | <view class="market-price" style="overflow: hidden"> |
232 | - <block wx:if="{{card_field}}"> | 232 | + <block wx:if="{{card_field && data[card_field]>0}}"> |
233 | <view class="flex ai-center grade-card-frame" style="margin-left:12rpx;"> | 233 | <view class="flex ai-center grade-card-frame" style="margin-left:12rpx;"> |
234 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> | 234 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
235 | <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view> | 235 | <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view> |
@@ -287,7 +287,7 @@ | @@ -287,7 +287,7 @@ | ||
287 | </view> | 287 | </view> |
288 | </view> | 288 | </view> |
289 | <!-- 立即续费的显示 --> | 289 | <!-- 立即续费的显示 --> |
290 | - <view wx:elif="{{is_near_date}}"> | 290 | + <view wx:elif="{{is_near_date && data[card_field]>0}}"> |
291 | <view class="beauty-makeup-frame flex ai-center"> | 291 | <view class="beauty-makeup-frame flex ai-center"> |
292 | <view class="left flex ai-center"> | 292 | <view class="left flex ai-center"> |
293 | <view class="flex ai-center grade-card-frame card-frame advert-card"style="max-width:32%;width:auto" > | 293 | <view class="flex ai-center grade-card-frame card-frame advert-card"style="max-width:32%;width:auto" > |
@@ -532,23 +532,7 @@ | @@ -532,23 +532,7 @@ | ||
532 | </view> | 532 | </view> |
533 | 533 | ||
534 | <!-- 显示商品 --> | 534 | <!-- 显示商品 --> |
535 | - <view class="xc-goods "> | ||
536 | - <view> | ||
537 | - <view bindtap="go_goods" data-gid="{{item.goods_id}}" class="rel xc-goods-recommend {{index%2==0?'':'ml'}}" wx:for="{{recommend_list}}"> | ||
538 | - <image class="xc-goods-imgs" src="{{iurl+item.original_img}}"></image> | ||
539 | - <view class='xc-goods-bottom abs'> | ||
540 | - <view class="flex monry-frame"> | ||
541 | - <view class="flex"> | ||
542 | - <view class="three-level-word money-color-val rmb-symbol">¥</view> | ||
543 | - <view class="two-level-word money-color-val" style='margin-top:8rpx;'>{{item.shop_price}}</view> | ||
544 | - </view> | ||
545 | - <view class="word-lines xc-original-price"> 原价¥{{item.market_price}}</view> | ||
546 | - </view> | ||
547 | - <view class="xc-good-explain ellipsis-2">{{item.goods_name}}</view> | ||
548 | - </view> | ||
549 | - </view> | ||
550 | - </view> | ||
551 | - </view> | 535 | + <goods_recommend id="goods_list"></goods_recommend> |
552 | 536 | ||
553 | </view> | 537 | </view> |
554 | 538 | ||
@@ -813,7 +797,7 @@ | @@ -813,7 +797,7 @@ | ||
813 | <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> | 797 | <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> |
814 | <view class="spec-goods-price" wx:if="{{prom_price==null}}"> | 798 | <view class="spec-goods-price" wx:if="{{prom_price==null}}"> |
815 | <!-- 如果是等级会员,且有等级价 --> | 799 | <!-- 如果是等级会员,且有等级价 --> |
816 | - <block wx:if="card_field && sele_g[card_field]>0"> | 800 | + <block wx:if="{{card_field && sele_g[card_field]>0}}"> |
817 | ¥ {{sele_g[card_field]}} | 801 | ¥ {{sele_g[card_field]}} |
818 | </block> | 802 | </block> |
819 | <block wx:else> | 803 | <block wx:else> |
@@ -908,7 +892,7 @@ | @@ -908,7 +892,7 @@ | ||
908 | <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> | 892 | <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> |
909 | <view class="spec-goods-price" wx:if="{{is_normal==1}}"> | 893 | <view class="spec-goods-price" wx:if="{{is_normal==1}}"> |
910 | <!-- 如果是等级会员,且有等级价 --> | 894 | <!-- 如果是等级会员,且有等级价 --> |
911 | - <block wx:if="card_field && sele_g[card_field]>0"> | 895 | + <block wx:if="{{card_field && sele_g[card_field]>0}}"> |
912 | ¥ {{sele_g[card_field]}} | 896 | ¥ {{sele_g[card_field]}} |
913 | </block> | 897 | </block> |
914 | <block wx:else> | 898 | <block wx:else> |
pages/goods/goodsList/g_filter.wxs
@@ -8,9 +8,9 @@ var g_filters = { | @@ -8,9 +8,9 @@ var g_filters = { | ||
8 | 8 | ||
9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | 9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- |
10 | get_card_price:function(goods,all_card,type){ | 10 | get_card_price:function(goods,all_card,type){ |
11 | - var price1=parseInt(goods['cardprice1']); | ||
12 | - var price2=parseInt(goods['cardprice2']); | ||
13 | - var price3=parseInt(goods['cardprice3']); | 11 | + var price1=parseFloat(goods['cardprice1']); |
12 | + var price2=parseFloat(goods['cardprice2']); | ||
13 | + var price3=parseFloat(goods['cardprice3']); | ||
14 | 14 | ||
15 | if(!all_card){ | 15 | if(!all_card){ |
16 | if(type==0) return 0; | 16 | if(type==0) return 0; |
pages/goods/goodsList/goodsList.wxml
@@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
70 | </view> | 70 | </view> |
71 | <view class="comment flex jc_sb"> | 71 | <view class="comment flex jc_sb"> |
72 | <view class="flex"> | 72 | <view class="flex"> |
73 | - <view class="word-line xc-ash">¥{{g_filter.get_card_price(item,card_list,0)}}</view> | 73 | + <view class="">¥{{g_filter.get_card_price(item,card_list,0)}}</view> |
74 | <view class="card_bg"><image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | 74 | <view class="card_bg"><image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> |
75 | {{g_filter.get_card_price(item,card_list,1)}} | 75 | {{g_filter.get_card_price(item,card_list,1)}} |
76 | </view> | 76 | </view> |
pages/goods/goodsList/goodsList.wxss
@@ -155,6 +155,6 @@ | @@ -155,6 +155,6 @@ | ||
155 | width: 300rpx; | 155 | width: 300rpx; |
156 | } | 156 | } |
157 | 157 | ||
158 | -.card_bg {display: flex; width: 108rpx;height: 28rpx; align-items: center; border-radius: 26rpx; font-size: 19rpx; | ||
159 | -background: #333; color: #fff; justify-content: center; margin-left: 4rpx;margin-top:8rpx } | ||
160 | -.card_bg image{ width: 19rpx; height: 19rpx; margin-right: 1rpx;} | 158 | +.card_bg {display: flex; width: 110rpx;height: 28rpx; align-items: center; border-radius: 26rpx; font-size: 19rpx; |
159 | +background: #333; color: #fff; justify-content: center; margin-left: 2rpx; margin-top:8rpx; line-height: 28rpx;} | ||
160 | +.card_bg image{ width: 19rpx; height: 19rpx; margin-right: 1rpx; vertical-align: middle} |
pages/goods/search/g_filter.wxs
@@ -8,9 +8,9 @@ var g_filters = { | @@ -8,9 +8,9 @@ var g_filters = { | ||
8 | 8 | ||
9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | 9 | //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- |
10 | get_card_price:function(goods,all_card,type){ | 10 | get_card_price:function(goods,all_card,type){ |
11 | - var price1=parseInt(goods['cardprice1']); | ||
12 | - var price2=parseInt(goods['cardprice2']); | ||
13 | - var price3=parseInt(goods['cardprice3']); | 11 | + var price1 = parseFloat(goods['cardprice1']); |
12 | + var price2 = parseFloat(goods['cardprice2']); | ||
13 | + var price3 = parseFloat(goods['cardprice3']); | ||
14 | 14 | ||
15 | if(!all_card){ | 15 | if(!all_card){ |
16 | if(type==0) return 0; | 16 | if(type==0) return 0; |
pages/goods/search/search.wxml
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | </view> | 66 | </view> |
67 | <view class="comment flex jc_sb"> | 67 | <view class="comment flex jc_sb"> |
68 | <view class="flex"> | 68 | <view class="flex"> |
69 | - <view class="word-line xc-ash">¥{{g_filter.get_card_price(item,card_list,0)}}</view> | 69 | + <view class="">¥{{g_filter.get_card_price(item,card_list,0)}}</view> |
70 | <view class="card_bg"><image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | 70 | <view class="card_bg"><image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> |
71 | {{g_filter.get_card_price(item,card_list,1)}} | 71 | {{g_filter.get_card_price(item,card_list,1)}} |
72 | </view> | 72 | </view> |
pages/goods/search/search.wxss
@@ -92,6 +92,8 @@ | @@ -92,6 +92,8 @@ | ||
92 | .price { | 92 | .price { |
93 | display: inline-block; | 93 | display: inline-block; |
94 | color: #f23030; | 94 | color: #f23030; |
95 | + height: 20rpx; | ||
96 | + line-height: 20rpx; | ||
95 | /* padding-bottom: 20rpx; */ | 97 | /* padding-bottom: 20rpx; */ |
96 | } | 98 | } |
97 | 99 | ||
@@ -226,6 +228,6 @@ | @@ -226,6 +228,6 @@ | ||
226 | margin-left: 15rpx; | 228 | margin-left: 15rpx; |
227 | } | 229 | } |
228 | 230 | ||
229 | -.card_bg {display: flex; width: 108rpx;height: 28rpx; align-items: center; border-radius: 26rpx; font-size: 19rpx; | ||
230 | -background: #333; color: #fff; justify-content: center; margin-left: 2rpx; margin-top:8rpx } | ||
231 | -.card_bg image{ width: 19rpx; height: 19rpx; margin-right: 1rpx;} | 231 | +.card_bg {display: flex; width: 110rpx;height: 28rpx; align-items: center; border-radius: 26rpx; font-size: 19rpx; |
232 | +background: #333; color: #fff; justify-content: center; margin-left: 2rpx; margin-top:8rpx; line-height: 28rpx;} | ||
233 | +.card_bg image{ width: 19rpx; height: 19rpx; margin-right: 1rpx; vertical-align: middle} |
pages/index/index/index.js
@@ -314,7 +314,8 @@ Page({ | @@ -314,7 +314,8 @@ Page({ | ||
314 | 314 | ||
315 | }); | 315 | }); |
316 | var goods_list = this.selectComponent("#goods_list"); //组件的id | 316 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
317 | - goods_list.get_list(); | 317 | + goods_list.init(); |
318 | + setTimeOut(function () { goods_list.get_list();},300) | ||
318 | }, | 319 | }, |
319 | 320 | ||
320 | //--判断小程序是否过期-- | 321 | //--判断小程序是否过期-- |
pages/user/collect_list/collect_list.js
@@ -49,9 +49,8 @@ Page({ | @@ -49,9 +49,8 @@ Page({ | ||
49 | is_goods: 1 | 49 | is_goods: 1 |
50 | }) | 50 | }) |
51 | var goods_list = th.selectComponent("#goods_recommend"); //组件的id | 51 | var goods_list = th.selectComponent("#goods_recommend"); //组件的id |
52 | - goods_list.get_list(); | ||
53 | - | ||
54 | - | 52 | + goods_list.init(); |
53 | + setTimeOut(function () { goods_list.get_list(); }, 300) | ||
55 | } | 54 | } |
56 | }); | 55 | }); |
57 | }, | 56 | }, |
pages/user/index/index.js
@@ -38,8 +38,7 @@ Page({ | @@ -38,8 +38,7 @@ Page({ | ||
38 | * 生命周期函数--监听页面加载 | 38 | * 生命周期函数--监听页面加载 |
39 | */ | 39 | */ |
40 | onLoad: function (options) { | 40 | onLoad: function (options) { |
41 | - var goods_list = this.selectComponent("#goods_recommend"); //组件的id | ||
42 | - goods_list.get_list(); | 41 | + |
43 | }, | 42 | }, |
44 | /** | 43 | /** |
45 | * 生命周期函数--监听页面显示 | 44 | * 生命周期函数--监听页面显示 |
@@ -217,6 +216,10 @@ Page({ | @@ -217,6 +216,10 @@ Page({ | ||
217 | } | 216 | } |
218 | }); | 217 | }); |
219 | 218 | ||
219 | + var goods_list = this.selectComponent("#goods_recommend"); //组件的id | ||
220 | + goods_list.init(); | ||
221 | + goods_list.get_list(); | ||
222 | + | ||
220 | }, | 223 | }, |
221 | 224 | ||
222 | //判断会员是后有改服务项目 | 225 | //判断会员是后有改服务项目 |
@@ -252,8 +255,9 @@ Page({ | @@ -252,8 +255,9 @@ Page({ | ||
252 | */ | 255 | */ |
253 | onReachBottom: function () { | 256 | onReachBottom: function () { |
254 | //!this.nomore && this.requestRecommend(); | 257 | //!this.nomore && this.requestRecommend(); |
255 | - var goods_list = this.selectComponent("#goods_recommend"); //组件的id | ||
256 | - goods_list.get_list(); | 258 | + var goods_list = this.selectComponent("#goods_recommend"); //组件的id |
259 | + goods_list.init(); | ||
260 | + setTimeOut(function () { goods_list.get_list(); }, 300) | ||
257 | }, | 261 | }, |
258 | 262 | ||
259 | /** | 263 | /** |
pages/user/index/index.json
1 | { | 1 | { |
2 | "usingComponents": { | 2 | "usingComponents": { |
3 | "pop_txt": "/components/userqy_pop_up/userqy_pop_up", | 3 | "pop_txt": "/components/userqy_pop_up/userqy_pop_up", |
4 | - "goods_recommend": "/components/goods_list/goods_list" | 4 | + "goods_recommend": "/components/goods_list/goods_list" |
5 | }, | 5 | }, |
6 | "navigationBarTitleText": "会员中心" | 6 | "navigationBarTitleText": "会员中心" |
7 | } | 7 | } |
8 | \ No newline at end of file | 8 | \ No newline at end of file |
pages/user/plus/plus.wxml
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | <view class="flex-space-between Membership_go"> | 18 | <view class="flex-space-between Membership_go"> |
19 | <view> | 19 | <view> |
20 | <view class="fs36">{{item.CardName}}</view> | 20 | <view class="fs36">{{item.CardName}}</view> |
21 | - <view class="fs24 Membership_remarks">开通会员年卡仅{{item.CardFee}}元</view> | 21 | + <view class="fs24 Membership_remarks">开通会员卡仅{{item.CardFee}}元</view> |
22 | </view> | 22 | </view> |
23 | <view class="Opening fs28 xc-black" data-ind="{{index}}" style="background:{{item.CardColor}}" bindtap="Opening">立即购买 | 23 | <view class="Opening fs28 xc-black" data-ind="{{index}}" style="background:{{item.CardColor}}" bindtap="Opening">立即购买 |
24 | </view> | 24 | </view> |