index.wxml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <wxs module="utils" src="../wxs/utils.wxs"/>
  2. <view class="custom-class van-card">
  3. <view class="{{ utils.bem('card__header', { center: centered }) }}">
  4. <view bind:tap="onClickThumb" class="van-card__thumb">
  5. <image
  6. class="van-card__img thumb-class"
  7. lazy-load="{{ lazyLoad }}"
  8. mode="{{ thumbMode }}"
  9. src="{{ thumb }}"
  10. wx:if="{{ thumb }}"
  11. />
  12. <slot name="thumb" wx:else/>
  13. <van-tag
  14. custom-class="van-card__tag"
  15. mark
  16. type="danger"
  17. wx:if="{{ tag }}"
  18. >
  19. {{ tag }}
  20. </van-tag>
  21. <slot name="tag" wx:else/>
  22. </view>
  23. <view class="van-card__content {{ utils.bem('card__content', { center: centered }) }}">
  24. <view>
  25. <view class="van-card__title title-class" wx:if="{{ title }}">{{ title }}</view>
  26. <slot name="title" wx:else/>
  27. <view class="van-card__desc desc-class" wx:if="{{ desc }}">{{ desc }}</view>
  28. <slot name="desc" wx:else/>
  29. <slot name="tags"/>
  30. </view>
  31. <view class="van-card__bottom">
  32. <slot name="price-top"/>
  33. <view class="van-card__price price-class" wx:if="{{ price || price === 0 }}">
  34. <text>{{ currency }}</text>
  35. <text class="van-card__price-integer">{{ integerStr }}</text>
  36. <text class="van-card__price-decimal">{{ decimalStr }}</text>
  37. </view>
  38. <slot name="price" wx:else/>
  39. <view class="van-card__origin-price origin-price-class" wx:if="{{ originPrice || originPrice === 0 }}">
  40. {{ currency }} {{ originPrice }}
  41. </view>
  42. <slot name="origin-price" wx:else/>
  43. <view class="van-card__num num-class" wx:if="{{ num }}">x {{ num }}</view>
  44. <slot name="num" wx:else/>
  45. <slot name="bottom"/>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="van-card__footer">
  50. <slot name="footer"/>
  51. </view>
  52. </view>