index.wxml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <nav type="title" background-color="#46a9a4" title="商超店铺" frontColor="#ffffff" />
  2. <view class="location">
  3. <view class="l_left">
  4. <van-icon name="https://cloud.file.futurestack.cn/F87DmDd4qN/20230327/1loeus105642.png" />
  5. 阜康市
  6. </view>
  7. <view class="l_right">
  8. 已有<span>5,666</span>人打卡自己自由之旅
  9. </view>
  10. </view>
  11. <view class="search">
  12. <van-search model:value="{{ value }}" placeholder="请输入搜索关键词" shape="round" bind:search="search" use-action-slot >
  13. <view slot="action" bind:tap="search" >搜索</view>
  14. </van-search>
  15. </view>
  16. <view class="store" date-store="{{store.objectId ? store.objectId : ''}}">
  17. <view class="cover" bind:tap="selectStore">
  18. <image src="{{store.cover ? store.cover : 'https://file-cloud.fmode.cn/sHNeVwSaAg/20220823/n1ei8h103147.png'}}" mode="aspectFill"></image>
  19. </view>
  20. <view class="storeInfo" bind:tap="selectStore">
  21. <view class="storeInfo_left">
  22. <view class="name">
  23. {{store.storeName ? store.storeName : '请选择店铺'}}
  24. <van-icon name="arrow" />
  25. </view>
  26. <view class="add">
  27. {{store.address ? store.address : '暂无店铺地址'}}
  28. <van-icon name="arrow" />
  29. </view>
  30. </view>
  31. <view class="storeInfo_right">
  32. <view class="mobile">
  33. <van-icon name="phone" />
  34. 联系方式:{{store.mobile ? store.mobile : '暂无联系方式' }}
  35. </view>
  36. <view class="opening">
  37. <van-icon name="clock" />
  38. 营业时间:{{store.workingTime ? store.workingTime : '暂未设置营业时间'}}
  39. </view>
  40. </view>
  41. </view>
  42. <view class="shopCart" bind:tap="checkCart">
  43. <image src="https://file-cloud.fmode.cn/sHNeVwSaAg/20220824/a18ee1095119.png" mode="aspectFill"></image>
  44. <view class="total" wx:if="{{shopCart.length > 0}}">{{shopCart.length}}</view>
  45. </view>
  46. </view>
  47. <!-- <view class="banner">
  48. <swiper class="swiper" indicator-dots="true" autoplay="true" circular="ture">
  49. <swiper-item wx:for="{{store.image}}" wx:key="index">
  50. <image src="{{item}}" class="slide-image" mode="aspectFill" />
  51. </swiper-item>
  52. </swiper>
  53. </view> -->
  54. <!-- 可视高度 - (nav栏 + docker条)- (搜索框 + hred元素 + tabs栏) - banners -->
  55. <view class="cate_info" style="height:calc(100vh - {{2 * (customBarHeight + screenHeight - bottom) + 50 + 340 }}rpx); margin-top: 20rpx;">
  56. <view class="cate_container">
  57. <scroll-view class="left_menu" scroll-y style="height:calc(100vh - {{2 * (customBarHeight + screenHeight - bottom) + 50 + 340}}rpx)">
  58. <view class="left_content">
  59. <view class="left_item {{activeItem == 'all' ? 'active' : ''}}" data-id="all" bind:tap="changeCate">
  60. 全部
  61. </view>
  62. <view class="left_item {{activeItem == item.objectId ? 'active' : ''}}" wx:for="{{category}}" wx:key="index" data-id="{{item.objectId}}" bind:tap="changeCate">
  63. {{item.name}}
  64. </view>
  65. </view>
  66. </scroll-view>
  67. <scroll-view class="right_list" scroll-y="{{true}}" scroll-top="{{scrollTop}}" style="height:calc(100vh - {{2 * (customBarHeight + screenHeight - bottom) + 50+ 340}}rpx)" bindscrolltolower="scrolltolower">
  68. <view class="loading" wx:if="{{loading}}">
  69. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  70. </view>
  71. <view class="right_content" wx:elif="{{goods && goods.length > 0}}">
  72. <block wx:for="{{goods}}" wx:key="index">
  73. <view class="title" wx:if="{{activeItem == 'all'}}">{{item.category.name}}</view>
  74. <view class="right_item" data-id="{{item.objectId}}">
  75. <image class="image" src="{{item.image}}" mode="aspectFill" />
  76. <view class="li_right">
  77. <view class="name">{{item.name}}</view>
  78. <view class="li_desc">{{item.desc ? item.desc : '暂无零食介绍~'}}</view>
  79. <view class="li_num">
  80. <view class="li_desc_row">销量 {{item.sales}}</view>
  81. <view class="li_desc_row" wx:if="{{!active}}">库存 {{item.total}}</view>
  82. </view>
  83. <view class="li_row">
  84. <view class="price">
  85. ¥{{item.price}}
  86. <view class="decoration">
  87. {{item.originalPrice ? item.originalPrice : item.price}}
  88. </view>
  89. </view>
  90. <view class="count">
  91. <van-icon wx:if="{{!active && !item.total}}" color="#999" name="add" class="tag" bind:tap="onTips" />
  92. <van-icon wx:else name="add" class="tag" data-index="{{index}}" bind:tap="addCount" />
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </block>
  98. </view>
  99. <view wx:else>
  100. <van-empty description="暂无商品" />
  101. </view>
  102. </scroll-view>
  103. </view>
  104. </view>
  105. <!-- 购物车 -->
  106. <van-popup show="{{ show }}" bind:close="onClose" round closeable close-icon-position="top-right" position="bottom" custom-style="height: 60%;">
  107. <view class="shopGoods">
  108. <view class="title" style="bottom:{{screenHeight - bottom }}px">购物车</view>
  109. <view class="loading" wx:if="{{cartLoading}}">
  110. <van-loading type="spinner" size='60rpx' vertical>加载中...</van-loading>
  111. </view>
  112. <block wx:if="{{shopCart.length > 0}}">
  113. <scroll-view scroll-y="{{true}}" style="height: 100% - 80rpx;padding-bottom: 200rpx;">
  114. <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o" text="向右滑动删除商品即可移出购物车" />
  115. <view class="goods" wx:for="{{orderGoods}}" wx:key="index">
  116. <van-radio-group value="{{ radio }}" bind:change="onChange">
  117. <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="delete">
  118. <view class="cart_info">
  119. <view class="left_info">
  120. <radio class="radio" wx:if="{{!item.open}}" disabled color="#fd4441" />
  121. <radio class="radio" bindtap="checkItem" wx:else data-index="{{index}}" checked="{{item.check}}" color="#fd4441" />
  122. <view class="image_box">
  123. <view class="open" wx:if="{{!item.open}}">该店铺库存不足</view>
  124. <image class="image" src="{{item.image}}" mode="aspectFill" lazy-load="false" />
  125. </view>
  126. </view>
  127. <view class="right_info">
  128. <view class="title">{{item.name}}</view>
  129. <view class="down_info">
  130. <view class="price">¥{{item.totalPrice}}</view>
  131. <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" />
  132. </view>
  133. </view>
  134. </view>
  135. <view slot="right" class="delete">删除</view>
  136. </van-swipe-cell>
  137. </van-radio-group>
  138. </view>
  139. </scroll-view>
  140. <view class="cart_down" style="--bottom:{{screenHeight - bottom }}px">
  141. <view class="cart_left">
  142. <label class="">
  143. <radio bindtap="checkAll" class="all_radio" checked="{{allCheck}}" color="#ef2a01" />
  144. </label>
  145. <view class="choose">全选</view>
  146. </view>
  147. <view class="cart_right">
  148. <view class="total_info">
  149. <view class="total_price">合计:¥{{totalPrice ? totalPrice : 0}}</view>
  150. </view>
  151. <button bindtap="{{totalPrice > 0 ? 'onDelete' : ''}}" class="button {{totalPrice > 0 ? 'actives' : ''}}">
  152. 删除
  153. </button>
  154. <button bindtap="submit" class="button {{totalPrice > 0 ? 'active' : ''}}">结算</button>
  155. </view>
  156. </view>
  157. </block>
  158. <block wx:else>
  159. <van-empty description="购物车空空如也~" />
  160. </block>
  161. </view>
  162. </van-popup>