favorites.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="user-favorites user-like">
  3. <nav-bar title="我的收藏" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view>
  5. <view class="user-favorites-tabs-wrapper user-like-tabs-wrapper">
  6. <view class="user-favorites-tabs user-like-tabs">
  7. <u-tabs :active.sync="tabActive" :tabs="tabs" @change="tabChange" />
  8. </view>
  9. </view>
  10. <view class="main-container">
  11. <view class="user-favorites-list user-like-list">
  12. <template v-for="(item, index) in favoritesList">
  13. <template v-if="tabActive === 'exhibitor'">
  14. <exhibitor-item :item="item" :footer-hidden="true" :key="index" />
  15. </template>
  16. <template v-else-if="tabActive === 'exhibit'">
  17. <exhibit-item :item="item" :footer-hidden="true" :key="index" />
  18. </template>
  19. <template v-else-if="tabActive === 'activity'">
  20. <activity-item :item="item" :favorites-hidden="true" :key="index" />
  21. </template>
  22. </template>
  23. </view>
  24. </view>
  25. </u-scroll-view>
  26. </view>
  27. </template>
  28. <script>
  29. import NavBar from '@/components/layout/nav-bar'
  30. import UTabs from '@/components/common/u-tabs'
  31. import UScrollView from '@/components/common/u-scroll-view'
  32. import ExhibitItem from '@/pages/exhibitor/components/exhibit-item.vue'
  33. import ExhibitorItem from '@/pages/exhibitor/components/exhibitor-item.vue'
  34. import ActivityItem from '@/pages/activity/components/activity-item.vue'
  35. export default {
  36. options: {
  37. styleIsolation: 'shared'
  38. },
  39. components: {
  40. NavBar,
  41. UTabs,
  42. UScrollView,
  43. ExhibitItem,
  44. ExhibitorItem,
  45. ActivityItem
  46. },
  47. computed: {
  48. },
  49. data() {
  50. return {
  51. tabActive: 'exhibitor',
  52. tabs: [{
  53. label: '展商',
  54. value: 'exhibitor'
  55. }, {
  56. label: '展品',
  57. value: 'exhibit'
  58. }, {
  59. label: '同期活动',
  60. value: 'activity'
  61. }],
  62. favoritesList: [{}, {}, {}, {}, {}, {}],
  63. }
  64. },
  65. created() {
  66. this.checkAuth('/pages/user/favorites')
  67. this.loadFontFace('Poppins')
  68. },
  69. onShow() {
  70. },
  71. methods: {
  72. tabChange() {
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. @import "@/static/style/pages/user-like.scss";
  79. </style>