cart.wxml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <view class="container">
  2. <view class="no-login" wx:if="{{!hasLogin}}">
  3. <view class="c">
  4. <text>还没有登录</text>
  5. <button style="background-color:#A9A9A9" bindtap="goLogin">去登录</button>
  6. </view>
  7. </view>
  8. <view class='login' wx:else>
  9. <view class="service-policy">
  10. <view class="item">30天无忧退货</view>
  11. <view class="item">48小时快速退款</view>
  12. <view class="item">满88元免邮费</view>
  13. </view>
  14. <view class="no-cart" wx:if="{{cartGoods.length <= 0}}">
  15. <view class="c">
  16. <text>空空如也~</text>
  17. <text>去添加点什么吧</text>
  18. </view>
  19. </view>
  20. <view class="cart-view" wx:else>
  21. <view class="list">
  22. <view class="group-item">
  23. <view class="goods">
  24. <view class="item {{isEditCart ? 'edit' : ''}}" wx:for="{{cartGoods}}" wx:key="id">
  25. <van-checkbox value="{{ item.checked }}" bind:change="checkedItem" data-item-index="{{index}}"></van-checkbox>
  26. <view class="cart-goods">
  27. <image class="img" src="{{item.picUrl}}"></image>
  28. <view class="info">
  29. <view class="t">
  30. <text class="name">{{item.goodsName}}</text>
  31. <text class="num">x{{item.number}}</text>
  32. </view>
  33. <view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.specifications||''}}</view>
  34. <view class="b">
  35. <text class="price">¥{{item.price}}</text>
  36. <view class="selnum">
  37. <view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
  38. <input value="{{item.number}}" class="number" disabled="true" type="number" />
  39. <view class="add" bindtap="addNumber" data-item-index="{{index}}">+</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="cart-bottom">
  49. <van-checkbox value="{{ checkedAllStatus }}" bind:change="checkedAll">全选({{cartTotal.checkedGoodsCount}})</van-checkbox>
  50. <view class="total">{{!isEditCart ? '¥'+cartTotal.checkedGoodsAmount : ''}}</view>
  51. <view class='action_btn_area'>
  52. <view class="{{!isEditCart ? 'edit' : 'sure'}}" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
  53. <view class="delete" bindtap="deleteCart" wx:if="{{isEditCart}}">删除({{cartTotal.checkedGoodsCount}})</view>
  54. <view class="checkout" bindtap="checkoutOrder" wx:if="{{!isEditCart}}">下单</view>
  55. <!-- </view> -->
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>