From 1a078c7ea1b7c12c8a5f0c4ca1ad88e753f715be Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Tue, 22 Aug 2023 15:21:03 +0800 Subject: [PATCH] 自定义组件 --- components/diy_public/diy_public.js | 43 +++++++++++++++++++++++++++++++++++++++---- components/diy_public/diy_public.wxml | 50 +++++++++++++++++++++++++------------------------- components/diy_public/diy_public.wxss | 10 ++++++++++ pages/index/index/index.wxml | 4 ++++ pages/template/index.json | 1 + pages/template/index.wxml | 9 +++++++++ 6 files changed, 88 insertions(+), 29 deletions(-) diff --git a/components/diy_public/diy_public.js b/components/diy_public/diy_public.js index 2eadc60..0a610d8 100644 --- a/components/diy_public/diy_public.js +++ b/components/diy_public/diy_public.js @@ -50,6 +50,7 @@ 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?', @@ -98,7 +99,7 @@ Component({ prom_text:'已团', nav1:'/pages/goods/goodsInfo/goodsInfo?', nav2:'/pages/goods/goodsInfo/goodsInfo?' - }) + }) } if (this.data.prom_type==8) { //预售 this.setData({ @@ -107,6 +108,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 +174,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 +239,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 +269,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 +305,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 +332,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 +342,11 @@ 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].goods_name = all_array[i].title } @@ -329,6 +359,8 @@ 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 + 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]) } @@ -464,6 +496,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 5b6d0bf..bbadfc0 100644 --- a/components/diy_public/diy_public.wxml +++ b/components/diy_public/diy_public.wxml @@ -16,7 +16,7 @@ - + @@ -43,7 +43,7 @@ - {{aitem.goods_name}} + {{aitem.group_num}}人团{{aitem.goods_name}} {{aitem.ct_num}}人团 {{kttypeArr[aitem.kttype]}}团 @@ -57,7 +57,7 @@ {{aitem.price_n}}.{{aitem.price_xs}} - ¥{{aitem.shop_price || aitem.market_price}} + ¥{{aitem.market_price || aitem.shop_price }} @@ -76,7 +76,7 @@ - + @@ -97,7 +97,7 @@ - {{aitem.goods_name}} + {{aitem.group_num}}人团{{aitem.goods_name}} {{aitem.ct_num}}人团 {{kttypeArr[aitem.kttype]}}团 @@ -112,7 +112,7 @@ {{aitem.price_n}}.{{aitem.price_xs}} - ¥{{aitem.shop_price || aitem.market_price}} + ¥{{aitem.market_price || aitem.shop_price }} @@ -130,7 +130,7 @@ - + @@ -151,7 +151,7 @@ - {{aitem.goods_name}} + {{aitem.group_num}}人团{{aitem.goods_name}} {{prom_text}}{{aitem.buy_num}} {{aitem.residue}} @@ -160,7 +160,7 @@ {{aitem.price_n}}.{{aitem.price_xs}} - ¥{{aitem.shop_price || aitem.market_price}} + ¥{{aitem.market_price || aitem.shop_price }} @@ -178,7 +178,7 @@ - + @@ -198,7 +198,7 @@ - {{aitem.goods_name}} + {{aitem.group_num}}人团{{aitem.goods_name}} + + 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..8d2a906 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -79,6 +79,15 @@ + + + + + + + + + -- libgit2 0.21.4