ShareDialog.vue 5.0 KB

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