index.wxml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!-- <swiper class="swiper" indicator-dots="true" autoplay="true">
  2. <swiper-item wx:for="{{imgUrls}}" wx:key="index">
  3. <image src="{{item}}" class="slide-image" mode="aspectFill" />
  4. </swiper-item>
  5. </swiper> -->
  6. <headerCard imgUrls="{{banner}}" title='商超预定'></headerCard>
  7. <view class="store" date-store="{{store.objectId ? store.objectId : ''}}">
  8. <view class="cover" bind:tap="selectStore">
  9. <image src="{{store.cover ? store.cover : 'https://file-cloud.fmode.cn/sHNeVwSaAg/20220823/n1ei8h103147.png'}}" mode="aspectFill"></image>
  10. </view>
  11. <view class="storeInfo" bind:tap="selectStore">
  12. <view class="storeInfo_left">
  13. <view class="name">
  14. {{store.storeName ? store.storeName : '请选择店铺'}}
  15. <!-- <van-icon name="arrow" /> -->
  16. </view>
  17. <view class="add">
  18. {{store.address ? store.address : '暂无店铺地址'}}
  19. <!-- <van-icon name="arrow" /> -->
  20. </view>
  21. </view>
  22. <view class="storeInfo_right">
  23. <view class="mobile">
  24. <image src="https://file-cloud.fmode.cn/sHNeVwSaAg/20230812/89brc6034149394.png?imageView2/1/w/200/h/200" style="height: 21rpx;width: 21rpx;"></image>
  25. 联系方式:{{store.mobile ? store.mobile : '暂无联系方式' }}
  26. </view>
  27. <view class="opening">
  28. <image src="https://file-cloud.fmode.cn/sHNeVwSaAg/20230812/6hmule034139186.png?imageView2/1/w/200/h/200" style="height: 21rpx;width: 21rpx;"></image>
  29. 营业时间:{{store.workingTime ? store.workingTime : '暂未设置营业时间'}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="shopCart" bind:tap="checkCart">
  34. <image src="https://file-cloud.fmode.cn/sHNeVwSaAg/20220824/a18ee1095119.png" mode="aspectFill"></image>
  35. <view class="total" wx:if="{{shopCart.length > 0}}">{{shopCart.length}}</view>
  36. </view>
  37. </view>
  38. <!-- 导航 -->
  39. <view class="tabs">
  40. <view class="tab {{activeItem == 'all' ? 'tabIndex' : ''}}" data-id="all" bind:tap="changeCate">全部
  41. <view class="borderRadius" wx:if="{{activeItem == 'all' ? 'tabIndex' : ''}}"></view>
  42. </view>
  43. <view class="tab {{activeItem == item.objectId ? 'tabIndex' : ''}}" wx:for="{{category}}" wx:key="index" data-id="{{item.objectId}}" bind:tap="changeCate" >{{item.name}}
  44. <view class="borderRadius" wx:if="{{activeItem == item.objectId ? 'tabIndex' : ''}}"></view>
  45. </view>
  46. </view>
  47. <!-- 商品 -->
  48. <view class="loading" wx:if="{{loading}}">
  49. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  50. </view>
  51. <view class="right_content" wx:elif="{{goods && goods.length > 0}}">
  52. <view class="goods_box" wx:for="{{goods}}" wx:key="index">
  53. <!-- <view class="title" wx:if="{{activeItem == 'all'}}">{{item.category.name}}</view> -->
  54. <view class="goods_item" data-id="{{item.objectId}}">
  55. <view class="image">
  56. <image class="image" src="{{item.image}}" mode="aspectFill" />
  57. </view>
  58. <view class="content">
  59. <view class="name">{{item.name}}</view>
  60. <view class="tags">
  61. <text wx:for="{{item.tag}}" wx:key="index" wx:for-item="tag">{{tag}}</text>
  62. </view>
  63. <view class="li_desc">{{item.desc ? item.desc : '暂无零食介绍~'}}</view>
  64. <!-- <view class="li_num">
  65. <view class="li_desc_row">销量 {{item.sales}}</view>
  66. <view class="li_desc_row" wx:if="{{!active}}">库存 {{item.total}}</view>
  67. </view> -->
  68. <view class="li_row">
  69. <view class="price">
  70. ¥{{item.price}}
  71. <!-- <view class="decoration">
  72. {{item.originalPrice ? item.originalPrice : item.price}}
  73. </view> -->
  74. </view>
  75. <view class="count">
  76. <van-icon wx:if="{{!active && !item.total}}" color="yellowgreen" name="add" class="tag" bind:tap="onTips" />
  77. <van-icon wx:else name="add" class="tag" data-index="{{index}}" bind:tap="addCount" />
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view style="height: 300rpx;"></view>
  84. </view>
  85. <view style="width: 100%;" wx:else>
  86. <van-empty description="暂无商品" />
  87. </view>
  88. <!-- 购物车 -->
  89. <van-popup show="{{ show }}" bind:close="onClose" round closeable close-icon-position="top-right" position="bottom" custom-style="height: 60%;">
  90. <view class="shopGoods">
  91. <view class="title" style="bottom:{{screenHeight - bottom }}px">购物车</view>
  92. <view class="loading" wx:if="{{cartLoading}}">
  93. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  94. </view>
  95. <block wx:if="{{shopCart.length > 0}}">
  96. <scroll-view scroll-y="{{true}}" style="height: 100% - 80rpx;padding-bottom: 200rpx;">
  97. <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o" text="向右滑动删除商品即可移出购物车" />
  98. <view class="goods" wx:for="{{orderGoods}}" wx:key="index">
  99. <van-radio-group value="{{ radio }}" bind:change="onChange">
  100. <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="delete">
  101. <view class="cart_info">
  102. <view class="left_info">
  103. <radio class="radio" wx:if="{{!item.open}}" disabled color="#fd4441" />
  104. <radio class="radio" bindtap="checkItem" wx:else data-index="{{index}}" checked="{{item.check}}" color="#fd4441" />
  105. <view class="image_box">
  106. <view class="open" wx:if="{{!item.open}}">该店铺库存不足</view>
  107. <image class="image" src="{{item.image}}" mode="aspectFill" lazy-load="false" />
  108. </view>
  109. </view>
  110. <view class="right_info">
  111. <view class="title">{{item.name}}</view>
  112. <view class="down_info">
  113. <view class="price">¥{{item.totalPrice}}</view>
  114. <van-stepper value="{{item.count}}" min="1" max="100" disable-input="true" input-class="ipt" data-index="{{index}}" bind:plus="plus" bind:minus="minus" bind:change="onChange" />
  115. </view>
  116. </view>
  117. </view>
  118. <view slot="right" class="delete">删除</view>
  119. </van-swipe-cell>
  120. </van-radio-group>
  121. </view>
  122. </scroll-view>
  123. <view class="cart_down" style="--bottom:{{screenHeight - bottom }}px">
  124. <view class="cart_left">
  125. <label class="">
  126. <radio bindtap="checkAll" class="all_radio" checked="{{allCheck}}" color="#ef2a01" />
  127. </label>
  128. <view class="choose">全选</view>
  129. </view>
  130. <view class="cart_right">
  131. <view class="total_info">
  132. <view class="total_price">合计:¥{{totalPrice ? totalPrice : 0}}</view>
  133. </view>
  134. <button bindtap="{{totalPrice > 0 ? 'onDelete' : ''}}" class="button {{totalPrice > 0 ? 'actives' : ''}}">
  135. 删除
  136. </button>
  137. <button bindtap="submit" class="button {{totalPrice > 0 ? 'active' : ''}}">结算</button>
  138. </view>
  139. </view>
  140. </block>
  141. <block wx:else>
  142. <van-empty description="购物车空空如也~" />
  143. </block>
  144. </view>
  145. </van-popup>
  146. <view style="width: 750rpx; height: 300rpx;"></view>