Commit c35b5219f5d6ef42b3d8bc1203931faeb5f5488a
1 parent
df729ebc
自定义团购组件
Showing
5 changed files
with
18 additions
and
14 deletions
components/diy_public/diy_public.js
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | // default: e | 3 | // default: e |
4 | // }; | 4 | // }; |
5 | // }(require("../../utils/LoadMore3.js")), | 5 | // }(require("../../utils/LoadMore3.js")), |
6 | -// n = new e.default(), | 6 | +// n = new e.default(), |
7 | var t = getApp(), | 7 | var t = getApp(), |
8 | a = t.request, | 8 | a = t.request, |
9 | o = t.globalData.setting, | 9 | o = t.globalData.setting, |
@@ -47,6 +47,7 @@ Component({ | @@ -47,6 +47,7 @@ Component({ | ||
47 | kttypeArr:['','商家','会员','阶梯'], | 47 | kttypeArr:['','商家','会员','阶梯'], |
48 | imgobj:{ | 48 | imgobj:{ |
49 | '1':"/miniapp/images/component/seckill.png", | 49 | '1':"/miniapp/images/component/seckill.png", |
50 | + '2':"/miniapp/images/component/pingd/pingd.png", | ||
50 | '6':"/miniapp/images/component/pingd/pingd.png" | 51 | '6':"/miniapp/images/component/pingd/pingd.png" |
51 | }, | 52 | }, |
52 | nav1:'/packageA/pages/goodsInfo/goodsInfo?', | 53 | nav1:'/packageA/pages/goodsInfo/goodsInfo?', |
components/diy_public/diy_public.wxml
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 51 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
52 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 52 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
53 | <view class="clor7b"> | 53 | <view class="clor7b"> |
54 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 54 | + <text class="{{prom_type==2 ? 'group':'' }}" wx:if="{{object.seconds_num}}">{{prom_text}}<text class="{{prom_type==2 ? '':'clor'}}">{{aitem.buy_num}}</text>件</text> |
55 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> | 55 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> |
56 | </view> | 56 | </view> |
57 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | 57 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> |
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | </view> | 97 | </view> |
98 | </block> | 98 | </block> |
99 | </view> | 99 | </view> |
100 | - <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | 100 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; '+ (prom_type==2 ? 'margin-bottom:10rpx;':'') + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> |
101 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> | 101 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> |
102 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> | 102 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
103 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> | 103 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
@@ -153,7 +153,7 @@ | @@ -153,7 +153,7 @@ | ||
153 | </view> | 153 | </view> |
154 | <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | 154 | <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> |
155 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 155 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
156 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 156 | + <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> |
157 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | 157 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> |
158 | </view> | 158 | </view> |
159 | <view class="new_item1_price clor7b" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 159 | <view class="new_item1_price clor7b" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
@@ -204,7 +204,7 @@ | @@ -204,7 +204,7 @@ | ||
204 | <view wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> | 204 | <view wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
205 | </view> --> | 205 | </view> --> |
206 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'font-size:24rpx;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 206 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'font-size:24rpx;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
207 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 207 | + <text class="{{prom_type==2 ? 'group':'' }}" wx:if="{{object.seconds_num}}">{{prom_text}}<text class="{{prom_type==2 ? '':'clor'}}">{{aitem.buy_num}}</text>件</text> |
208 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | 208 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> |
209 | </view> | 209 | </view> |
210 | <view class="new_item1_price clor7b" style="{{'width:100%;' + (object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 210 | <view class="new_item1_price clor7b" style="{{'width:100%;' + (object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
@@ -263,7 +263,7 @@ | @@ -263,7 +263,7 @@ | ||
263 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 263 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
264 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 264 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
265 | <view class="clor7b"> | 265 | <view class="clor7b"> |
266 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 266 | + <text class="{{prom_type==2 ? 'group':'' }}" wx:if="{{object.seconds_num}}">{{prom_text}}<text class="{{prom_type==2 ? '':'clor'}}">{{aitem.buy_num}}</text>件</text> |
267 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> | 267 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> |
268 | </view> | 268 | </view> |
269 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | 269 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> |
@@ -299,13 +299,13 @@ | @@ -299,13 +299,13 @@ | ||
299 | </view> | 299 | </view> |
300 | </block> | 300 | </block> |
301 | </view> | 301 | </view> |
302 | - <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | 302 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; '+ (prom_type==2 ? 'margin-bottom:10rpx;':'') + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> |
303 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> | 303 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> |
304 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> | 304 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
305 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> | 305 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
306 | </view> | 306 | </view> |
307 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 307 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
308 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 308 | + <text class="{{prom_type==2 ? 'group':'' }}" wx:if="{{object.seconds_num}}">{{prom_text}}<text class="{{prom_type==2 ? '':'clor'}}">{{aitem.buy_num}}</text>件</text> |
309 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | 309 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> |
310 | </view> | 310 | </view> |
311 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 311 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
@@ -341,13 +341,13 @@ | @@ -341,13 +341,13 @@ | ||
341 | </view> | 341 | </view> |
342 | </block> | 342 | </block> |
343 | </view> | 343 | </view> |
344 | - <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | 344 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; '+ (prom_type==2 ? 'margin-bottom:10rpx;':'') + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> |
345 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> | 345 | <view class="buy_box fs24" style="{{'margin-bottom:10rpx;' +(object.text_align==2 ? ' justify-content: center;' :'' )}}" wx:if="{{prom_type==6 && (object.group_size || object.group_type)}}"> |
346 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> | 346 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
347 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> | 347 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
348 | </view> | 348 | </view> |
349 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 349 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
350 | - <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 350 | + <text class="{{prom_type==2 ? 'group':'' }}" wx:if="{{object.seconds_num}}">{{prom_text}}<text class="{{prom_type==2 ? '':'clor'}}">{{aitem.buy_num}}</text>件</text> |
351 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | 351 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> |
352 | </view> | 352 | </view> |
353 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | 353 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
@@ -440,7 +440,7 @@ | @@ -440,7 +440,7 @@ | ||
440 | </view> | 440 | </view> |
441 | </block> | 441 | </block> |
442 | </view> | 442 | </view> |
443 | - <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | 443 | + <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> |
444 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | 444 | <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
445 | <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> | 445 | <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> |
446 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | 446 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> |
pages/index/index/index.json
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | "searchbox":"/components/diy_searchbox/diy_searchbox", | 9 | "searchbox":"/components/diy_searchbox/diy_searchbox", |
10 | "shopname": "/components/diy_shopname/diy_shopname", | 10 | "shopname": "/components/diy_shopname/diy_shopname", |
11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", | 11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
12 | - "div_public": "/components/diy_public/diy_public", | 12 | + "diy_public": "/components/diy_public/diy_public", |
13 | "title": "/components/diy_title/diy_title", | 13 | "title": "/components/diy_title/diy_title", |
14 | "notice": "/components/diy_notice/diy_notice", | 14 | "notice": "/components/diy_notice/diy_notice", |
15 | "voice": "/components/diy_voice/diy_voice", | 15 | "voice": "/components/diy_voice/diy_voice", |
pages/index/index/index.wxml
@@ -481,7 +481,7 @@ | @@ -481,7 +481,7 @@ | ||
481 | <pingd_buy object="{{item.content}}"></pingd_buy> | 481 | <pingd_buy object="{{item.content}}"></pingd_buy> |
482 | </block> | 482 | </block> |
483 | <block wx:if="{{item.ename=='pingd_buyNew'}}"> | 483 | <block wx:if="{{item.ename=='pingd_buyNew'}}"> |
484 | - <div_public object="{{item.content}}" prom_type="6"></div_public> | 484 | + <diy_public object="{{item.content}}" prom_type="6"></diy_public> |
485 | </block> | 485 | </block> |
486 | <!--秒杀--> | 486 | <!--秒杀--> |
487 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | 487 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
@@ -520,6 +520,9 @@ | @@ -520,6 +520,9 @@ | ||
520 | <block wx:if="{{item.ename=='groupbuy'}}"> | 520 | <block wx:if="{{item.ename=='groupbuy'}}"> |
521 | <groupbuy object="{{item.content}}"></groupbuy> | 521 | <groupbuy object="{{item.content}}"></groupbuy> |
522 | </block> | 522 | </block> |
523 | + <block wx:if="{{item.ename=='groupbuyNew'}}"> | ||
524 | + <diy_public object="{{item.content}}" prom_type="2"></diy_public> | ||
525 | + </block> | ||
523 | <!-- 幸运购 --> | 526 | <!-- 幸运购 --> |
524 | <block wx:if="{{item.ename=='luckyactivity'}}"> | 527 | <block wx:if="{{item.ename=='luckyactivity'}}"> |
525 | <luckyGo object="{{item.content}}"></luckyGo> | 528 | <luckyGo object="{{item.content}}"></luckyGo> |
pages/template/index.wxml
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | <block wx:if="{{item.ename=='white'}}"> | 52 | <block wx:if="{{item.ename=='white'}}"> |
53 | <assist object="{{item.content}}"></assist> | 53 | <assist object="{{item.content}}"></assist> |
54 | </block> | 54 | </block> |
55 | - <!--图片组合--> | 55 | + <!--图片组合--> |
56 | <block wx:if="{{item.ename=='picMix'}}"> | 56 | <block wx:if="{{item.ename=='picMix'}}"> |
57 | <picMax object="{{item.content}}"></picMax> | 57 | <picMax object="{{item.content}}"></picMax> |
58 | </block> | 58 | </block> |