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,7 +81,7 @@ Component({ | ||
| 81 | 81 | ||
| 82 | //--调用接口,读取秒杀-- | 82 | //--调用接口,读取秒杀-- |
| 83 | app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" | 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 | console.log(res); | 85 | console.log(res); |
| 86 | //如果秒杀的数组为空的时候 | 86 | //如果秒杀的数组为空的时候 |
| 87 | var goodslist = res.data.data; | 87 | var goodslist = res.data.data; |
| @@ -113,6 +113,11 @@ Component({ | @@ -113,6 +113,11 @@ Component({ | ||
| 113 | 113 | ||
| 114 | //就算是添加的活动已经过期,就要用最新的活动 | 114 | //就算是添加的活动已经过期,就要用最新的活动 |
| 115 | set_goods_list(g_id, goodslist) { | 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 | var newTime = ut.gettimestamp(), all_array = [], th = this; | 122 | var newTime = ut.gettimestamp(), all_array = [], th = this; |
| 118 | th.setData({ newTime: newTime }); | 123 | th.setData({ newTime: newTime }); |
| @@ -121,16 +126,14 @@ Component({ | @@ -121,16 +126,14 @@ Component({ | ||
| 121 | g_id.forEach(function (val, ind) { | 126 | g_id.forEach(function (val, ind) { |
| 122 | goodslist.forEach(function (vy, indy) { | 127 | goodslist.forEach(function (vy, indy) { |
| 123 | if (val.goodsid == vy.goods_id) { | 128 | if (val.goodsid == vy.goods_id) { |
| 124 | - if(!vy.id) vy.id=vy.prom_id; | ||
| 125 | all_array.push(vy); | 129 | all_array.push(vy); |
| 126 | } | 130 | } |
| 127 | }) | 131 | }) |
| 128 | }) | 132 | }) |
| 129 | } else { | 133 | } else { |
| 130 | - all_array = goodslist; | 134 | + all_array = goodslist; |
| 131 | } | 135 | } |
| 132 | 136 | ||
| 133 | - | ||
| 134 | if (all_array.length == 0) { | 137 | if (all_array.length == 0) { |
| 135 | all_array = goodslist; | 138 | all_array = goodslist; |
| 136 | } | 139 | } |
pages/goods/goodsInfo/goodsInfo.js
| @@ -836,7 +836,6 @@ Page({ | @@ -836,7 +836,6 @@ Page({ | ||
| 836 | t.data.data.prom_type=ee.data.prom_type; | 836 | t.data.data.prom_type=ee.data.prom_type; |
| 837 | t.data.data.prom_id=ee.data.prom_id; | 837 | t.data.data.prom_id=ee.data.prom_id; |
| 838 | } | 838 | } |
| 839 | - | ||
| 840 | ee.setData({ | 839 | ee.setData({ |
| 841 | data: t.data.data, | 840 | data: t.data.data, |
| 842 | sele_g: t.data.data, | 841 | sele_g: t.data.data, |
| @@ -1838,7 +1837,20 @@ Page({ | @@ -1838,7 +1837,20 @@ Page({ | ||
| 1838 | return false; | 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 | th.setData({is_pop_more:1}); | 1854 | th.setData({is_pop_more:1}); |
| 1843 | }else{ | 1855 | }else{ |
| 1844 | var ind = t.currentTarget.dataset.ind; | 1856 | var ind = t.currentTarget.dataset.ind; |
| @@ -3096,9 +3108,8 @@ Page({ | @@ -3096,9 +3108,8 @@ Page({ | ||
| 3096 | }); | 3108 | }); |
| 3097 | } | 3109 | } |
| 3098 | }) | 3110 | }) |
| 3099 | - | ||
| 3100 | - | ||
| 3101 | } | 3111 | } |
| 3112 | + | ||
| 3102 | if (prom_type == 1 && prom_id==0){ | 3113 | if (prom_type == 1 && prom_id==0){ |
| 3103 | this.setData({ | 3114 | this.setData({ |
| 3104 | prom_type: 0,isshow: 1, | 3115 | prom_type: 0,isshow: 1, |
| @@ -4355,6 +4366,12 @@ Page({ | @@ -4355,6 +4366,12 @@ Page({ | ||
| 4355 | context.fillText('强烈推荐', 64*unit, 672*unit); | 4366 | context.fillText('强烈推荐', 64*unit, 672*unit); |
| 4356 | // 7.商品价格 | 4367 | // 7.商品价格 |
| 4357 | let price = '¥' + this.data.data.shop_price; | 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 | // if (th.data.prom_act) | 4375 | // if (th.data.prom_act) |
| 4359 | // pri0 = th.data.prom_act.price; | 4376 | // pri0 = th.data.prom_act.price; |
| 4360 | context.setFontSize(32*unit); | 4377 | context.setFontSize(32*unit); |
| @@ -4527,8 +4544,11 @@ Page({ | @@ -4527,8 +4544,11 @@ Page({ | ||
| 4527 | context.setFontSize(23 * unit) | 4544 | context.setFontSize(23 * unit) |
| 4528 | context.setFillStyle("red") | 4545 | context.setFillStyle("red") |
| 4529 | 4546 | ||
| 4530 | - | ||
| 4531 | var pri0 = th.data.data.shop_price; | 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 | if (th.data.prom_act) | 4552 | if (th.data.prom_act) |
| 4533 | pri0 = th.data.prom_price; | 4553 | pri0 = th.data.prom_price; |
| 4534 | pri0 = parseFloat(pri0).toFixed(2); | 4554 | pri0 = parseFloat(pri0).toFixed(2); |
pages/user/index/index.js
| @@ -462,7 +462,7 @@ Page({ | @@ -462,7 +462,7 @@ Page({ | ||
| 462 | }, | 462 | }, |
| 463 | setappdata: function(t) { | 463 | setappdata: function(t) { |
| 464 | var t=getApp().globalData.wxapp_buy_obj; | 464 | var t=getApp().globalData.wxapp_buy_obj; |
| 465 | - if (t.isout == 1) | 465 | + if (t && t.isout == 1) |
| 466 | wx.navigateTo({ | 466 | wx.navigateTo({ |
| 467 | url: "/pages/error/error?msg=小程序已经过期", | 467 | url: "/pages/error/error?msg=小程序已经过期", |
| 468 | }); | 468 | }); |