template-cart.wxml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template name="no-goods">
  2. <van-empty description="购物车空空如也~" image="https://dcdn.it120.cc/2021/03/02/11544ab7-38ca-4570-a876-cbfd39720367.png">
  3. <van-button round type="danger" size="small" class="bottom-button" bind:click="toIndexPage">
  4. 去逛逛
  5. </van-button>
  6. </van-empty>
  7. </template>
  8. <template name="cart-goods-list">
  9. <view wx:if="{{ shopCarType == 0 }}" class="goodsList"> <!-- 自营 -->
  10. <van-cell-group wx:for="{{shopList}}" wx:for-item="shop" wx:for-index="shopIndex" wx:key="id" title="{{ shop.name }}">
  11. <view class="a-gooods" wx:for="{{items}}" wx:key="key" wx:if="{{ item.shopId == shop.id }}">
  12. <view class="a-goods-conts {{item.active? 'active':''}}" bindtouchstart="touchS" bindtouchmove="touchM"
  13. bindtouchend="touchE" data-index="{{index}}" style="{{item.left}}">
  14. <view class="goods-info">
  15. <view class="radio-box">
  16. <radio checked="{{ item.selected }}" bindtap="radioClick" data-index="{{index}}" />
  17. </view>
  18. <view class="img-box">
  19. <image mode="aspectFill" src="{{item.pic}}" class="img" />
  20. </view>
  21. <view class="text-box">
  22. <view class="goods-title">{{item.name}}</view>
  23. <view wx:show="{{item.sku}}" class="goods-label">
  24. <block wx:for="{{item.sku}}" wx:for-item="option" wx:key="index">
  25. {{option.optionName}}:{{option.optionValueName}}
  26. </block>
  27. <block wx:for="{{item.additions}}" wx:for-item="option" wx:key="index">
  28. {{option.pname}}:{{option.name}}
  29. </block>
  30. </view>
  31. <view class="goods-price">¥ {{item.price}}</view>
  32. <view class="buy-num">
  33. <view class="jian-btn" catchtap="jianBtnTap" data-index="{{index}}">-</view>
  34. <input type="number" value="{{item.number}}" data-key="{{item.key}}" bindinput="changeCarNumber" />
  35. <view class="jia-btn {{item.number==curTouchGoodStore? 'disabled' : ''}}" catchtap="jiaBtnTap"
  36. data-index="{{index}}">+</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="delete-btn" data-key="{{item.key}}" catchtap="delItem">
  41. 删除
  42. </view>
  43. <!-- <view class="del-icon">
  44. <van-icon name="close" size="32rpx" color="#000" data-key="{{item.key}}" catchtap="delItem" />
  45. </view> -->
  46. </view>
  47. </view>
  48. </van-cell-group>
  49. </view>
  50. <view wx:if="{{ shopCarType == 1 }}" class="goodsList"> <!-- vop -->
  51. <view class="a-gooods" wx:for="{{items}}" wx:key="key">
  52. <view class="a-goods-conts {{item.active? 'active':''}}" bindtouchstart="touchS" bindtouchmove="touchM"
  53. bindtouchend="touchE" data-index="{{index}}" style="{{item.left}}">
  54. <view class="goods-info">
  55. <view class="radio-box">
  56. <radio checked="{{ item.selected }}" bindtap="radioClick" data-index="{{index}}" />
  57. </view>
  58. <view class="img-box">
  59. <image mode="aspectFill" src="{{item.pic}}" class="img" />
  60. </view>
  61. <view class="text-box">
  62. <view class="goods-title">{{item.name}}</view>
  63. <view wx:show="{{item.sku}}" class="goods-label">
  64. <block wx:for="{{item.sku}}" wx:for-item="option" wx:key="index">
  65. {{option.optionName}}:{{option.optionValueName}}
  66. </block>
  67. <block wx:for="{{item.additions}}" wx:for-item="option" wx:key="index">
  68. {{option.pname}}:{{option.name}}
  69. </block>
  70. </view>
  71. <view class="goods-price">¥ {{item.price}}</view>
  72. <view class="buy-num">
  73. <view class="jian-btn" catchtap="jianBtnTap" data-index="{{index}}">-</view>
  74. <input type="number" value="{{item.number}}" data-key="{{item.key}}" bindinput="changeCarNumber" />
  75. <view class="jia-btn {{item.number==curTouchGoodStore? 'disabled' : ''}}" catchtap="jiaBtnTap"
  76. data-index="{{index}}">+</view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="delete-btn" data-key="{{item.key}}" catchtap="delItem">
  81. 删除
  82. </view>
  83. <!-- <view class="del-icon">
  84. <van-icon name="close" size="32rpx" color="#000" data-key="{{item.key}}" catchtap="delItem" />
  85. </view> -->
  86. </view>
  87. </view>
  88. </view>
  89. <view class="jiesuan-box">
  90. <view class="left-price">
  91. <view wx:if="{{ score }}" class="total">合计:¥ {{price}} + {{score}} 积分</view>
  92. <view wx:else class="total">合计:¥ {{price}}</view>
  93. </view>
  94. <view class="to-pay-btn">
  95. <navigator url="/pages/to-pay-order/index?shopCarType={{shopCarType}}">去结算</navigator>
  96. </view>
  97. </view>
  98. </template>