Commit 610f423a0174a62428c74d4d4aea9addee4d4590
Merge branch 'dev' into 'test'
OA单积分购优化 See merge request !1159
Showing
1 changed file
with
22 additions
and
0 deletions
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -55,6 +55,7 @@ Page({ |
55 | 55 | openPromModal: !1, |
56 | 56 | activeCategoryId: 0, |
57 | 57 | supportPageScroll: !1, |
58 | + prom_type4:0, //积分购是否开始 | |
58 | 59 | address: { |
59 | 60 | address: "", |
60 | 61 | district: 0 |
... | ... | @@ -902,7 +903,13 @@ Page({ |
902 | 903 | failRollback: !0, |
903 | 904 | success: function (t) { |
904 | 905 | console.log(t); |
906 | + // t.data.data.prom_type=0 | |
905 | 907 | if (t.data.code == 0) { |
908 | + if(t.data.data && t.data.data.prom_type==4){ | |
909 | + if(ee.data.prom_type4==1){ | |
910 | + t.data.data.prom_type=0 | |
911 | + } | |
912 | + } | |
906 | 913 | if (t.data.data.is_on_sale != 1) { |
907 | 914 | wx.showModal({ |
908 | 915 | title: '商品已经下架', |
... | ... | @@ -7492,9 +7499,24 @@ Page({ |
7492 | 7499 | success: function (e) { |
7493 | 7500 | if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { |
7494 | 7501 | var arr = e.data.data; |
7502 | + let times = new Date().getTime() | |
7503 | + arr.map(item=>{ | |
7504 | + //如果是积分购的话,要进行活动时间判断 | |
7505 | + if(item.prom_type==4){ | |
7506 | + let atimes= item.warm_uptime*1000 | |
7507 | + if(atimes > times){ | |
7508 | + item.prom_type=0 | |
7509 | + th.setData({ | |
7510 | + prom_type4:1 | |
7511 | + }) | |
7512 | + } | |
7513 | + } | |
7514 | + }) | |
7515 | + | |
7495 | 7516 | var arr2 = arr.filter(function (e) { |
7496 | 7517 | return e.s_time < ut.gettimestamp(); |
7497 | 7518 | }) |
7519 | + | |
7498 | 7520 | //-- 如果只有一个活动的话 -- |
7499 | 7521 | if (arr.length == 1) { |
7500 | 7522 | th.data.prom_type = arr[0].prom_type; | ... | ... |