2021-05-13 10:56:04 +08:00
|
|
|
import Vue from "vue";
|
|
|
|
import ViewUI from "view-design";
|
|
|
|
import "./styles/theme.less";
|
|
|
|
|
|
|
|
import "core-js/stable";
|
2021-08-20 17:45:57 +08:00
|
|
|
import vueQr from "vue-qr";
|
2021-05-13 10:56:04 +08:00
|
|
|
|
2022-08-26 17:12:48 +08:00
|
|
|
import liliDialog from '@/views/lili-dialog'
|
2021-05-13 10:56:04 +08:00
|
|
|
import App from "./App";
|
|
|
|
import { router } from "./router/index";
|
|
|
|
import store from "./store";
|
|
|
|
import {
|
|
|
|
getRequest,
|
|
|
|
postRequest,
|
|
|
|
putRequest,
|
|
|
|
deleteRequest,
|
|
|
|
importRequest,
|
|
|
|
uploadFileRequest
|
|
|
|
} from "@/libs/axios";
|
|
|
|
import { setStore, getStore, removeStore } from "@/libs/storage";
|
|
|
|
|
2021-10-21 15:48:03 +08:00
|
|
|
import i18nBox from '@/views/lili-components/i18n-translate'
|
2021-05-13 10:56:04 +08:00
|
|
|
import util from "@/libs/util";
|
2021-09-22 15:08:34 +08:00
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
import VueLazyload from "vue-lazyload";
|
|
|
|
|
|
|
|
import * as filters from "@/utils/filters"; // global filter
|
|
|
|
|
|
|
|
import { md5 } from "@/utils/md5.js";
|
2022-05-20 16:40:09 +08:00
|
|
|
const { aMapSecurityJsCode } = require("@/config");
|
2022-07-06 15:18:56 +08:00
|
|
|
// 打印
|
|
|
|
import Print from 'vue-print-nb';
|
|
|
|
Vue.use(Print);
|
2022-05-20 16:40:09 +08:00
|
|
|
// 高德安全密钥
|
|
|
|
if (aMapSecurityJsCode) {
|
|
|
|
window._AMapSecurityConfig = {
|
|
|
|
securityJsCode: aMapSecurityJsCode,
|
|
|
|
};
|
|
|
|
}
|
2021-05-13 10:56:04 +08:00
|
|
|
Vue.config.devtools = true;
|
|
|
|
Vue.config.productionTip = false;
|
|
|
|
Vue.use(VueLazyload, {
|
|
|
|
error: require("./assets/img-error.png"),
|
|
|
|
loading: require("./assets/loading2.gif")
|
|
|
|
});
|
|
|
|
|
2021-08-27 18:10:33 +08:00
|
|
|
Vue.use(ViewUI);
|
2022-03-03 11:26:50 +08:00
|
|
|
Vue.component('liliDialog',liliDialog)
|
2021-10-21 15:48:03 +08:00
|
|
|
Vue.component('i18nBox',i18nBox)
|
2022-08-26 17:12:48 +08:00
|
|
|
Vue.component('liliDialog',liliDialog)
|
2021-08-20 17:45:57 +08:00
|
|
|
Vue.component("vue-qr", vueQr); //此处将vue-qr添加为全局组件
|
2021-05-13 10:56:04 +08:00
|
|
|
|
|
|
|
// 挂载全局使用的方法
|
|
|
|
Vue.prototype.getRequest = getRequest;
|
|
|
|
Vue.prototype.postRequest = postRequest;
|
|
|
|
Vue.prototype.putRequest = putRequest;
|
|
|
|
Vue.prototype.deleteRequest = deleteRequest;
|
|
|
|
Vue.prototype.importRequest = importRequest;
|
|
|
|
Vue.prototype.uploadFileRequest = uploadFileRequest;
|
|
|
|
Vue.prototype.setStore = setStore;
|
|
|
|
Vue.prototype.getStore = getStore;
|
|
|
|
Vue.prototype.removeStore = removeStore;
|
|
|
|
Vue.prototype.md5 = md5;
|
2021-09-17 17:16:15 +08:00
|
|
|
const PC_URL = BASE.PC_URL; // 跳转买家端地址 pc端
|
|
|
|
const WAP_URL = BASE.WAP_URL; // 跳转买家端地址 wap端
|
2021-08-20 17:45:57 +08:00
|
|
|
Vue.prototype.linkTo = function(goodsId, skuId) {
|
|
|
|
// 跳转买家端商品
|
|
|
|
window.open(
|
2021-09-03 14:58:03 +08:00
|
|
|
`${PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`,
|
2021-08-20 17:45:57 +08:00
|
|
|
"_blank"
|
|
|
|
);
|
2021-05-18 18:03:00 +08:00
|
|
|
};
|
2021-08-20 17:45:57 +08:00
|
|
|
Vue.prototype.wapLinkTo = function(goodsId, skuId) {
|
|
|
|
// app端二维码
|
2021-09-03 14:58:03 +08:00
|
|
|
return `${WAP_URL}/pages/product/goods?id=${skuId}&goodsId=${goodsId}`;
|
2021-05-18 18:03:00 +08:00
|
|
|
};
|
2021-05-13 10:56:04 +08:00
|
|
|
|
|
|
|
Array.prototype.remove = function(from, to) {
|
|
|
|
var rest = this.slice((to || from) + 1 || this.length);
|
|
|
|
this.length = from < 0 ? this.length + from : from;
|
|
|
|
return this.push.apply(this, rest);
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.keys(filters).forEach(key => {
|
|
|
|
Vue.filter(key, filters[key]);
|
|
|
|
});
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
new Vue({
|
|
|
|
el: "#app",
|
|
|
|
router,
|
|
|
|
store,
|
|
|
|
render: h => h(App),
|
|
|
|
data: {
|
|
|
|
currentPageName: ""
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
// 初始化菜单
|
|
|
|
util.initRouter(this);
|
2022-05-20 16:40:09 +08:00
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
this.currentPageName = this.$route.name;
|
|
|
|
// 显示打开的页面的列表
|
|
|
|
this.$store.commit("setOpenedList");
|
|
|
|
this.$store.commit("initCachepage");
|
|
|
|
}
|
|
|
|
});
|