roadshowItem.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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="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/cygx/multimedia/leaving_message.png"></image>
  31. <image
  32. @click="isCollectionHandeler(list)"
  33. :src="list.IsCollect ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/collected_icon.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/multimedia/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/cygx/multimedia/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="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. handelPlay(item) {
  98. let content_item = null;
  99. if (item.AudioActivityId) {
  100. content_item = {
  101. ActivityId: item.AudioActivityId,
  102. PlaySeconds: item.AudioPlaySeconds,
  103. ResourceUrl: item.AudioResourceUrl,
  104. Title: item.AudioTitle,
  105. Type: item.AudioType,
  106. };
  107. }
  108. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  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. } else {
  126. this.$store.dispatch("checkHandle");
  127. }
  128. },
  129. //视频的播放事件
  130. handelVideoPlay(item) {
  131. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  132. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  133. this.$store.commit("videoPlay/playVideo", item.Id);
  134. }
  135. this.globalBgAudioManager.stop();
  136. this.videoPopList = item;
  137. this.showVideoPop = true;
  138. },
  139. //音频的播放事件
  140. async audioPlayBack(item) {
  141. this.curVideoId = 0;
  142. this.$store.commit("audioBg/parseIntAudio", true);
  143. // 判断是否为同一个音频
  144. if (this.$store.state.audioBg.indexId == item.ActivityId) {
  145. if (this.globalBgAudioManager.paused) {
  146. this.globalBgAudioManager.play();
  147. } else {
  148. this.globalBgAudioManager.pause();
  149. }
  150. } else {
  151. let VoiceList = {
  152. Url: item.ResourceUrl,
  153. Name: item.Title,
  154. PlaySeconds: item.PlaySeconds,
  155. };
  156. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.ActivityId, activityTitle: item.Title });
  157. }
  158. this.showAudioPop = true;
  159. },
  160. //音视频的背景色 文字颜色
  161. classifyColor(item) {
  162. let text_color = color_word_bg.color_word.find((key) => key.name == item).color;
  163. let back_ground = color_word_bg.color_bg.find((key) => key.name == item).color;
  164. let _isColor = { color: text_color, "background-color": back_ground };
  165. return _isColor;
  166. },
  167. //音视频的图标
  168. classifyIcon(item) {
  169. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  170. let imgSrc = item.Type == 1 || item.AudioType == 1 ? srcItem.audio : srcItem.video;
  171. return imgSrc;
  172. },
  173. // 微路演留言
  174. myLeavingMessageHandler(item) {
  175. uni.navigateTo({
  176. url: "/activityPages/generationAsk/generationAsk?id=" + (item.Type == 3 ? item.Id : item.ActivityId) + "&type=文章&roadshow=" + item.Type + "&roadshowTitle=" + item.Title,
  177. });
  178. },
  179. // 微路演收藏
  180. async isCollectionHandeler(item) {
  181. this.$emit("isCollectionHandeler", item);
  182. },
  183. },
  184. };
  185. </script>
  186. <style scoped lang="scss">
  187. .container-roadshow-item {
  188. width: 100%;
  189. background: #ffffff;
  190. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.05);
  191. padding: 20rpx 14rpx;
  192. border-radius: 8rpx;
  193. margin-bottom: 20rpx;
  194. overflow: hidden;
  195. .cover-item {
  196. width: calc(100% + 28rpx);
  197. height: 250rpx;
  198. display: flex;
  199. flex-direction: column-reverse;
  200. position: relative;
  201. background-repeat: no-repeat;
  202. background-size: 100% 100%;
  203. font-size: 24rpx;
  204. color: #fff;
  205. margin-left: -14rpx;
  206. .identification {
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. position: absolute;
  211. top: 0;
  212. right: 0;
  213. width: 0;
  214. height: 0;
  215. border-top: 90rpx solid #3385ff;
  216. border-left: 90rpx solid transparent;
  217. }
  218. .identification-img {
  219. position: absolute;
  220. top: 15rpx;
  221. right: 10rpx;
  222. width: 30rpx;
  223. height: 30rpx;
  224. }
  225. .identification-video {
  226. border-top: 90rpx solid #ffab31 !important;
  227. }
  228. .img-bg {
  229. position: absolute;
  230. top: 50%;
  231. left: 50%;
  232. transform: translate(-50%, -50%);
  233. width: 80rpx;
  234. height: 80rpx;
  235. image {
  236. width: 80rpx;
  237. height: 80rpx;
  238. }
  239. }
  240. .time {
  241. position: absolute;
  242. bottom: 8rpx;
  243. left: 15rpx;
  244. font-size: 24rpx;
  245. font-weight: 400;
  246. color: #ffffff;
  247. line-height: 46rpx;
  248. }
  249. }
  250. .title {
  251. height: 88rpx;
  252. font-size: 32rpx;
  253. font-weight: 500;
  254. color: #333333;
  255. line-height: 40rpx;
  256. padding-bottom: 10rpx;
  257. border-bottom: 1rpx solid #dcdfe6;
  258. margin-bottom: 20rpx;
  259. word-wrap: break-word;
  260. word-break: break-all;
  261. }
  262. .title-share {
  263. margin-top: 20rpx;
  264. padding-top: 20rpx;
  265. border-top: 1rpx solid #dcdfe6;
  266. .share {
  267. display: flex;
  268. align-items: center;
  269. justify-content: space-between;
  270. .share-icon {
  271. display: flex;
  272. align-items: center;
  273. justify-content: center;
  274. width: 50rpx;
  275. height: 50rpx;
  276. }
  277. image {
  278. width: 44rpx;
  279. height: 44rpx;
  280. }
  281. .share-text {
  282. position: flex;
  283. align-items: center;
  284. padding: 0 10rpx;
  285. image {
  286. width: 20rpx;
  287. height: 20rpx;
  288. margin-right: 5rpx;
  289. }
  290. }
  291. }
  292. .share-collected {
  293. justify-content: space-around;
  294. }
  295. }
  296. }
  297. </style>