初始化产品库

This commit is contained in:
aixianling
2021-11-15 10:29:05 +08:00
parent 8f735a4ffe
commit 5440b43b9c
306 changed files with 54508 additions and 3 deletions

39
src/main.js Normal file
View File

@@ -0,0 +1,39 @@
import Vue from 'vue';
import App from './App';
import store from './store';
import axios from './common/axios';
import utils from './common/util';
import dayjs from 'dayjs';
import mixin from './uview/libs/mixin/mixin';
Vue.config.productionTip = false;
Vue.prototype.$store = store;
//初始化接口工具类
axios.defaults.baseURL = store.state.baseURL;
Vue.prototype.$http = axios;
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
Vue.prototype.imgHomeUrl = 'https://cdn.cunwuyun.cn/dvcp/h5/home/';
Vue.prototype.imgOtherUrl = 'https://cdn.cunwuyun.cn/dvcp/h5/other/';
Vue.prototype.$formatName = (name) => {
if (name == undefined) {
return;
}
return name.substr(name.length - 2, name.length > 2 ? name.length - 1 : name.length);
};
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
let relativeTime = require('dayjs/plugin/relativeTime');
require('dayjs/locale/zh-cn');
let dayjs_plugin_duration = require('dayjs/plugin/duration');
dayjs.extend(dayjs_plugin_duration);
dayjs.extend(relativeTime);
Vue.prototype.$dayjs = dayjs;
Vue.mixin(mixin);
App.mpType = 'app';
process.env.NODE_ENV == 'development' && new VConsole();
const app = new Vue({
store,
...App
});
app.$mount();