marterialDetail.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. <style lang="scss" scoped>
  2. #office-iframe {
  3. height: 800px;
  4. }
  5. </style>
  6. <style>
  7. .info-detail .ant-descriptions-item-content {
  8. font-weight: bold;
  9. }
  10. .info-detail .ant-descriptions-item-label {
  11. color: darkgray;
  12. min-width: 80px;
  13. }
  14. .info-detail table tr td {
  15. border: 0;
  16. }
  17. .show-data p {
  18. color: black;
  19. font-weight: 600;
  20. }
  21. .show-data p span {
  22. display: inline-block;
  23. width: 85px;
  24. color: slategrey;
  25. font-weight: 500;
  26. }
  27. </style>
  28. <template>
  29. <a-row :gutter="10">
  30. <a-spin :spinning="spinning">
  31. <a-col :sm="6" style="margin-bottom: 20px; z-index: 10">
  32. <a-card
  33. style="min-height: 100px"
  34. :style="{
  35. width: (clientWidth / 24) * 6 - 10 + 'px',
  36. }"
  37. >
  38. <video class="video" :src="materialInfo.url" controls="controls" style="width: 100%" v-if="materialInfo">
  39. 您的浏览器不支持 video 标签。
  40. </video>
  41. <img :src="noImg" alt="" v-else style="width: 100%" />
  42. </a-card>
  43. </a-col>
  44. <a-col :sm="18" style="margin-bottom: 20px; z-index: 10">
  45. <a-card class="info-detail" style="min-height: 300px">
  46. <a-descriptions title="视频信息" v-if="materialInfo">
  47. <a-descriptions-item label="素材标题" :span="3">
  48. {{ materialInfo.materialName ? materialInfo.materialName : '-' }}
  49. </a-descriptions-item>
  50. <a-descriptions-item label="素材ID">
  51. {{ materialInfo.materialId ? materialInfo.materialId : '-' }}
  52. </a-descriptions-item>
  53. <a-descriptions-item label="上线时间">
  54. {{ materialInfo.createTime ? materialInfo.createTime.split(' ')[0] : '-' }}
  55. </a-descriptions-item>
  56. <a-descriptions-item label="素材类型">
  57. {{
  58. materialInfo.materialType ? (materialInfo.materialType == '' ? '无' : materialInfo.materialType) : '-'
  59. }}
  60. </a-descriptions-item>
  61. <a-descriptions-item label="视频时长">
  62. <span v-if="materialInfo.second">
  63. {{ materialInfo.second | formatS }}
  64. </span>
  65. <span v-else>-</span>
  66. </a-descriptions-item>
  67. <a-descriptions-item label="视频大小">
  68. {{ materialInfo.size ? materialInfo.size : '-' }}
  69. </a-descriptions-item>
  70. <a-descriptions-item label="视频尺寸">
  71. {{ materialInfo.width ? materialInfo.width + '*' + materialInfo.height : '-' }}
  72. </a-descriptions-item>
  73. <a-descriptions-item label="投放媒体">
  74. {{ materialInfo.madia || '-' }}
  75. </a-descriptions-item>
  76. <a-descriptions-item label="素材渠道">
  77. {{ materialInfo.channelType || '-' }}
  78. </a-descriptions-item>
  79. <a-descriptions-item label="供应商">
  80. {{ materialInfo.supplier || '-' }}
  81. </a-descriptions-item>
  82. <a-descriptions-item label="关联项目">
  83. {{ materialInfo.projectName || '-' }}
  84. </a-descriptions-item>
  85. <a-descriptions-item label="唯一编码" :span="2">
  86. {{ materialInfo.code || '-' }}
  87. </a-descriptions-item>
  88. <a-descriptions-item label="设计组长" :span="3" style="margin-top: 10px">
  89. {{ materialInfo.leaderName || '-' }}
  90. </a-descriptions-item>
  91. <a-descriptions-item label="编导">
  92. {{ materialInfo.planName ? (materialInfo.planName == '' ? '无' : materialInfo.planName) : '-' }}
  93. </a-descriptions-item>
  94. <a-descriptions-item label="拍摄">
  95. {{ materialInfo.shotName ? (materialInfo.shotName == '' ? '无' : materialInfo.shotName) : '-' }}
  96. </a-descriptions-item>
  97. <a-descriptions-item label="剪辑">
  98. {{ materialInfo.clipName ? (materialInfo.clipName == '' ? '无' : materialInfo.clipName) : '-' }}
  99. </a-descriptions-item>
  100. </a-descriptions>
  101. </a-card>
  102. <a-card style="min-height: 300px; margin: 10px 0" v-if="dataView && mediaId == 2">
  103. <div
  104. style="
  105. margin-bottom: 20px;
  106. color: rgba(0, 0, 0, 0.85);
  107. font-weight: bold;
  108. font-size: 16px;
  109. line-height: 1.5;
  110. "
  111. >
  112. 数据概览
  113. </div>
  114. <a-row :gutter="15">
  115. <a-col :xl="6" class="show-data">
  116. <h3>素材消耗</h3>
  117. <p
  118. :style="{ color: dataView.charge[0].charge >= dataView.charge[2].charge ? '#F66C6D' : '#67C239' }"
  119. style="font-size: 18px; font-weight: 700"
  120. >
  121. {{ dataView.charge[0].charge | decimalsHandle }}
  122. </p>
  123. <p><span>项目top</span>{{ dataView.charge[1].charge | decimalsHandle }}</p>
  124. <p><span>素材库均值</span>{{ dataView.charge[2].charge | decimalsHandle }}</p>
  125. </a-col>
  126. <a-col :xl="6" class="show-data">
  127. <h3>封面曝光数</h3>
  128. <p
  129. :style="{
  130. color: dataView.photoShow[0].photoShow >= dataView.photoShow[2].photoShow ? '#F66C6D' : '#67C239',
  131. }"
  132. style="font-size: 18px; font-weight: 700"
  133. >
  134. {{ dataView.photoShow[0].photoShow }}
  135. </p>
  136. <p><span>项目top</span>{{ dataView.photoShow[1].photoShow }}</p>
  137. <p><span>素材库均值</span>{{ dataView.photoShow[2].photoShow }}</p>
  138. </a-col>
  139. <a-col :xl="6" class="show-data">
  140. <h3>封面点击数</h3>
  141. <p
  142. :style="{
  143. color: dataView.photoClick[0].photoClick >= dataView.photoClick[2].photoClick ? '#F66C6D' : '#67C239',
  144. }"
  145. style="font-size: 18px; font-weight: 700"
  146. >
  147. {{ dataView.photoClick[0].photoClick }}
  148. </p>
  149. <p><span>项目top</span>{{ dataView.photoClick[1].photoClick }}</p>
  150. <p><span>素材库均值</span>{{ dataView.photoClick[2].photoClick }}</p>
  151. </a-col>
  152. <a-col :xl="6" class="show-data">
  153. <h3>素材曝光数</h3>
  154. <p
  155. :style="{ color: dataView.aclick[0].aclick >= dataView.aclick[2].aclick ? '#F66C6D' : '#67C239' }"
  156. style="font-size: 18px; font-weight: 700"
  157. >
  158. {{ dataView.aclick[0].aclick }}
  159. </p>
  160. <p><span>项目top</span>{{ dataView.aclick[1].aclick }}</p>
  161. <p><span>素材库均值</span>{{ dataView.aclick[2].aclick }}</p>
  162. </a-col>
  163. </a-row>
  164. <a-row :gutter="15" style="margin-top: 20px">
  165. <a-col :xl="6" class="show-data">
  166. <h3>行为数</h3>
  167. <p
  168. :style="{ color: dataView.bclick[0].bclick >= dataView.bclick[2].bclick ? '#F66C6D' : '#67C239' }"
  169. style="font-size: 18px; font-weight: 700"
  170. >
  171. {{ dataView.bclick[0].bclick }}
  172. </p>
  173. <p><span>项目top</span>{{ dataView.bclick[1].bclick }}</p>
  174. <p><span>素材库均值</span>{{ dataView.bclick[2].bclick }}</p>
  175. </a-col>
  176. <a-col :xl="6" class="show-data">
  177. <h3>激活数</h3>
  178. <p
  179. :style="{
  180. color: dataView.activation[0].activation >= dataView.activation[2].activation ? '#F66C6D' : '#67C239',
  181. }"
  182. style="font-size: 18px; font-weight: 700"
  183. >
  184. {{ dataView.activation[0].activation }}
  185. </p>
  186. <p><span>项目top</span>{{ dataView.activation[1].activation }}</p>
  187. <p><span>素材库均值</span>{{ dataView.activation[2].activation }}</p>
  188. </a-col>
  189. <a-col :xl="6" class="show-data">
  190. <h3>3s播放率</h3>
  191. <p
  192. :style="{
  193. color: dataView.play3sRate[0].play3sRate >= dataView.play3sRate[2].play3sRate ? '#F66C6D' : '#67C239',
  194. }"
  195. style="font-size: 18px; font-weight: 700"
  196. >
  197. {{ (dataView.play3sRate[0].play3sRate * 100).toFixed(2) + '%' }}
  198. </p>
  199. <p><span>项目top</span>{{ (dataView.play3sRate[1].play3sRate * 100).toFixed(2) + '%' }}</p>
  200. <p><span>素材库均值</span>{{ (dataView.play3sRate[2].play3sRate * 100).toFixed(2) + '%' }}</p>
  201. </a-col>
  202. </a-row>
  203. </a-card>
  204. <a-card style="min-height: 300px; margin: 10px 0" v-if="dataView && mediaId == 1">
  205. <div
  206. style="
  207. margin-bottom: 20px;
  208. color: rgba(0, 0, 0, 0.85);
  209. font-weight: bold;
  210. font-size: 16px;
  211. line-height: 1.5;
  212. "
  213. >
  214. 数据概览
  215. </div>
  216. <a-row :gutter="15">
  217. <a-col :xl="6" class="show-data">
  218. <h3>素材消耗</h3>
  219. <p
  220. :style="{ color: dataView.cost[0].cost >= dataView.cost[2].cost ? '#F66C6D' : '#67C239' }"
  221. style="font-size: 18px; font-weight: 700"
  222. >
  223. {{ dataView.cost[0].cost | decimalsHandle }}
  224. </p>
  225. <p><span>项目top</span>{{ dataView.cost[1].cost | decimalsHandle }}</p>
  226. <p><span>素材库均值</span>{{ dataView.cost[2].cost | decimalsHandle }}</p>
  227. </a-col>
  228. <a-col :xl="6" class="show-data">
  229. <h3>点击数</h3>
  230. <p
  231. :style="{
  232. color: dataView.click[0].click >= dataView.click[2].click ? '#F66C6D' : '#67C239',
  233. }"
  234. style="font-size: 18px; font-weight: 700"
  235. >
  236. {{ dataView.click[0].click }}
  237. </p>
  238. <p><span>项目top</span>{{ dataView.click[1].click }}</p>
  239. <p><span>素材库均值</span>{{ dataView.click[2].click }}</p>
  240. </a-col>
  241. <a-col :xl="6" class="show-data">
  242. <h3>曝光数</h3>
  243. <p
  244. :style="{
  245. color:
  246. dataView.materialShow[0].materialShow >= dataView.materialShow[2].materialShow
  247. ? '#F66C6D'
  248. : '#67C239',
  249. }"
  250. style="font-size: 18px; font-weight: 700"
  251. >
  252. {{ dataView.materialShow[0].materialShow }}
  253. </p>
  254. <p><span>项目top</span>{{ dataView.materialShow[1].materialShow }}</p>
  255. <p><span>素材库均值</span>{{ dataView.materialShow[2].materialShow }}</p>
  256. </a-col>
  257. <a-col :xl="6" class="show-data">
  258. <h3>完播率</h3>
  259. <p
  260. :style="{
  261. color:
  262. dataView.play100Rate[0].play100Rate >= dataView.play100Rate[2].play100Rate ? '#F66C6D' : '#67C239',
  263. }"
  264. style="font-size: 18px; font-weight: 700"
  265. >
  266. {{ (dataView.play100Rate[0].play100Rate * 100).toFixed(2) + '%' }}
  267. </p>
  268. <p><span>项目top</span>{{ (dataView.play100Rate[1].play100Rate * 100).toFixed(2) + '%' }}</p>
  269. <p><span>素材库均值</span>{{ (dataView.play100Rate[2].play100Rate * 100).toFixed(2) + '%' }}</p>
  270. </a-col>
  271. </a-row>
  272. <a-row :gutter="15" style="margin-top: 20px">
  273. <a-col :xl="6" class="show-data">
  274. <h3>点赞数</h3>
  275. <p
  276. :style="{
  277. color:
  278. dataView.likeMaterial[0].likeMaterial >= dataView.likeMaterial[2].likeMaterial
  279. ? '#F66C6D'
  280. : '#67C239',
  281. }"
  282. style="font-size: 18px; font-weight: 700"
  283. >
  284. {{ dataView.likeMaterial[0].likeMaterial }}
  285. </p>
  286. <p><span>项目top</span>{{ dataView.likeMaterial[1].likeMaterial }}</p>
  287. <p><span>素材库均值</span>{{ dataView.likeMaterial[2].likeMaterial }}</p>
  288. </a-col>
  289. <a-col :xl="6" class="show-data">
  290. <h3>评论数</h3>
  291. <p
  292. :style="{
  293. color:
  294. dataView.commentMaterial[0].commentMaterial >= dataView.commentMaterial[2].commentMaterial
  295. ? '#F66C6D'
  296. : '#67C239',
  297. }"
  298. style="font-size: 18px; font-weight: 700"
  299. >
  300. {{ dataView.commentMaterial[0].commentMaterial }}
  301. </p>
  302. <p><span>项目top</span>{{ dataView.commentMaterial[1].commentMaterial }}</p>
  303. <p><span>素材库均值</span>{{ dataView.commentMaterial[2].commentMaterial }}</p>
  304. </a-col>
  305. <a-col :xl="6" class="show-data">
  306. <h3>转发数</h3>
  307. <p
  308. :style="{
  309. color:
  310. dataView.shareMaterial[0].shareMaterial >= dataView.shareMaterial[2].shareMaterial
  311. ? '#F66C6D'
  312. : '#67C239',
  313. }"
  314. style="font-size: 18px; font-weight: 700"
  315. >
  316. {{ dataView.shareMaterial[0].shareMaterial }}
  317. </p>
  318. <p><span>项目top</span>{{ dataView.shareMaterial[1].shareMaterial }}</p>
  319. <p><span>素材库均值</span>{{ dataView.shareMaterial[2].shareMaterial }}</p>
  320. </a-col>
  321. <a-col :xl="6" class="show-data">
  322. <h3>关注数</h3>
  323. <p
  324. :style="{
  325. color: dataView.follow[0].follow >= dataView.follow[2].follow ? '#F66C6D' : '#67C239',
  326. }"
  327. style="font-size: 18px; font-weight: 700"
  328. >
  329. {{ dataView.follow[0].follow }}
  330. </p>
  331. <p><span>项目top</span>{{ dataView.follow[1].follow }}</p>
  332. <p><span>素材库均值</span>{{ dataView.follow[2].follow }}</p>
  333. </a-col>
  334. </a-row>
  335. </a-card>
  336. <a-card style="min-height: 300px">
  337. <div
  338. style="
  339. margin-bottom: 20px;
  340. color: rgba(0, 0, 0, 0.85);
  341. font-weight: bold;
  342. font-size: 16px;
  343. line-height: 1.5;
  344. "
  345. >
  346. 数据消耗趋势
  347. </div>
  348. <div
  349. id="echartCircular"
  350. ref="echartCircular"
  351. style="height: 350px"
  352. :style="{ width: (clientWidth / 24) * 18 - 48 - 24 + 'px' }"
  353. ></div
  354. ></a-card>
  355. <!-- <a-card class="search-box" style="min-height: 300px; margin: 20px 0"> </a-card> -->
  356. </a-col>
  357. </a-spin>
  358. </a-row>
  359. </template>
  360. <script>
  361. import { getAction, postAction } from '@/api/manage'
  362. import moment from 'moment'
  363. import $ from 'jquery'
  364. import qs from 'qs'
  365. import UploadToAli from '@femessage/upload-to-ali'
  366. import uploadFile from '@/components/uploadFile.vue'
  367. import { mapActions, mapGetters, mapState } from 'vuex'
  368. var echarts = require('echarts')
  369. export default {
  370. name: 'online-training-list',
  371. data() {
  372. return {
  373. noImg: require('@/assets/noImg.png'),
  374. materialInfo: null,
  375. dataView: null,
  376. clientWidth: 1920,
  377. spinning: false,
  378. scrollTopAll: 0,
  379. scrollTop: 124,
  380. mediaId: 0,
  381. }
  382. },
  383. components: {
  384. UploadToAli,
  385. uploadFile,
  386. },
  387. watch: {
  388. $route: function (n, o) {
  389. if (n.query.md5 != o.query.md5 || n.path != o.path) {
  390. this.getMaterialInfo()
  391. }
  392. },
  393. },
  394. methods: {
  395. handlerEchartOption(data) {
  396. var option = {
  397. noDataLoadingOption: {
  398. text: '暂无数据',
  399. effect: 'bubble',
  400. effectOption: {
  401. effect: {
  402. n: 0,
  403. },
  404. },
  405. },
  406. // title: {
  407. // text: '折线图堆叠'
  408. // },
  409. tooltip: {
  410. trigger: 'axis',
  411. },
  412. // legend: {
  413. // data: ['邮件营销', '联盟广告', ]
  414. // },
  415. grid: {
  416. left: '3%',
  417. right: '4%',
  418. bottom: '3%',
  419. containLabel: true,
  420. },
  421. legend: {
  422. icon: 'circle',
  423. top: '5%',
  424. right: '5%',
  425. itemWidth: 6,
  426. itemGap: 20,
  427. textStyle: {
  428. color: '#556677',
  429. },
  430. },
  431. toolbox: {
  432. // feature: {
  433. // saveAsImage: {}
  434. // }
  435. },
  436. xAxis: {
  437. type: 'category',
  438. data: data.map((item) => {
  439. return item.statDate
  440. }),
  441. boundaryGap: false,
  442. // 坐标轴线
  443. axisLine: {
  444. show: false,
  445. lineStyle: {
  446. color: '#999',
  447. },
  448. },
  449. // 分割线
  450. splitLine: {
  451. show: true,
  452. lineStyle: {
  453. type: 'dashed',
  454. color: '#e5e5e5',
  455. },
  456. },
  457. },
  458. yAxis: {
  459. type: 'value',
  460. axisLine: {
  461. show: false,
  462. lineStyle: {
  463. color: '#999',
  464. },
  465. },
  466. splitLine: {
  467. lineStyle: {
  468. type: 'dashed',
  469. color: '#e5e5e5',
  470. },
  471. },
  472. },
  473. series: [
  474. {
  475. smooth: true,
  476. name: '消耗',
  477. type: 'line',
  478. stack: '总量',
  479. data: data.map((item) => {
  480. return item.cost.toFixed(3)
  481. }),
  482. symbol: 'circle',
  483. symbolSize: 6,
  484. lineStyle: {
  485. normal: {
  486. width: 2,
  487. // color: '#0bcd74'
  488. },
  489. },
  490. itemStyle: {
  491. borderColor: '#ffffff',
  492. borderWidth: 0,
  493. },
  494. },
  495. ],
  496. }
  497. return option
  498. },
  499. initEchart(idName, optionName) {
  500. var that = this
  501. const chart = this.$refs[idName]
  502. // console.log(chart)
  503. if (chart) {
  504. const myChart = echarts.init(document.getElementById(idName))
  505. // myChart.showLoading({
  506. // text: "图表数据正在努力加载..."
  507. // });
  508. myChart.setOption(optionName)
  509. window.addEventListener('resize', function () {
  510. that.clientWidth = document.documentElement.clientWidth - 224
  511. myChart.resize()
  512. })
  513. }
  514. },
  515. getKuaishou() {
  516. var data = JSON.parse(localStorage.getItem('videoInfo'))
  517. var params = {
  518. mediaId: data.mediaId,
  519. md5: data.md5,
  520. }
  521. var that = this
  522. var getProjectIdByMd5 = new Promise(function (resolve, reject) {
  523. that.postDataAction('/overView/getProjectIdByMd5', params).then((res) => {
  524. if (res.success) {
  525. var materialDetailCharge = new Promise(function (resolve, reject) {
  526. that
  527. .postDataAction('/overView/materialDetailCharge', { md5: data.md5, projectId: res.result })
  528. .then((res) => {
  529. if (res.success) {
  530. resolve(res.result)
  531. }
  532. })
  533. })
  534. var materialDetailPhotoShow = new Promise(function (resolve, reject) {
  535. that
  536. .postDataAction('/overView/materialDetailPhotoShow', {
  537. md5: data.md5,
  538. projectId: res.result,
  539. })
  540. .then((res) => {
  541. if (res.success) {
  542. resolve(res.result)
  543. }
  544. })
  545. })
  546. var materialDetailPhotoClick = new Promise(function (resolve, reject) {
  547. that
  548. .postDataAction('/overView/materialDetailPhotoClick', {
  549. md5: data.md5,
  550. projectId: res.result,
  551. })
  552. .then((res) => {
  553. if (res.success) {
  554. resolve(res.result)
  555. }
  556. })
  557. })
  558. var materialDetailAClick = new Promise(function (resolve, reject) {
  559. that
  560. .postDataAction('/overView/materialDetailAClick', { md5: data.md5, projectId: res.result })
  561. .then((res) => {
  562. if (res.success) {
  563. resolve(res.result)
  564. }
  565. })
  566. })
  567. var materialDetailBClick = new Promise(function (resolve, reject) {
  568. that
  569. .postDataAction('/overView/materialDetailBClick', { md5: data.md5, projectId: res.result })
  570. .then((res) => {
  571. if (res.success) {
  572. resolve(res.result)
  573. }
  574. })
  575. })
  576. var materialDetailActivation = new Promise(function (resolve, reject) {
  577. that
  578. .postDataAction('/overView/materialDetailActivation', {
  579. md5: data.md5,
  580. projectId: res.result,
  581. })
  582. .then((res) => {
  583. if (res.success) {
  584. resolve(res.result)
  585. }
  586. })
  587. })
  588. var materialDetailPlay3sRate = new Promise(function (resolve, reject) {
  589. that
  590. .postDataAction('/overView/materialDetailPlay3sRate', {
  591. md5: data.md5,
  592. projectId: res.result,
  593. })
  594. .then((res) => {
  595. if (res.success) {
  596. resolve(res.result)
  597. }
  598. })
  599. })
  600. Promise.all([
  601. materialDetailPlay3sRate,
  602. materialDetailCharge,
  603. materialDetailPhotoShow,
  604. materialDetailPhotoClick,
  605. materialDetailAClick,
  606. materialDetailBClick,
  607. materialDetailActivation,
  608. ]).then((item) => {
  609. // dataView
  610. that.spinning = false
  611. that.dataView = {}
  612. for (let i = 0; i < item.length; i++) {
  613. for (const key in item[i]) {
  614. that.dataView[key] = item[i][key]
  615. }
  616. }
  617. })
  618. }
  619. })
  620. })
  621. },
  622. getToutiao() {
  623. var data = JSON.parse(localStorage.getItem('videoInfo'))
  624. var params = {
  625. mediaId: data.mediaId,
  626. md5: data.md5,
  627. }
  628. var that = this
  629. var getProjectIdByMd5 = new Promise(function (resolve, reject) {
  630. that.postDataAction('/overView/getProjectIdByMd5', params).then((res) => {
  631. if (res.success) {
  632. var materialDetailMaterialShow = new Promise(function (resolve, reject) {
  633. that
  634. .postDataAction('/overView/materialDetailMaterialShow', {
  635. md5: data.md5,
  636. projectId: res.result,
  637. })
  638. .then((res) => {
  639. if (res.success) {
  640. resolve(res.result)
  641. }
  642. })
  643. })
  644. var materialDetailCost = new Promise(function (resolve, reject) {
  645. that
  646. .postDataAction('/overView/materialDetailCost', { md5: data.md5, projectId: res.result })
  647. .then((res) => {
  648. if (res.success) {
  649. resolve(res.result)
  650. }
  651. })
  652. })
  653. var materialDetailClick = new Promise(function (resolve, reject) {
  654. that
  655. .postDataAction('/overView/materialDetailClick', {
  656. md5: data.md5,
  657. projectId: res.result,
  658. })
  659. .then((res) => {
  660. if (res.success) {
  661. resolve(res.result)
  662. }
  663. })
  664. })
  665. var materialDetailPlay100Rate = new Promise(function (resolve, reject) {
  666. that
  667. .postDataAction('/overView/materialDetailPlay100Rate', {
  668. md5: data.md5,
  669. projectId: res.result,
  670. })
  671. .then((res) => {
  672. if (res.success) {
  673. resolve(res.result)
  674. }
  675. })
  676. })
  677. var materialDetailLikeMaterial = new Promise(function (resolve, reject) {
  678. that
  679. .postDataAction('/overView/materialDetailLikeMaterial', {
  680. md5: data.md5,
  681. projectId: res.result,
  682. })
  683. .then((res) => {
  684. if (res.success) {
  685. resolve(res.result)
  686. }
  687. })
  688. })
  689. var materialDetailCommentMaterial = new Promise(function (resolve, reject) {
  690. that
  691. .postDataAction('/overView/materialDetailCommentMaterial', {
  692. md5: data.md5,
  693. projectId: res.result,
  694. })
  695. .then((res) => {
  696. if (res.success) {
  697. resolve(res.result)
  698. }
  699. })
  700. })
  701. var materialDetailShareMaterial = new Promise(function (resolve, reject) {
  702. that
  703. .postDataAction('/overView/materialDetailShareMaterial', {
  704. md5: data.md5,
  705. projectId: res.result,
  706. })
  707. .then((res) => {
  708. if (res.success) {
  709. resolve(res.result)
  710. }
  711. })
  712. })
  713. var materialDetailFollow = new Promise(function (resolve, reject) {
  714. that
  715. .postDataAction('/overView/materialDetailFollow', {
  716. md5: data.md5,
  717. projectId: res.result,
  718. })
  719. .then((res) => {
  720. if (res.success) {
  721. resolve(res.result)
  722. }
  723. })
  724. })
  725. Promise.all([
  726. materialDetailCost,
  727. materialDetailClick,
  728. materialDetailMaterialShow,
  729. materialDetailPlay100Rate,
  730. materialDetailLikeMaterial,
  731. materialDetailCommentMaterial,
  732. materialDetailShareMaterial,
  733. materialDetailFollow,
  734. ]).then((item) => {
  735. // dataView
  736. console.log(item)
  737. that.spinning = false
  738. that.dataView = {}
  739. for (let i = 0; i < item.length; i++) {
  740. for (const key in item[i]) {
  741. that.dataView[key] = item[i][key]
  742. }
  743. }
  744. })
  745. }
  746. })
  747. })
  748. },
  749. getMaterialInfo() {
  750. var data = JSON.parse(localStorage.getItem('videoInfo'))
  751. this.spinning = true
  752. var params = {
  753. mediaId: data.mediaId,
  754. md5: data.md5,
  755. }
  756. this.postDataAction('/overView/materialDetailInfo', params).then((res) => {
  757. if (res.success) {
  758. if (res.result) {
  759. this.materialInfo = res.result
  760. } else {
  761. // this.$error({
  762. // title: '页面数据加载出错',
  763. // content: '该视频未上传公司素材库,请重新上传之后,可展示视频信息',
  764. // })
  765. }
  766. }
  767. })
  768. if (data.mediaId == 1) {
  769. this.getToutiao()
  770. } else if (data.mediaId == 2) {
  771. this.getKuaishou()
  772. }
  773. this.postDataAction('/overView/materialDetailChat', params).then((res) => {
  774. if (res.success) {
  775. this.initEchart('echartCircular', this.handlerEchartOption(res.result))
  776. }
  777. })
  778. },
  779. handleScroll() {
  780. var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
  781. this.scrollTop = scrollTop
  782. },
  783. },
  784. mounted() {
  785. this.$nextTick(() => {
  786. this.mediaId = JSON.parse(localStorage.getItem('videoInfo')).mediaId
  787. window.addEventListener('scroll', this.handleScroll)
  788. this.clientWidth = document.documentElement.clientWidth - 224
  789. // this.$route.query.mediaId
  790. // this.$route.query.md5
  791. this.getMaterialInfo()
  792. })
  793. },
  794. created() {},
  795. }
  796. </script>