main.js
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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()
})