You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
2.6 KiB

  1. <template>
  2. <view :class="[outline ? '' : 'no-card', type !== 'base' ? type : '']" class="cu-card">
  3. <view class="cu-item shadow">
  4. <template v-if="type === 'case'">
  5. <view class="image">
  6. <slot name="img"><image :src="info.img" mode="widthFix"></image></slot>
  7. <slot name="badge">
  8. <l-tag :color="info.badgeColor">{{ info.badge }}</l-tag>
  9. </slot>
  10. <view class="cu-bar bg-shadeBottom">
  11. <slot name="title">
  12. <text class="text-cut">{{ info.title }}</text>
  13. </slot>
  14. </view>
  15. </view>
  16. <view class="cu-list menu-avatar">
  17. <view class="cu-item">
  18. <slot name="avatar">
  19. <l-avatar :src="info.avatar" size="lg" style="margin: 0 30rpx; position: absolute; left: 0;" round />
  20. </slot>
  21. <view class="content flex-sub">
  22. <slot name="user">
  23. <view class="text-grey">{{ info.user }}</view>
  24. </slot>
  25. <view class="text-gray text-sm flex justify-between">
  26. <slot name="tips">{{ info.tips }}</slot>
  27. <slot name="footer"></slot>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <template v-else-if="type === 'dynamic'">
  34. <view class="cu-list menu-avatar">
  35. <view class="cu-item">
  36. <slot name="avatar">
  37. <l-avatar :src="info.avatar" size="lg" style="margin: 0 30rpx; position: absolute; left: 0;" round />
  38. </slot>
  39. <view class="content flex-sub">
  40. <slot name="user">
  41. <view>{{ info.user }}</view>
  42. </slot>
  43. <slot name="tips">
  44. <view class="text-gray text-sm flex justify-between">{{ info.tips }}</view>
  45. </slot>
  46. </view>
  47. </view>
  48. </view>
  49. <slot></slot>
  50. <slot name="footer"></slot>
  51. </template>
  52. <template v-else-if="type === 'article'">
  53. <view class="title">
  54. <slot name="title">
  55. <view class="text-cut">{{ info.title }}</view>
  56. </slot>
  57. </view>
  58. <view class="content">
  59. <slot name="img"><image :src="info.img" mode="aspectFill"></image></slot>
  60. <view class="desc">
  61. <view class="text-content"><slot></slot></view>
  62. <slot name="footer"></slot>
  63. </view>
  64. </view>
  65. </template>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. name: 'l-card',
  72. props: {
  73. type: { default: 'case' },
  74. outline: {},
  75. info: { default: () => ({}) }
  76. }
  77. }
  78. </script>