index.wxml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <i-auth bind:authSuccess="authSuccess" needAuth="{{!is_login}}">
  2. <view class='page-wrap'>
  3. <!--搜索框begin-->
  4. <view class='search-bar'>
  5. <view class='search-box'>
  6. <input class='ipt' placeholder="搜索商品" confirm-type="搜索" type="text" bindconfirm="goResult"></input>
  7. <view class='search-icon'>
  8. <image src='../../images/search.png'></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="page-content">
  13. <scroll-view scrollWithAnimation scrollY class="page-category" scrollTop="{{categoryScrollBarTop}}" style="height:{{scrollViewHeight}}px">
  14. <view bindtap="changeCategory" class="category-item {{rushCategoryData.activeIndex===index?'active':''}}" data-index="{{index}}" wx:for="{{rushCategoryData.tabs}}" wx:key="index">
  15. <view class="item-border"></view>
  16. <view>{{item.name}}</view>
  17. </view>
  18. </scroll-view>
  19. <!-- 子栏目 -->
  20. <view class='mask' hidden='{{!showDrop}}' bindtap='showDrop'></view>
  21. <view class='sub-cate' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length}}">
  22. <scroll-view class='sub-cate-scroll' scroll-x scrollLeft="{{scrollLeft}}">
  23. <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
  24. <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
  25. </scroll-view>
  26. <view class='icon-open' bindtap='showDrop'><image class="openImg {{showDrop?'':'down'}}" src="../../images/commentsOpen.png"></image></view>
  27. </view>
  28. <view class='sub-cate-hide' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length&&showDrop}}">
  29. <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
  30. <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
  31. </view>
  32. <!-- 列表 -->
  33. <scroll-view scrollWithAnimation scrollY bindscroll="scroll" bindscrolltolower="onReachBottom" bindtouchend="touchend" bindtouchstart="touchstart" class="page-list {{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length?'pt50':''}}" lowerThreshold="{{200}}" scrollTop="{{resetScrollBarTop}}" style="height:{{scrollViewHeight}}px"
  34. upperThreshold="{{50}}">
  35. <view class="scroll-col-tip-top">
  36. <!-- <span wx:if="{{isFirstCategory}}">已经拉到最顶部啦~</span>
  37. <block wx:else>
  38. <span>到顶了,看看别的分类吧~</span>
  39. </block> -->
  40. </view>
  41. <view style="min-height: {{scrollViewHeight+50}}px;">
  42. <block wx:if="{{!pageEmpty}}">
  43. <i-type-item wx:for="{{rushList}}" wx:key="{{item.actId}}" spuItem="{{item}}" reduction="{{reduction}}" stopClick="{{stopClick}}" bind:openSku="openSku" bind:changeCartNum="changeCartNum" changeCarCount="{{changeCarCount}}"/>
  44. </block>
  45. <view class="none-rush-list" wx:elif="{{pageEmpty}}">
  46. <image class="img-block" src="../../images/icon-index-empty.png"></image>
  47. <view class="h1">暂时没有团购</view>
  48. <view class="h2">我们正在为您准备更优惠的团购</view>
  49. </view>
  50. <view wx:if="{{loadMore}}">
  51. <i-load-more loading="{{loadMore}}" tip="{{loadText}}"></i-load-more>
  52. </view>
  53. <view class="scroll-col-tip-bottom" wx:elif="{{canNext}}">
  54. <span wx:if="{{isLastCategory}}">看到我的底线了吗~</span>
  55. <block wx:else>
  56. <span>到底了,看看别的分类吧~</span>
  57. </block>
  58. </view>
  59. </view>
  60. </scroll-view>
  61. </view>
  62. <i-tabbar currentIdx='1' cartNum='{{cartNum}}' class="tabbar {{isIpx?'pb20':''}}" />
  63. </view>
  64. </i-auth>
  65. <view class="mask" hidden="{{!visible}}"></view>
  66. <!---规格选择begin-->
  67. <view bind:cancel="close" class='sku-content' scrollUp="{{true}}" hidden="{{!visible}}">
  68. <view class="sku-card">
  69. <view bindtap="closeSku" class="close">
  70. <image src="../../images/icon-sku-close.png"></image>
  71. </view>
  72. <view class="sku-header">
  73. <i-img defaultImage="../../images/placeholder-refund.png" height="80" iClass="sku-img" loadImage="{{cur_sku_arr.skuImage}}" width="80"></i-img>
  74. <view class="sku-desc">
  75. <view class="sku-title">
  76. <span>{{cur_sku_arr.spuName}}</span>
  77. </view>
  78. <view class="sku-price">
  79. <view class="sale-price">
  80. ¥
  81. <span>{{cur_sku_arr.actPrice[0]}}</span>.{{cur_sku_arr.actPrice[1]}}
  82. </view>
  83. <view class="market-price">¥{{cur_sku_arr.marketPrice[0]}}.{{cur_sku_arr.marketPrice[1]}}</view>
  84. </view>
  85. <view class="sku-switch-on">已选择:{{cur_sku_arr.spec}}</view>
  86. </view>
  87. </view>
  88. <view class="sku-spec" wx:for="{{skuList.list}}" wx:key="{{item.id}}">
  89. <view class="title">{{item.name}}</view>
  90. <view class="spec-list">
  91. <span bindtap="selectSku" class="{{idx==sku[index]['idx']?'on':''}}" data-disabled="{{item.canBuyNum-value<0}}" data-type="{{index}}_{{idx}}_{{value.option_value_id}}_{{value.name}}" wx:for-index="idx" data-idx="{{idx}}" wx:for="{{item.option_value}}"
  92. wx:for-item="value" wx:key="{{idx}}">{{value.name}}</span>
  93. </view>
  94. </view>
  95. <view class="sku-num-content">
  96. <view class="title">数量</view>
  97. <view class="i-class i-input-number i-input-number-size-{{size}}">
  98. <view bindtap="setNum" data-type="decrease" class="i-input-number-minus {{value<=min?'i-input-number-disabled':''}}">
  99. <image src="../../images/icon-input-reduce.png"></image>
  100. </view>
  101. <input bindblur="handleBlur" bindfocus="handleFocus" class="i-input-number-text {{min>=max?'i-input-number-disabled':''}}" disabled="true" type="number" value="{{sku_val}}"></input>
  102. <view bindtap="setNum" data-type="add" class="i-input-number-plus {{value>=max?'i-input-number-disabled':''}}">
  103. <image src="../../images/icon-input-add.png"></image>
  104. </view>
  105. </view>
  106. <view class="msg" wx:if="{{skuList[current].isLimit}}">
  107. <span wx:if="{{skuList[current].limitMemberNum>-1}}">每人限{{skuList[current].limitMemberNum}}单</span>
  108. <span wx:if="{{skuList[current].limitOrderNum>-1}}">每单限{{skuList[current].limitOrderNum}}份</span>
  109. <span></span>
  110. </view>
  111. <view class="even-num" wx:elif="{{!skuList[current].isLimit&&skuList[current].canBuyNum-value<=10&&skuList[current].canBuyNum-value>-1}}">还可以购买 {{skuList[current].canBuyNum-value}} 件</view>
  112. </view>
  113. <form bindsubmit="gocarfrom" report-submit="true">
  114. <button formType="submit" class="sku-confirm" disabled='{{cur_sku_arr.stock==0 ? true : false}}'>
  115. <view>{{cur_sku_arr.stock==0?"已抢光":"确定"}}</view>
  116. </button>
  117. </form>
  118. </view>
  119. </view>
  120. <!---规格选择end-->