Commit 02bfdad153658dc0462a40575b616df38c114d5f
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
3 changed files
with
33 additions
and
10 deletions
components/diy_seckill/diy_seckill.js
... | ... | @@ -81,7 +81,7 @@ Component({ |
81 | 81 | |
82 | 82 | //--调用接口,读取秒杀-- |
83 | 83 | app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" |
84 | - + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { | |
84 | + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1", {}).then(res => { | |
85 | 85 | console.log(res); |
86 | 86 | //如果秒杀的数组为空的时候 |
87 | 87 | var goodslist = res.data.data; |
... | ... | @@ -113,6 +113,11 @@ Component({ |
113 | 113 | |
114 | 114 | //就算是添加的活动已经过期,就要用最新的活动 |
115 | 115 | set_goods_list(g_id, goodslist) { |
116 | + | |
117 | + goodslist.forEach(function (vy, indy) { | |
118 | + if(!vy.id) vy.id=vy.prom_id; | |
119 | + }) | |
120 | + | |
116 | 121 | // 判断火热,预热 |
117 | 122 | var newTime = ut.gettimestamp(), all_array = [], th = this; |
118 | 123 | th.setData({ newTime: newTime }); |
... | ... | @@ -121,16 +126,14 @@ Component({ |
121 | 126 | g_id.forEach(function (val, ind) { |
122 | 127 | goodslist.forEach(function (vy, indy) { |
123 | 128 | if (val.goodsid == vy.goods_id) { |
124 | - if(!vy.id) vy.id=vy.prom_id; | |
125 | 129 | all_array.push(vy); |
126 | 130 | } |
127 | 131 | }) |
128 | 132 | }) |
129 | 133 | } else { |
130 | - all_array = goodslist; | |
134 | + all_array = goodslist; | |
131 | 135 | } |
132 | 136 | |
133 | - | |
134 | 137 | if (all_array.length == 0) { |
135 | 138 | all_array = goodslist; |
136 | 139 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -836,7 +836,6 @@ Page({ |
836 | 836 | t.data.data.prom_type=ee.data.prom_type; |
837 | 837 | t.data.data.prom_id=ee.data.prom_id; |
838 | 838 | } |
839 | - | |
840 | 839 | ee.setData({ |
841 | 840 | data: t.data.data, |
842 | 841 | sele_g: t.data.data, |
... | ... | @@ -1838,7 +1837,20 @@ Page({ |
1838 | 1837 | return false; |
1839 | 1838 | } |
1840 | 1839 | |
1841 | - if(th.data.more_flash && open_store==1){ | |
1840 | + var check_up=0; | |
1841 | + if(th.data.more_flash){ | |
1842 | + for(var i in th.data.more_flash){ | |
1843 | + var item=th.data.more_flash[i]; | |
1844 | + if(item.prom_type==1){ | |
1845 | + check_up=1; | |
1846 | + break | |
1847 | + } | |
1848 | + } | |
1849 | + } | |
1850 | + | |
1851 | + | |
1852 | + | |
1853 | + if(check_up && open_store==1){ | |
1842 | 1854 | th.setData({is_pop_more:1}); |
1843 | 1855 | }else{ |
1844 | 1856 | var ind = t.currentTarget.dataset.ind; |
... | ... | @@ -3096,9 +3108,8 @@ Page({ |
3096 | 3108 | }); |
3097 | 3109 | } |
3098 | 3110 | }) |
3099 | - | |
3100 | - | |
3101 | 3111 | } |
3112 | + | |
3102 | 3113 | if (prom_type == 1 && prom_id==0){ |
3103 | 3114 | this.setData({ |
3104 | 3115 | prom_type: 0,isshow: 1, |
... | ... | @@ -4355,6 +4366,12 @@ Page({ |
4355 | 4366 | context.fillText('强烈推荐', 64*unit, 672*unit); |
4356 | 4367 | // 7.商品价格 |
4357 | 4368 | let price = '¥' + this.data.data.shop_price; |
4369 | + | |
4370 | + if(this.data.card_field && this.data.data[this.data.card_field]){ | |
4371 | + price = '¥' + this.data.data[this.data.card_field]; | |
4372 | + } | |
4373 | + | |
4374 | + | |
4358 | 4375 | // if (th.data.prom_act) |
4359 | 4376 | // pri0 = th.data.prom_act.price; |
4360 | 4377 | context.setFontSize(32*unit); |
... | ... | @@ -4527,8 +4544,11 @@ Page({ |
4527 | 4544 | context.setFontSize(23 * unit) |
4528 | 4545 | context.setFillStyle("red") |
4529 | 4546 | |
4530 | - | |
4531 | 4547 | var pri0 = th.data.data.shop_price; |
4548 | + if(th.data.card_field && th.data.data[th.data.card_field]){ | |
4549 | + pri0=th.data.data[th.data.card_field]; | |
4550 | + } | |
4551 | + | |
4532 | 4552 | if (th.data.prom_act) |
4533 | 4553 | pri0 = th.data.prom_price; |
4534 | 4554 | pri0 = parseFloat(pri0).toFixed(2); | ... | ... |
pages/user/index/index.js