select-goods.wxml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!--module/order/pages/select-goods/select-goods.wxml-->
  2. <t-navbar title="选择商品" left-arrow />
  3. <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
  4. <!-- 商品列表 -->
  5. <view class="goods-list" wx:for="{{goodsList}}" wx:key="category">
  6. <!-- 分类标题 -->
  7. <view class="category-title">{{item.category}}</view>
  8. <!-- 商品项 -->
  9. <view class="goods-item" wx:for="{{item.goods}}" wx:for-item="goods" wx:for-index="goodsIndex" wx:key="id">
  10. <!-- 复选框 -->
  11. <view class="goods-checkbox">
  12. <t-checkbox checked="{{goods.checked}}" bind:change="onGoodsCheckChange" data-category-index="{{index}}" data-goods-index="{{goodsIndex}}" style="padding:0" />
  13. </view>
  14. <!-- 商品图片 -->
  15. <image class="goods-image" src="{{goods.image}}" mode="aspectFill" />
  16. <!-- 商品信息 -->
  17. <view class="goods-info">
  18. <view class="goods-name-row">
  19. <text class="goods-name">{{goods.name}}</text>
  20. </view>
  21. <view class="goods-desc" wx:if="{{goods.description}}">{{goods.description}}</view>
  22. <view class="goods-price-row">
  23. <text class="goods-price">¥{{goods.price}}</text>
  24. <!-- 数量选择器 -->
  25. <view wx:if="{{goods.price !== 0}}" class="quantity-selector">
  26. <view class="quantity-btn minus {{goods.quantity <= 1 ? 'disabled' : ''}}" bind:tap="onQuantityChange" data-category-index="{{index}}" data-goods-index="{{goodsIndex}}" data-type="minus">-</view>
  27. <input class="quantity-input" type="number" value="{{goods.quantity}}" bind:input="onQuantityInput" bind:blur="onQuantityBlur" data-category-index="{{index}}" data-goods-index="{{goodsIndex}}" />
  28. <view class="quantity-btn plus" bind:tap="onQuantityChange" data-category-index="{{index}}" data-goods-index="{{goodsIndex}}" data-type="plus">+</view>
  29. </view>
  30. <!-- 单价为0时直接显示X1 -->
  31. <view wx:else class="quantity-text">x1</view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 底部占位 -->
  37. <view class="footer-placeholder"></view>
  38. </scroll-view>
  39. <!-- 底部固定栏 -->
  40. <view class="footer-bar" style="padding-bottom: {{container.safeBottomOffset}}px;">
  41. <view class="footer-left">
  42. <t-checkbox checked="{{selectAll}}" bind:change="onSelectAllChange" label="全选" />
  43. </view>
  44. <view class="footer-center">
  45. <text class="footer-text">已选{{selectedCount}}件 合计: </text>
  46. <text class="footer-price">¥{{totalPrice}}</text>
  47. </view>
  48. <view class="footer-right">
  49. <view class="checkout-btn" bind:tap="onCheckout">结算</view>
  50. </view>
  51. </view>