Commit 8a5a4b6e32d0764d293ecdd5edf21c9a2e0701bc
1 parent
8987935b
自定义组件商品分组优化
Showing
2 changed files
with
14 additions
and
13 deletions
components/diy_goodsGroup/diy_goodsGroup.wxml
... | ... | @@ -11,17 +11,17 @@ |
11 | 11 | <view class="{{'tabBox ' + (object.menu_style==2 ? 'tab2' :'')}}"> |
12 | 12 | <!--样式一--> |
13 | 13 | <block wx:if="{{object.menu_style==1}}"> |
14 | - <view wx:if="{{object.show_all==1}}" style="padding: 0 35rpx;" class="{{'tab ' + (title_index == 10 ? 'clor ' :'')}}" >全部<span class="tab1" wx:if="{{10==title_index}}"></span></view> | |
15 | - <view wx:for="{{object.nav_list}}" style="padding: 0 35rpx;" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}" class="{{'tab ' + (index==title_index ? 'clor ' :'')}}">{{item.title}}<span class="tab1" wx:if="{{index==title_index}}"></span></view> | |
14 | + <view wx:if="{{object.show_all==1}}" style="padding: 0 35rpx;font-size: {{object.title_font_size*2}}rpx;color: {{object.title_color}};" class="{{'tab ' + (title_index == 10 ? 'clor ' :'')}}" >全部<span class="tab1" wx:if="{{10==title_index}}"></span></view> | |
15 | + <view wx:for="{{object.nav_list}}" style="padding: 0 35rpx;font-size: {{object.title_font_size*2}}rpx;color: {{object.title_color}};" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}" class="{{'tab ' + (index==title_index ? 'clor ' :'')}}">{{item.title}}<span class="tab1" wx:if="{{index==title_index}}"></span></view> | |
16 | 16 | </block> |
17 | 17 | <!--样式二--> |
18 | 18 | <block wx:if="{{object.menu_style==2}}"> |
19 | - <view wx:for="{{object.nav_list}}" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}" class="{{'tab ' + (index==title_index ? 'tab_action' : '')}}"> {{item.title}}</view> | |
19 | + <view wx:for="{{object.nav_list}}" style="font-size: {{object.title_font_size*2}}rpx;color: {{object.title_color}};" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}" class="{{'tab ' + (index==title_index ? 'tab_action' : '')}}"> {{item.title}}</view> | |
20 | 20 | </block> |
21 | 21 | <!--样式三--> |
22 | 22 | <block wx:if="{{object.menu_style==3}}"> |
23 | 23 | <view wx:for="{{object.nav_list}}" class="tab "> |
24 | - <view class="{{'tab3 ' + (index==title_index ? 'tab_action' : '')}}" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}"> | |
24 | + <view class="{{'tab3 ' + (index==title_index ? 'tab_action' : '')}}" style="font-size: {{object.title_font_size*2}}rpx;color: {{object.title_color}};" data-index="{{index}}" bindtap="gr_set_nav" data-idlist="{{item.idlist}}" data-wgroup="{{item.wgroup}}" data-classstyle="{{item.classstyle}}"> | |
25 | 25 | {{item.title}} |
26 | 26 | </view> |
27 | 27 | </view> |
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | <block wx:if="{{goods_array.length > 0 }}"> |
51 | 51 | <!-- 大图模式 --> |
52 | 52 | <block wx:if="{{object.style==1}}"> |
53 | - <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
53 | + <view style="{{'padding-top:'+object.product_spacing+'px;padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}" class="{{'new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
54 | 54 | <!-- <block wx:for="{{goods_array}}"> --> |
55 | 55 | <view wx:for="{{goods_array}}" wx:for-item="aitem" wx:for-index="aind" class="{{'new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> |
56 | 56 | <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> |
... | ... | @@ -91,7 +91,7 @@ |
91 | 91 | </block> |
92 | 92 | <!-- 一行两个 --> |
93 | 93 | <block wx:if="{{object.style==2}}"> |
94 | - <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
94 | + <view style="{{'padding-top:'+object.product_spacing+'px;padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
95 | 95 | <!-- <block wx:for="{{goods_array}}"> --> |
96 | 96 | <view wx:for="{{goods_array}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')+ (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}"> |
97 | 97 | <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> |
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 | </block> |
140 | 140 | <!-- 一行三个 --> |
141 | 141 | <block wx:if="{{object.style==3}}"> |
142 | - <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
142 | + <view style="{{'padding-top:'+object.product_spacing+'px;padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
143 | 143 | <!-- <block wx:for="{{goods_array}}"> --> |
144 | 144 | <view wx:for="{{goods_array}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/3 - ' + (object.product_spacing*2)/3+'px)')}}"> |
145 | 145 | <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> |
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | </block> |
188 | 188 | <!-- 详细列表 --> |
189 | 189 | <block wx:if="{{object.style==4}}"> |
190 | - <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
190 | + <view style="{{'padding-top:'+object.product_spacing+'px;padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
191 | 191 | <!-- <block wx:for="{{goods_array}}"> --> |
192 | 192 | <view wx:for="{{goods_array}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> |
193 | 193 | <navigator style="display: flex;" url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> |
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | </block> |
236 | 236 | <!-- 一大一小 --> |
237 | 237 | <block wx:if="{{object.style==5}}"> |
238 | - <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
238 | + <view style="{{'padding-top:'+object.product_spacing+'px;padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
239 | 239 | <block wx:for="{{goods_array}}"> |
240 | 240 | <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> |
241 | 241 | <view wx:if="{{aind==0}}" class="{{'new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> |
... | ... | @@ -413,7 +413,7 @@ |
413 | 413 | |
414 | 414 | </block> |
415 | 415 | <!-- 横向滑动 3个--> |
416 | - <block wx:if="{{object.style==6}}"> | |
416 | + <view wx:if="{{object.style==6}}" style="padding-top:{{object.product_spacing}}px;{{(object.product_style==2 ? ('background-color:'+object.bg_color) :'' )}}"> | |
417 | 417 | <!-- <swiper indicator-dots circular> --> |
418 | 418 | <swiper indicator-dots style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(swiperHeight ? ('height:'+swiperHeight+';'):'' )}}" class="{{' new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> |
419 | 419 | <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;"> |
... | ... | @@ -459,7 +459,7 @@ |
459 | 459 | </swiper> |
460 | 460 | <!-- </swiper> --> |
461 | 461 | |
462 | - </block> | |
462 | + </view> | |
463 | 463 | |
464 | 464 | <block wx:if="{{object.style!=6}}"> |
465 | 465 | <block wx:if="{{classstyle_id=='1' }}"> | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
... | ... | @@ -1025,6 +1025,7 @@ top: 10rpx; |
1025 | 1025 | .boxsha{ |
1026 | 1026 | /* box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25); */ |
1027 | 1027 | /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ |
1028 | + background-color: #fff; | |
1028 | 1029 | box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19); |
1029 | 1030 | } |
1030 | 1031 | .but_radius85{ |
... | ... | @@ -1151,7 +1152,7 @@ top: 10rpx; |
1151 | 1152 | font-size: 28rpx; |
1152 | 1153 | font-weight: bold; |
1153 | 1154 | overflow-x: auto; |
1154 | - margin-bottom: 20rpx; | |
1155 | + /* margin-bottom: 20rpx; */ | |
1155 | 1156 | /* min-width: 25%; */ |
1156 | 1157 | } |
1157 | 1158 | |
... | ... | @@ -1188,7 +1189,7 @@ top: 10rpx; |
1188 | 1189 | } |
1189 | 1190 | .tab_action{ |
1190 | 1191 | background-color: #f23030; |
1191 | - color: #fff; | |
1192 | + color: #fff !important; | |
1192 | 1193 | border: none !important; |
1193 | 1194 | opacity: .8; |
1194 | 1195 | /* border-color: #f23030 !important; */ | ... | ... |