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,6 +55,7 @@ Page({ | ||
55 | openPromModal: !1, | 55 | openPromModal: !1, |
56 | activeCategoryId: 0, | 56 | activeCategoryId: 0, |
57 | supportPageScroll: !1, | 57 | supportPageScroll: !1, |
58 | + prom_type4:0, //积分购是否开始 | ||
58 | address: { | 59 | address: { |
59 | address: "", | 60 | address: "", |
60 | district: 0 | 61 | district: 0 |
@@ -902,7 +903,13 @@ Page({ | @@ -902,7 +903,13 @@ Page({ | ||
902 | failRollback: !0, | 903 | failRollback: !0, |
903 | success: function (t) { | 904 | success: function (t) { |
904 | console.log(t); | 905 | console.log(t); |
906 | + // t.data.data.prom_type=0 | ||
905 | if (t.data.code == 0) { | 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 | if (t.data.data.is_on_sale != 1) { | 913 | if (t.data.data.is_on_sale != 1) { |
907 | wx.showModal({ | 914 | wx.showModal({ |
908 | title: '商品已经下架', | 915 | title: '商品已经下架', |
@@ -7492,9 +7499,24 @@ Page({ | @@ -7492,9 +7499,24 @@ Page({ | ||
7492 | success: function (e) { | 7499 | success: function (e) { |
7493 | if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { | 7500 | if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { |
7494 | var arr = e.data.data; | 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 | var arr2 = arr.filter(function (e) { | 7516 | var arr2 = arr.filter(function (e) { |
7496 | return e.s_time < ut.gettimestamp(); | 7517 | return e.s_time < ut.gettimestamp(); |
7497 | }) | 7518 | }) |
7519 | + | ||
7498 | //-- 如果只有一个活动的话 -- | 7520 | //-- 如果只有一个活动的话 -- |
7499 | if (arr.length == 1) { | 7521 | if (arr.length == 1) { |
7500 | th.data.prom_type = arr[0].prom_type; | 7522 | th.data.prom_type = arr[0].prom_type; |