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 | 3 | // default: e |
4 | 4 | // }; |
5 | 5 | // }(require("../../utils/LoadMore3.js")), |
6 | -// n = new e.default(), | |
6 | +// n = new e.default(), | |
7 | 7 | var t = getApp(), |
8 | 8 | a = t.request, |
9 | 9 | o = t.globalData.setting, |
... | ... | @@ -47,6 +47,7 @@ Component({ |
47 | 47 | kttypeArr:['','商家','会员','阶梯'], |
48 | 48 | imgobj:{ |
49 | 49 | '1':"/miniapp/images/component/seckill.png", |
50 | + '2':"/miniapp/images/component/pingd/pingd.png", | |
50 | 51 | '6':"/miniapp/images/component/pingd/pingd.png" |
51 | 52 | }, |
52 | 53 | nav1:'/packageA/pages/goodsInfo/goodsInfo?', | ... | ... |
components/diy_public/diy_public.wxml
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
52 | 52 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
53 | 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 | 55 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> |
56 | 56 | </view> |
57 | 57 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | </view> |
98 | 98 | </block> |
99 | 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 | 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 | 102 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
103 | 103 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 | </view> |
154 | 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 | 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 | 157 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> |
158 | 158 | </view> |
159 | 159 | <view class="new_item1_price clor7b" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
... | ... | @@ -204,7 +204,7 @@ |
204 | 204 | <view wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
205 | 205 | </view> --> |
206 | 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 | 208 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> |
209 | 209 | </view> |
210 | 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 | 263 | <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
264 | 264 | <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> |
265 | 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 | 267 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> |
268 | 268 | </view> |
269 | 269 | <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> |
... | ... | @@ -299,13 +299,13 @@ |
299 | 299 | </view> |
300 | 300 | </block> |
301 | 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 | 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 | 304 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
305 | 305 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
306 | 306 | </view> |
307 | 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 | 309 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> |
310 | 310 | </view> |
311 | 311 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
... | ... | @@ -341,13 +341,13 @@ |
341 | 341 | </view> |
342 | 342 | </block> |
343 | 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 | 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 | 346 | <view class="mgr10 lineh24" wx:if="{{object.group_size}}">{{aitem.ct_num}}人团</view> |
347 | 347 | <view class="lineh24" wx:if="{{object.group_type}}">{{kttypeArr[aitem.kttype]}}团</view> |
348 | 348 | </view> |
349 | 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 | 351 | <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> |
352 | 352 | </view> |
353 | 353 | <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> |
... | ... | @@ -440,7 +440,7 @@ |
440 | 440 | </view> |
441 | 441 | </block> |
442 | 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 | 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 | 445 | <text wx:if="{{object.seconds_num}}">{{prom_text}}<text class="clor">{{aitem.buy_num}}</text>件</text> |
446 | 446 | <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | ... | ... |
pages/index/index/index.json
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | "searchbox":"/components/diy_searchbox/diy_searchbox", |
10 | 10 | "shopname": "/components/diy_shopname/diy_shopname", |
11 | 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 | 13 | "title": "/components/diy_title/diy_title", |
14 | 14 | "notice": "/components/diy_notice/diy_notice", |
15 | 15 | "voice": "/components/diy_voice/diy_voice", | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -481,7 +481,7 @@ |
481 | 481 | <pingd_buy object="{{item.content}}"></pingd_buy> |
482 | 482 | </block> |
483 | 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 | 485 | </block> |
486 | 486 | <!--秒杀--> |
487 | 487 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
... | ... | @@ -520,6 +520,9 @@ |
520 | 520 | <block wx:if="{{item.ename=='groupbuy'}}"> |
521 | 521 | <groupbuy object="{{item.content}}"></groupbuy> |
522 | 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 | 527 | <block wx:if="{{item.ename=='luckyactivity'}}"> |
525 | 528 | <luckyGo object="{{item.content}}"></luckyGo> | ... | ... |
pages/template/index.wxml