Box2LineLargeImageUserShadow.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view
  3. :class="'position-relative grid4-item d-flex flex-col shadow-l radius-l bg-base p-2 mb-2 overflow-hidden ' + classNames"
  4. @click="$emit('click')"
  5. >
  6. <image
  7. v-if="image"
  8. class="w-100 height-300 radius-base"
  9. :src="image"
  10. mode="aspectFill"
  11. />
  12. <image
  13. v-if="videoMark"
  14. class="width-60 mr-2 video-mark"
  15. :src="PlayVideo" mode="widthFix"
  16. />
  17. <view v-if="userName" class="d-flex flex-row align-center mt-2">
  18. <image class="width-60 mr-2" :src="userHead" mode="widthFix" />
  19. <text class="size-s">{{ userName }}</text>
  20. </view>
  21. <text
  22. :class="[
  23. `color-${titleColor}`,
  24. title1 || desc ? 'text-lines-1' : 'text-lines-2',
  25. 'mt-2',
  26. ]"
  27. >
  28. {{ title }}
  29. </text>
  30. <text v-if="desc" class="color-second text-lines-2 mt-2">{{ desc }}</text>
  31. <view v-if="likes !== undefined && comment !== undefined" class="d-flex flex-row mt-2">
  32. <image class="width-40 mr-2" :src="IconHeart" mode="widthFix" />
  33. <text class="size-s mr-3">{{ likes }}</text>
  34. <image class="width-40 mr-2" :src="IconChat" mode="widthFix" />
  35. <text class="size-s">{{ comment }}</text>
  36. </view>
  37. <view v-if="bottomTime" class="d-flex flex-row mt-2">
  38. <image class="width-40 mr-2" :src="IconTime" mode="widthFix" />
  39. <text class="size-s mr-3">{{ bottomTime }}</text>
  40. </view>
  41. <view v-if="bottomLocate" class="d-flex flex-row justify-between mt-2">
  42. <view class="d-flex flex-row align-center">
  43. <image class="width-40 mr-2" :src="IconLocation" mode="widthFix" />
  44. <text class="size-s">{{ bottomLocate }}</text>
  45. </view>
  46. <view class="d-flex flex-row align-center">
  47. <image class="width-40 mr-2" :src="IconStar" mode="widthFix" />
  48. <text class="size-s">{{ bottomScore }}</text>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup lang="ts">
  54. import IconHeart from '/static/images/discover/IconHeart.png';
  55. import IconChat from '/static/images/discover/IconChat.png';
  56. import IconLocation from '/static/images/inhert/IconLocation.png';
  57. import IconTime from '/static/images/inhert/IconTime.png';
  58. import IconStar from '/static/images/inhert/IconStar.png';
  59. import PlayVideo from '/static/images/inhert/PlayVideo.png';
  60. defineProps({
  61. classNames: {
  62. type: String,
  63. },
  64. title: {
  65. type: String,
  66. },
  67. titleColor: {
  68. type: String,
  69. default: 'primary',
  70. },
  71. title1: {
  72. type: Boolean,
  73. default: false,
  74. },
  75. videoMark: {
  76. type: Boolean,
  77. default: false,
  78. },
  79. desc: {
  80. type: String,
  81. },
  82. image: {
  83. type: String,
  84. },
  85. likes: {
  86. type: Number,
  87. },
  88. comment: {
  89. type: Number,
  90. },
  91. userHead: {
  92. type: String,
  93. },
  94. userName: {
  95. type: String,
  96. },
  97. bottomLocate: {
  98. type: String,
  99. },
  100. bottomScore: {
  101. type: String,
  102. },
  103. bottomTime: {
  104. type: String,
  105. },
  106. })
  107. </script>
  108. <style scoped>
  109. .video-mark {
  110. position: absolute;
  111. left: calc(50% - 20rpx);
  112. top: 145rpx
  113. }
  114. </style>