roadshowItem.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="global_card_content container-roadshow-item">
  3. <view class="content-item-flex content-item-top">
  4. <view class="global_content_center">{{ list.LabelType == 1 ? "路演回放" : list.LabelType == 2 ? "调研反馈" : list.LabelType == 3 ? "产业视频" : "问答系列" }}</view>
  5. <view :class="['global_content_center', list.Type == 2 || list.Type == 3 ? 'is-video-sing' : 'is-audio-sing']">
  6. <image v-if="list.Type == 2 || list.Type == 3" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/video_icon.png"></image>
  7. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/audio_icon.png"></image>
  8. {{ totalSeconds(list) }}
  9. </view>
  10. </view>
  11. <view class="global_title container-roadshow-title" @click="goDetails">
  12. <mp-html :content="richTextClamp(4) + list.Title + '</div>'" />
  13. </view>
  14. <view class="content-item-flex iten-buttom">
  15. <view class="global_content_center" @click.stop="handelPlay(list)">
  16. <image
  17. v-if="(list.Type == 1 || list.Type == 4) && curVoiceId === list.SourceId && !curAudioPaused"
  18. class="play-img"
  19. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/suspend_play_list.png"
  20. ></image>
  21. <image v-else class="play-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/play-circle-filled.png"></image>
  22. {{ (list.Type == 1 || list.Type == 4) && curVoiceId === list.SourceId && !curAudioPaused ? "暂停" : "播放" }}
  23. </view>
  24. <view v-if="list.Type == 1 || list.Type == 4" class="global_content_center" @click="joinPlaylist(list)">
  25. <image class="play-list" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/paly_list.png"></image>
  26. 添加
  27. </view>
  28. </view>
  29. <view class="title-share">
  30. <view class="share share-collected">
  31. <image @click="myLeavingMessageHandler(list)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/leaving_message.png"></image>
  32. <image
  33. @click="isCollectionHandeler(list)"
  34. :src="list.IsCollect ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collected_icon.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/not_collected.png'"
  35. ></image>
  36. <button class="share-icon" open-type="share" :data-item="list">
  37. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/share-btn-icon.png"></image>
  38. </button>
  39. </view>
  40. </view>
  41. <view class="item-itme">
  42. <view class="global_content_center chart-permission-name"> {{ list.ChartPermissionName }}</view>
  43. <view class="time"> {{ list.PublishTime }}</view>
  44. </view>
  45. <videoModule :showVideoPop.sync="showVideoPop" :curVideoId="curVideoId" :videoPopList="videoPopList" />
  46. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  47. </view>
  48. </template>
  49. <script>
  50. import { Search, activity, Report, Home } from "@/config/api";
  51. import { MultimediaIcon } from "@/utils/styleClassify";
  52. import videoModule from "@/components/videoModule/index";
  53. import modalDialog from "@/components/modalDialog.vue";
  54. export default {
  55. name: "",
  56. props: {
  57. list: {
  58. type: Object,
  59. default: {},
  60. required: true,
  61. },
  62. },
  63. data() {
  64. return {
  65. curVideoId: 0, //音频Id
  66. showVideoPop: false,
  67. showAudioPop: false, //播放音频
  68. videoPopList: {},
  69. isShowhasPermission: false, // 联系销售的提交申请
  70. applyForIsShow: false, // 提交申请
  71. jurisdictionList: {},
  72. hasPermission: "", //权限
  73. };
  74. },
  75. components: {
  76. videoModule,
  77. modalDialog,
  78. },
  79. computed: {
  80. curVoiceId() {
  81. //当前正在播放的音频id
  82. return this.$store.state.audioBg.indexId;
  83. },
  84. curAudioPaused() {
  85. //当前音频是否暂停状态
  86. return this.$store.state.audioBg.paused;
  87. },
  88. },
  89. watch: {},
  90. created() {},
  91. mounted() {},
  92. methods: {
  93. //播放的权限判断
  94. async handelPlay(item) {
  95. await this.$store.dispatch("showLoginModal");
  96. let content_item = null;
  97. if (item.SourceId) {
  98. content_item = {
  99. SourceId: item.SourceId || item.ActivityId,
  100. PlaySeconds: item.PlaySeconds,
  101. ResourceUrl: item.ResourceUrl,
  102. Title: item.Title,
  103. Type: item.Type,
  104. };
  105. }
  106. if (item.AuthInfo.HasPermission == 1) {
  107. item.Type == 1 || item.AudioType == 1 || item.Type == 4 ? this.audioPlayBack(content_item ? content_item : item) : this.handelVideoPlay(item);
  108. } else {
  109. this.hasPermission = item.AuthInfo.HasPermission;
  110. this.jurisdictionList.ActivityId = item.Id;
  111. this.jurisdictionList.isAudioVideo = item.Type;
  112. if (this.hasPermission == 2) {
  113. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  114. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  115. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  116. this.isShowhasPermission = true;
  117. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  118. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  119. this.applyForIsShow = true;
  120. }
  121. }
  122. },
  123. //视频的播放事件
  124. handelVideoPlay(item) {
  125. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  126. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  127. this.$store.commit("videoPlay/playVideo", item.Id);
  128. }
  129. this.globalBgAudioManager.stop();
  130. this.videoPopList = item;
  131. this.showVideoPop = true;
  132. },
  133. //音频的播放事件
  134. async audioPlayBack(item) {
  135. this.curVideoId = 0;
  136. this.$store.commit("audioBg/parseIntAudio", true);
  137. // 判断是否为同一个音频
  138. if (this.$store.state.audioBg.indexId == item.SourceId) {
  139. if (this.globalBgAudioManager.paused) {
  140. this.globalBgAudioManager.play();
  141. } else {
  142. this.globalBgAudioManager.pause();
  143. }
  144. } else {
  145. let VoiceList = {
  146. Url: item.ResourceUrl,
  147. Name: item.Title,
  148. PlaySeconds: +item.PlaySeconds,
  149. };
  150. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.SourceId || item.ActivityId, activityTitle: item.Title, recordList: item });
  151. }
  152. this.$parent.showAudioPop = true;
  153. },
  154. //音视频的图标
  155. classifyIcon(item) {
  156. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  157. let imgSrc = item.Type == 1 || item.AudioType == 1 || item.Type == 4 ? srcItem.audio : srcItem.video;
  158. return imgSrc;
  159. },
  160. // 微路演留言
  161. async myLeavingMessageHandler(item) {
  162. await this.$store.dispatch("showLoginModal");
  163. uni.navigateTo({
  164. url: "/activityPages/generationAsk/generationAsk?id=" + item.SourceId + "&type=文章&roadshow=" + item.Type + "&roadshowTitle=" + item.Title,
  165. });
  166. },
  167. // 微路演收藏
  168. async isCollectionHandeler(item) {
  169. this.$emit("isCollectionHandeler", item);
  170. },
  171. // 跳转
  172. goDetails() {
  173. if (this.list.Type == 4) return;
  174. if (this.list.Type == 3) {
  175. // 跳转产业资源包
  176. uni.navigateTo({ url: "/reportPages/IndustryReport/IndustryReport?id=" + this.list.IndustryId });
  177. } else {
  178. uni.navigateTo({ url: "/activityPages/activityDetail/activityDetail?id=" + this.list.ActivityId });
  179. }
  180. },
  181. richTextClamp(val) {
  182. return `<div style="${
  183. val == 7 ? "min-height: 50px;" : ""
  184. }line-clamp: ${val};-webkit-line-clamp: ${val};text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;word-wrap: break-word;word-break: break-all;">`;
  185. },
  186. // 加入播放列表
  187. async joinPlaylist(item) {
  188. if (item.AuthInfo.HasPermission == 1) {
  189. let dataList = {
  190. Url: item.ResourceUrl,
  191. Name: item.Title,
  192. PlaySeconds: +item.PlaySeconds,
  193. indexId: item.SourceId || item.ActivityId,
  194. activityTitle: item.Title,
  195. recordList: item,
  196. };
  197. const playlist = this.$store.state.audioJoinPlaylist.playlist.some((key) => key.indexId === dataList.indexId);
  198. if (!playlist) {
  199. this.$store.commit("audioJoinPlaylist/addPlaylist", { dataList });
  200. }
  201. uni.showToast({
  202. title: "已加入播放列表",
  203. icon: "success",
  204. duration: 500,
  205. });
  206. } else {
  207. this.hasPermission = item.AuthInfo.HasPermission;
  208. this.jurisdictionList.ActivityId = item.Id;
  209. this.jurisdictionList.isAudioVideo = item.Type;
  210. if (this.hasPermission == 2) {
  211. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  212. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  213. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  214. this.isShowhasPermission = true;
  215. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  216. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  217. this.applyForIsShow = true;
  218. }
  219. }
  220. },
  221. // 播放时长的转换
  222. totalSeconds(item) {
  223. let minutes = Math.floor(item.PlaySeconds / 60);
  224. let seconds = item.PlaySeconds % 60;
  225. let time = minutes.toString().padStart(2, "0") + ":" + seconds.toString().padStart(2, "0");
  226. return time;
  227. },
  228. },
  229. };
  230. </script>
  231. <style scoped lang="scss">
  232. .container-roadshow-item {
  233. width: 100%;
  234. background: #ffffff;
  235. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  236. overflow: hidden;
  237. padding-top: 25rpx;
  238. margin-bottom: 20rpx;
  239. min-height: 220rpx;
  240. .cover-item {
  241. margin-top: 10rpx;
  242. width: calc(100% + 28rpx);
  243. height: 250rpx;
  244. display: flex;
  245. flex-direction: column-reverse;
  246. position: relative;
  247. background-repeat: no-repeat;
  248. background-size: 100% 100%;
  249. font-size: 24rpx;
  250. color: #fff;
  251. margin-left: -14rpx;
  252. .identification {
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. position: absolute;
  257. top: 0;
  258. right: 0;
  259. width: 0;
  260. height: 0;
  261. border-top: 90rpx solid $uni-color-new;
  262. border-left: 90rpx solid transparent;
  263. }
  264. .identification-img {
  265. position: absolute;
  266. top: 15rpx;
  267. right: 10rpx;
  268. width: 30rpx;
  269. height: 30rpx;
  270. }
  271. .identification-video {
  272. border-top: 90rpx solid #fa9550 !important;
  273. }
  274. .img-bg {
  275. position: absolute;
  276. top: 50%;
  277. left: 50%;
  278. transform: translate(-50%, -50%);
  279. width: 80rpx;
  280. height: 80rpx;
  281. image {
  282. width: 80rpx;
  283. height: 80rpx;
  284. }
  285. }
  286. .time {
  287. position: absolute;
  288. bottom: 8rpx;
  289. left: 15rpx;
  290. font-size: 24rpx;
  291. font-weight: 400;
  292. color: #ffffff;
  293. line-height: 46rpx;
  294. }
  295. }
  296. .container-roadshow-title {
  297. height: 180rpx;
  298. }
  299. .title {
  300. height: 88rpx;
  301. font-size: 32rpx;
  302. font-weight: 500;
  303. color: #333333;
  304. line-height: 40rpx;
  305. padding-bottom: 10rpx;
  306. border-bottom: 1rpx solid #dcdfe6;
  307. margin-bottom: 20rpx;
  308. word-wrap: break-word;
  309. word-break: break-all;
  310. }
  311. .title-share {
  312. margin-top: 5rpx;
  313. padding-top: 20rpx;
  314. image {
  315. width: 48rpx;
  316. height: 48rpx;
  317. }
  318. .share {
  319. display: flex;
  320. align-items: center;
  321. justify-content: space-between;
  322. .share-icon {
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. width: 50rpx;
  327. height: 50rpx;
  328. background-color: rgba(0, 0, 0, 0);
  329. }
  330. }
  331. .share-collected {
  332. justify-content: space-around;
  333. }
  334. }
  335. .content-item-flex {
  336. display: flex;
  337. align-items: center;
  338. justify-content: space-between;
  339. }
  340. .content-item-top {
  341. margin-bottom: 15rpx;
  342. view:nth-child(1) {
  343. width: 124rpx;
  344. height: 42rpx;
  345. font-size: 24rpx;
  346. font-weight: 500;
  347. border-radius: 38rpx;
  348. color: $uni-color-new;
  349. background-color: #e5efff;
  350. }
  351. view:nth-child(2) {
  352. width: 132rpx;
  353. height: 42rpx;
  354. border-radius: 38rpx;
  355. font-size: 24rpx;
  356. image {
  357. width: 32rpx;
  358. height: 32rpx;
  359. margin-right: 8rpx;
  360. }
  361. }
  362. .is-video-sing {
  363. color: #e37318;
  364. background-color: #fff1e9;
  365. }
  366. .is-audio-sing {
  367. color: $uni-color-new;
  368. background-color: #e5efff;
  369. }
  370. }
  371. .iten-buttom {
  372. margin-top: 10rpx;
  373. view {
  374. height: 48rpx;
  375. border-radius: 8rpx;
  376. font-size: 24rpx;
  377. font-weight: 600;
  378. }
  379. view:nth-child(1) {
  380. flex: 1;
  381. background-color: $uni-color-new;
  382. color: #fff;
  383. }
  384. view:nth-child(2) {
  385. width: 146rpx;
  386. border-radius: 8rpx;
  387. background-color: #e5efff;
  388. color: $uni-color-new;
  389. margin-left: 25rpx;
  390. }
  391. .play-img,
  392. .play-list {
  393. width: 30rpx;
  394. height: 30rpx;
  395. margin-right: 6rpx;
  396. }
  397. }
  398. .item-itme {
  399. width: 100%;
  400. display: flex;
  401. align-items: center;
  402. justify-content: space-between;
  403. margin-top: 20rpx;
  404. font-size: 24rpx;
  405. .chart-permission-name {
  406. font-weight: 500;
  407. width: 72rpx;
  408. height: 42rpx;
  409. border-radius: 38rpx;
  410. color: $uni-color-new;
  411. background-color: #e5efff;
  412. }
  413. .time {
  414. color: #999999;
  415. }
  416. }
  417. }
  418. </style>