index.wxml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 {{ utils.bem('card__content', { center: centered }) }}">
  23. <view>
  24. <view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view>
  25. <slot wx:else name="title" />
  26. <view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view>
  27. <slot wx:else name="desc" />
  28. <slot name="tags" />
  29. </view>
  30. <view class="van-card__bottom">
  31. <slot name="price-top" />
  32. <view wx:if="{{ price || price === 0 }}" class="van-card__price price-class">{{ currency }}<text class="van-card__price-integer">{{ integerStr }}</text><text class="van-card__price-decimal">{{ decimalStr }}</text></view>
  33. <slot wx:else name="price" />
  34. <view wx:if="{{ originPrice || originPrice === 0 }}" class="van-card__origin-price origin-price-class">{{ currency }} {{ originPrice }}</view>
  35. <view wx:if="{{ num }}" class="van-card__num num-class">x {{ num }}</view>
  36. <slot wx:else name="num" />
  37. <slot name="bottom" />
  38. </view>
  39. </view>
  40. </view>
  41. <view class="van-card__footer">
  42. <slot name="footer" />
  43. </view>
  44. </view>