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

import constants from '@/constant/index'
Vue.prototype.$constant = constants
import './static/iconfont/iconfont.css'
import '@/filters/index'

import util from './utils/util'
Vue.prototype.$util = util

import globalMixins from './mixins/globalMixins'
Vue.mixin(globalMixins)

import store from './store'
Vue.prototype.$store = store

// 阻止启动生产消息，常用作指令
Vue.config.productionTip = false

// 封装得全局消息提示
Vue.prototype.$msg = (title) => (
	uni.showToast({
		title,
		icon: 'none'
	})
)

// 生产环境中控制台不打印普通信息，以免造成内存泄漏
if (process.env.NODE_ENV == 'production') {
	if (console) {
		console.log = () => {}
	}
}

// Vue.prototype.$backgroundAudioData = {
// 	playing: false,
// 	playTime: 0,
// 	formatedPlayTime: '00:00:00'
// }

// Vue.component('page-head', pageHead)
// Vue.component('page-foot', pageFoot)
// Vue.component('uLink', uLink)

App.mpType = 'app'

const app = new Vue({
	store,
	...App
})
app.$mount()
