Commit b8cbf558279e0225de8d8198ca4e610165bdc391
1 parent
e8c97497
商品分组添加购物车图标
Showing
2 changed files
with
135 additions
and
10 deletions
components/diy_goodsGroup/diy_goodsGroup.wxml
| @@ -155,7 +155,25 @@ | @@ -155,7 +155,25 @@ | ||
| 155 | </block> | 155 | </block> |
| 156 | 156 | ||
| 157 | </view> | 157 | </view> |
| 158 | - <view class='zs_wz5' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | 158 | + <!-- <view class='zs_wz5' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> --> |
| 159 | + <view class="flex jc-sb ai-center"> | ||
| 160 | + <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | ||
| 161 | + | ||
| 162 | + <!-- 购物车图标 --> | ||
| 163 | + <view class="icon-box" wx:if="{{object.goodcaricon != 1}}"> | ||
| 164 | + <!-- 系统图标 --> | ||
| 165 | + <block wx:if="{{object.goodcaricon == 2}}"> | ||
| 166 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_1.png'}}" wx:if="{{object.stylecaricon == 1}}" mode="widthFix"></image> | ||
| 167 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_2.png'}}" wx:if="{{object.stylecaricon == 2}}" mode="widthFix"></image> | ||
| 168 | + <text class="icon-text" wx:if="{{object.stylecaricon == 3}}">马上抢</text> | ||
| 169 | + <text class="icon-text" wx:if="{{object.stylecaricon == 4}}">立即购买</text> | ||
| 170 | + </block> | ||
| 171 | + <!-- 自定义图标 --> | ||
| 172 | + <block wx:if="{{object.goodcaricon == 3}}"> | ||
| 173 | + <image class="icon icon2" src="{{object.customcaricon}}" mode="widthFix"></image> | ||
| 174 | + </block> | ||
| 175 | + </view> | ||
| 176 | + </view> | ||
| 159 | <view style="height: 10rpx;"></view> | 177 | <view style="height: 10rpx;"></view> |
| 160 | </view> | 178 | </view> |
| 161 | </navigator> | 179 | </navigator> |
| @@ -303,8 +321,27 @@ | @@ -303,8 +321,27 @@ | ||
| 303 | </block> | 321 | </block> |
| 304 | </block> | 322 | </block> |
| 305 | </view> | 323 | </view> |
| 306 | - <view class='zs_wz5_2l' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | ||
| 307 | - <view style="height: 10rpx;"></view> | 324 | + <!-- <view class='zs_wz5_2l' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> --> |
| 325 | + <view class="flex jc-sb ai-center"> | ||
| 326 | + <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | ||
| 327 | + | ||
| 328 | + <!-- 购物车图标 --> | ||
| 329 | + <view class="icon-box" wx:if="{{object.goodcaricon != 1}}"> | ||
| 330 | + <!-- 系统图标 --> | ||
| 331 | + <block wx:if="{{object.goodcaricon == 2}}"> | ||
| 332 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_1.png'}}" wx:if="{{object.stylecaricon == 1}}" mode="widthFix"></image> | ||
| 333 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_2.png'}}" wx:if="{{object.stylecaricon == 2}}" mode="widthFix"></image> | ||
| 334 | + <text class="icon-text" wx:if="{{object.stylecaricon == 3}}">马上抢</text> | ||
| 335 | + <text class="icon-text" wx:if="{{object.stylecaricon == 4}}">立即购买</text> | ||
| 336 | + </block> | ||
| 337 | + <!-- 自定义图标 --> | ||
| 338 | + <block wx:if="{{object.goodcaricon == 3}}"> | ||
| 339 | + <image class="icon icon2" src="{{object.customcaricon}}" mode="widthFix"></image> | ||
| 340 | + </block> | ||
| 341 | + </view> | ||
| 342 | + </view> | ||
| 343 | + | ||
| 344 | + <view style="height: 10rpx;"></view> | ||
| 308 | </view> | 345 | </view> |
| 309 | </view> | 346 | </view> |
| 310 | </view> | 347 | </view> |
| @@ -453,7 +490,25 @@ | @@ -453,7 +490,25 @@ | ||
| 453 | </block> | 490 | </block> |
| 454 | </block> | 491 | </block> |
| 455 | </view> | 492 | </view> |
| 456 | - <view class='zs_wz5_3l' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | 493 | + <!-- <view class='zs_wz5_3l' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> --> |
| 494 | + <view class="flex jc-sb ai-center"> | ||
| 495 | + <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | ||
| 496 | + | ||
| 497 | + <!-- 购物车图标 --> | ||
| 498 | + <view class="icon-box" wx:if="{{object.goodcaricon != 1}}"> | ||
| 499 | + <!-- 系统图标 --> | ||
| 500 | + <block wx:if="{{object.goodcaricon == 2}}"> | ||
| 501 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_1.png'}}" wx:if="{{object.stylecaricon == 1}}" mode="widthFix"></image> | ||
| 502 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_2.png'}}" wx:if="{{object.stylecaricon == 2}}" mode="widthFix"></image> | ||
| 503 | + <text class="icon-text" wx:if="{{object.stylecaricon == 3}}">马上抢</text> | ||
| 504 | + <text class="icon-text" wx:if="{{object.stylecaricon == 4}}">立即购买</text> | ||
| 505 | + </block> | ||
| 506 | + <!-- 自定义图标 --> | ||
| 507 | + <block wx:if="{{object.goodcaricon == 3}}"> | ||
| 508 | + <image class="icon icon2" src="{{object.customcaricon}}" mode="widthFix"></image> | ||
| 509 | + </block> | ||
| 510 | + </view> | ||
| 511 | + </view> | ||
| 457 | <view style="height: 10rpx;"></view> | 512 | <view style="height: 10rpx;"></view> |
| 458 | </view> | 513 | </view> |
| 459 | </view> | 514 | </view> |
| @@ -610,7 +665,26 @@ | @@ -610,7 +665,26 @@ | ||
| 610 | 665 | ||
| 611 | </block> | 666 | </block> |
| 612 | </view> | 667 | </view> |
| 613 | - <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | 668 | + |
| 669 | + <view class="flex jc-sb ai-center"> | ||
| 670 | + <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> | ||
| 671 | + | ||
| 672 | + <!-- 购物车图标 --> | ||
| 673 | + <view class="icon-box" wx:if="{{object.goodcaricon != 1}}"> | ||
| 674 | + <!-- 系统图标 --> | ||
| 675 | + <block wx:if="{{object.goodcaricon == 2}}"> | ||
| 676 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_1.png'}}" wx:if="{{object.stylecaricon == 1}}" mode="widthFix"></image> | ||
| 677 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_2.png'}}" wx:if="{{object.stylecaricon == 2}}" mode="widthFix"></image> | ||
| 678 | + <text class="icon-text" wx:if="{{object.stylecaricon == 3}}">马上抢</text> | ||
| 679 | + <text class="icon-text" wx:if="{{object.stylecaricon == 4}}">立即购买</text> | ||
| 680 | + </block> | ||
| 681 | + <!-- 自定义图标 --> | ||
| 682 | + <block wx:if="{{object.goodcaricon == 3}}"> | ||
| 683 | + <image class="icon icon2" src="{{object.customcaricon}}" mode="widthFix"></image> | ||
| 684 | + </block> | ||
| 685 | + </view> | ||
| 686 | + </view> | ||
| 687 | + | ||
| 614 | </view> | 688 | </view> |
| 615 | 689 | ||
| 616 | </view> | 690 | </view> |
| @@ -784,7 +858,25 @@ | @@ -784,7 +858,25 @@ | ||
| 784 | </block> | 858 | </block> |
| 785 | </block> | 859 | </block> |
| 786 | </view> | 860 | </view> |
| 787 | - <view class='zs_wz5_3l' wx:if="{{object.goodsnum}}">销量:{{aitem.sales_sum}}件</view> | 861 | + <!-- <view class='zs_wz5_3l' wx:if="{{object.goodsnum}}">销量:{{aitem.sales_sum}}件</view> --> |
| 862 | + <view class="flex jc-sb ai-center"> | ||
| 863 | + <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{aitem.sales_sum}}件</view> | ||
| 864 | + | ||
| 865 | + <!-- 购物车图标 --> | ||
| 866 | + <view class="icon-box" wx:if="{{object.goodcaricon != 1}}"> | ||
| 867 | + <!-- 系统图标 --> | ||
| 868 | + <block wx:if="{{object.goodcaricon == 2}}"> | ||
| 869 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_1.png'}}" wx:if="{{object.stylecaricon == 1}}" mode="widthFix"></image> | ||
| 870 | + <image class="icon" src="{{url + '/miniapp/images/cart/group_goods_car_2.png'}}" wx:if="{{object.stylecaricon == 2}}" mode="widthFix"></image> | ||
| 871 | + <text class="icon-text" wx:if="{{object.stylecaricon == 3}}">马上抢</text> | ||
| 872 | + <text class="icon-text" wx:if="{{object.stylecaricon == 4}}">立即购买</text> | ||
| 873 | + </block> | ||
| 874 | + <!-- 自定义图标 --> | ||
| 875 | + <block wx:if="{{object.goodcaricon == 3}}"> | ||
| 876 | + <image class="icon icon2" src="{{object.customcaricon}}" mode="widthFix"></image> | ||
| 877 | + </block> | ||
| 878 | + </view> | ||
| 879 | + </view> | ||
| 788 | <view style="height: 10rpx;"></view> | 880 | <view style="height: 10rpx;"></view> |
| 789 | </view> | 881 | </view> |
| 790 | 882 |
components/diy_goodsGroup/diy_goodsGroup.wxss
| @@ -31,9 +31,10 @@ | @@ -31,9 +31,10 @@ | ||
| 31 | .zs_top { | 31 | .zs_top { |
| 32 | width: 100%; | 32 | width: 100%; |
| 33 | min-height: 700rpx; | 33 | min-height: 700rpx; |
| 34 | - margin: 0 auto; | ||
| 35 | - margin-bottom: 30rpx; | 34 | + /* margin: 0 auto; |
| 35 | + margin-bottom: 30rpx; */ | ||
| 36 | display: flex; | 36 | display: flex; |
| 37 | + | ||
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | .zs_t_img { | 40 | .zs_t_img { |
| @@ -43,13 +44,15 @@ | @@ -43,13 +44,15 @@ | ||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | .zs_center { | 46 | .zs_center { |
| 47 | + box-sizing: border-box; | ||
| 46 | width: 100%; | 48 | width: 100%; |
| 47 | /* min-height: 200rpx; */ | 49 | /* min-height: 200rpx; */ |
| 48 | font-size: 28rpx; | 50 | font-size: 28rpx; |
| 49 | color: #333; | 51 | color: #333; |
| 50 | text-align: left; | 52 | text-align: left; |
| 51 | - margin-left: 25rpx; | ||
| 52 | - padding: 0 10rpx; | 53 | + padding: 20rpx; |
| 54 | + /* margin-left: 25rpx; */ | ||
| 55 | + /* padding: 0 10rpx; */ | ||
| 53 | } | 56 | } |
| 54 | 57 | ||
| 55 | .zs_wz1 { | 58 | .zs_wz1 { |
| @@ -171,6 +174,8 @@ | @@ -171,6 +174,8 @@ | ||
| 171 | .zs_center_x { | 174 | .zs_center_x { |
| 172 | /* width: 100%; | 175 | /* width: 100%; |
| 173 | min-height: 200rpx; */ | 176 | min-height: 200rpx; */ |
| 177 | + box-sizing: border-box; | ||
| 178 | + flex-grow: 1; | ||
| 174 | font-size: 28rpx; | 179 | font-size: 28rpx; |
| 175 | color: #333; | 180 | color: #333; |
| 176 | padding-left: 20rpx; | 181 | padding-left: 20rpx; |
| @@ -555,6 +560,10 @@ | @@ -555,6 +560,10 @@ | ||
| 555 | justify-content: space-around; | 560 | justify-content: space-around; |
| 556 | } | 561 | } |
| 557 | 562 | ||
| 563 | +.jc-sb { | ||
| 564 | + justify-content: space-between; | ||
| 565 | +} | ||
| 566 | + | ||
| 558 | .fs24 { | 567 | .fs24 { |
| 559 | font-size: 24rpx; | 568 | font-size: 24rpx; |
| 560 | } | 569 | } |
| @@ -870,5 +879,29 @@ top: 10rpx; | @@ -870,5 +879,29 @@ top: 10rpx; | ||
| 870 | -webkit-line-clamp: 2; | 879 | -webkit-line-clamp: 2; |
| 871 | } | 880 | } |
| 872 | 881 | ||
| 882 | +.icon-box { | ||
| 883 | + /* width: 50rpx; */ | ||
| 884 | +} | ||
| 885 | + | ||
| 886 | +.icon-box .icon { | ||
| 887 | + display: block; | ||
| 888 | + width: 50rpx; | ||
| 889 | + height: 50rpx; | ||
| 890 | +} | ||
| 891 | + | ||
| 892 | +.icon-box .icon.icon2 { | ||
| 893 | + width: 80rpx; | ||
| 894 | +} | ||
| 895 | + | ||
| 896 | +.icon-box .icon-text { | ||
| 897 | + font-size: 26rpx; | ||
| 898 | + color: red; | ||
| 899 | + padding: 10rpx 20rpx; | ||
| 900 | + border: 2rpx solid red; | ||
| 901 | + border-radius: 40rpx; | ||
| 902 | +} | ||
| 903 | + | ||
| 904 | + | ||
| 905 | + | ||
| 873 | 906 | ||
| 874 | 907 |