category.wxml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <van-search value="{{ name }}" placeholder="请输入搜索关键词" shape="round" bind:search="bindconfirm" />
  2. <view class="main">
  3. <scroll-view class="category-container" scroll-y="true" scroll-with-animation="true" scroll-into-view="{{ aaa }}">
  4. <van-sidebar active-key="{{ activeCategory }}">
  5. <van-sidebar-item wx:if="{{item.level == 1}}" id="category{{item.id}}" wx:for="{{firstCategories}}" wx:key="id" data-idx="{{index}}" bindtap="onCategoryClick" title="{{ item.name }}" />
  6. </van-sidebar>
  7. </scroll-view>
  8. <scroll-view class="goods-container" scroll-y="true" scroll-top="{{scrolltop}}" wx:if='{{onLoadStatus}}' bindscrolltolower="goodsGoBottom">
  9. <van-tabs wx:if="{{ categorySelected.childs && categorySelected.childs.length > 0 }}" custom-class="llargada" bind:change="onSecondCategoryClick">
  10. <van-tab title="全部"></van-tab>
  11. <van-tab wx:for="{{categorySelected.childs}}" wx:key="id" title="{{ item.name }}"></van-tab>
  12. </van-tabs>
  13. <van-empty wx:if="{{!currentGoods}}" description="暂无商品" />
  14. <!-- 三级级分类展示 -->
  15. <!-- <view wx:for="{{categories}}" wx:key="id" wx:if="{{item.pid == categorySelected.id}}">
  16. <navigator url="/pages/goods/list?categoryId={{item.id}}">
  17. <view class="no-data medium-category">
  18. <view class="line"></view>
  19. <view class="txt">{{item.name}}</view>
  20. <view class="line"></view>
  21. </view>
  22. </navigator>
  23. <view class="small-category-box">
  24. <navigator wx:for="{{categories}}" wx:for-item="small" wx:key="id" wx:if="{{small.pid == item.id}}" url="/pages/goods/list?categoryId={{small.id}}">
  25. <view class="small-category">
  26. <image mode="aspectFill" src="{{small.icon}}"></image>
  27. <view>{{small.name}}</view>
  28. </view>
  29. </navigator>
  30. </view>
  31. </view> -->
  32. <!-- 显示右侧商品 -->
  33. <van-card
  34. wx:for="{{currentGoods}}" wx:key="id"
  35. price="{{item.minPrice}}"
  36. desc="{{item.numberSells ? '已售' + item.numberSells : ''}}"
  37. tag="{{item.gotScore ? item.gotScore + '积分' : ''}}"
  38. title="{{item.name}}"
  39. thumb="{{item.pic}}_m"
  40. thumb-link="/pages/goods-details/index?id={{item.id}}"
  41. >
  42. <view class="goods-btn" slot="footer">
  43. <van-icon wx:if="{{ item.propertyIds || item.hasAddition }}" name="add" color="#e64340" size="48rpx" data-id="{{item.id}}" bind:click="addShopCar" />
  44. <van-icon wx:else name="shopping-cart-o" color="#e64340" size="48rpx" data-id="{{item.id}}" bind:click="addShopCar" />
  45. </view>
  46. </van-card>
  47. </scroll-view>
  48. </view>
  49. <van-popup
  50. show="{{ skuCurGoodsShow }}"
  51. position="bottom"
  52. round
  53. custom-style="padding-top:32rpx;max-height: 80%;"
  54. bind:close="closeSku"
  55. >
  56. <van-card
  57. centered
  58. price="{{ selectSizePrice }}"
  59. origin-price="{{ selectSizePrice != selectSizePrice ? selectSizeOPrice : '' }}"
  60. title="{{ skuCurGoods.basicInfo.name }}"
  61. thumb="{{ skuGoodsPic }}"
  62. />
  63. <view class="sku-container">
  64. <view class="sku" wx:for="{{skuCurGoods.properties}}" wx:key="id">
  65. <view class="t">{{item.name}}</view>
  66. <view class="items">
  67. <text class="{{small.active? 'active' : ''}}" wx:for="{{item.childsCurGoods}}" wx:for-item="small" wx:key="id" data-pid="{{small.propertyId}}" data-id="{{small.id}}" bindtap="skuSelect">{{small.name}}</text>
  68. </view>
  69. </view>
  70. <view class="num">
  71. <view class="t">购买数量</view>
  72. <van-stepper value="{{ skuCurGoods.basicInfo.storesBuy }}" bind:plus="storesJia" bind:minus="storesJian" />
  73. </view>
  74. </view>
  75. <van-button type="danger" block bind:click="addCarSku">加入购物车</van-button>
  76. </van-popup>
  77. <van-dialog id="van-dialog-auth-login" bind:getuserinfo="processLogin" />