roadshowItem.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="global_card_content container-roadshow-item">
  3. <view class="global_title" @click="goDetails">
  4. <mp-html :content="richTextClamp(2) + list.Title + '</div>'" />
  5. </view>
  6. <view @click="joinPlaylist(list)">加入播放列表</view>
  7. <view class="cover-item" :style="{ 'background-image': 'url(' + list.BackgroundImg + ')' }">
  8. <block v-if="list.Type == 2 || list.Type == 3">
  9. <image class="img-bg" @click="handelPlay(list)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon_index.png"></image>
  10. </block>
  11. <block v-else>
  12. <image
  13. class="img-bg"
  14. @click.stop="handelPlay(list)"
  15. :src="
  16. curVoiceId === list.ActivityId && !curAudioPaused
  17. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop_index.png'
  18. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group_index.png'
  19. "
  20. ></image>
  21. </block>
  22. <text class="time">{{ list.PublishTime }}</text>
  23. <view :class="['identification', list.Type != 1 && list.Type != 4 && 'identification-video']"> </view>
  24. <image
  25. class="identification-img"
  26. :src="
  27. list.Type == 1 || list.Type == 4
  28. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/video-iocn.png'
  29. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/audio-icon.png'
  30. "
  31. ></image>
  32. </view>
  33. <view class="title-share">
  34. <view class="share share-collected">
  35. <image @click="myLeavingMessageHandler(list)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/leaving_message.png"></image>
  36. <image
  37. @click="isCollectionHandeler(list)"
  38. :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'"
  39. ></image>
  40. <button class="share-icon" open-type="share" :data-item="list">
  41. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/share-btn-icon.png"></image>
  42. </button>
  43. </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. }
  200. },
  201. },
  202. };
  203. </script>
  204. <style scoped lang="scss">
  205. .container-roadshow-item {
  206. width: 100%;
  207. background: #ffffff;
  208. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  209. overflow: hidden;
  210. padding-top: 25rpx;
  211. margin-bottom: 20rpx;
  212. .cover-item {
  213. margin-top: 10rpx;
  214. width: calc(100% + 28rpx);
  215. height: 250rpx;
  216. display: flex;
  217. flex-direction: column-reverse;
  218. position: relative;
  219. background-repeat: no-repeat;
  220. background-size: 100% 100%;
  221. font-size: 24rpx;
  222. color: #fff;
  223. margin-left: -14rpx;
  224. .identification {
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. position: absolute;
  229. top: 0;
  230. right: 0;
  231. width: 0;
  232. height: 0;
  233. border-top: 90rpx solid $uni-color-new;
  234. border-left: 90rpx solid transparent;
  235. }
  236. .identification-img {
  237. position: absolute;
  238. top: 15rpx;
  239. right: 10rpx;
  240. width: 30rpx;
  241. height: 30rpx;
  242. }
  243. .identification-video {
  244. border-top: 90rpx solid #fa9550 !important;
  245. }
  246. .img-bg {
  247. position: absolute;
  248. top: 50%;
  249. left: 50%;
  250. transform: translate(-50%, -50%);
  251. width: 80rpx;
  252. height: 80rpx;
  253. image {
  254. width: 80rpx;
  255. height: 80rpx;
  256. }
  257. }
  258. .time {
  259. position: absolute;
  260. bottom: 8rpx;
  261. left: 15rpx;
  262. font-size: 24rpx;
  263. font-weight: 400;
  264. color: #ffffff;
  265. line-height: 46rpx;
  266. }
  267. }
  268. .title {
  269. height: 88rpx;
  270. font-size: 32rpx;
  271. font-weight: 500;
  272. color: #333333;
  273. line-height: 40rpx;
  274. padding-bottom: 10rpx;
  275. border-bottom: 1rpx solid #dcdfe6;
  276. margin-bottom: 20rpx;
  277. word-wrap: break-word;
  278. word-break: break-all;
  279. }
  280. .title-share {
  281. margin-top: 20rpx;
  282. padding-top: 20rpx;
  283. image {
  284. width: 48rpx;
  285. height: 48rpx;
  286. }
  287. .share {
  288. display: flex;
  289. align-items: center;
  290. justify-content: space-between;
  291. .share-icon {
  292. display: flex;
  293. align-items: center;
  294. justify-content: center;
  295. width: 50rpx;
  296. height: 50rpx;
  297. background-color: rgba(0, 0, 0, 0);
  298. }
  299. }
  300. .share-collected {
  301. justify-content: space-around;
  302. }
  303. }
  304. }
  305. </style>