微信小店联盟带货小程序

index.wxml 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <view class="container">
  2. <!-- 排序栏 -->
  3. <view class="sort-bar">
  4. <block wx:for="{{sortTypes}}" wx:key="value">
  5. <view
  6. class="sort-item {{currentSort === item.value ? 'active' : ''}}"
  7. data-sort="{{item.value}}"
  8. bindtap="changeSort"
  9. >
  10. {{item.label}}
  11. </view>
  12. </block>
  13. </view>
  14. <!-- 商品列表 -->
  15. <view class="goods-list">
  16. <view class="goods-item"
  17. wx:for="{{goodsList}}"
  18. wx:key="id"
  19. bindtap="navigateToDetail"
  20. data-id="{{item.id}}"
  21. >
  22. <view class="goods-img" style="background-color: #f8f8f8;">
  23. <image src="{{item.image}}" mode="aspectFill" lazy-load></image>
  24. </view>
  25. <view class="goods-info">
  26. <text class="goods-name">{{item.name}}</text>
  27. <view class="price-box">
  28. <view class="price-group">
  29. <text class="price-symbol">¥</text>
  30. <text class="price">{{item.price}}</text>
  31. </view>
  32. <view class="commission-group">
  33. <text class="iconfont icon-share"></text>
  34. <text class="commission">{{item.commission}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 加载状态 -->
  41. <view wx:if="{{loading}}" class="loading-state">
  42. <text>加载中...</text>
  43. </view>
  44. <!-- 无更多数据 -->
  45. <view wx:if="{{!loading && !hasMore && goodsList.length > 0}}" class="no-more">
  46. 没有更多商品了
  47. </view>
  48. <!-- 空状态 -->
  49. <view wx:if="{{!loading && goodsList.length === 0}}" class="empty-state">
  50. <text>暂无商品</text>
  51. </view>
  52. </view>