ReportDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <div class="detail-report" v-if="infoDetail">
  3. <i class="el-icon-close" @click="closeDialog"></i>
  4. <div
  5. class="detail-left"
  6. v-if="infoDetail.res_urls_type && infoDetail.res_urls_type.length > 0"
  7. >
  8. <el-carousel :autoplay="false" arrow="always">
  9. <el-carousel-item
  10. v-for="item in infoDetail.res_urls_type"
  11. :key="item.url"
  12. >
  13. <template v-if="item.type === 'img'">
  14. <el-image
  15. class="image"
  16. :src="item.url"
  17. :fit="'contain'"
  18. :style="'width:802px;height:870px;'"
  19. >
  20. <div
  21. slot="placeholder"
  22. class="image-slot"
  23. :style="'line-height:130px'"
  24. >
  25. 加载中<span class="dot">...</span>
  26. </div>
  27. </el-image>
  28. </template>
  29. <template v-else-if="item.type === 'mp4'">
  30. <video controls width="802" height="870">
  31. <source :src="item.url" type="video/webm" />
  32. <source :src="item.url" type="video/mp4" />
  33. Sorry, your browser doesn't support embedded videos.
  34. </video>
  35. </template>
  36. <template v-else-if="item.type === 'mp3'">
  37. <audio :src="item.url" controls loop muted>
  38. 浏览器不支持音频播放。
  39. </audio>
  40. </template>
  41. </el-carousel-item>
  42. </el-carousel>
  43. </div>
  44. <div class="detail-right">
  45. <div class="right-top">
  46. <div class="creator-info">
  47. <el-image
  48. :src="
  49. infoDetail.creator_img_url
  50. ? infoDetail.creator_img_url
  51. : require('../../../assets/avatar.png')
  52. "
  53. fit="cover"
  54. style="width: 32px; height: 32px; margin-right: 8px"
  55. >
  56. </el-image>
  57. <span class="name">{{ infoDetail.creator_name }}</span>
  58. </div>
  59. <h3>{{ infoDetail.art_title }}</h3>
  60. <p>{{ infoDetail.art_content }}</p>
  61. <b>{{ infoDetail.create_time.substring(0, 10) }}</b>
  62. </div>
  63. <div class="right-bottom">
  64. <h4>
  65. {{
  66. infoDetail.comment_count > 999 ? "999+" : infoDetail.comment_count
  67. }}
  68. 条评论
  69. </h4>
  70. <div class="comment-box">
  71. <div class="comment-item">
  72. <div class="comment-top">
  73. <el-image
  74. :src="
  75. infoDetail.creator_img_url
  76. ? infoDetail.creator_img_url
  77. : require('../../../assets/avatar.png')
  78. "
  79. fit="cover"
  80. style="width: 32px; height: 32px; margin-right: 16px"
  81. >
  82. </el-image>
  83. <div class="comment-top-right">
  84. <span class="name">{{ infoDetail.creator_name }}</span>
  85. <p>{{ infoDetail.art_content }}</p>
  86. <div class="comment-top-bottom">
  87. <b>{{ infoDetail.create_time.substring(0, 10) }}</b>
  88. <div class="ding-box">
  89. <svg-icon
  90. icon-class="like-line"
  91. className="chat"
  92. ></svg-icon>
  93. <span>{{
  94. infoDetail.ding_count < 1000
  95. ? infoDetail.ding_count
  96. : "999+"
  97. }}</span>
  98. <svg-icon
  99. icon-class="chat-line"
  100. className="chat"
  101. ></svg-icon>
  102. <span>{{
  103. infoDetail.comment_count < 1000
  104. ? infoDetail.comment_count
  105. : "999+"
  106. }}</span>
  107. <svg-icon
  108. icon-class="delete-line"
  109. className="chat"
  110. ></svg-icon>
  111. </div>
  112. </div>
  113. <div class="comment-bottom">
  114. <div class="comment-bottom-item">
  115. <el-image
  116. :src="
  117. infoDetail.creator_img_url
  118. ? infoDetail.creator_img_url
  119. : require('../../../assets/avatar.png')
  120. "
  121. fit="cover"
  122. style="width: 32px; height: 32px; margin-right: 16px"
  123. >
  124. </el-image>
  125. <div class="comment-top-right">
  126. <span class="name">{{ infoDetail.creator_name }}</span>
  127. <p>{{ infoDetail.art_content }}</p>
  128. <div class="comment-top-bottom">
  129. <b>{{ infoDetail.create_time.substring(0, 10) }}</b>
  130. <div class="ding-box">
  131. <svg-icon
  132. icon-class="like-line"
  133. className="chat"
  134. ></svg-icon>
  135. <span>{{
  136. infoDetail.ding_count < 1000
  137. ? infoDetail.ding_count
  138. : "999+"
  139. }}</span>
  140. <svg-icon
  141. icon-class="chat-line"
  142. className="chat"
  143. ></svg-icon>
  144. <span>{{
  145. infoDetail.comment_count < 1000
  146. ? infoDetail.comment_count
  147. : "999+"
  148. }}</span>
  149. <svg-icon
  150. icon-class="delete-line"
  151. className="chat"
  152. ></svg-icon>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="comment-bottom-item">
  158. <el-image
  159. :src="
  160. infoDetail.creator_img_url
  161. ? infoDetail.creator_img_url
  162. : require('../../../assets/avatar.png')
  163. "
  164. fit="cover"
  165. style="width: 32px; height: 32px; margin-right: 16px"
  166. >
  167. </el-image>
  168. <div class="comment-top-right">
  169. <span class="name">{{ infoDetail.creator_name }}</span>
  170. <p>
  171. 回复<span class="reply-name">SlowLee</span
  172. >{{ infoDetail.art_content }}
  173. </p>
  174. <div class="comment-top-bottom">
  175. <b>{{ infoDetail.create_time.substring(0, 10) }}</b>
  176. <div class="ding-box">
  177. <svg-icon
  178. icon-class="like-line"
  179. className="chat"
  180. ></svg-icon>
  181. <span>{{
  182. infoDetail.ding_count < 1000
  183. ? infoDetail.ding_count
  184. : "999+"
  185. }}</span>
  186. <svg-icon
  187. icon-class="chat-line"
  188. className="chat"
  189. ></svg-icon>
  190. <span>{{
  191. infoDetail.comment_count < 1000
  192. ? infoDetail.comment_count
  193. : "999+"
  194. }}</span>
  195. <svg-icon
  196. icon-class="delete-line"
  197. className="chat"
  198. ></svg-icon>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="input-box">
  210. <div class="ding-box">
  211. <svg-icon icon-class="like-line" className="chat"></svg-icon>
  212. <span>{{
  213. infoDetail.ding_count < 1000 ? infoDetail.ding_count : "999+"
  214. }}</span>
  215. <svg-icon icon-class="chat-line" className="chat"></svg-icon>
  216. <span>{{
  217. infoDetail.comment_count < 1000 ? infoDetail.comment_count : "999+"
  218. }}</span>
  219. </div>
  220. <el-input placeholder="输入评论" v-model="searchInput" maxlength="100">
  221. </el-input>
  222. </div>
  223. </div>
  224. </div>
  225. </template>
  226. <script>
  227. export default {
  228. components: {},
  229. name: "publishReport",
  230. props: ["info"],
  231. data() {
  232. return {
  233. infoDetail: JSON.parse(JSON.stringify(this.info)),
  234. searchInput: "",
  235. };
  236. },
  237. watch: {},
  238. computed: {},
  239. methods: {
  240. handleData() {
  241. this.infoDetail.res_urls_type = [];
  242. this.infoDetail.res_urls.forEach((item) => {
  243. let index = item.lastIndexOf(".");
  244. let type = item.substring(index + 1).toLowerCase();
  245. let obj = {
  246. type: "img",
  247. url: item,
  248. };
  249. if (
  250. type === "avi" ||
  251. type === "wmv" ||
  252. type === "mpeg" ||
  253. type === "mov" ||
  254. type === "mp4"
  255. ) {
  256. obj.type = "mp4";
  257. } else if (type === "mp3" || type === "wav") {
  258. obj.type = "mp3";
  259. }
  260. this.infoDetail.res_urls_type.push(obj);
  261. });
  262. this.$forceUpdate();
  263. },
  264. closeDialog() {
  265. this.$emit("closeDetail");
  266. },
  267. },
  268. created() {},
  269. mounted() {
  270. this.handleData();
  271. },
  272. beforeDestroy() {},
  273. };
  274. </script>
  275. <style lang="scss" scoped>
  276. .detail-report {
  277. display: flex;
  278. position: relative;
  279. .el-icon-close {
  280. position: absolute;
  281. width: 16px;
  282. height: 16px;
  283. cursor: pointer;
  284. color: rgba(0, 0, 0, 0.88);
  285. top: 24px;
  286. right: 24px;
  287. z-index: 1;
  288. }
  289. .detail-left {
  290. width: 802px;
  291. height: 870px;
  292. }
  293. .detail-right {
  294. position: relative;
  295. flex: 1;
  296. padding-bottom: 150px;
  297. .right-top {
  298. padding: 24px 24px 16px 24px;
  299. border-bottom: 1px solid #f1f1f1;
  300. }
  301. .creator-info {
  302. display: flex;
  303. align-items: center;
  304. span {
  305. color: #2f3742;
  306. font-size: 14px;
  307. font-weight: 500;
  308. line-height: 22px;
  309. }
  310. }
  311. h3 {
  312. color: #2f3742;
  313. font-size: 18px;
  314. font-weight: 500;
  315. line-height: 24px;
  316. margin: 16px 0;
  317. }
  318. p {
  319. color: #2f3742;
  320. font-size: 14px;
  321. font-weight: 400;
  322. line-height: 24px;
  323. margin: 0 0 16px 0;
  324. }
  325. b {
  326. color: #c6c6c6;
  327. font-size: 12px;
  328. font-weight: 400;
  329. line-height: 20px;
  330. }
  331. }
  332. .right-bottom {
  333. padding: 16px 24px;
  334. h4 {
  335. color: #2f3742;
  336. font-size: 12px;
  337. font-weight: 400;
  338. line-height: 20px;
  339. margin: 0;
  340. }
  341. }
  342. .input-box {
  343. position: absolute;
  344. left: 0;
  345. bottom: 0;
  346. width: 100%;
  347. padding: 24px 16px;
  348. border-top: 1px solid rgba(0, 0, 0, 0.08);
  349. background: #fff;
  350. .ding-box {
  351. color: rgba(0, 0, 0, 0.85);
  352. font-size: 14px;
  353. font-weight: 500;
  354. line-height: 22px;
  355. display: flex;
  356. align-items: center;
  357. margin-bottom: 16px;
  358. .svg-icon {
  359. width: 24px;
  360. height: 24px;
  361. &.chat {
  362. color: rgba(0, 0, 0, 0.85);
  363. }
  364. }
  365. span {
  366. margin: 0 16px 0 4px;
  367. }
  368. }
  369. .el-input {
  370. border-radius: 8px;
  371. background: #f4f4f4;
  372. }
  373. }
  374. .comment-box {
  375. .comment-item {
  376. padding: 24px 0;
  377. font-size: 14px;
  378. line-height: 22px;
  379. .comment-top {
  380. display: flex;
  381. &-right {
  382. flex: 1;
  383. }
  384. }
  385. .comment-bottom {
  386. margin-top: 24px;
  387. .comment-top-right {
  388. flex: 1;
  389. }
  390. &-item {
  391. width: 100%;
  392. padding: 8px 0;
  393. display: flex;
  394. }
  395. }
  396. .name {
  397. color: rgba(0, 0, 0, 0.5);
  398. }
  399. p {
  400. color: #000;
  401. margin: 8px 0;
  402. }
  403. .reply-name {
  404. margin: 0 4px;
  405. color: rgba(0, 0, 0, 0.6);
  406. }
  407. .comment-top-bottom {
  408. display: flex;
  409. justify-content: space-between;
  410. .ding-box {
  411. color: rgba(0, 0, 0, 0.65);
  412. .svg-icon {
  413. font-size: 16px;
  414. cursor: pointer;
  415. }
  416. span {
  417. font-size: 12px;
  418. line-height: 22px;
  419. margin: 0 16px 0 4px;
  420. font-weight: 500;
  421. }
  422. }
  423. }
  424. }
  425. }
  426. }
  427. </style>
  428. <style lang="scss">
  429. .detail-report {
  430. .el-carousel__container {
  431. height: 870px;
  432. .el-carousel__item {
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. }
  437. }
  438. .input-box {
  439. .el-input__inner {
  440. background: #f4f4f4;
  441. }
  442. }
  443. }
  444. </style>