roadshow.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view :class="['roadshow-search', tabsRoadshowSearch == 5 && 'roadshow-search-top']">
  3. <view class="audio-video-content">
  4. <view style="width: 49%" v-for="item in roadshowPageList" :key="item.Id">
  5. <RoadshowItem :list="item" @isCollectionHandeler="isCollectionHandeler" />
  6. </view>
  7. </view>
  8. <view v-if="showAudioBox">
  9. <audioModule :showAudioPop.sync="showAudioPop" />
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { Home } from "@/config/api";
  15. import RoadshowItem from "@/components/ItemComponent/roadshowItem.vue";
  16. import audioModule from "@/components/audioModule/index";
  17. export default {
  18. props: {
  19. roadshowPageList: {
  20. type: Array,
  21. default: [],
  22. required: true,
  23. },
  24. tabsRoadshowSearch: {
  25. type: Number,
  26. required: true,
  27. },
  28. },
  29. data() {
  30. return {
  31. showAudioPop: false,
  32. };
  33. },
  34. computed: {
  35. showAudioBox() {
  36. return this.$store.state.audioBg.parseIntShow;
  37. },
  38. },
  39. components: { RoadshowItem, audioModule },
  40. methods: {
  41. // 微路演收藏
  42. async isCollectionHandeler(item) {
  43. await this.$store.dispatch("showLoginModal");
  44. const res = await Home.microRoadshowCollect({
  45. SourceId: item.SourceId,
  46. SourceType: item.Type,
  47. PageRouter: this.$store.state.pageRouterReport,
  48. });
  49. if (res.Ret === 200) {
  50. let index = this.roadshowPageList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
  51. res.Data.Status == 1 ? (this.$parent.roadshowPageList[index].IsCollect = true) : (this.$parent.roadshowPageList[index].IsCollect = false);
  52. uni.showToast({
  53. title: res.Msg,
  54. duration: 2000,
  55. });
  56. }
  57. },
  58. },
  59. };
  60. </script>
  61. <style lang="scss" scoped>
  62. .roadshow-search {
  63. padding: 35rpx 12rpx;
  64. .audio-video-content {
  65. display: flex;
  66. flex-wrap: wrap;
  67. justify-content: space-between;
  68. }
  69. }
  70. .roadshow-search-top {
  71. padding-top: 90rpx !important;
  72. }
  73. </style>