roadshow.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. });
  37. if (res.Ret === 200) {
  38. let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
  39. res.Data.Status == 1 ? (this.$parent.roadshowPageList[index].IsCollect = true) : (this.$parent.roadshowPageList[index].IsCollect = false);
  40. uni.showToast({
  41. title: res.Msg,
  42. duration: 2000,
  43. });
  44. }
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .roadshow-search {
  51. padding: 35rpx 12rpx;
  52. .audio-video-content {
  53. display: flex;
  54. flex-wrap: wrap;
  55. justify-content: space-between;
  56. }
  57. }
  58. .roadshow-search-top {
  59. padding-top: 90rpx !important;
  60. }
  61. </style>