roadshow.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view :class="['roadshow-search', tabsRoadshowSearch == 5 && 'roadshow-search-top']">
  3. <view class="audio-video-content">
  4. <view class="audio-item" v-for="item in roadshowPageList" :key="item.Id">
  5. <view class="cover-item" :style="{ 'background-image': 'url(' + item.BackgroundImg + ')' }">
  6. <!-- type:3 -- 产业视频 -->
  7. <block v-if="item.Type == 2 || item.Type == 3">
  8. <image class="img-bg" @click="handelPlay(item)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon_index.png"></image>
  9. </block>
  10. <block v-else>
  11. <image
  12. class="img-bg"
  13. @click.stop="handelPlay(item)"
  14. :src="
  15. curVoiceId === item.ActivityId && !curAudioPaused
  16. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop_index.png'
  17. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group_index.png'
  18. "
  19. ></image>
  20. </block>
  21. <text class="time">{{ item.PublishTime }}</text>
  22. <view :class="['identification', item.Type != 1 && 'identification-video']"> </view>
  23. <image
  24. class="identification-img"
  25. :src="item.Type == 1 ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/video-iocn.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/audio-icon.png'"
  26. ></image>
  27. </view>
  28. <view class="title-share">
  29. <view class="title text_twoLine">{{ item.Title }}</view>
  30. <view class="share share-collected">
  31. <image @click="myLeavingMessageHandler(item)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/leaving_message.png"></image>
  32. <image
  33. @click="isCollectionHandeler(item)"
  34. :src="
  35. item.IsCollect ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/collected_icon.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/not_collected.png'
  36. "
  37. ></image>
  38. <button class="share-icon" open-type="share" :data-item="item">
  39. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/share-btn-icon.png"></image>
  40. </button>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { Search, activity, Report, Home } from "@/config/api";
  49. import { color_word_bg, MultimediaIcon } from "@/utils/styleClassify";
  50. export default {
  51. props: {
  52. roadshowPageList: {
  53. type: Array,
  54. default: [],
  55. required: true,
  56. },
  57. tabsRoadshowSearch: {
  58. type: Number,
  59. required: true,
  60. },
  61. },
  62. data() {
  63. return {};
  64. },
  65. methods: {
  66. //播放的权限判断
  67. handelPlay(item) {
  68. let content_item = null;
  69. if (item.AudioActivityId) {
  70. content_item = {
  71. ActivityId: item.AudioActivityId,
  72. PlaySeconds: item.AudioPlaySeconds,
  73. ResourceUrl: item.AudioResourceUrl,
  74. Title: item.AudioTitle,
  75. Type: item.AudioType,
  76. };
  77. }
  78. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  79. if (item.AuthInfo.HasPermission == 1) {
  80. item.Type == 1 || item.AudioType == 1 ? this.audioPlayBack(content_item ? content_item : item) : this.handelVideoPlay(item);
  81. } else {
  82. this.hasPermission = item.AuthInfo.HasPermission;
  83. this.jurisdictionList.ActivityId = item.Id;
  84. this.jurisdictionList.isAudioVideo = item.Type;
  85. if (this.hasPermission == 2) {
  86. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  87. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  88. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  89. this.isShowhasPermission = true;
  90. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  91. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  92. this.applyForIsShow = true;
  93. }
  94. }
  95. } else {
  96. this.$store.dispatch("checkHandle");
  97. }
  98. },
  99. //视频的播放事件
  100. handelVideoPlay(item) {
  101. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  102. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  103. console.log(this.$store.state.videoPlay.palyCurrentTime);
  104. this.$store.commit("videoPlay/playVideo", item.Id);
  105. }
  106. this.globalBgAudioManager.stop();
  107. this.videoPopList = item;
  108. this.showVideoPop = true;
  109. },
  110. //音频的播放事件
  111. async audioPlayBack(item) {
  112. this.curVideoId = 0;
  113. this.$store.commit("audioBg/parseIntAudio", true);
  114. // 判断是否为同一个音频
  115. if (this.$store.state.audioBg.indexId == item.ActivityId) {
  116. if (this.globalBgAudioManager.paused) {
  117. this.globalBgAudioManager.play();
  118. } else {
  119. this.globalBgAudioManager.pause();
  120. }
  121. } else {
  122. let VoiceList = {
  123. Url: item.ResourceUrl,
  124. Name: item.Title,
  125. PlaySeconds: item.PlaySeconds,
  126. };
  127. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.ActivityId, activityTitle: item.Title });
  128. }
  129. this.showAudioPop = true;
  130. },
  131. //音视频的背景色 文字颜色
  132. classifyColor(item) {
  133. let text_color = color_word_bg.color_word.find((key) => key.name == item).color;
  134. let back_ground = color_word_bg.color_bg.find((key) => key.name == item).color;
  135. let _isColor = { color: text_color, "background-color": back_ground };
  136. return _isColor;
  137. },
  138. //音视频的图标
  139. classifyIcon(item) {
  140. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  141. let imgSrc = item.Type == 1 || item.AudioType == 1 ? srcItem.audio : srcItem.video;
  142. return imgSrc;
  143. },
  144. // 微路演留言
  145. myLeavingMessageHandler(item) {
  146. uni.navigateTo({
  147. url: "/activityPages/generationAsk/generationAsk?id=" + (item.Type == 3 ? item.Id : item.ActivityId) + "&type=文章&roadshow=" + item.Type + "&roadshowTitle=" + item.Title,
  148. });
  149. },
  150. // 微路演收藏
  151. async isCollectionHandeler(item) {
  152. const res = await Home.microRoadshowCollect({
  153. Id: item.Id,
  154. SourceType: item.Type,
  155. });
  156. if (res.Ret === 200) {
  157. let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
  158. res.Data.Status == 1 ? (this.$parent.roadshowPageList[index].IsCollect = true) : (this.$parent.roadshowPageList[index].IsCollect = false);
  159. uni.showToast({
  160. title: res.Msg,
  161. duration: 2000,
  162. });
  163. }
  164. },
  165. },
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. .roadshow-search {
  170. padding: 35rpx;
  171. .audio-video-content {
  172. width: calc(100% + 40rpx);
  173. height: calc(100% + 25rpx);
  174. margin: -20rpx 0 0 -20rpx;
  175. padding: 0 !important;
  176. .audio-item {
  177. width: 100%;
  178. height: auto;
  179. box-shadow: none;
  180. }
  181. }
  182. @import "@/components/audioVideo.scss";
  183. }
  184. .roadshow-search-top {
  185. padding-top: 90rpx !important;
  186. }
  187. </style>