index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. created() {
  39. },
  40. methods: {
  41. onShare(e) {
  42. this.shareInfo = e.detail
  43. this.showShare = true
  44. },
  45. onShareAppMessage: function (res) {
  46. if (res.from === 'button') {
  47. if (this.shareInfo) {
  48. return this.shareInfo
  49. }
  50. }
  51. this.shareInfo = null
  52. this.showShare = false
  53. return {
  54. title: '慕尼黑上海电子生产设备展',
  55. path: '/pages/index/index',
  56. 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'
  57. }
  58. },
  59. onClickSearch() {
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. </style>