index.wxml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <view class="cates">
  2. <view class="seller">
  3. <!-- 商户信息 -->
  4. <view class="seller_info">
  5. <!-- 商家头像 -->
  6. <view class="header">
  7. <image class="header_img" src="{{serverPrefix+merchant.headerUrl}}"></image>
  8. </view>
  9. <view class="name" bindtap="handle2AboutUs">
  10. <text>{{merchant.storeName}}</text>
  11. <image src="/img/icon/toright.png"></image>
  12. </view>
  13. <view class="score">
  14. <text>评分 {{merchant.score}} | 放心吃</text>
  15. </view>
  16. <view class="announcement" bindtap="handle2AboutUs">
  17. <text>公告:{{merchant.announcement}}</text>
  18. </view>
  19. <!-- 优惠券条 -->
  20. <scroll-view scroll-x class="scroll_discount">
  21. <view class="discount">
  22. <block wx:for="{{coupon.data}}" wx:key="id">
  23. <discount upto="{{item.reach}}" down="{{item.reduce}}" bindtap="handleCouponTap"></discount>
  24. </block>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. <view class="sale_block">
  30. <!-- 点菜/评价栏/搜索-->
  31. <view class="order_bar">
  32. <!-- 左 -->
  33. <view class="left_bar">
  34. <view class="title {{index===currentTitleIdx?'title_selected':''}}" wx:for="{{titles}}" wx:key="*this" bindtap="handleTitleTap" data-index="{{index}}">
  35. <text>{{item}}</text>
  36. </view>
  37. </view>
  38. <!-- 右 -->
  39. <view class="right_bar">
  40. <searchInput searchUrl="/pages/sub_index_page/search/search"></searchInput>
  41. </view>
  42. </view>
  43. <view class="cates_container">
  44. <swiper class="cates_swiper" current="{{currentTitleIdx}}" bindchange="handleSwiperChange">
  45. <!-- 菜单 -->
  46. <swiper-item class="cates_swiper_item">
  47. <!-- 左侧菜单 -->
  48. <scroll-view class="left_menu" scroll-y="true">
  49. <view class="menu_item {{-3===currentIdx?'active':''}}" bindtap="handleItemTap" data-index="{{-3}}">
  50. 推荐
  51. </view>
  52. <view class="menu_item {{-2===currentIdx?'active':''}}" bindtap="handleItemTap" data-index="{{-2}}">
  53. 全部商品
  54. </view>
  55. <view class="menu_item {{-1===currentIdx?'active':''}}" bindtap="handleItemTap" data-index="{{-1}}">
  56. 热门商品
  57. </view>
  58. <block wx:for="{{leftMenuList}}" wx:key="id" >
  59. <view class="menu_item {{index===currentIdx?'active':''}}" bindtap="handleItemTap" data-index="{{index}}" data-type-id="{{item.id}}">
  60. {{item.type}}
  61. </view>
  62. </block>
  63. <!-- 空白占位 -->
  64. <view style="width: auto;height: 8vh;"></view>
  65. </scroll-view>
  66. <!-- 右侧商品内容 -->
  67. <scroll-view class="right_content" scroll-y="true" bindscrolltolower="handleToBottom">
  68. <view wx:for="{{goodsList.data}}" class="goods_group" wx:key="id">
  69. <view wx:if="{{item.goods.length!=0}}" class="goods_title">
  70. <text>{{item.type}}</text>
  71. </view>
  72. <view wx:if="{{item.goods.length!=0}}" wx:for="{{item.goods}}" wx:key="id" wx:for-item="goods" class="goods_list">
  73. <view class="goods_img">
  74. <navigator url="/pages/sub_index_page/goods_info/goods_info?goodsId={{goods.id}}">
  75. <!-- 商品图片判断 -->
  76. <block wx:if="{{goods.pictures[0].picUrl!=null}}">
  77. <image src="{{serverPrefix+goods.pictures[0].picUrl}}"></image>
  78. </block>
  79. </navigator>
  80. </view>
  81. <view class="goods_name" bindtap="navigate2GoodsInfo" data-goods-id="{{goods.id}}">{{goods.goodsName}}</view>
  82. <view class="goods_info">{{goods.desc}}</view>
  83. <view class="goods_item">
  84. <view class="sale_num">月售 <block>{{goods.sales}}</block>
  85. </view>
  86. <view class="like_num">评分 <block>{{goods.score}}</block></view>
  87. </view>
  88. <view class="action_bar">
  89. <view class="goods_price">
  90. <block>¥</block>{{goods.price}}起
  91. </view>
  92. <view class="goods_action">
  93. <block wx:if="{{goods.goodsOptions.length==0}}">
  94. <block wx:for="{{cartList}}" wx:key="goodsId">
  95. <block wx:if="{{item.goodsId==goods.id}}">
  96. <image class="reduce {{item.num==0 ? 'hidden' : ''}}" src="/img/icon/reduce.png" bindtap="handleReduceTap" data-goods-id="{{goods.id}}"/>
  97. <text class="order_num {{item.num==0 ? 'hidden' : ''}}">{{item.num}}</text>
  98. </block>
  99. </block>
  100. <image class="add" src="/img/icon/add.png" bindtap="handleAddTap" data-goods="{{goods}}"/>
  101. </block>
  102. <block wx:if="{{goods.goodsOptions.length!=0}}">
  103. <view class="select_options" bindtap="handleGoodsInfoShow" data-goodsId="{{goods.id}}">
  104. 选规格
  105. </view>
  106. </block>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <!-- 空白占位 -->
  112. <view style="width: auto;height: 8vh;"></view>
  113. </scroll-view>
  114. </swiper-item>
  115. <!-- 评价 -->
  116. <swiper-item class="cates_swiper_item">
  117. <scroll-view class="comment-scroll-view" scroll-y="true" bindscrolltolower="handleToCommentBottom">
  118. <view class="comment">
  119. <view class="comment_item comment-score">
  120. <text style="font-size: 30rpx;color: black;">商家评分:</text>
  121. {{merchant.score}}
  122. </view>
  123. <view class="comment_item sort_type">
  124. <block wx:for="{{commentSearchType}}" wx:for-item="type" wx:key="index">
  125. <view class="comment-type {{type.select ? 'type-selected' :''}} float-left" bindtap="handleCommentTap" data-index="{{index}}">{{type.name}}</view>
  126. </block>
  127. </view>
  128. <view class="comment-cotent">
  129. <block wx:for="{{commentList.data}}" wx:for-item="comment" wx:key="id">
  130. <view class="comment_item user-comment">
  131. <view class="user-comment-title">
  132. <view class="user-pic float-left">
  133. <block wx:if="{{!comment.avatarUrl}}">
  134. <image class="user-pic-img" src="/img/icon/default_header.png"></image>
  135. </block>
  136. <block wx:if="{{comment.avatarUrl}}">
  137. <image class="user-pic-img" src="{{comment.avatarUrl}}"></image>
  138. </block>
  139. </view>
  140. <view class="user-title-mid float-left">
  141. <view class="user-name">
  142. {{comment.nickName}}
  143. </view>
  144. <view class="user-comment-score">
  145. <!-- <image class="star" src="/img/icon/star-1.png"></image>-->
  146. 环境:{{comment.environmentScore}} 味道:{{comment.tasteScore}} 服务:{{comment.serviceScore}}
  147. </view>
  148. </view>
  149. <!-- 时间 -->
  150. <view class="user-comment-date float-left">
  151. {{comment.createTime}}
  152. </view>
  153. </view>
  154. <view class="user-comment-content">
  155. <view class="user-comment-text">
  156. {{comment.content}}
  157. </view>
  158. <view class="user-comment-pics">
  159. <block wx:for="{{comment.picUrls}}" wx:for-item="pic" wx:key="*this">
  160. <image src="{{serverPrefix+pic.picUrl}}"></image>
  161. </block>
  162. </view>
  163. <view wx:if="{{comment.reply}}" class="user-comment-reply">
  164. 商家回复:{{comment.reply}}
  165. </view>
  166. </view>
  167. </view>
  168. </block>
  169. </view>
  170. </view>
  171. <view class="bottom" wx:if="{{reachedBottom}}">我也是有底线的哦</view>
  172. </scroll-view>
  173. </swiper-item>
  174. </swiper>
  175. </view>
  176. </view>
  177. </view>
  178. <view class="mask-layer" wx:if="{{goodsInfoShowState}}" catchtap="handleGoodsInfoHide">
  179. </view>
  180. <!-- 选规格弹出 -->
  181. <view class="select_view" wx:if="{{goodsInfoShowState}}" animation="{{animationData}}">
  182. <view class="selected_goods">
  183. <view class="selected_goods_img float-left">
  184. <!-- <image id="goods_info_img" src="{{staticUrl+goods.pictures[0].picUrl}}"></image> -->
  185. <!-- 商品图片判断 -->
  186. <block wx:if="{{goods.pictures[0].picUrl!=null}}">
  187. <image src="{{serverPrefix+goods.pictures[0].picUrl}}"></image>
  188. </block>
  189. </view>
  190. <view class="goods_info_item goods_name float-left">
  191. <text>{{goods.goodsName}}</text>
  192. </view>
  193. <view class="goods_info_item goods_desc float-left">
  194. <text>{{goods.desc}}</text>
  195. </view>
  196. <view class="goods_info_item selected_options float-left">
  197. <text id="selected_text">已选:{{selectedOptions.text}}</text>
  198. </view>
  199. <view class="goods_info_item goods_price float-left">
  200. <text>¥{{goods.price+selectedOptions.extra}}</text>
  201. </view>
  202. </view>
  203. <view class="select_goods_options">
  204. <view class="goods_num">
  205. <text id="gNum">数量</text>
  206. <view class="action">
  207. <view style="width: 40rpx;height: 40rpx;margin-right: 10rpx;">
  208. <image class="" src="/img/icon/reduce.png" bindtap="handleGoodsReduceTap"></image>
  209. </view>
  210. <text class=" ">{{goodsNum}}</text>
  211. <view style="width: 40rpx;height: 40rpx;margin-left: 10rpx;">
  212. <image class="" src="/img/icon/add.png" bindtap="handleGoodsAddTap"></image>
  213. </view>
  214. </view>
  215. </view>
  216. <scroll-view class="scroll_options" scroll-y="true">
  217. <view class="options" wx:for="{{goods.goodsOptions}}" wx:for-item="option" wx:for-index="index1" wx:key="id">
  218. <view class="option_title">
  219. <text>{{option.optionName}}</text>
  220. </view>
  221. <view class="option_item">
  222. <block wx:for="{{option.goodsOptionItems}}" wx:for-item="optionItem" wx:for-index="index2" wx:key="id">
  223. <view class="option_type type {{optionItem.selectedState ? 'selected' : ''}}" data-index1="{{index1}}" data-index2="{{index2}}" bindtap="handleSelectStateTap">
  224. {{optionItem.optionItem}}
  225. </view>
  226. </block>
  227. </view>
  228. </view>
  229. </scroll-view>
  230. </view>
  231. <view class="add_cart" bindtap="handleAdd2CartGoodsTap">
  232. <button class="btn">
  233. 加入购物车
  234. </button>
  235. </view>
  236. </view>
  237. <!-- 购物车 -->
  238. <view class="mask-layer" wx:if="{{GoodsCartInfoShowState}}" catchtap="hideModel">
  239. </view>
  240. <!-- 购物车详细弹出 -->
  241. <view class="cart_selected_goods" wx:if="{{GoodsCartInfoShowState}}" animation="{{animationData}}">
  242. <view class="title">
  243. <view class="title_name float-left">
  244. 已选商品
  245. </view>
  246. <view class="clear_cart float-right" bindtap="handleClearCartTap">
  247. <view class="clear_icon float-left" style="width: 50rpx;height: 50rpx;">
  248. <image src="/img/icon/delete.png"></image>
  249. </view>
  250. <block>清空</block>
  251. </view>
  252. </view>
  253. <view class="selected_goods_scroll">
  254. <scroll-view scroll-y class="cart_scroll">
  255. <view class="cart_goods" wx:for="{{cartList}}" wx:for-item="cart" wx:key="goodsId">
  256. <view class="cart_goods_img float-left">
  257. <navigator class="all" url="/pages/sub_index_page/goods_info/goods_info?goodsId={{cart.goods.id}}">
  258. <block wx:if="{{cart.goods.pictures[0].picUrl!=null}}">
  259. <image src="{{serverPrefix+cart.goods.pictures[0].picUrl}}"></image>
  260. </block>
  261. </navigator>
  262. </view>
  263. <view class="cart_goods_name cart_goods_item float-left">{{cart.goods.goodsName}}</view>
  264. <view class="cart_goods_select cart_goods_item float-left">已选:{{cart.selectedOptions.text}}</view>
  265. <view class="cart_goods_action cart_goods_item float-left">
  266. <view class="action_price float-left">
  267. <block>¥{{cart.goods.price+cart.selectedOptions.extra}}</block>
  268. </view>
  269. <view class="num_action float-right">
  270. <image class="reduce {{cart.num==0 ? 'hidden' : ''}}" src="/img/icon/reduce.png" bindtap="handleReduceTap" data-goods-id="{{cart.goodsId}}"></image>
  271. <text class="order_num {{cart.num==0 ? 'hidden' : ''}}">{{cart.num}}</text>
  272. <image class="add" src="/img/icon/add.png" bindtap="handleAddCartGoodsTap" data-goods-id="{{cart.goodsId}}"></image>
  273. </view>
  274. </view>
  275. </view>
  276. </scroll-view>
  277. </view>
  278. </view>
  279. <!-- 购物车条 -->
  280. <view class="cart_bar" wx:if="{{ GoodsCartInfoShowState||(cartList.length >0 && cartShowState)}}">
  281. <view class="cart float-left">
  282. <view class="cart_btn" bindtap="handleCartBtnTap">
  283. <view class="cart_icon">
  284. <image src="/img/icon/gouwuchekong.png"></image>
  285. </view>
  286. <block>购物车</block>
  287. </view>
  288. </view>
  289. <view class="total_price float-left">
  290. <block>¥{{totalPrice}}</block>
  291. </view>
  292. <view class="buy_now float-left" bindtap="handle2BuyInfo">
  293. <block>选好了</block>
  294. </view>
  295. </view>