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

import store from './store'

Vue.prototype.$store = store
import util from './common/util.js'
Vue.prototype.$util = util;
import common from './common/common.js'
Vue.prototype.$common = common;
import uView from "uview-ui";
Vue.use(uView);

Vue.config.productionTip = false
App.mpType = 'app'

Vue.prototype.$toast = function(msg, callback = false) {
	uni.showToast({
		icon: 'none',
		title: msg,
	})
	if (callback !== false) {
		setTimeout(() => {
			callback()
		}, 2000)
	}
}
Vue.prototype.$load = function(msg, callback = false) {
	uni.showLoading({
		title:msg,
		mask:true
	})
	if (callback !== false) {
		setTimeout(() => {
			callback()
		}, 2000)
	}
}
Vue.prototype.$back = function() {
	uni.navigateBack({
		delta: 1
	})
}



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

// 引入请求封装，将app参数传递到配置中
require('./http/request.js')(app)

app.$mount()