favorites.vue 2.0 KB

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