1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- const moment=require('../utils/moment-with-locales.min')
- moment.locale('zh-cn');
- import {globalImgUrls} from "../utils/config"
- import store from '@/store'
- module.exports = {
- watch: {
- tabbar(){
- const page = this.$mp.page;
- if( page&&(page.route==='pages/buy/buy'||
- page.route=='pages/report/report'||
- page.route=='pages/chart/chart'||
- page.route=='pages/activity/activity'||
- page.route=='pages/user/user')
- ){
- if (page&&typeof page.getTabBar === "function" && page.getTabBar()){;
- page.getTabBar().setData({
- list: this.tabbar,
- selected:this.tabbar[0].pagePath
- });
- }
- }
- }
- },
- computed: {
- tabbar(){
- return store.state.user.tabbarList
- }
- },
- filters: {
-
- formatActivityTime(start,end){
- const week=moment(start).format('dddd');
- const day=moment(start).format('YYYY-MM-DD');
- const startTime=moment(start).format('HH:mm');
- const endTime=moment(end).format('HH:mm');
- return `${day} ${startTime}-${endTime} ${week}`
- }
- },
- data() {
- return {
- globalImgUrls:globalImgUrls,
- userInfo:{},
- };
- },
- onLoad() {
- this.handleSetTabBarItem()
- },
- onShow(){
- this.userInfo=this.$store.state.user.userInfo
- },
- methods: {
-
- handleSetTabBarItem(){
- const page = this.$mp.page;
- const tabbarList=this.$store.state.user.tabbarList
- if( page.route==='pages/buy/buy'||
- page.route=='pages/report/report'||
- page.route=='pages/chart/chart'||
- page.route=='pages/activity/activity'||
- page.route=='pages/user/user'
- ){
- if (page&&typeof page.getTabBar === "function" && page.getTabBar()) {
- page.getTabBar().setData({
- selected: page.route,
- list:tabbarList
- });
- }
- }
-
- }
- },
- };
|