2022-12-28 10:08:51 +08:00
|
|
|
import 'core-js/stable'
|
|
|
|
import 'regenerator-runtime/runtime'
|
|
|
|
|
|
|
|
import Vue from 'vue'
|
|
|
|
import App from '@/App'
|
|
|
|
import store from '@/store'
|
|
|
|
import router from '@/router'
|
|
|
|
import MainMixin from './mixins/main-mixin'
|
|
|
|
import face from '@/components/face'
|
|
|
|
import faceNull from '@/components/face-null'
|
|
|
|
import config from "@/config/config";
|
|
|
|
import './core/lazy-use'
|
|
|
|
import './core/global-component'
|
|
|
|
import './core/filter'
|
|
|
|
import './core/directives'
|
|
|
|
import '@/permission'
|
|
|
|
import '@/icons'
|
2023-02-13 09:24:30 +08:00
|
|
|
import * as filters from "./plugins/filters";
|
|
|
|
Object.keys(filters).forEach((key) => {
|
|
|
|
Vue.filter(key, filters[key]);
|
|
|
|
});
|
2022-12-28 10:08:51 +08:00
|
|
|
|
|
|
|
// 引入自定义全局css
|
|
|
|
import '@/assets/css/global.less'
|
|
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
Vue.mixin(MainMixin) // 引入mixins
|
2022-12-30 18:40:50 +08:00
|
|
|
Vue.component('face', face)
|
|
|
|
Vue.component('face-null', faceNull)
|
2022-12-28 10:08:51 +08:00
|
|
|
|
|
|
|
Vue.prototype.linkToGoods = function (goodsId, skuId) { // 跳转买家端商品
|
2023-01-10 18:44:39 +08:00
|
|
|
if (localStorage.getItem('storeFlag') == 'false') {
|
2023-02-16 15:57:18 +08:00
|
|
|
window.open(`${config.PC_URL}goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
|
2023-01-10 18:44:39 +08:00
|
|
|
} else {
|
2023-02-09 16:34:01 +08:00
|
|
|
window.open(`${config.PC_URL}goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
|
2023-01-10 18:44:39 +08:00
|
|
|
}
|
2022-12-28 10:08:51 +08:00
|
|
|
};
|
2023-01-10 18:44:39 +08:00
|
|
|
Vue.prototype.linkToStore = function (storeId) { // 跳转商家端商品
|
2022-12-30 18:40:50 +08:00
|
|
|
console.log(`${config.PC_URL}/Merchant?id=${storeId}`)
|
|
|
|
window.open(`${config.PC_URL}/Merchant?id=${storeId}`, '_blank')
|
|
|
|
};
|
|
|
|
// 订单跳转商家订单页面
|
2023-01-10 18:44:39 +08:00
|
|
|
Vue.prototype.linkToOrders = function (sn) {
|
|
|
|
if (localStorage.getItem('storeFlag') == 'false') {
|
|
|
|
// 商家
|
2023-01-31 17:42:36 +08:00
|
|
|
window.open(`${config.PC_STORE}order-detail?sn=${sn}`, '_blank')
|
2023-01-10 18:44:39 +08:00
|
|
|
} else {
|
|
|
|
// 用户
|
2023-02-09 16:34:01 +08:00
|
|
|
window.open(`${config.PC_URL}home/OrderDetail?sn=${sn}`, '_blank')
|
2023-01-10 18:44:39 +08:00
|
|
|
}
|
2022-12-29 18:20:06 +08:00
|
|
|
};
|
2023-01-10 18:44:39 +08:00
|
|
|
|
2022-12-28 10:08:51 +08:00
|
|
|
const Instance = new Vue({
|
|
|
|
router,
|
|
|
|
store,
|
|
|
|
mixins: [MainMixin],
|
|
|
|
render: h => h(App),
|
|
|
|
}).$mount('#app')
|
|
|
|
export default Instance
|