import Vue from 'vue'
import App from './App'
import uView from "uview-ui";
Vue.use(uView);

// ColorUI的 导航栏
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)

import comSelectPicture from './components/comSelectPicture/comSelectPicture.vue'
Vue.component('com-select-picture',comSelectPicture)

//oss图片服务器
// Vue.prototype.$ossUrl = function(img){
// 	return  "https://cdn.uxianxin.com/app/group/"+img;
// };

Vue.prototype.$ossUrl = 'http://cdn.uxianxin.com/app/group/login/bg-top.png'


// 此处为vuex使用
import store from '@/store';

// 引入uView提供的对vuex的简写法文件
let vuexStore = require('@/store/$u.mixin.js');
Vue.mixin(vuexStore);

App.mpType = 'app'


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


const msg = (title, duration=1500, mask=false, icon='none')=>{
	//统一提示方便全局修改
	if(Boolean(title) === false){
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}

Vue.prototype.$fire = new Vue();
Vue.prototype.$store = store;
Vue.prototype.$api = {msg};

// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js'
Vue.use(httpInterceptor, app)

// http接口API集中管理引入部分
import httpApi from '@/api/http.api.js'
Vue.use(httpApi, app)

import common from '@/common/common.js'
Vue.prototype.$isNull = common.isNull;
Vue.prototype.$timefilter = common.timefilter;



app.$mount()
