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 | 155 | </block> |
| 156 | 156 | |
| 157 | 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 | 177 | <view style="height: 10rpx;"></view> |
| 160 | 178 | </view> |
| 161 | 179 | </navigator> |
| ... | ... | @@ -303,8 +321,27 @@ |
| 303 | 321 | </block> |
| 304 | 322 | </block> |
| 305 | 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 | 345 | </view> |
| 309 | 346 | </view> |
| 310 | 347 | </view> |
| ... | ... | @@ -453,7 +490,25 @@ |
| 453 | 490 | </block> |
| 454 | 491 | </block> |
| 455 | 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 | 512 | <view style="height: 10rpx;"></view> |
| 458 | 513 | </view> |
| 459 | 514 | </view> |
| ... | ... | @@ -610,7 +665,26 @@ |
| 610 | 665 | |
| 611 | 666 | </block> |
| 612 | 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 | 688 | </view> |
| 615 | 689 | |
| 616 | 690 | </view> |
| ... | ... | @@ -784,7 +858,25 @@ |
| 784 | 858 | </block> |
| 785 | 859 | </block> |
| 786 | 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 | 880 | <view style="height: 10rpx;"></view> |
| 789 | 881 | </view> |
| 790 | 882 | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
| ... | ... | @@ -31,9 +31,10 @@ |
| 31 | 31 | .zs_top { |
| 32 | 32 | width: 100%; |
| 33 | 33 | min-height: 700rpx; |
| 34 | - margin: 0 auto; | |
| 35 | - margin-bottom: 30rpx; | |
| 34 | + /* margin: 0 auto; | |
| 35 | + margin-bottom: 30rpx; */ | |
| 36 | 36 | display: flex; |
| 37 | + | |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | .zs_t_img { |
| ... | ... | @@ -43,13 +44,15 @@ |
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | .zs_center { |
| 47 | + box-sizing: border-box; | |
| 46 | 48 | width: 100%; |
| 47 | 49 | /* min-height: 200rpx; */ |
| 48 | 50 | font-size: 28rpx; |
| 49 | 51 | color: #333; |
| 50 | 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 | 58 | .zs_wz1 { |
| ... | ... | @@ -171,6 +174,8 @@ |
| 171 | 174 | .zs_center_x { |
| 172 | 175 | /* width: 100%; |
| 173 | 176 | min-height: 200rpx; */ |
| 177 | + box-sizing: border-box; | |
| 178 | + flex-grow: 1; | |
| 174 | 179 | font-size: 28rpx; |
| 175 | 180 | color: #333; |
| 176 | 181 | padding-left: 20rpx; |
| ... | ... | @@ -555,6 +560,10 @@ |
| 555 | 560 | justify-content: space-around; |
| 556 | 561 | } |
| 557 | 562 | |
| 563 | +.jc-sb { | |
| 564 | + justify-content: space-between; | |
| 565 | +} | |
| 566 | + | |
| 558 | 567 | .fs24 { |
| 559 | 568 | font-size: 24rpx; |
| 560 | 569 | } |
| ... | ... | @@ -870,5 +879,29 @@ top: 10rpx; |
| 870 | 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 | ... | ... |