Commit 8a5a4b6e32d0764d293ecdd5edf21c9a2e0701bc

Authored by 前端开发-罗建龙
1 parent 8987935b

自定义组件商品分组优化

components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -11,17 +11,17 @@ @@ -11,17 +11,17 @@
11 <view class="{{'tabBox ' + (object.menu_style==2 ? 'tab2' :'')}}"> 11 <view class="{{'tabBox ' + (object.menu_style==2 ? 'tab2' :'')}}">
12 <!--样式一--> 12 <!--样式一-->
13 <block wx:if="{{object.menu_style==1}}"> 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 </block> 16 </block>
17 <!--样式二--> 17 <!--样式二-->
18 <block wx:if="{{object.menu_style==2}}"> 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 </block> 20 </block>
21 <!--样式三--> 21 <!--样式三-->
22 <block wx:if="{{object.menu_style==3}}"> 22 <block wx:if="{{object.menu_style==3}}">
23 <view wx:for="{{object.nav_list}}" class="tab "> 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 {{item.title}} 25 {{item.title}}
26 </view> 26 </view>
27 </view> 27 </view>
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 <block wx:if="{{goods_array.length > 0 }}"> 50 <block wx:if="{{goods_array.length > 0 }}">
51 <!-- 大图模式 --> 51 <!-- 大图模式 -->
52 <block wx:if="{{object.style==1}}"> 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 <!-- <block wx:for="{{goods_array}}"> --> 54 <!-- <block wx:for="{{goods_array}}"> -->
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;'}}"> 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 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> 56 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1">
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 </block> 91 </block>
92 <!-- 一行两个 --> 92 <!-- 一行两个 -->
93 <block wx:if="{{object.style==2}}"> 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 <!-- <block wx:for="{{goods_array}}"> --> 95 <!-- <block wx:for="{{goods_array}}"> -->
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)')}}"> 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 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> 97 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1">
@@ -139,7 +139,7 @@ @@ -139,7 +139,7 @@
139 </block> 139 </block>
140 <!-- 一行三个 --> 140 <!-- 一行三个 -->
141 <block wx:if="{{object.style==3}}"> 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 <!-- <block wx:for="{{goods_array}}"> --> 143 <!-- <block wx:for="{{goods_array}}"> -->
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)')}}"> 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 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> 145 <navigator url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1">
@@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
187 </block> 187 </block>
188 <!-- 详细列表 --> 188 <!-- 详细列表 -->
189 <block wx:if="{{object.style==4}}"> 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 <!-- <block wx:for="{{goods_array}}"> --> 191 <!-- <block wx:for="{{goods_array}}"> -->
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;'}}"> 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 <navigator style="display: flex;" url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1"> 193 <navigator style="display: flex;" url="{{g_filter.get_url_by_type(aitem)}}" class="s1_gk_a1">
@@ -235,7 +235,7 @@ @@ -235,7 +235,7 @@
235 </block> 235 </block>
236 <!-- 一大一小 --> 236 <!-- 一大一小 -->
237 <block wx:if="{{object.style==5}}"> 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 <block wx:for="{{goods_array}}"> 239 <block wx:for="{{goods_array}}">
240 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 240 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
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;'}}"> 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,7 +413,7 @@
413 413
414 </block> 414 </block>
415 <!-- 横向滑动 3个--> 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 <!-- <swiper indicator-dots circular> --> 417 <!-- <swiper indicator-dots circular> -->
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 ':'')}}"> 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 <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;"> 419 <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;">
@@ -459,7 +459,7 @@ @@ -459,7 +459,7 @@
459 </swiper> 459 </swiper>
460 <!-- </swiper> --> 460 <!-- </swiper> -->
461 461
462 - </block> 462 + </view>
463 463
464 <block wx:if="{{object.style!=6}}"> 464 <block wx:if="{{object.style!=6}}">
465 <block wx:if="{{classstyle_id=='1' }}"> 465 <block wx:if="{{classstyle_id=='1' }}">
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -1025,6 +1025,7 @@ top: 10rpx; @@ -1025,6 +1025,7 @@ top: 10rpx;
1025 .boxsha{ 1025 .boxsha{
1026 /* box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25); */ 1026 /* box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25); */
1027 /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ 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 box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19); 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 .but_radius85{ 1031 .but_radius85{
@@ -1151,7 +1152,7 @@ top: 10rpx; @@ -1151,7 +1152,7 @@ top: 10rpx;
1151 font-size: 28rpx; 1152 font-size: 28rpx;
1152 font-weight: bold; 1153 font-weight: bold;
1153 overflow-x: auto; 1154 overflow-x: auto;
1154 - margin-bottom: 20rpx; 1155 + /* margin-bottom: 20rpx; */
1155 /* min-width: 25%; */ 1156 /* min-width: 25%; */
1156 } 1157 }
1157 1158
@@ -1188,7 +1189,7 @@ top: 10rpx; @@ -1188,7 +1189,7 @@ top: 10rpx;
1188 } 1189 }
1189 .tab_action{ 1190 .tab_action{
1190 background-color: #f23030; 1191 background-color: #f23030;
1191 - color: #fff; 1192 + color: #fff !important;
1192 border: none !important; 1193 border: none !important;
1193 opacity: .8; 1194 opacity: .8;
1194 /* border-color: #f23030 !important; */ 1195 /* border-color: #f23030 !important; */