roadshowItem.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. .cover-item {
  240. margin-top: 10rpx;
  241. width: calc(100% + 28rpx);
  242. height: 250rpx;
  243. display: flex;
  244. flex-direction: column-reverse;
  245. position: relative;
  246. background-repeat: no-repeat;
  247. background-size: 100% 100%;
  248. font-size: 24rpx;
  249. color: #fff;
  250. margin-left: -14rpx;
  251. .identification {
  252. display: flex;
  253. align-items: center;
  254. justify-content: center;
  255. position: absolute;
  256. top: 0;
  257. right: 0;
  258. width: 0;
  259. height: 0;
  260. border-top: 90rpx solid $uni-color-new;
  261. border-left: 90rpx solid transparent;
  262. }
  263. .identification-img {
  264. position: absolute;
  265. top: 15rpx;
  266. right: 10rpx;
  267. width: 30rpx;
  268. height: 30rpx;
  269. }
  270. .identification-video {
  271. border-top: 90rpx solid #fa9550 !important;
  272. }
  273. .img-bg {
  274. position: absolute;
  275. top: 50%;
  276. left: 50%;
  277. transform: translate(-50%, -50%);
  278. width: 80rpx;
  279. height: 80rpx;
  280. image {
  281. width: 80rpx;
  282. height: 80rpx;
  283. }
  284. }
  285. .time {
  286. position: absolute;
  287. bottom: 8rpx;
  288. left: 15rpx;
  289. font-size: 24rpx;
  290. font-weight: 400;
  291. color: #ffffff;
  292. line-height: 46rpx;
  293. }
  294. }
  295. .container-roadshow-title {
  296. height: 180rpx;
  297. }
  298. .title {
  299. height: 88rpx;
  300. font-size: 32rpx;
  301. font-weight: 500;
  302. color: #333333;
  303. line-height: 40rpx;
  304. padding-bottom: 10rpx;
  305. border-bottom: 1rpx solid #dcdfe6;
  306. margin-bottom: 20rpx;
  307. word-wrap: break-word;
  308. word-break: break-all;
  309. }
  310. .title-share {
  311. margin-top: 5rpx;
  312. padding-top: 20rpx;
  313. image {
  314. width: 48rpx;
  315. height: 48rpx;
  316. }
  317. .share {
  318. display: flex;
  319. align-items: center;
  320. justify-content: space-between;
  321. .share-icon {
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. width: 50rpx;
  326. height: 50rpx;
  327. background-color: rgba(0, 0, 0, 0);
  328. }
  329. }
  330. .share-collected {
  331. justify-content: space-around;
  332. }
  333. }
  334. .content-item-flex {
  335. display: flex;
  336. align-items: center;
  337. justify-content: space-between;
  338. }
  339. .content-item-top {
  340. margin-bottom: 15rpx;
  341. view:nth-child(1) {
  342. width: 124rpx;
  343. height: 42rpx;
  344. font-size: 24rpx;
  345. font-weight: 500;
  346. border-radius: 38rpx;
  347. color: $uni-color-new;
  348. background-color: #e5efff;
  349. }
  350. view:nth-child(2) {
  351. width: 132rpx;
  352. height: 42rpx;
  353. border-radius: 38rpx;
  354. font-size: 24rpx;
  355. image {
  356. width: 32rpx;
  357. height: 32rpx;
  358. margin-right: 8rpx;
  359. }
  360. }
  361. .is-video-sing {
  362. color: #e37318;
  363. background-color: #fff1e9;
  364. }
  365. .is-audio-sing {
  366. color: $uni-color-new;
  367. background-color: #e5efff;
  368. }
  369. }
  370. .iten-buttom {
  371. margin-top: 10rpx;
  372. view {
  373. height: 48rpx;
  374. border-radius: 8rpx;
  375. font-size: 24rpx;
  376. font-weight: 600;
  377. }
  378. view:nth-child(1) {
  379. flex: 1;
  380. background-color: $uni-color-new;
  381. color: #fff;
  382. }
  383. view:nth-child(2) {
  384. width: 146rpx;
  385. border-radius: 8rpx;
  386. background-color: #e5efff;
  387. color: $uni-color-new;
  388. margin-left: 25rpx;
  389. }
  390. .play-img,
  391. .play-list {
  392. width: 30rpx;
  393. height: 30rpx;
  394. margin-right: 6rpx;
  395. }
  396. }
  397. .item-itme {
  398. width: 100%;
  399. display: flex;
  400. align-items: center;
  401. justify-content: space-between;
  402. margin-top: 20rpx;
  403. font-size: 24rpx;
  404. .chart-permission-name {
  405. font-weight: 500;
  406. width: 72rpx;
  407. height: 42rpx;
  408. border-radius: 38rpx;
  409. color: $uni-color-new;
  410. background-color: #e5efff;
  411. }
  412. .time {
  413. color: #999999;
  414. }
  415. }
  416. }
  417. </style>