index.axml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <import-sjs
  2. name="carUtils"
  3. from="../goods-detail/index.sjs"
  4. />
  5. <import-sjs
  6. from="./index.sjs"
  7. name="utils"
  8. />
  9. <import-sjs
  10. from="../utils-component/index.sjs"
  11. name="priceUtils"
  12. />
  13. <wrapper>
  14. <view class="goods-item-container">
  15. <view
  16. class="goods-item-box {{activeId === goodsItem.skuId ? 'goods-item-active' : ''}}"
  17. onTap="handleClick"
  18. >
  19. <!-- img -->
  20. <stock-img
  21. imgSrc="{{goodsItem.picList[0]}}"
  22. isNoStock="{{showStock && !goodsItem.stock}}"
  23. />
  24. <!-- 描述信息 -->
  25. <view class="goods-info">
  26. <!-- name -->
  27. <view class="name">{{goodsItem.name}}
  28. </view>
  29. <!-- unit 和 库存 -->
  30. <view class="unit-and-stock">
  31. <view class="unit">{{goodsItem.specDesc}}</view>
  32. <view
  33. a:if="{{showStock}}"
  34. class="{{goodsItem.stock >= goodsItem.quantity && goodsItem.stock ? 'stock' : 'stock red'}}"
  35. >库存: {{goodsItem.stock || 0}}</view>
  36. </view>
  37. <!-- 限购 -->
  38. <view class="goods-limit">
  39. <view style="display: flex">
  40. <goods-tag
  41. a:if="{{goodsItem.buyLimitType === 'GENERAL'}}"
  42. text="限{{goodsItem.buyLimitCount}}份"
  43. />
  44. <goods-tag
  45. a:if="{{showBooking && goodsItem.userLimitType === 'BESPEAK'}}"
  46. text="{{goodsItem.isbespeak ? '已预约' : '去预约'}}"
  47. isbespeak="{{goodsItem.isbespeak}}"
  48. clickTip="{{goodsItem.activity.joinLinkTip}}"
  49. url="{{goodsItem.activity.joinLink}}"
  50. linkType="{{goodsItem.activity.joinLinkType}}"
  51. />
  52. </view>
  53. <view style="display: flex">
  54. <goods-tag
  55. a:if="{{showAuto && (goodsItem.deliverType.indexOf('AUTO') > -1 || goodsItem.deliverType.indexOf('MANUAL') > -1)}}"
  56. text="到店自提"
  57. />
  58. <goods-tag
  59. a:if="{{showAuto && goodsItem.deliverType.indexOf('DELIVERY') > -1}}"
  60. text="可配送"
  61. />
  62. <!-- <goods-tag
  63. a:if="{{showAuto && goodsItem.deliverType.indexOf('MANUAL') > -1}}"
  64. text="到店自提"
  65. /> -->
  66. </view>
  67. </view>
  68. <!-- price -->
  69. <view class="price-button-container">
  70. <view style="display: flex;flex: 1;flex-direction: column">
  71. <price-tag
  72. a:if="{{memberLevel && goodsItem.memberPrices}}"
  73. price="{{priceUtils.getMemberLevelPrice(goodsItem.memberPrices,memberLevel)}}"
  74. fontSize="22rpx"
  75. padding="2px 4px"
  76. maxWidth="164rpx"
  77. />
  78. <view style="display: flex;align-items: baseline;">
  79. <view class="price">
  80. <!-- (memberLevel && goodsItem.memberPrices) ? priceUtils.getMemberLevelPrice(goodsItem.memberPrices,memberLevel) : -->
  81. <view class="price-icon">¥</view>
  82. {{goodsItem.sellPrice}}
  83. </view>
  84. <view
  85. class="pre-price"
  86. a:if="{{goodsItem.price !== goodsItem.sellPrice}}"
  87. >¥{{goodsItem.price}}</view>
  88. </view>
  89. </view>
  90. <!-- 步进器 -->
  91. <view
  92. class="step {{carUtils.isActive(goodsItem) ? '' : 'disable'}}"
  93. hidden="{{!goodsItem.quantity}}"
  94. >
  95. <stepper
  96. catchChange="changeNum"
  97. defaultNum="{{defaultNum}}"
  98. maxNum="{{utils.getMaxBuyNum(goodsItem)}}"
  99. targetId="{{targetId}}"
  100. numType="{{utils.getNumType(goodsItem)}}"
  101. />
  102. </view>
  103. <!-- plus -->
  104. <!--<view class="add-plus">
  105. +</view> -->
  106. <view
  107. catchTap="handelPlusClick"
  108. hidden="{{goodsItem.quantity}}"
  109. class="stepper-add {{carUtils.isActive(goodsItem) ? '' : 'disable'}}"
  110. >
  111. <am-icon
  112. type="add"
  113. size="{{10}}"
  114. />
  115. </view>
  116. <!--<view class="add-plus-disable">
  117. +</view> -->
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </wrapper>