index.wxml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <!--nova-tourism/components/template2/shop/index.wxml-->
  2. <nav type="location" title="商超店铺" frontColor="#ffffff" background-color="#f39283" />
  3. <view class="flexd" wx:if="{{!show}}">
  4. <view class="nav-background"></view>
  5. <view class="nav-info">
  6. <view class="info-top" bind:tap="selectStore">
  7. <view class="top-left">
  8. <view>
  9. <image
  10. src="{{store.cover ? store.cover : 'https://file-cloud.fmode.cn/sHNeVwSaAg/20220823/n1ei8h103147.png'}}"
  11. mode="aspectFill" style="width: 90rpx;height: 90rpx;border-radius: 100rpx;" />
  12. </view>
  13. <view class="name-distance">
  14. <view class="name">{{store.storeName ? store.storeName : '请选择店铺'}}</view>
  15. <view class="distance" wx:if="{{store.distance}}">该店铺距离您{{store.distance}}km</view>
  16. </view>
  17. </view>
  18. <view class="top-right">
  19. <view>
  20. <view>
  21. <image src="https://file.ruixiuauto.com/cDBRXuM6Xh/20230809/jirkaj100203799.png"
  22. style="width: 22rpx;height: 22rpx;" />
  23. </view>
  24. <view class="right-info">联系方式:{{store.mobile ? store.mobile : '暂无联系方式' }}</view>
  25. </view>
  26. <view>
  27. <view>
  28. <image src="https://file.ruixiuauto.com/cDBRXuM6Xh/20230809/bp3f3p100156488.png"
  29. style="width: 22rpx;height: 22rpx;" />
  30. </view>
  31. <view class="right-info">营业时间:{{store.workingTime ? store.workingTime : '暂未设置营业时间'}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="v-search">
  36. <van-search model:value="{{ value }}"
  37. left-icon="https://file.ruixiuauto.com/cDBRXuM6Xh/20230809/eg1pes093404417.png" background="transparent"
  38. placeholder="搜索你想要的生活" shape="round" use-action-slot bind:change="search" bind:search="search">
  39. </van-search>
  40. </view>
  41. </view>
  42. </view>
  43. <view style="height: 275rpx;"></view>
  44. <view class="cate_info" style="height:1000rpx;">
  45. <view class="cate_container">
  46. <scroll-view class="left_menu" scroll-y
  47. style="height:calc(100vh - {{2 * (customBarHeight + screenHeight - bottom) + 50 + 340}}rpx)">
  48. <view class="left_content">
  49. <view class="left_item {{activeItem == 'all' ? 'active' : ''}}" data-id="all" bind:tap="changeCate">
  50. 全部
  51. </view>
  52. <view class="left_item {{activeItem == item.objectId ? 'active' : ''}}" wx:for="{{category}}" wx:key="index"
  53. data-id="{{item.objectId}}" bind:tap="changeCate">
  54. {{item.name}}
  55. </view>
  56. </view>
  57. </scroll-view>
  58. <!-- bindscrolltolower="scrolltolower" -->
  59. <scroll-view class="right_list" scroll-y="{{true}}" scroll-top="{{scrollTop}}"
  60. style="height:calc(100vh - {{2 * (customBarHeight + screenHeight - bottom) + 50+ 340}}rpx)"
  61. >
  62. <view class="loading" wx:if="{{loading}}">
  63. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  64. </view>
  65. <view class="right_content" wx:elif="{{goods && goods.length > 0}}">
  66. <swiper class="right_swiper" indicator-dots>
  67. <block wx:for="{{banner}}" wx:key="index">
  68. <swiper-item>
  69. <image src="{{item.image}}" style="height: 220rpx;border-radius: 12rpx;width: 528rpx;">
  70. </image>
  71. </swiper-item>
  72. </block>
  73. </swiper>
  74. <!-- <view class="title" wx:if="{{activeItem == 'all'}}">{{item.category.name}}</view> -->
  75. <view class="play-list">
  76. <block wx:for="{{goods}}" wx:key="index">
  77. <view class="play-item" bindtap="goUrl"
  78. data-url="/nova-tourism/pages/home/village/village-details/index?id={{item.objectId}}">
  79. <view>
  80. <image src="{{item.image}}" style="width: 246rpx;height: 250rpx;border-radius: 12rpx;" />
  81. </view>
  82. <view class="body">
  83. <view class="item-text">
  84. {{item.name}}</view>
  85. <view class="label">
  86. <block wx:for="{{item.tag}}" wx:for-item="tag" wx:key="*this" wx:for-index="i">
  87. <view>{{tag}}</view>
  88. </block>
  89. </view>
  90. <view class="detail">
  91. <view class="d-light">¥{{item.price}}</view>
  92. <view wx:if="{{!active && !item.total}}">
  93. <image bind:tap="onTips" src="https://file-cloud.fmode.cn/sHNeVwSaAg/20230811/31ljt6092632004.png"
  94. style="width: 40rpx;height: 40rpx;" />
  95. </view>
  96. <view wx:else>
  97. <image bind:tap="addCount" data-index="{{index}}"
  98. src="https://file-cloud.fmode.cn/sHNeVwSaAg/20230811/31ljt6092632004.png"
  99. style="width: 40rpx;height: 40rpx;" />
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </block>
  105. </view>
  106. <!-- <view class="right_item" data-id="{{item.objectId}}">
  107. <image class="image" src="{{item.image}}" mode="aspectFill" />
  108. <view class="li_right">
  109. <view class="name">{{item.name}}</view>
  110. <view class="li_desc">{{item.desc ? item.desc : '暂无零食介绍~'}}</view>
  111. <view class="li_num">
  112. <view class="li_desc_row">销量 {{item.sales}}</view>
  113. <view class="li_desc_row" wx:if="{{!active}}">库存 {{item.total}}</view>
  114. </view>
  115. <view class="li_row">
  116. <view class="price">
  117. ¥{{item.price}}
  118. <view class="decoration">
  119. {{item.originalPrice ? item.originalPrice : item.price}}
  120. </view>
  121. </view>
  122. <view class="count">
  123. <van-icon wx:if="{{!active && !item.total}}" color="#999" name="add" class="tag" bind:tap="onTips" />
  124. <van-icon wx:else name="add" class="tag" data-index="{{index}}" bind:tap="addCount" />
  125. </view>
  126. </view>
  127. </view>
  128. </view> -->
  129. </view>
  130. <view wx:else>
  131. <van-empty description="暂无商品" />
  132. </view>
  133. </scroll-view>
  134. </view>
  135. </view>
  136. <view class="shopcart">
  137. <view class="price">
  138. <view style="position: relative;">
  139. <view class="total" wx:if="{{shopCart.length > 0}}">{{shopCart.length}}</view>
  140. <image src="https://file-cloud.fmode.cn/sHNeVwSaAg/20220824/a18ee1095119.png"
  141. style="width: 64rpx;height: 64rpx;" />
  142. </view>
  143. <view class="sum">¥{{totalPrice ? totalPrice : 0}}</view>
  144. </view>
  145. <view class="cart-btn"><button bind:tap="checkCart">我要付款</button></view>
  146. </view>
  147. <!-- 购物车 -->
  148. <van-popup show="{{ show }}" bind:close="onClose" round closeable close-icon-position="top-right" position="bottom"
  149. custom-style="height: 60%;">
  150. <view class="shopGoods">
  151. <view class="title" style="bottom:{{screenHeight - bottom }}px">购物车</view>
  152. <view class="loading" wx:if="{{cartLoading}}">
  153. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  154. </view>
  155. <block wx:if="{{shopCart.length > 0}}">
  156. <scroll-view scroll-y="{{true}}" style="height: 100% - 80rpx;padding-bottom: 200rpx;">
  157. <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o" text="向右滑动删除商品即可移出购物车" />
  158. <view class="goods" wx:for="{{orderGoods}}" wx:key="index">
  159. <van-radio-group value="{{ radio }}" bind:change="onChange">
  160. <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close
  161. bind:close="delete">
  162. <view class="cart_info">
  163. <view class="left_info">
  164. <radio class="radio" wx:if="{{!item.open}}" disabled color="#fd4441" />
  165. <radio class="radio" bindtap="checkItem" wx:else data-index="{{index}}" checked="{{item.check}}"
  166. color="#fd4441" />
  167. <view class="image_box">
  168. <view class="open" wx:if="{{!item.open}}">该店铺库存不足</view>
  169. <image class="image" src="{{item.image}}" mode="aspectFill" lazy-load="false" />
  170. </view>
  171. </view>
  172. <view class="right_info">
  173. <view class="title">{{item.name}}</view>
  174. <view class="down_info">
  175. <view class="price">¥{{item.totalPrice}}</view>
  176. <van-stepper value="{{item.count}}" min="1" max="100" disable-input="true" input-class="ipt"
  177. data-index="{{index}}" bind:plus="plus" bind:minus="minus" bind:change="onChange" />
  178. </view>
  179. </view>
  180. </view>
  181. <view slot="right" class="delete">删除</view>
  182. </van-swipe-cell>
  183. </van-radio-group>
  184. </view>
  185. </scroll-view>
  186. <view class="cart_down" style="--bottom:{{screenHeight - bottom }}px">
  187. <view class="cart_left">
  188. <label class="">
  189. <radio bindtap="checkAll" class="all_radio" checked="{{allCheck}}" color="#ef2a01" />
  190. </label>
  191. <view class="choose">全选</view>
  192. </view>
  193. <view class="cart_right">
  194. <view class="total_info">
  195. <view class="total_price">合计:¥{{totalPrice ? totalPrice : 0}}</view>
  196. </view>
  197. <button bindtap="{{totalPrice > 0 ? 'onDelete' : ''}}" class="button {{totalPrice > 0 ? 'actives' : ''}}">
  198. 删除
  199. </button>
  200. <button bindtap="submit" class="button {{totalPrice > 0 ? 'active' : ''}}">结算</button>
  201. </view>
  202. </view>
  203. </block>
  204. <block wx:else>
  205. <van-empty description="购物车空空如也~" />
  206. </block>
  207. </view>
  208. </van-popup>