import App from './App'
import store from './store/index'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
	...App,
	store,
})
app.$mount()
// #endif

uni.$u.config.unit = 'rpx'

// 全局引入uView
import uView from '@/uni_modules/uview-ui'
import UniQrcode from 'uniapp-qrcode'
Vue.use(uView)

//重载uni.showToast，简化调用
Vue.prototype.$showToast = function(title, duration = 2000, icon = "none") {
	return uni.showToast({ title, duration, icon })
}

//全局apis
import apis from './http/index.js'
Vue.prototype.$api = apis;
//日期格式处理
import dateFormat from '@/utils/dateFormat.js'
Vue.use(dateFormat);

// 全局注册自定义头部组件
import customNavBar from './components/uNavBar'
Vue.component('c-nav-bar', customNavBar);
// 全局注册空数据组件
import NoData from './components/NoData'
Vue.component('NoData', NoData);
// 全局注册tabbar组件
import Tabbar from './components/Tabbar'
Vue.component('Tabbar', Tabbar);
//全局分享当前页(带参数)
import wxShare from '@/utils/wxShare.js'
Vue.mixin(wxShare);
//全局属性
import getSystemInfo from '@/utils/getSystemInfo.js'
Vue.mixin(getSystemInfo);

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif