index.wxml 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 wx:else 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. <slot wx:else name="tag" />
  22. </view>
  23. <view class="van-card__content {{ utils.bem('card__content', { center: centered }) }}">
  24. <view>
  25. <view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view>
  26. <slot wx:else name="title" />
  27. <view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view>
  28. <slot wx:else name="desc" />
  29. <slot name="tags" />
  30. </view>
  31. <view class="van-card__bottom">
  32. <slot name="price-top" />
  33. <view wx:if="{{ price || price === 0 }}" class="van-card__price price-class">
  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 wx:else name="price" />
  39. <view wx:if="{{ originPrice || originPrice === 0 }}" class="van-card__origin-price origin-price-class">{{ currency }} {{ originPrice }}</view>
  40. <slot wx:else name="origin-price" />
  41. <view wx:if="{{ num }}" class="van-card__num num-class">x {{ num }}</view>
  42. <slot wx:else name="num" />
  43. <slot name="bottom" />
  44. </view>
  45. </view>
  46. </view>
  47. <view class="van-card__footer">
  48. <slot name="footer" />
  49. </view>
  50. </view>