Commit dfc54179 by chenxin

Merge branch 'dev2' of http://115.159.76.241/integralMall/integral-mall into dev

# Conflicts:
#	dist/index.html
#	src/router/index.js
parents bfc61e82 54a37c83
......@@ -2,4 +2,4 @@
gio('init','8be12240a3749eab', {});
//custom page code begin here
//custom page code end here
gio('send');</script><link href=./static/css/app.fa637f0f19135872891e9686699a09ea.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.35.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.41.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.06.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.451aecb7500fefa94ef3.js></script><script type=text/javascript src=./static/js/app.9833a7a922f7df35ee2d.js></script></body></html>
\ No newline at end of file
gio('send');</script><link href=./static/css/app.15ac1aa39dd8b8e018b70f528db45463.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.35.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.41.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.06.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.40751fde931b32dd5f6c.js></script><script type=text/javascript src=./static/js/app.3f05d2aed65b84dc21ac.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
export default {
// eslint-disable-next-line
api: process.env['NODE_ENV'] === 'development' ? 'http://gicdev.demogic.com/' : window.location.protocol + '//' + window.location.host + '/' || ''
// /dmApi/
// http://gicdev.demogic.com/
};
......@@ -13,6 +13,7 @@ import store from './store';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/theme/index.css';
import '../static/fonts/iconfont.js';
import limit from '@/utils/limiting';
Vue.use(ElementUI);
Vue.use(VueAxios, axios);
// import vueGicStoreLinkage from '@gic-test/vue-gic-store-linkage';
......@@ -21,10 +22,23 @@ Vue.use(VueAxios, axios);
Vue.axios.defaults.withCredentials = true; // 跨域cookie访问
Vue.config.productionTip = false;
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
/* eslint-disable no-new */
limit({
createApp() {
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
});
}
});
// new Vue({
// el: '#app',
// router,
// store,
// components: { App },
// template: '<App/>'
// });
import Vue from 'vue';
import Router from 'vue-router';
import store from '@/store/index';
import bus from '../assets/eventBus.js';
import VueClipboard from 'vue-clipboard2';
import main from '../views/main';
import gift from '../views/goods/gift/gift';
......@@ -14,9 +16,11 @@ import editDeliver from '../views/setting/editDeliver';
import orderDetail from '../views/order/orderDetail';
import recordList from '../views/setting/recordList';
import convenSet from '../views/setting/convenSet';
// import testStore from '../views/goods/coupon/testStore.vue';
Vue.use(VueClipboard);
/**
* meta useMenuLimit 被上标记为true的路由,进入时将会与store中允许的菜单路由进行比较,如果不存在将会被重定向
*/
const router = new Router({
// mode: 'history',
// base: '/integral-mall',
......@@ -29,7 +33,10 @@ const router = new Router({
{
path: '/gift',
name: 'gift',
component: gift
component: gift,
meta: {
useMenuLimit: true
}
},
{
path: '/giftInfo',
......@@ -39,7 +46,10 @@ const router = new Router({
{
path: '/coupon',
name: 'coupon',
component: coupon
component: coupon,
meta: {
useMenuLimit: true
}
},
{
path: '/couponInfo',
......@@ -49,7 +59,10 @@ const router = new Router({
{
path: '/giftExchange',
name: 'giftExchange',
component: giftExchange
component: giftExchange,
meta: {
useMenuLimit: true
}
},
{
path: '/orderDetail',
......@@ -59,17 +72,26 @@ const router = new Router({
{
path: '/couponExchange',
name: 'couponExchange',
component: couponExchange
component: couponExchange,
meta: {
useMenuLimit: true
}
},
{
path: '/refundList',
name: 'refundList',
component: refundList
component: refundList,
meta: {
useMenuLimit: true
}
},
{
path: '/deliverSet',
name: 'deliverSet',
component: deliverSet
component: deliverSet,
meta: {
useMenuLimit: true
}
},
{
path: '/editDeliver',
......@@ -79,21 +101,37 @@ const router = new Router({
{
path: '/recordList',
name: 'recordList',
component: recordList
component: recordList,
meta: {
useMenuLimit: true
}
},
{
path: '/convenSet',
name: 'convenSet',
component: convenSet
component: convenSet,
meta: {
useMenuLimit: true
}
}
]
}
]
});
// router.beforeEach((to, from, next) => {
// // ...
// console.log(123456789, to);
// next();
// });
router.beforeEach((to, from, next) => {
if (from.meta.useMenuLimit == true) {
if (store.state.product.canUseMenuUrl.includes(to.path)) {
next();
} else {
// 不允许访问则重置到menu的第一个路由
// 全部不选(没有积分商城任何菜单时,limit.js catch
bus.$emit('updateLeft', store.state.product.canUseMenuUrl[0]); // 更新左侧
next(store.state.product.canUseMenuUrl[0]);
}
} else {
next();
}
});
export default router;
......@@ -2,7 +2,8 @@
const state = {
all: 0,
cartData: [],
total: 0
total: 0,
canUseMenuUrl: []
};
// getters
......@@ -53,6 +54,10 @@ const mutations = {
state.cartData.splice(i, 1);
}
}
},
// 更新可用菜单可用url
mutations_updateMenuUrl(state, url) {
state.canUseMenuUrl = url;
}
};
......
import request from '@/service/request.js';
import globalConfig from '@/config/index';
import store from '@/store/index';
export default config => {
const { createApp } = config;
window.onload = async function() {
try {
// 获取用户企业id
let loginUserRes = await request.get('/api-auth/get-current-memu-data?project=integral-mall&path=giftExchange&requestProject=integral-mall');
const leftMenu = loginUserRes.data.result.leftMenu || [];
let _leftMenuLimit = [];
leftMenu.forEach(element => {
if (element.level4List) {
element.level4List.forEach(level4 => {
_leftMenuLimit.push(`/${level4.menuUrl}`);
});
} else {
_leftMenuLimit.push(`/${element.menuUrl}`);
}
});
_leftMenuLimit = [...new Set(_leftMenuLimit)];
store.commit('mutations_updateMenuUrl', _leftMenuLimit); // 更新企业id
createApp();
} catch (error) {
// 未登录
window.location.href = globalConfig.api + 'gic-web/';
}
};
};
......@@ -3,7 +3,7 @@
<vue-gic-header :projectName="projectName" :collapseFlag="collapseFlag" @collapseTag="collapseTag" @toRouterView="toRouterView"></vue-gic-header>
<div class="mall-content-container">
<div class="left-menu">
<vue-gic-aside-menu :projectName="projectName" :leftModulesName="leftModulesName" :collapseFlag="collapseFlag" style="display:inline-block;height:100%"></vue-gic-aside-menu>
<vue-gic-aside-menu ref="leftmenu" :projectName="projectName" :leftModulesName="leftModulesName" :collapseFlag="collapseFlag" style="display:inline-block;height:100%"></vue-gic-aside-menu>
</div>
<div class="goods-manege-content" :style="{ marginLeft: widthData }">
<div :style="{ minHeight: mallHeight + 'px' }">
......@@ -34,6 +34,10 @@ export default {
bus.$on('widthData', function(widthData) {
that.widthData = widthData;
});
bus.$on('updateLeft', key => {
// 刷新左侧菜单
that.$refs.leftmenu.handleSelect(key);
});
},
computed: {},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment