diff --git a/components/diy_public/diy_public.js b/components/diy_public/diy_public.js index 2eadc60..d5494db 100644 --- a/components/diy_public/diy_public.js +++ b/components/diy_public/diy_public.js @@ -50,9 +50,11 @@ Component({ '2':"/miniapp/images/component/pingd/pingd.png", '6':"/miniapp/images/component/pingd/pingd.png", '8':"/miniapp/images/component/presale.png", + '9':"/miniapp/images/component/luckyactivity.png", }, nav1:'/packageA/pages/goodsInfo/goodsInfo?', nav2:'/pages/goods/goodsInfo/goodsInfo?', + }, pageLifetimes: { @@ -98,7 +100,7 @@ Component({ prom_text:'已团', nav1:'/pages/goods/goodsInfo/goodsInfo?', nav2:'/pages/goods/goodsInfo/goodsInfo?' - }) + }) } if (this.data.prom_type==8) { //预售 this.setData({ @@ -107,6 +109,14 @@ Component({ nav2:'/packageC/pages/presell/goodsInfo/goodsInfo?' }) } + if (this.data.prom_type==9) { //幸运购 + this.setData({ + prom_text:'已售', + nav1:'/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?', + nav2:'/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?' + }) + } + var g_id = this.data.object; this.init(g_id); @@ -165,6 +175,10 @@ Component({ gUrl="/api/weshop/marketing/marketingPresellList/page?store_id=" +os.stoid+"&goodsidlist="+goodsidlist + "&user_id="+user_id+'&is_end=0&timetype=3&isuse=1'; } + if (th.data.prom_type==9) { //幸运购 + gUrl="/api/weshop/prom/luckyActivity/getGoodsList?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist + "&user_id="+user_id+'&is_end=0&timetype=1&type=1'; + } @@ -226,6 +240,18 @@ Component({ pageSize:9 } } + if (this.data.prom_type==9) { //幸运购 + gUrl="/api/weshop/prom/luckyActivity/page" + req={ + store_id:os.stoid, + is_end:0, + timetype:1, + // isuse:1, + // page:1, + // user_id:user_id, + // pageSize:9 + } + } getApp().request.promiseGet(gUrl, { isShowLoading: 1, data:req } @@ -244,6 +270,7 @@ Component({ let prom_type=this.data.prom_type goodslist.forEach(function (vy, indy) { if(!vy.id) vy.id=vy.prom_id; + if(vy.title && !vy.goods_name) vy.goods_name=vy.title; }) // 判断火热,预热 @@ -279,7 +306,7 @@ Component({ var promisies = []; - if (th.data.prom_type !=8) { + if (th.data.prom_type !=8 && th.data.prom_type !=9) { for (const key in all_array) { if (Object.hasOwnProperty.call(all_array, key)) { const val = all_array[key]; @@ -306,6 +333,7 @@ Component({ }; // let price=all_array[i].price.toFixed(2) let price=all_array[i].price + '' + if (th.data.prom_type==8) { //预售 price = all_array[i].presell_price + '' if (all_array[i].status ===0) { @@ -315,8 +343,12 @@ Component({ all_array[i].goods_num=all_array[i].presell_sumqty*1 + all_array[i].virtual_qty*1 all_array[i].buy_num=all_array[i].buy_goodnum + all_array[i].virtual_qty*1 } - - + } + if (th.data.prom_type==9) { //幸运购 + price = (all_array[i].group_price / 100) + '' + // all_array[i].buy_num = all_array[i].group_joined + all_array[i].buy_num = all_array[i].goods_num*1 - all_array[i].actLen*1 + all_array[i].goods_name = all_array[i].title } @@ -329,6 +361,12 @@ Component({ } all_array[i].residue=all_array[i].goods_num*1 - all_array[i].buy_num*1 + all_array[i].residue = (all_array[i].residue >= 0) ? all_array[i].residue : 0 + if (th.data.prom_type==9) { //幸运购 + all_array[i].residue= all_array[i].actLen + } + + // console.error(all_array[i].residue); if (all_array[i].residue && all_array[i].residue > 0 && all_array[i].status !=2) { empty.push(all_array[i]) } @@ -438,7 +476,14 @@ Component({ sec: '00' } } - var txt = "goods_array[" + j + "][" + i + "].djs"; + let txt = "goods_array[" + j + "][" + i + "].djs"; + + if (!o.status && obj.day=='00' && obj.hou=='00' && obj.min=='00' && obj.sec=='01') { + let t1="goods_array[" + j + "][" + i + "].status"; + ee.setData({ + [t1]:1 + }) + } ee.setData({ [txt]: obj }); @@ -464,6 +509,9 @@ Component({ if (this.data.prom_type==8) { //预售 url="/packageC/pages/presell/list/list"; } + if (this.data.prom_type==9) { //幸运购 + url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList"; + } wx.navigateTo({ url diff --git a/components/diy_public/diy_public.wxml b/components/diy_public/diy_public.wxml index bbadfc0..fc02b38 100644 --- a/components/diy_public/diy_public.wxml +++ b/components/diy_public/diy_public.wxml @@ -16,7 +16,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/components/diy_public/diy_public.wxss b/components/diy_public/diy_public.wxss index abdb465..f0c1894 100644 --- a/components/diy_public/diy_public.wxss +++ b/components/diy_public/diy_public.wxss @@ -555,4 +555,14 @@ swiper { border-radius: 10rpx; margin-right: 10rpx; opacity: .8; + } + .lucky{ + display: inline-block; + font-size: 24rpx; + padding: 0 10rpx; + background-color: #f23023; + opacity: .8; + color: #fff; + margin-right: 10rpx; + border-radius: 10rpx; } \ No newline at end of file diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 15aa246..78cc564 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -484,9 +484,12 @@ - + + + + @@ -530,6 +533,10 @@ + + + + diff --git a/pages/template/index.json b/pages/template/index.json index 42bc7a2..10882a3 100644 --- a/pages/template/index.json +++ b/pages/template/index.json @@ -11,6 +11,7 @@ "searchbox":"/components/diy_searchbox/diy_searchbox", "shopname": "/components/diy_shopname/diy_shopname", "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", + "luckyGo": "/components/diy_luckyGo/diy_luckyGo", "diy_public": "/components/diy_public/diy_public", "title": "/components/diy_title/diy_title", "notice": "/components/diy_notice/diy_notice", diff --git a/pages/template/index.wxml b/pages/template/index.wxml index 4071247..7be1c03 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -41,9 +41,12 @@ - + + + + @@ -79,6 +82,15 @@ + + + + + + + + +