roadshowItem.vue 9.8 KB

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