import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

import uView from 'uview-ui'
Vue.use(uView)
// uni.$u.config.unit = 'rpx'
import store from './store/index.js' // 确保路径正确
Vue.prototype.$store = store;
import {formatSeconds}from './utils/tools.js'
Vue.prototype.$formatSeconds = formatSeconds;
import {isLoginCourseAuto}from './utils/courseTool.js'
Vue.prototype.$isLoginCourseAuto = isLoginCourseAuto;
import utils from './utils/common.js'
Vue.prototype.utils = utils;
import {
	setData,
	isLoginCourse
} from './utils/common.js'
// vuex
Vue.prototype.$isLoginCourse = isLoginCourse
Vue.prototype.setData = setData;
App.mpType = 'app'
const app = new Vue({
	...App,
	store
})
app.$mount()
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	app.use(uviewPlus)
	app.config.globalProperties.$isLogin = isLogin
	app.config.globalProperties.$isEmpty = isEmpty
	app.config.globalProperties.$parsePhone = parsePhone
	app.config.globalProperties.$showLoginPage = showLoginPage
	app.config.globalProperties.$getRegistrationID = getRegistrationID
	app.config.globalProperties.$navBack = navBack
	app.config.globalProperties.$navTo = navTo
	app.config.globalProperties.$qconfig = qconfig
	app.config.globalProperties.$getAge = getAge
	app.config.globalProperties.$parseIdCard = parseIdCard
	app.config.globalProperties.$getDictLabelName = getDictLabelName
	app.config.globalProperties.$parseText = parseText
	app.config.globalProperties.$logout = logout,
	app.config.globalProperties.$getUserInfo = getUserInfo,
	app.config.globalProperties.$dateFormatStr = dateFormatStr,
	app.config.globalProperties.$registerIdCode = registerIdCode,
	app.config.globalProperties.$formatSeconds = formatSeconds, 
	app.config.globalProperties.$formatDate = formatDate,
	app.config.globalProperties.$parseIDCardInfo = parseIDCardInfo
	app.config.globalProperties.$timeFormat = timeFormat;
	app.config.globalProperties.$formatHour = formatHour;
	return {
		app
	}
}
// #endif