Box2LineLargeImageUserShadow.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <Touchable
  3. :padding="20"
  4. :flexShrink="fixSize ? 0 : undefined"
  5. :flexGrow="fixSize ? undefined : 1"
  6. :gap="10"
  7. :radius="20"
  8. overflow="hidden"
  9. position="relative"
  10. backgroundColor="white"
  11. :innerClass="[
  12. 'grid4-item',
  13. classNames,
  14. ]"
  15. :innerStyle="{
  16. height: 'calc(100% - 20rpx)',
  17. width: fixSize ? undefined : 'calc(100% - 40rpx)',
  18. }"
  19. direction="column"
  20. @click="$emit('click')"
  21. >
  22. <Image
  23. v-if="image"
  24. :height="300"
  25. width="100%"
  26. :radius="20"
  27. :src="image"
  28. mode="aspectFill"
  29. />
  30. <Image
  31. v-if="videoMark"
  32. :width="60"
  33. :src="PlayVideo"
  34. class="video-mark"
  35. mode="widthFix"
  36. />
  37. <FlexRow v-if="userName" align="center" :gap="20">
  38. <Image width="60" :src="userHead" mode="widthFix" />
  39. <Text fontConfig="subText">{{ userName }}</Text>
  40. </FlexRow>
  41. <Text
  42. :color="titleColor"
  43. :fontConfig="title1 || desc ? 'h4' : 'subText'"
  44. :lines="title1 || desc ? 1 : 2"
  45. >
  46. {{ title }}
  47. </Text>
  48. <FlexRow
  49. v-if="badge"
  50. position="absolute"
  51. :top="0"
  52. :right="0"
  53. :margin="15"
  54. :radius="20"
  55. :padding="15"
  56. backgroundColor="background.primary"
  57. >
  58. <Text
  59. color="primary"
  60. fontConfig="subText"
  61. :lines="1"
  62. :text="badge"
  63. />
  64. </FlexRow>
  65. <Text v-if="desc" color="second" :lines="2">{{ desc }}</Text>
  66. <FlexRow v-if="likes !== undefined && comment !== undefined" :gap="20">
  67. <Image width="40" :src="IconHeart" mode="widthFix" />
  68. <Text fontConfig="subText">{{ likes }}</Text>
  69. <Image width="40" :src="IconChat" mode="widthFix" />
  70. <Text fontConfig="subText">{{ comment }}</Text>
  71. </FlexRow>
  72. <RoundTags v-if="tags" :tags="tags" small />
  73. <FlexRow v-if="bottomTime" :gap="20">
  74. <Image width="40" :src="IconTime" mode="widthFix" />
  75. <Text fontConfig="subText">{{ bottomTime }}</Text>
  76. </FlexRow>
  77. <FlexRow v-if="bottomLocate" justify="space-between" :gap="20">
  78. <FlexRow align="center" :gap="20">
  79. <Image width="40" :src="IconLocation" mode="widthFix" />
  80. <Text fontConfig="subText">{{ bottomLocate }}</Text>
  81. </FlexRow>
  82. <FlexRow align="center" :gap="20">
  83. <Image width="40" :src="IconStar" mode="widthFix" />
  84. <Text fontConfig="subText">{{ bottomScore }}</Text>
  85. </FlexRow>
  86. </FlexRow>
  87. </Touchable>
  88. </template>
  89. <script setup lang="ts">
  90. import type { PropType } from 'vue';
  91. import RoundTags from './RoundTags.vue';
  92. import FlexCol from '@/components/layout/FlexCol.vue';
  93. import FlexRow from '@/components/layout/FlexRow.vue';
  94. import Image from '@/components/basic/Image.vue';
  95. import Text from '@/components/basic/Text.vue';
  96. import Touchable from '@/components/feedback/Touchable.vue';
  97. const IconHeart = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconHeart.png';
  98. const IconChat = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconChat.png';
  99. const IconLocation = 'https://mncdn.wenlvti.net/app_static/minnan/images/inhert/IconLocation.png';
  100. const IconTime = 'https://mncdn.wenlvti.net/app_static/minnan/images/inhert/IconTime.png';
  101. const IconStar = 'https://mncdn.wenlvti.net/app_static/minnan/images/inhert/IconStar.png';
  102. const PlayVideo = 'https://mncdn.wenlvti.net/app_static/minnan/images/inhert/PlayVideo.png';
  103. defineProps({
  104. classNames: {
  105. type: String,
  106. },
  107. title: {
  108. type: String,
  109. },
  110. titleColor: {
  111. type: String,
  112. default: 'primary',
  113. },
  114. title1: {
  115. type: Boolean,
  116. default: false,
  117. },
  118. fixSize: {
  119. type: Boolean,
  120. default: false,
  121. },
  122. badge: {
  123. type: String,
  124. default: '',
  125. },
  126. tags: {
  127. type: Array as PropType<string[]>,
  128. default: [],
  129. },
  130. videoMark: {
  131. type: Boolean,
  132. default: false,
  133. },
  134. desc: {
  135. type: String,
  136. },
  137. image: {
  138. type: String,
  139. },
  140. likes: {
  141. type: Number,
  142. },
  143. comment: {
  144. type: Number,
  145. },
  146. userHead: {
  147. type: String,
  148. },
  149. userName: {
  150. type: String,
  151. },
  152. bottomLocate: {
  153. type: String,
  154. },
  155. bottomScore: {
  156. type: String,
  157. },
  158. bottomTime: {
  159. type: String,
  160. },
  161. })
  162. </script>
  163. <style scoped>
  164. .video-mark {
  165. position: absolute;
  166. left: calc(50% - 20rpx);
  167. top: 145rpx
  168. }
  169. </style>