index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <home v-if="tabbarActive === 'home'" @switch-tab="tabbarActive = 'exhibitor'" />
  4. <exhibitor v-if="tabbarActive === 'exhibitor'" @share="onShare" />
  5. <activity v-if="tabbarActive === 'activity'" />
  6. <user v-if="tabbarActive === 'user'" />
  7. <van-dialog id="van-dialog" />
  8. <tab-bar :active.sync="tabbarActive"></tab-bar>
  9. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
  10. </view>
  11. </template>
  12. <script>
  13. import TabBar from '@/components/layout/tab-bar.vue'
  14. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  15. import Home from '@/pages/index/home.vue'
  16. import Exhibitor from '@/pages/exhibitor/index.vue'
  17. import Activity from '@/pages/activity/index.vue'
  18. import User from '@/pages/user/index.vue'
  19. import PageLayout from "@/components/layout/page-layout";
  20. export default {
  21. options: {
  22. styleIsolation: 'shared'
  23. },
  24. components: {
  25. PageLayout,
  26. TabBar,
  27. Home,
  28. Exhibitor,
  29. Activity,
  30. User,
  31. UShareActionSheet
  32. },
  33. data() {
  34. return {
  35. tabbarActive: 'home',
  36. showShare: false,
  37. shareInfo: null
  38. }
  39. },
  40. onLoad(options) {
  41. if (options.tab) {
  42. this.tabbarActive = options.tab
  43. }
  44. },
  45. created() {
  46. },
  47. methods: {
  48. onShare(e) {
  49. this.shareInfo = e.detail
  50. this.showShare = true
  51. },
  52. onShareAppMessage: function (res) {
  53. if (res.from === 'button') {
  54. if (this.shareInfo) {
  55. return this.shareInfo
  56. }
  57. }
  58. this.shareInfo = null
  59. this.showShare = false
  60. return {
  61. title: '慕尼黑上海电子生产设备展',
  62. path: '/pages/index/index',
  63. imageUrl: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  64. }
  65. },
  66. onClickSearch() {
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. </style>