import { backToMemberCenter } from '../constants/routes.js'

/** 状态栏时间（Pixso 顶栏占位） */
export const statusBarTimeMixin = {
    data() {
        return {
            statusBarTime: '9:41'
        }
    },
    onLoad() {
        this.updateStatusBarTime()
    },
    methods: {
        updateStatusBarTime() {
            const now = new Date()
            this.statusBarTime = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`
        }
    }
}

/** 子页面返回个人中心 tab */
export const subPageMixin = {
    methods: {
        goBack() {
            backToMemberCenter()
        }
    }
}
