TallItem.vue 6.4 KB

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