EqualItem.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <div class="itemLayou" @click="handlerItem">
  3. <div style="display: flex; flex-direction: column">
  4. <div
  5. class="item"
  6. :style="{
  7. backgroundSize: 'cover',
  8. backgroundPosition: 'center',
  9. backgroundImage:
  10. 'url(' +
  11. (props.item.coverImagePath != '' && sysConfig.FILE_URL + props.item.coverImagePath
  12. ? sysConfig.FILE_URL + props.item.coverImagePath
  13. : '') +
  14. ')'
  15. }"
  16. ></div>
  17. <div style="padding: 10px">
  18. <span style="display: block">{{ props.item.fileName }}</span>
  19. <div style="display: flex; align-items: center">
  20. <span style="display: block; font-size: 10px; color: darkgray">{{ props.item.resourceCreaterUserName }}</span>
  21. <div style="width: 1px; height: 10px; margin-left: 5px; margin-right: 5px; background-color: black"></div>
  22. <span style="display: block; font-size: 10px; color: darkgray">{{ props.item.viewCount }}</span>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script setup>
  29. import { ref } from 'vue'
  30. import TabSwitcher from './TabSwitcher.vue'
  31. import EventBus from '@/utils/EventBus'
  32. import sysConfig from '@/config'
  33. const emit = defineEmits(['selectTab'])
  34. // id: 1,
  35. // name: '张三',是1000元,请给我一个好评,谢谢',
  36. // follw: 0,
  37. const props = defineProps({
  38. item: {
  39. type: Object,
  40. default: () => {}
  41. }
  42. // name: {
  43. // type: String,
  44. // default: () => ''
  45. // },
  46. // talk: {
  47. // type: String,
  48. // default: () => ''
  49. // },
  50. // follw: {
  51. // type: Number,
  52. // default: () => 0
  53. // },
  54. // callBackTalk: {
  55. // type: Array,
  56. // default: () => []
  57. // }
  58. })
  59. const listUnpublishedView = ref(null)
  60. const tallTag = ref(false)
  61. const handerMessage = (form) => {
  62. console.log('查询内容', form)
  63. tallTag.value == true ? (tallTag.value = false) : (tallTag.value = true)
  64. EventBus.emit('closeInput', null, props.item.id)
  65. //....
  66. // listUnpublishedView.value.setData(tableData.value)
  67. }
  68. const handlerItem = () => {
  69. // emit('handlerItem', item)
  70. EventBus.emit('openResourceDetailsInner', { id: props.item.id })
  71. }
  72. watch(
  73. () => props.item,
  74. (val) => {
  75. console.log('item有变化吗', val)
  76. }
  77. )
  78. const handerPublish = () => {
  79. tallTag.value = false
  80. emit('publish')
  81. //....
  82. // listUnpublishedView.value.setData(tableData.value)
  83. }
  84. const handleCloseInput = (data, tag) => {
  85. if (props.item.id != tag) {
  86. tallTag.value = false
  87. }
  88. }
  89. onMounted(() => {
  90. // getList()
  91. })
  92. EventBus.off('closeInput', handleCloseInput)
  93. EventBus.on('closeInput', handleCloseInput)
  94. </script>
  95. <style scoped>
  96. .tab-switcher {
  97. display: flex;
  98. border-radius: 20px;
  99. border: 1px solid #1e90ff;
  100. overflow: hidden;
  101. }
  102. .tab-switcher div {
  103. padding: 2px 20px;
  104. background-color: #f5f5f5;
  105. cursor: pointer;
  106. }
  107. .tab-switcher div.active {
  108. background-color: #1e90ff;
  109. color: white;
  110. }
  111. .tab-switcher div:not(:last-child) {
  112. }
  113. .user-info {
  114. display: flex;
  115. align-items: center;
  116. width: 100%;
  117. height: 200px;
  118. border: 1px solid #dfe2e5;
  119. padding: 20px;
  120. }
  121. .resource-container {
  122. width: 850px;
  123. margin: 0 auto;
  124. padding: 20px;
  125. border: 1px solid #dfe2e5;
  126. }
  127. .user-avatar {
  128. width: 40px;
  129. height: 40px;
  130. background: #1e90ff;
  131. border-radius: 50%;
  132. margin-right: 10px;
  133. }
  134. .user-details {
  135. flex: 1;
  136. }
  137. .user-name {
  138. font-size: 13px;
  139. font-weight: bold;
  140. }
  141. .publish-time {
  142. font-size: 12px;
  143. color: #999;
  144. margin-top: 5px;
  145. }
  146. .metrics {
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. .metric-item {
  152. display: flex;
  153. flex-direction: column;
  154. align-items: center;
  155. padding-left: 10px;
  156. padding-right: 10px;
  157. }
  158. .metric-item span:first-child {
  159. font-size: 18px;
  160. font-weight: bold;
  161. }
  162. .metric-item span:last-child {
  163. font-size: 12px;
  164. color: #666;
  165. }
  166. .actions {
  167. display: flex;
  168. }
  169. .share-btn,
  170. .favorite-btn {
  171. background-color: transparent;
  172. border: none;
  173. cursor: pointer;
  174. }
  175. .course-info {
  176. margin-top: 20px;
  177. line-height: 1.6;
  178. }
  179. .liene {
  180. height: 35px;
  181. width: 1px;
  182. background: #00000018;
  183. }
  184. .resource-container {
  185. width: 850px;
  186. margin: 0 auto;
  187. padding: 20px;
  188. border: 1px solid #dfe2e5;
  189. }
  190. h1 {
  191. text-align: center;
  192. margin-bottom: 20px;
  193. }
  194. .ant-descriptions {
  195. margin-top: 20px;
  196. }
  197. .ant-typography-title {
  198. margin-top: 20px;
  199. }
  200. .ant-typography-paragraph {
  201. margin-top: 10px;
  202. }
  203. .ant-space {
  204. margin-top: 10px;
  205. }
  206. .video-info {
  207. height: 100%; /* 确保填满容器高度 */
  208. }
  209. .resInfo {
  210. margin-left: 10px;
  211. width: 350px;
  212. height: 570px;
  213. border: 1px solid #dfe2e5;
  214. padding: 10px;
  215. }
  216. .user-info-container {
  217. display: flex;
  218. }
  219. .resInfoTitile {
  220. width: 5px;
  221. height: 14px;
  222. background-color: cadetblue;
  223. margin-right: 5px;
  224. }
  225. .tallList {
  226. display: flex;
  227. flex-direction: column;
  228. width: 850px;
  229. border: 1px solid #dfe2e5;
  230. padding: 20px;
  231. margin-top: 10px;
  232. }
  233. .tallListInfo {
  234. color: rgba(0, 0, 0, 0.116);
  235. font-size: 12px;
  236. }
  237. .line {
  238. width: 100%;
  239. height: 0.5px;
  240. background-color: rgba(0, 0, 0, 0.075);
  241. margin-top: 10px;
  242. margin-bottom: 10px;
  243. }
  244. .itemLayou {
  245. padding: 0px;
  246. cursor: pointer;
  247. margin-bottom: 10px;
  248. }
  249. .item {
  250. width: 100%;
  251. height: 150px;
  252. }
  253. </style>