index.wxml 1.4 KB

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