roadshowItem.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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 class="cover-item" :style="{ 'background-image': 'url(' + list.BackgroundImg + ')' }">
  7. <block v-if="list.Type == 2 || list.Type == 3">
  8. <image class="img-bg" @click="handelPlay(list)" 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(list)"
  14. :src="
  15. curVoiceId === list.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">{{ list.PublishTime }}</text>
  22. <view :class="['identification', list.Type != 1 && 'identification-video']"> </view>
  23. <image
  24. class="identification-img"
  25. :src="list.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="share share-collected">
  30. <image @click="myLeavingMessageHandler(list)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/leaving_message.png"></image>
  31. <image
  32. @click="isCollectionHandeler(list)"
  33. :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'"
  34. ></image>
  35. <button class="share-icon" open-type="share" :data-item="list">
  36. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/share-btn-icon.png"></image>
  37. </button>
  38. </view>
  39. </view>
  40. <videoModule :showVideoPop.sync="showVideoPop" :curVideoId="curVideoId" :videoPopList="videoPopList" />
  41. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  42. </view>
  43. </template>
  44. <script>
  45. import { Search, activity, Report, Home } from "@/config/api";
  46. import { MultimediaIcon } from "@/utils/styleClassify";
  47. import videoModule from "@/components/videoModule/index";
  48. import modalDialog from "@/components/modalDialog.vue";
  49. export default {
  50. name: "",
  51. props: {
  52. list: {
  53. type: Object,
  54. default: {},
  55. required: true,
  56. },
  57. },
  58. data() {
  59. return {
  60. curVideoId: 0, //音频Id
  61. showVideoPop: false,
  62. showAudioPop: false, //播放音频
  63. videoPopList: {},
  64. isShowhasPermission: false, // 联系销售的提交申请
  65. applyForIsShow: false, // 提交申请
  66. jurisdictionList: {},
  67. hasPermission: "", //权限
  68. };
  69. },
  70. components: {
  71. videoModule,
  72. modalDialog,
  73. },
  74. computed: {
  75. curVoiceId() {
  76. //当前正在播放的音频id
  77. return this.$store.state.audioBg.indexId;
  78. },
  79. curAudioPaused() {
  80. //当前音频是否暂停状态
  81. return this.$store.state.audioBg.paused;
  82. },
  83. },
  84. watch: {},
  85. created() {},
  86. mounted() {},
  87. methods: {
  88. //播放的权限判断
  89. async handelPlay(item) {
  90. await this.$store.dispatch("showLoginModal");
  91. let content_item = null;
  92. if (item.AudioActivityId) {
  93. content_item = {
  94. ActivityId: item.AudioActivityId,
  95. PlaySeconds: +item.AudioPlaySeconds,
  96. ResourceUrl: item.AudioResourceUrl,
  97. Title: item.AudioTitle,
  98. Type: item.AudioType,
  99. };
  100. }
  101. if (item.AuthInfo.HasPermission == 1) {
  102. item.Type == 1 || item.AudioType == 1 ? this.audioPlayBack(content_item ? content_item : item) : this.handelVideoPlay(item);
  103. } else {
  104. this.hasPermission = item.AuthInfo.HasPermission;
  105. this.jurisdictionList.ActivityId = item.Id;
  106. this.jurisdictionList.isAudioVideo = item.Type;
  107. if (this.hasPermission == 2) {
  108. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  109. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  110. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  111. this.isShowhasPermission = true;
  112. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  113. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  114. this.applyForIsShow = true;
  115. }
  116. }
  117. },
  118. //视频的播放事件
  119. handelVideoPlay(item) {
  120. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  121. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  122. this.$store.commit("videoPlay/playVideo", item.Id);
  123. }
  124. this.globalBgAudioManager.stop();
  125. this.videoPopList = item;
  126. this.showVideoPop = true;
  127. },
  128. //音频的播放事件
  129. async audioPlayBack(item) {
  130. this.curVideoId = 0;
  131. this.$store.commit("audioBg/parseIntAudio", true);
  132. // 判断是否为同一个音频
  133. if (this.$store.state.audioBg.indexId == item.ActivityId) {
  134. if (this.globalBgAudioManager.paused) {
  135. this.globalBgAudioManager.play();
  136. } else {
  137. this.globalBgAudioManager.pause();
  138. }
  139. } else {
  140. let VoiceList = {
  141. Url: item.ResourceUrl,
  142. Name: item.Title,
  143. PlaySeconds: +item.PlaySeconds,
  144. };
  145. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.ActivityId, activityTitle: item.Title });
  146. }
  147. this.$parent.showAudioPop = true;
  148. },
  149. //音视频的图标
  150. classifyIcon(item) {
  151. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  152. let imgSrc = item.Type == 1 || item.AudioType == 1 ? srcItem.audio : srcItem.video;
  153. return imgSrc;
  154. },
  155. // 微路演留言
  156. async myLeavingMessageHandler(item) {
  157. await this.$store.dispatch("showLoginModal");
  158. uni.navigateTo({
  159. url: "/activityPages/generationAsk/generationAsk?id=" + (item.Type == 3 ? item.Id : item.ActivityId) + "&type=文章&roadshow=" + item.Type + "&roadshowTitle=" + item.Title,
  160. });
  161. },
  162. // 微路演收藏
  163. async isCollectionHandeler(item) {
  164. this.$emit("isCollectionHandeler", item);
  165. },
  166. // 跳转
  167. goDetails() {
  168. console.log(this.list);
  169. if (this.list.Type == 3) {
  170. // 跳转产业资源包
  171. uni.navigateTo({ url: "/reportPages/IndustryReport/IndustryReport?id=" + this.list.IndustryId });
  172. } else {
  173. uni.navigateTo({ url: "/activityPages/activityDetail/activityDetail?id=" + this.list.ActivityId });
  174. }
  175. },
  176. richTextClamp(val) {
  177. return `<div style="${
  178. val == 7 ? "min-height: 50px;" : ""
  179. }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;">`;
  180. },
  181. },
  182. };
  183. </script>
  184. <style scoped lang="scss">
  185. .container-roadshow-item {
  186. width: 100%;
  187. background: #ffffff;
  188. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  189. overflow: hidden;
  190. padding-top: 25rpx;
  191. margin-bottom: 20rpx;
  192. .cover-item {
  193. margin-top: 10rpx;
  194. width: calc(100% + 28rpx);
  195. height: 250rpx;
  196. display: flex;
  197. flex-direction: column-reverse;
  198. position: relative;
  199. background-repeat: no-repeat;
  200. background-size: 100% 100%;
  201. font-size: 24rpx;
  202. color: #fff;
  203. margin-left: -14rpx;
  204. .identification {
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. position: absolute;
  209. top: 0;
  210. right: 0;
  211. width: 0;
  212. height: 0;
  213. border-top: 90rpx solid $uni-color-new;
  214. border-left: 90rpx solid transparent;
  215. }
  216. .identification-img {
  217. position: absolute;
  218. top: 15rpx;
  219. right: 10rpx;
  220. width: 30rpx;
  221. height: 30rpx;
  222. }
  223. .identification-video {
  224. border-top: 90rpx solid #fa9550 !important;
  225. }
  226. .img-bg {
  227. position: absolute;
  228. top: 50%;
  229. left: 50%;
  230. transform: translate(-50%, -50%);
  231. width: 80rpx;
  232. height: 80rpx;
  233. image {
  234. width: 80rpx;
  235. height: 80rpx;
  236. }
  237. }
  238. .time {
  239. position: absolute;
  240. bottom: 8rpx;
  241. left: 15rpx;
  242. font-size: 24rpx;
  243. font-weight: 400;
  244. color: #ffffff;
  245. line-height: 46rpx;
  246. }
  247. }
  248. .title {
  249. height: 88rpx;
  250. font-size: 32rpx;
  251. font-weight: 500;
  252. color: #333333;
  253. line-height: 40rpx;
  254. padding-bottom: 10rpx;
  255. border-bottom: 1rpx solid #dcdfe6;
  256. margin-bottom: 20rpx;
  257. word-wrap: break-word;
  258. word-break: break-all;
  259. }
  260. .title-share {
  261. margin-top: 20rpx;
  262. padding-top: 20rpx;
  263. image {
  264. width: 48rpx;
  265. height: 48rpx;
  266. }
  267. .share {
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-between;
  271. .share-icon {
  272. display: flex;
  273. align-items: center;
  274. justify-content: center;
  275. width: 50rpx;
  276. height: 50rpx;
  277. background-color: rgba(0, 0, 0, 0);
  278. }
  279. }
  280. .share-collected {
  281. justify-content: space-around;
  282. }
  283. }
  284. }
  285. </style>