import App from './App'
import globalMethods from '@/utils/globalMethods.js';
import pageData from "@/static/json/page.json"
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	// 从缓存读取系统信息（已在App.vue中获取）
	app.config.globalProperties.$pageData = pageData
	let systemInfo = uni.getStorageSync('systemInfo') || {}
	if (!systemInfo.platform) {
		systemInfo = uni.getSystemInfoSync() || {}
	}
	app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
	// #ifdef APP-PLUS
	app.config.globalProperties.$system = plus.os.name;
	// #endif
	app.config.globalProperties.$systemInfo = systemInfo
	uni.setStorageSync('version', '1.0.6.sp17')
	app.config.globalProperties.$version = uni.getStorageSync('version')
	app.use(globalMethods);
	return {
		app
	}
}
// #endif