index.wxml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!--pages/cart/index.wxml-->
  2. <view>
  3. <!-- <view wx:if="{{loading}}">
  4. <t-loading t-class="page-loading" theme="circular" size="40rpx" loading t-class-indicator="t-class-indicator">
  5. <span slot="text" class="loading-text">加载中...</span>
  6. </t-loading>
  7. </view> -->
  8. <view class="d-flex flex-column" style="min-height: 800rpx;">
  9. <block wx:if="{{cartData.isNotEmpty}}">
  10. <template is="address" data="{{address: addr.name}}" />
  11. <template is="cartlist" data="{{cart: cartData, cartGoods: cartGoods, invalids: _invalidGoods, container: container }}" />
  12. </block>
  13. <template is="cartempty" wx:else />
  14. </view>
  15. <view class="pt-4 text-md gray-2" wx:if="{{favList && favList.length > 0}}" style="background-color: #f5f5f5;">
  16. <view class="px-4 pb-4">猜你喜欢</view>
  17. <view class="d-flex align-items-start pb-5">
  18. <t-icon name="chevron-left" style="margin-top: 160rpx;" />
  19. <view class="flex-1 overflow-hidden">
  20. <scroll-view scroll-x style="white-space: nowrap;" bindscrolltolower="handleReachBottom">
  21. <view class="d-flex pb-2" style="column-gap: 30rpx;">
  22. <view wx:for="{{favList}}" wx:for-item="item" wx:key="index">
  23. <n-good-card id="fav-gd-{{index}}" data="{{item}}" currency="{{item.currency || '¥'}}" thresholds="{{thresholds}}" class="goods-card-inside" data-index="{{index}}" bind:thumb="onClickGoodsThumb" bind:click="gotoGoodsDetail" bind:add-cart="onAddCart" />
  24. </view>
  25. <view style="padding-top: 150rpx;" wx:if="{{loadMoreStatus !== 2}}">
  26. <t-loading />
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. <t-icon name="chevron-right" style="margin-top: 160rpx;" />
  32. </view>
  33. </view>
  34. </view>
  35. <n-goods-specs-popup id="goodsSpecsPopup" show="{{isSpuSelectPopupShow}}" title="{{details.title || ''}}" src="{{specImg ? specImg : primaryImage}}" specList="{{details.specList || []}}" skuList="{{skuArray}}" limitBuyInfo="{{details.limitInfo[0].text || ''}}" limitMaxCount="{{limitMaxCount}}" limitMinCount="{{limitMinCount}}" limitBuyInfo="{{limitBuyInfo}}" bind:closeSpecsPopup="handlePopupHide" bind:change="chooseSpecItem" bind:specsConfirm="specsConfirm" isStock="{{isStock}}" outEditStatus="{{outEditStatus}}">
  36. <view slot="goods-price">
  37. <view class="popup-sku__price">
  38. <n-price price="{{isAllSelectedSku ? selectSkuSellPrice : minSalePrice }}" wr-class="goods-price" symbol-class="popup-sku__price-symbol" class="mr-2" />
  39. <n-price price="{{isAllSelectedSku ? selectSkuLinePrice : minLinePrice}}" wr-class="goods-del" type="delthrough" />
  40. </view>
  41. </view>
  42. </n-goods-specs-popup>
  43. <t-toast id="t-toast" />
  44. <n-wait loading="{{wait }}" />
  45. <template name="address">
  46. <view class="d-flex px-3 py-2 text-sm gray-3">
  47. <view class="pr-2 shrink-0">配送至</view>
  48. <view class="flex-1 text-single">
  49. {{address && address.length > 0 ? address : "未设置"}}
  50. </view>
  51. <view class="ml-2 linkbtn d-flex align-items-center shrink-0" hover-class="linkbtn-active" catchtap="gotoAddr">
  52. <t-icon name="edit" />
  53. <view class="pl-1">管理</view>
  54. </view>
  55. <view class="ml-2 linkbtn d-flex align-items-center shrink-0" hover-class="linkbtn-active" catchtap="reload">
  56. <t-icon name="refresh" />
  57. <view class="pl-1">刷新</view>
  58. </view>
  59. </view>
  60. </template>
  61. <template name="cartempty">
  62. <view class="pt-7">
  63. <image src="/assets/cart/empty.jpg" mode="aspectFit" style="width: 750rpx;" bindtap="gotoList" />
  64. </view>
  65. </template>
  66. <template name="cartlist">
  67. <view class="cartwrap">
  68. <view class="flex-1">
  69. <template is="cartgroup" data="{{goods: cartGoods, invalids: invalids}}" />
  70. </view>
  71. <t-sticky container="{{ container }}">
  72. <n-cart-bar is-all-selected="{{cart.isAllSelected}}" total-amount="{{cart.totalAmount}}" total-goods-num="{{cart.selectedGoodsCount || 0}}" total-discount-amount="{{cart.totalDiscountAmount}}" fixed="{{false}}" bottomHeight="{{114}}" bindhandleSelectAll="onSelectAll" bindhandleToSettle="onToSettle" />
  73. </t-sticky>
  74. </view>
  75. </template>
  76. <template name="cartgroup">
  77. <view class="cart-group">
  78. <view class="goods-wrap">
  79. <!-- <block wx:for="{{goods}}" wx:for-item="good" wx:for-index="goodindex" wx:key="goodindex"> -->
  80. <!-- <view class="promotion-wrap" wx:if="{{handlePromotion.hasPromotion(promotion.promotionCode)}}" bindtap="gotoBuyMore" data-promotion="{{promotion}}">
  81. <view class="promotion-title">
  82. <view class="promotion-icon">{{promotion.tag}}</view>
  83. <view class="promotion-text">{{promotion.description}}</view>
  84. </view>
  85. <view class="promotion-action action-btn" hover-class="action-btn--active">
  86. <view class="promotion-action-label">
  87. {{promotion.isNeedAddOnShop == 1 ? '去凑单' : '再逛逛'}}
  88. </view>
  89. <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
  90. </view>
  91. </view> -->
  92. <view class="goods-item" wx:for="{{goods}}" wx:for-item="goods" wx:for-index="gi" wx:key="extKey">
  93. <n-swipe-out right-width="{{ 72 }}">
  94. <view class="goods-item-info">
  95. <view class="check-wrap" catchtap="selectGoods" data-goods="{{goods}}" data-gi="{{gi}}" data-promoindex="{{promoindex}}">
  96. <t-icon size="40rpx" color="{{goods.isSelected ? 'rgba(0, 0, 0, 0.8)' : '#BBBBBB'}}" name="{{goods.isSelected ? 'check-circle-filled' : 'circle'}}" class="check" />
  97. </view>
  98. <view class="goods-sku-info">
  99. <view class="imageWrap" data-goods="{{goods}}" catchtap="gotoGoods">
  100. <view class="stock-mask" wx:if="{{goods.shortageStock || goods.stockQuantity <= 3}}">
  101. 仅剩{{goods.stockQuantity}}件
  102. </view>
  103. <t-image class="imgfix" t-class="thumb" src="{{goods.skuImage && goods.skuImage.length < 0 ? goods.skuImage : goods.goodImage}}" mode="aspectFit" />
  104. </view>
  105. <view class="flex-1 px-3 d-flex flex-column">
  106. <view class="flex-1 pb-2">
  107. <view class="text-sm thumb-title"><text>{{goods.title}}
  108. </text></view>
  109. <view class="thumb-tag" catchtap="onChangeSpec" data-gi="{{gi}}" data-goods="{{goods}}">
  110. <view> {{goods.skuTitle}}</view>
  111. <t-icon name="chevron-down" />
  112. </view>
  113. </view>
  114. <view>
  115. <n-price price="{{goods.price || '0'}}" fill="{{false}}" decimalSmaller />
  116. </view>
  117. </view>
  118. <view class="goods-stepper">
  119. <t-stepper classname="stepper-info" value="{{goods.buyNum}}" min="{{1}}" max="{{999}}" data-goods="{{goods}}" data-gi="{{gi}}" data-si="{{si}}" catchchange="onChangeStepper" catchblur="onBlurStepper" catchoverlimit="overlimit" theme="grey" />
  120. </view>
  121. </view>
  122. </view>
  123. <view slot="right" class="swiper-right-del" catchtap="onDeleteGoods" data-gi="{{gi}}" data-goods="{{goods}}">
  124. 删除
  125. </view>
  126. </n-swipe-out>
  127. </view>
  128. <!-- </block> -->
  129. </view>
  130. </view>
  131. </template>
  132. <wxs module="sw">
  133. var stringify = function (v) {
  134. return JSON.stringify(v)
  135. }
  136. var join = function (v) {
  137. return v.join(",")
  138. }
  139. module.exports = {
  140. stringify: stringify,
  141. join: join
  142. }
  143. </wxs>
  144. <n-pop-right open="{{true}}" bind:disagree="handleAuthDisagree" bind:ok="handleAuthOK" />