123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view>
- <home v-show="tabbarActive === 'home'" @switch-tab="switchTab" />
- <exhibitor v-if="tabbarActive === 'exhibitor'" @share="onShare" />
- <activity v-if="tabbarActive === 'activity'" @share="onShare" />
- <user v-if="tabbarActive === 'user'" />
- <product v-if="tabbarActive === 'product'" @share="onShare" ></product>
- <van-dialog id="van-dialog" />
- <tab-bar :active.sync="tabbarActive"></tab-bar>
- <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
- </view>
- </template>
- <script>
- import TabBar from '@/components/layout/tab-bar.vue'
- import UShareActionSheet from '@/components/common/u-share-action-sheet'
- import Home from '@/pages/index/home.vue'
- import Exhibitor from '@/pages/exhibitor/index.vue'
- import Activity from '@/pages/activity/index.vue'
- import User from '@/pages/user/index.vue'
- import PageLayout from "@/components/layout/page-layout";
- import Product from "@/pages/exhibitor/exhibit"
- export default {
- options: {
- styleIsolation: 'shared'
- },
- components: {
- PageLayout,
- TabBar,
- Home,
- Exhibitor,
- Activity,
- User,
- UShareActionSheet,
- Product
- },
- watch: {
- '$store.getters.page': {
- handler(val) {
- this.tabbarActive = val[val.length-1]
- }
- }
- },
- data() {
- return {
- tabbarActive: 'home',
- showShare: false,
- shareInfo: null
- }
- },
- onLoad(options) {
- if (options.tab) {
- this.tabbarActive = options.tab
- }
- },
- created() {
- },
- methods: {
- switchTab(active) {
- this.tabbarActive = active
- },
- onShare(e) {
- console.log(e,'e')
- this.shareInfo = e.detail
- this.showShare = true
- },
- onShareAppMessage: function (res) {
- if (res.from === 'button') {
- if (this.shareInfo) {
- return this.shareInfo
- }
- }
- this.shareInfo = null
- this.showShare = false
- return {
- title: '慕尼黑上海电子生产设备展',
- path: '/pages/index/index?tab='+this.tabbarActive,
- imageUrl: 'https://oss.productronicachina.com.cn/resources/common/up/0000001002/20250221/67b829f60c212.png'
- }
- },
- onShareTimeline() {
- return {
- title: '慕尼黑上海电子生产设备展',
- path: '/pages/index/index',
- query: 'tab=' + this.tabbarActive,
- imageUrl: 'https://oss.productronicachina.com.cn/resources/common/up/0000001002/20250221/67b829f60c212.png'
- };
- },
- onClickSearch() {
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|