roadshowItem.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. },
  93. methods: {
  94. //播放的权限判断
  95. async handelPlay(item) {
  96. await this.$store.dispatch("showLoginModal");
  97. let content_item = null;
  98. if (item.SourceId) {
  99. content_item = {
  100. ActivityId: item.SourceId,
  101. PlaySeconds: item.PlaySeconds,
  102. ResourceUrl: item.ResourceUrl,
  103. Title: item.Title,
  104. Type: item.Type,
  105. };
  106. }
  107. if (item.AuthInfo.HasPermission == 1) {
  108. item.Type == 1 || item.AudioType == 1 || item.Type == 4 ? this.audioPlayBack(content_item ? content_item : item) : this.handelVideoPlay(item);
  109. } else {
  110. this.hasPermission = item.AuthInfo.HasPermission;
  111. this.jurisdictionList.ActivityId = item.Id;
  112. this.jurisdictionList.isAudioVideo = item.Type;
  113. if (this.hasPermission == 2) {
  114. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  115. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  116. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  117. this.isShowhasPermission = true;
  118. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  119. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  120. this.applyForIsShow = true;
  121. }
  122. }
  123. },
  124. //视频的播放事件
  125. handelVideoPlay(item) {
  126. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  127. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  128. this.$store.commit("videoPlay/playVideo", item.Id);
  129. }
  130. this.globalBgAudioManager.stop();
  131. this.videoPopList = item;
  132. this.showVideoPop = true;
  133. },
  134. //音频的播放事件
  135. async audioPlayBack(item) {
  136. this.curVideoId = 0;
  137. this.$store.commit("audioBg/parseIntAudio", true);
  138. // 判断是否为同一个音频
  139. if (this.$store.state.audioBg.indexId == item.ActivityId) {
  140. if (this.globalBgAudioManager.paused) {
  141. this.globalBgAudioManager.play();
  142. } else {
  143. this.globalBgAudioManager.pause();
  144. }
  145. } else {
  146. let VoiceList = {
  147. Url: item.ResourceUrl,
  148. Name: item.Title,
  149. PlaySeconds: +item.PlaySeconds,
  150. };
  151. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.ActivityId, activityTitle: item.Title, recordList: item });
  152. }
  153. this.$parent.showAudioPop = true;
  154. },
  155. //音视频的图标
  156. classifyIcon(item) {
  157. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  158. let imgSrc = item.Type == 1 || item.AudioType == 1 || item.Type == 4 ? srcItem.audio : srcItem.video;
  159. return imgSrc;
  160. },
  161. // 微路演留言
  162. async myLeavingMessageHandler(item) {
  163. await this.$store.dispatch("showLoginModal");
  164. uni.navigateTo({
  165. url: "/activityPages/generationAsk/generationAsk?id=" + item.SourceId + "&type=文章&roadshow=" + item.Type + "&roadshowTitle=" + item.Title,
  166. });
  167. },
  168. // 微路演收藏
  169. async isCollectionHandeler(item) {
  170. this.$emit("isCollectionHandeler", item);
  171. },
  172. // 跳转
  173. goDetails() {
  174. if (this.list.Type == 4) return;
  175. if (this.list.Type == 3) {
  176. // 跳转产业资源包
  177. uni.navigateTo({ url: "/reportPages/IndustryReport/IndustryReport?id=" + this.list.IndustryId });
  178. } else {
  179. uni.navigateTo({ url: "/activityPages/activityDetail/activityDetail?id=" + this.list.ActivityId });
  180. }
  181. },
  182. richTextClamp(val) {
  183. return `<div style="${
  184. val == 7 ? "min-height: 50px;" : ""
  185. }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;">`;
  186. },
  187. // 加入播放列表
  188. joinPlaylist(item) {
  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. },
  202. },
  203. };
  204. </script>
  205. <style scoped lang="scss">
  206. .container-roadshow-item {
  207. width: 100%;
  208. background: #ffffff;
  209. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  210. overflow: hidden;
  211. padding-top: 25rpx;
  212. margin-bottom: 20rpx;
  213. .cover-item {
  214. margin-top: 10rpx;
  215. width: calc(100% + 28rpx);
  216. height: 250rpx;
  217. display: flex;
  218. flex-direction: column-reverse;
  219. position: relative;
  220. background-repeat: no-repeat;
  221. background-size: 100% 100%;
  222. font-size: 24rpx;
  223. color: #fff;
  224. margin-left: -14rpx;
  225. .identification {
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. position: absolute;
  230. top: 0;
  231. right: 0;
  232. width: 0;
  233. height: 0;
  234. border-top: 90rpx solid $uni-color-new;
  235. border-left: 90rpx solid transparent;
  236. }
  237. .identification-img {
  238. position: absolute;
  239. top: 15rpx;
  240. right: 10rpx;
  241. width: 30rpx;
  242. height: 30rpx;
  243. }
  244. .identification-video {
  245. border-top: 90rpx solid #fa9550 !important;
  246. }
  247. .img-bg {
  248. position: absolute;
  249. top: 50%;
  250. left: 50%;
  251. transform: translate(-50%, -50%);
  252. width: 80rpx;
  253. height: 80rpx;
  254. image {
  255. width: 80rpx;
  256. height: 80rpx;
  257. }
  258. }
  259. .time {
  260. position: absolute;
  261. bottom: 8rpx;
  262. left: 15rpx;
  263. font-size: 24rpx;
  264. font-weight: 400;
  265. color: #ffffff;
  266. line-height: 46rpx;
  267. }
  268. }
  269. .title {
  270. height: 88rpx;
  271. font-size: 32rpx;
  272. font-weight: 500;
  273. color: #333333;
  274. line-height: 40rpx;
  275. padding-bottom: 10rpx;
  276. border-bottom: 1rpx solid #dcdfe6;
  277. margin-bottom: 20rpx;
  278. word-wrap: break-word;
  279. word-break: break-all;
  280. }
  281. .title-share {
  282. margin-top: 20rpx;
  283. padding-top: 20rpx;
  284. image {
  285. width: 48rpx;
  286. height: 48rpx;
  287. }
  288. .share {
  289. display: flex;
  290. align-items: center;
  291. justify-content: space-between;
  292. .share-icon {
  293. display: flex;
  294. align-items: center;
  295. justify-content: center;
  296. width: 50rpx;
  297. height: 50rpx;
  298. background-color: rgba(0, 0, 0, 0);
  299. }
  300. }
  301. .share-collected {
  302. justify-content: space-around;
  303. }
  304. }
  305. }
  306. </style>