roadshow.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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>
  9. </template>
  10. <script>
  11. import { Home } from "@/config/api";
  12. import RoadshowItem from "@/components/ItemComponent/roadshowItem.vue";
  13. export default {
  14. props: {
  15. roadshowPageList: {
  16. type: Array,
  17. default: [],
  18. required: true,
  19. },
  20. tabsRoadshowSearch: {
  21. type: Number,
  22. required: true,
  23. },
  24. },
  25. data() {
  26. return {};
  27. },
  28. computed: {},
  29. components: { RoadshowItem },
  30. methods: {
  31. // 微路演收藏
  32. async isCollectionHandeler(item) {
  33. const res = await Home.microRoadshowCollect({
  34. Id: item.Id,
  35. SourceType: item.Type,
  36. PageRouter: this.$store.state.pageRouterReport
  37. });
  38. if (res.Ret === 200) {
  39. let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
  40. res.Data.Status == 1 ? (this.$parent.roadshowPageList[index].IsCollect = true) : (this.$parent.roadshowPageList[index].IsCollect = false);
  41. uni.showToast({
  42. title: res.Msg,
  43. duration: 2000,
  44. });
  45. }
  46. },
  47. },
  48. };
  49. </script>
  50. <style lang="scss" scoped>
  51. .roadshow-search {
  52. padding: 35rpx 12rpx;
  53. .audio-video-content {
  54. display: flex;
  55. flex-wrap: wrap;
  56. justify-content: space-between;
  57. }
  58. }
  59. .roadshow-search-top {
  60. padding-top: 90rpx !important;
  61. }
  62. </style>