roadshowItem.vue 9.5 KB

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