main.js 1.75 KB
import Vue from 'vue'
import store from './store'
import App from './App'
import echarts from 'echarts/'
import MiniRefreshTools from 'module/minirefresh';
import 'module/minirefresh/dist/debug/minirefresh.css'
import AwesomePicker from 'module/vue-awesome-picker';
import VueI18n from 'module/vue-i18n'
// 引入样式
import 'vue-easytable/libs/themes-base/index.css'
// 导入 table 和 分页组件
import {VTable,VPagination} from 'vue-easytable'
import permissionsFun from './common/common'

//引入弹窗组件
import MobileMessage from 'mobile-message'
import 'mobile-message/dist/message.css'

// webview function
// import { webviewPub } from './common/webviewpub.js'

// vue prototype
import './common/vproto.js'
Vue.prototype.permissionsFun = permissionsFun
// 注册到全局

Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination)
Vue.use(VueI18n)
Vue.use(AwesomePicker);
Vue.use(MobileMessage);
Vue.config.productionTip = false
Vue.prototype.echarts=echarts;
App.mpType = 'app'
Vue.prototype.$store = store
// Vue.prototype.$webviewPub = webviewPub;
window.getNavHeight=function(val){
	uni.setStorage({
		key:'statusBarH',
		data:Number(val)
	})
}
var locale=''
if(window.pageType=="store"){
	locale='zh-store'
}else if(window.pageType=="mall"){
	locale='zh-mall'
}
// var src='./i18n/langs/mallCN'
var src='./i18n/langs/storeCN'
const i18n = new VueI18n({
	locale:locale,
	messages:{}
})
function loadI18nMessages(lang) {
    return import(/* webpackChunkName: "[request]" */'./i18n/langs/'+lang).then(msg => {
        i18n.setLocaleMessage(lang, msg.default)
        i18n.locale = lang
        return Promise.resolve()
    })
}
loadI18nMessages(locale).then(() => {
	const app = new Vue({
	   i18n,
	   store,
	   ...App
	 })
	 app.$mount()
})