index.wxml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!--index.wxml-->
  2. <view class="wrap">
  3. <!-- 门店 -->
  4. <view class="store_wrap">
  5. <view class="store_l" wx:if="{{ store }}">
  6. <view class="logo_wrap">
  7. <image class="logo" mode="heightFix" src="{{ imgUrl+ store.thumb }}"></image>
  8. </view>
  9. <view class="store_t_info">
  10. <view class="">
  11. <view class="store_t_info_t">
  12. <view class="name slh">{{ store.title }}</view>
  13. <!-- <image class="icon_phone" src="/statics/img/icon_phone.png" bind:tap="onMakePhone"></image> -->
  14. </view>
  15. <view class="desc">距离您{{ store.distance }}km</view>
  16. <!-- <view class="desc">营业时间:{{ store.begin_at+'~'+ store.end_at }}</view> -->
  17. </view>
  18. <!-- <image class="icon_phone" src="/statics/img/icon_phone.png" bind:tap="onMakePhone"></image> -->
  19. </view>
  20. </view>
  21. <view class="store_r" wx:if="{{ store }}">
  22. <view class="{{ fare_type != 1 ? 'wenzi active' : 'wenzi'}}" bind:tap="changeFareType" data-type="0">外卖</view>
  23. <view class="{{ fare_type == 1 ? 'wenzi active' : 'wenzi'}}" bind:tap="changeFareType" data-type="1">自取</view>
  24. </view>
  25. </view>
  26. <!-- 商品 -->
  27. <view class="goods_wrap">
  28. <scroll-view scroll-y="{{true}}" style="height:{{ scrollH }}px" scroll-into-view="{{ toViewYiji }}">
  29. <view class="goods_wrap_l">
  30. <view class="{{ item.id == activeCateId ? 'cate_item active' : 'cate_item'}}" wx:for="{{ good_cate }}" wx:key="idx" id="{{ 'yijicate'+item.id }}" data-item="{{item}}" bindtap="selectClassesClick">{{ item.name }}</view>
  31. </view>
  32. </scroll-view>
  33. <view class="">
  34. <!-- wx:if="{{ showErjiCate }}" -->
  35. <view class="erji_cate">
  36. <view wx:if="{{ currentCate.children && currentCate.children.length != 0 }}">
  37. <scroll-view scroll-x="{{true}}" scroll-into-view="{{ toViewErji }}" style="white-space: nowrap;width:570rpx;">
  38. <text class="{{ activeErjiId == item.id ? 'cate_item active' : 'cate_item' }}" id="{{ 'erjiCate'+ item.id}}" wx:for="{{ currentCate.children }}" wx:key="idx" bind:tap="onErjiCate" data-item="{{item}}">{{ item.name }}</text>
  39. </scroll-view>
  40. </view>
  41. <view style="padding-left:15rpx;" wx:else>{{ currentCate.name }}</view>
  42. </view>
  43. <!-- toViewErji toView-->
  44. <scroll-view scroll-y="{{ true }}" style="height:{{ scrollH }}px" scroll-into-view="{{toView}}" scroll-with-animation bindscroll="scrollProductList">
  45. <view class="goods_wrap_r">
  46. <view class="goods_list_w" wx:for="{{ good_list }}" wx:key="idx" wx:for-item="goods" id="{{ 'yiji'+ goods.good_cate_id}}">
  47. <view class="cate_name">{{ goods.name }}</view>
  48. <view>
  49. <!-- 有二级 -->
  50. <view wx:if="{{ goods.children }}">
  51. <view class="goods_list" wx:for="{{ goods.children }}" wx:for-item="goods" wx:key="idx" id="{{ 'erji'+goods.good_cate_id }}">
  52. <view class="goods_item_w" wx:for="{{ goods.goodList }}" wx:for-item="item" wx:key="idx" id="{{ item.id }}">
  53. <view class="goods_item">
  54. <image class="goods_tu" src="{{ imgUrl + item.thumb }}" bind:tap="onGoodsSpec" data-item="{{ item }}"></image>
  55. <view class="goods_info">
  56. <view class="goods_title slh_s" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.title }}</view>
  57. <view class="goods_desc slh" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.describe ? item.describe : '' }}</view>
  58. <view class="goods_specs">
  59. <view class="price">
  60. <view><text class="unit">¥</text>{{ item.price }}</view>
  61. <view class='vip'>会员价{{ '¥'+item.low_member_price }}</view>
  62. </view>
  63. <view class="topNum_w" wx:if="{{ item.status == 1 }}">
  64. <view class="btn_specs" wx:if="{{ item.good_specs && item.good_specs.length != 0 }}" bind:tap="onGoodsSpec" data-item="{{ item }}">
  65. <text class="">选规格</text>
  66. <view class="topNum" wx:if="{{ item.good_specs && item.good_specs.length != 0 && item.cartNums }}">{{ item.cartNums }}</view>
  67. </view>
  68. <van-stepper wx:else value="{{ item.nums }}" input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" bind:change="onChangeSpecNum" data-item="{{ item }}" />
  69. </view>
  70. <view class="topNum_w" wx:if="{{ item.status != 1 }}">已售罄</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="use_coupon" wx:if="{{ item.is_use_coupon != 1 }}">特殊商品不参与任何活动</view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- 无二级 -->
  79. <view wx:else id="{{ 'erji'+ goods.good_cate_id}}">
  80. <view class="goods_list">
  81. <view class="goods_item_w" wx:for="{{ goods.goodList }}" wx:for-item="item" wx:key="idx" id="{{ item.id }}">
  82. <view class="goods_item">
  83. <image class="goods_tu" src="{{ imgUrl + item.thumb }}" bind:tap="onGoodsSpec" data-item="{{ item }}"></image>
  84. <view class="goods_info">
  85. <view class="goods_title slh_s" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.title }}</view>
  86. <view class="goods_desc slh" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.describe ? item.describe : '' }}</view>
  87. <view class="goods_specs">
  88. <view class="price">
  89. <view><text class="unit">¥</text>{{ item.price }}</view>
  90. <view class='vip'>会员价{{ '¥'+item.low_member_price }}</view>
  91. </view>
  92. <view class="topNum_w" wx:if="{{ item.status == 1 }}">
  93. <view class="btn_specs" wx:if="{{ item.good_specs && item.good_specs.length != 0 }}" bind:tap="onGoodsSpec" data-item="{{ item }}">
  94. <text class="">选规格</text>
  95. <view class="topNum" wx:if="{{ item.good_specs && item.good_specs.length != 0 && item.cartNums }}">{{ item.cartNums }}</view>
  96. </view>
  97. <van-stepper wx:else value="{{ item.nums }}" input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" bind:change="onChangeSpecNum" data-item="{{ item }}" />
  98. </view>
  99. <view class="topNum_w" wx:if="{{ item.status != 1 }}">已售罄</view>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="use_coupon" wx:if="{{ item.is_use_coupon != 1 }}">特殊商品不参与任何活动</view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </scroll-view>
  111. </view>
  112. </view>
  113. <!-- 合计 -->
  114. <!-- style="background-image:url({{ hejiBg }})" -->
  115. <view class="heji_wrap">
  116. <view class="heji_l">
  117. <view class="cart_w" bind:tap="goShopCart">
  118. <image class="cart_tu" src="/statics/img/shopcar_tu.png"></image>
  119. <view class="goods_num" wx:if="{{ totalNums }}">{{ totalNums }}</view>
  120. </view>
  121. <view class="total_price">
  122. <text><text class="unit">¥</text>{{ totalPrice }}</text>
  123. <!-- <text class="vip" wx:if="{{ totalMemberPrice }}"><text class="unit">{{ '会员¥'+totalMemberPrice }}</text></text> -->
  124. </view>
  125. </view>
  126. <view class="heji_btn" bind:tap="toPay">选好了</view>
  127. </view>
  128. </view>
  129. <!-- 规格 -->
  130. <van-overlay z-index="5" class-style="background: rgba(0,0,0,.3);" show="{{ showGoodsSpec }}" catch:tap="closeGoodsSpec"></van-overlay>
  131. <!-- style="top: {{ setBgHeight + 40 }}px" -->
  132. <view class="guige_wrap" wx:if="{{ showGoodsSpec }}">
  133. <view class="guige">
  134. <view class="goods_thumb_wrap" style="">
  135. <!-- aspectFit center widthFix -->
  136. <image class="goods_thumb" mode="widthFix" src="{{ imgUrl+currentGoods.thumb }}"></image>
  137. </view>
  138. <view class="goods_name">
  139. <view class="goods_name_l">{{ currentGoods.title }}</view>
  140. </view>
  141. <view class="goods_desc" wx:if="{{ currentGoods.describe }}">
  142. <view class="goods_desc_nr">{{ currentGoods.describe }}</view>
  143. </view>
  144. <view class="goods_guige" wx:if="{{ currentGoods.good_specs.length != 0 }}">
  145. <view class="goods_guige_name">规格</view>
  146. <view class="goods_guige_nr">
  147. <view class="{{ good_specs.is_checked ? 'guige_item selected' : 'guige_item' }}" wx:for="{{ currentGoods.good_specs }}" wx:for-item="good_specs" wx:key="index" bind:tap="onChangeSpecGoods" data-specs="{{ good_specs }}" data-id="{{good_specs.id}}">
  148. <view class="item_wenzi">
  149. <text>{{ good_specs.title }}</text>
  150. </view>
  151. <!-- <view class="price">
  152. <text>
  153. <text class="unit"></text>
  154. <text>{{ good_specs.price }}</text>
  155. </text>
  156. <text class="vip">会员价{{ '¥'+ good_specs.member_price}}</text>
  157. </view> -->
  158. </view>
  159. </view>
  160. </view>
  161. <view class="guige_b">
  162. <view class="guige_b_l">
  163. <text class="price"><text class="unit">¥</text>{{ checkedSpec.price }}</text>
  164. <text class="vip">会员价{{ '¥'+checkedSpec.member_price }}</text>
  165. </view>
  166. <!-- <view class="">
  167. <van-stepper value="{{ checkedSpec.nums }}" async-change input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" data-item="{{ checkedSpec }}" bind:change="onChangeSpecNum" />
  168. </view> -->
  169. <view class="" wx:if="{{ checkedSpec.status == 1 }}">
  170. <van-stepper value="{{ checkedSpecNums }}" async-change input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" data-item="{{ checkedSpec }}" bind:change="onChangeSpecNum" />
  171. </view>
  172. <view class="" wx:if="{{ checkedSpec.status != 1 }}">已售罄</view>
  173. </view>
  174. </view>
  175. <van-icon name="close" class="btn_close" color="#ffffff" size="30px" bind:tap="closeGoodsSpec" />
  176. </view>
  177. <!-- loading -->
  178. <!-- <van-overlay show="{{ loading }}" z-index="100">
  179. <van-loading custom-class="custom_loading" />
  180. </van-overlay> -->
  181. <!-- 开启定位提示 -->
  182. <van-dialog class="custom_dialog" title="地理位置未授权" message="开启羊汤馆小程序定位授权后,可为您推荐就近门店" show="{{ showOpenLocation }}" confirm-button-text="授权定位" confirm-button-color="#D54C43" show-cancel-button bind:close="onCloseLocation" bind:confirm="onConfirmLocation"></van-dialog>
  183. <!-- 所选门店不支持的提醒 -->
  184. <van-dialog
  185. title="{{ tipsTitle }}"
  186. show="{{ showTips }}"
  187. class="single_btn"
  188. confirm-button-color="#000000"
  189. confirmButtonText="我知道了"
  190. bind:confirm="closeShowTips"
  191. >
  192. </van-dialog>
  193. <!-- 配送方式弹层 -->
  194. <!-- <van-overlay z-index="5" class-style="background: rgba(0,0,0,.3);" show="{{ showSelectFare }}">
  195. <view class="fare_w">
  196. <view class="title">请选择您的取货方式</view>
  197. <view class="type">
  198. <image class="type_bg" src="/statics/img/type_bg.png"></image>
  199. <view class="type_item waimai" bind:tap="changeFareType" data-type="0">外卖</view>
  200. <view class="type_item ziqu" bind:tap="changeFareType" data-type="1">自提</view>
  201. </view>
  202. <van-icon name="close" class="btn_close" color="#ffffff" size="30px" bind:tap="closeSelectFare" />
  203. </view>
  204. </van-overlay> -->
  205. <!-- js -->
  206. <wxs module="we">
  207. /* 字符串长度截取 */
  208. var strSlice = function(value) {
  209. if(value.length > 10){
  210. value = value.slice(0,6)+'...'
  211. };
  212. return value;
  213. };
  214. module.exports = {
  215. strSlice: strSlice
  216. }
  217. </wxs>