roadshowItem.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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="(ist.Type == 1 || list.Type == 4) && curVoiceId === list.Id && !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.Id && !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. ActivityId: item.SourceId,
  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.ActivityId) {
  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.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. joinPlaylist(item) {
  188. let dataList = {
  189. Url: item.ResourceUrl,
  190. Name: item.Title,
  191. PlaySeconds: +item.PlaySeconds,
  192. indexId: item.SourceId || item.ActivityId,
  193. activityTitle: item.Title,
  194. recordList: item,
  195. };
  196. const playlist = this.$store.state.audioJoinPlaylist.playlist.some((key) => key.indexId === dataList.indexId);
  197. if (!playlist) {
  198. this.$store.commit("audioJoinPlaylist/addPlaylist", { dataList });
  199. uni.showToast({
  200. title: "已加入播放列表",
  201. icon: "success",
  202. duration: 2000,
  203. });
  204. }
  205. },
  206. // 播放时长的转换
  207. totalSeconds(item) {
  208. let minutes = Math.floor(item.PlaySeconds / 60);
  209. let seconds = item.PlaySeconds % 60;
  210. let time = minutes.toString().padStart(2, "0") + ":" + seconds.toString().padStart(2, "0");
  211. return time;
  212. },
  213. },
  214. };
  215. </script>
  216. <style scoped lang="scss">
  217. .container-roadshow-item {
  218. width: 100%;
  219. background: #ffffff;
  220. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  221. overflow: hidden;
  222. padding-top: 25rpx;
  223. margin-bottom: 20rpx;
  224. .cover-item {
  225. margin-top: 10rpx;
  226. width: calc(100% + 28rpx);
  227. height: 250rpx;
  228. display: flex;
  229. flex-direction: column-reverse;
  230. position: relative;
  231. background-repeat: no-repeat;
  232. background-size: 100% 100%;
  233. font-size: 24rpx;
  234. color: #fff;
  235. margin-left: -14rpx;
  236. .identification {
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. position: absolute;
  241. top: 0;
  242. right: 0;
  243. width: 0;
  244. height: 0;
  245. border-top: 90rpx solid $uni-color-new;
  246. border-left: 90rpx solid transparent;
  247. }
  248. .identification-img {
  249. position: absolute;
  250. top: 15rpx;
  251. right: 10rpx;
  252. width: 30rpx;
  253. height: 30rpx;
  254. }
  255. .identification-video {
  256. border-top: 90rpx solid #fa9550 !important;
  257. }
  258. .img-bg {
  259. position: absolute;
  260. top: 50%;
  261. left: 50%;
  262. transform: translate(-50%, -50%);
  263. width: 80rpx;
  264. height: 80rpx;
  265. image {
  266. width: 80rpx;
  267. height: 80rpx;
  268. }
  269. }
  270. .time {
  271. position: absolute;
  272. bottom: 8rpx;
  273. left: 15rpx;
  274. font-size: 24rpx;
  275. font-weight: 400;
  276. color: #ffffff;
  277. line-height: 46rpx;
  278. }
  279. }
  280. .container-roadshow-title {
  281. height: 180rpx;
  282. }
  283. .title {
  284. height: 88rpx;
  285. font-size: 32rpx;
  286. font-weight: 500;
  287. color: #333333;
  288. line-height: 40rpx;
  289. padding-bottom: 10rpx;
  290. border-bottom: 1rpx solid #dcdfe6;
  291. margin-bottom: 20rpx;
  292. word-wrap: break-word;
  293. word-break: break-all;
  294. }
  295. .title-share {
  296. margin-top: 5rpx;
  297. padding-top: 20rpx;
  298. image {
  299. width: 48rpx;
  300. height: 48rpx;
  301. }
  302. .share {
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. .share-icon {
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. width: 50rpx;
  311. height: 50rpx;
  312. background-color: rgba(0, 0, 0, 0);
  313. }
  314. }
  315. .share-collected {
  316. justify-content: space-around;
  317. }
  318. }
  319. .content-item-flex {
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. }
  324. .content-item-top {
  325. margin-bottom: 15rpx;
  326. view:nth-child(1) {
  327. width: 124rpx;
  328. height: 42rpx;
  329. font-size: 24rpx;
  330. font-weight: 500;
  331. border-radius: 38rpx;
  332. color: $uni-color-new;
  333. background-color: #e5efff;
  334. }
  335. view:nth-child(2) {
  336. width: 132rpx;
  337. height: 42rpx;
  338. border-radius: 38rpx;
  339. font-size: 24rpx;
  340. image {
  341. width: 32rpx;
  342. height: 32rpx;
  343. margin-right: 8rpx;
  344. }
  345. }
  346. .is-video-sing {
  347. color: #e37318;
  348. background-color: #fff1e9;
  349. }
  350. .is-audio-sing {
  351. color: $uni-color-new;
  352. background-color: #e5efff;
  353. }
  354. }
  355. .iten-buttom {
  356. margin-top: 10rpx;
  357. view {
  358. height: 48rpx;
  359. border-radius: 8rpx;
  360. font-size: 24rpx;
  361. font-weight: 600;
  362. }
  363. view:nth-child(1) {
  364. flex: 1;
  365. background-color: $uni-color-new;
  366. color: #fff;
  367. }
  368. view:nth-child(2) {
  369. width: 146rpx;
  370. border-radius: 8rpx;
  371. background-color: #e5efff;
  372. color: $uni-color-new;
  373. margin-left: 25rpx;
  374. }
  375. .play-img,
  376. .play-list {
  377. width: 30rpx;
  378. height: 30rpx;
  379. margin-right: 6rpx;
  380. }
  381. }
  382. .item-itme {
  383. width: 100%;
  384. display: flex;
  385. align-items: center;
  386. justify-content: space-between;
  387. margin-top: 20rpx;
  388. font-size: 24rpx;
  389. .chart-permission-name {
  390. font-weight: 500;
  391. width: 72rpx;
  392. height: 42rpx;
  393. border-radius: 38rpx;
  394. color: $uni-color-new;
  395. background-color: #e5efff;
  396. }
  397. .time {
  398. color: #999999;
  399. }
  400. }
  401. }
  402. </style>