index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="content">
  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. export default {
  20. options: {
  21. styleIsolation: 'shared'
  22. },
  23. components: {
  24. TabBar,
  25. Home,
  26. Exhibitor,
  27. Activity,
  28. User,
  29. UShareActionSheet
  30. },
  31. data() {
  32. return {
  33. tabbarActive: 'home',
  34. showShare: false,
  35. shareInfo: null
  36. }
  37. },
  38. onLoad(options) {
  39. if (options.tab) {
  40. this.tabbarActive = options.tab
  41. }
  42. },
  43. created() {
  44. },
  45. methods: {
  46. onShare(e) {
  47. this.shareInfo = e.detail
  48. this.showShare = true
  49. },
  50. onShareAppMessage: function (res) {
  51. if (res.from === 'button') {
  52. if (this.shareInfo) {
  53. return this.shareInfo
  54. }
  55. }
  56. this.shareInfo = null
  57. this.showShare = false
  58. return {
  59. title: '慕尼黑上海电子生产设备展',
  60. path: '/pages/index/index',
  61. 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'
  62. }
  63. },
  64. onClickSearch() {
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. </style>