Files
dvcp_v2_wxcp_app/src/main.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-11-15 10:29:05 +08:00
import Vue from 'vue';
import App from './App';
import store from './store';
import axios from './common/axios';
import utils from './common/util';
2021-11-17 17:34:44 +08:00
import ui from 'uview-ui'
2022-02-15 17:13:00 +08:00
import VConsole from 'vconsole'
2021-11-15 10:29:05 +08:00
2021-12-08 19:24:59 +08:00
const loading = title => {
uni.showLoading({
title: title ? title : '加载中',
mask: true
})
}
const hideLoading = () => {
uni.hideLoading()
}
Vue.prototype.$loading = loading
Vue.prototype.$hideLoading = hideLoading
2021-11-17 17:34:44 +08:00
Vue.use(ui)
2021-11-15 10:29:05 +08:00
Vue.config.productionTip = false;
//初始化接口工具类
Vue.prototype.$http = axios;
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
2022-03-15 10:53:46 +08:00
utils.dict.init({instance: axios})
2021-11-15 10:29:05 +08:00
App.mpType = 'app';
2022-02-15 17:13:00 +08:00
process.env.NODE_ENV == 'development' && new VConsole();
2021-11-15 10:29:05 +08:00
const app = new Vue({
2021-11-17 17:34:44 +08:00
store,
...App
2021-11-15 10:29:05 +08:00
});
2022-03-29 16:30:25 +08:00
app.$mount();
// store.dispatch("agentSign").then(config => {
// const init = (c = 0) => {
// if (config) {
// store.commit("getConfig", {...config, latlng: [config.lat, config.lng]})
// app.$mount();
// } else {
// if (c < 5) {
// setTimeout(() => {
// init(++c)
// }, 300)
// }
// }
// }
// init()
// })
2021-11-15 10:29:05 +08:00