Commit 4c750b82 authored by zhanglw's avatar zhanglw

面包屑

parent 812c1049
...@@ -6,7 +6,8 @@ const state = { ...@@ -6,7 +6,8 @@ const state = {
withoutAnimation: false withoutAnimation: false
}, },
device: 'desktop', device: 'desktop',
size: Cookies.get('size') || 'mini' size: Cookies.get('size') || 'mini',
currentMenu: {}
} }
const mutations = { const mutations = {
...@@ -30,6 +31,9 @@ const mutations = { ...@@ -30,6 +31,9 @@ const mutations = {
SET_SIZE: (state, size) => { SET_SIZE: (state, size) => {
state.size = size state.size = size
Cookies.set('size', size) Cookies.set('size', size)
},
SET_CURRENT_MENU: (state, currentMenu) => {
state.currentMenu = currentMenu
} }
} }
...@@ -45,6 +49,9 @@ const actions = { ...@@ -45,6 +49,9 @@ const actions = {
}, },
setSize({ commit }, size) { setSize({ commit }, size) {
commit('SET_SIZE', size) commit('SET_SIZE', size)
},
setCurrentMenu({ commit }, currentMenu) {
commit('SET_CURRENT_MENU', currentMenu)
} }
} }
......
<template>
<div class="showcase">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>{{ this.$store.state.app.currentMenu.name||'' }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
</template>
<script>
export default {
data() {
return {
visible: false
}
},
mounted() {
this.$nextTick(() => {
})
},
methods: {
click() {
this.visible = !this.visible
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.showcase {
padding: 1px 15px 1px;
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: 400;
}
</style>
...@@ -8,7 +8,7 @@ export default { ...@@ -8,7 +8,7 @@ export default {
data() { data() {
return { return {
menus: [ menus: [
{ name: '首页', active: true }, { name: '优质产品' }, { name: '优质供应商' }, { name: '解决方案与服务' }, { name: '软件系统' }, { name: '专业培训' }, { name: '行业资讯' }, { name: '信息发布' } { name: '首页', url: '/home' }, { name: '优质产品', url: '/product' }, { name: '优质供应商' }, { name: '解决方案与服务' }, { name: '软件系统' }, { name: '专业培训' }, { name: '行业资讯' }, { name: '信息发布' }
], ],
currentMenuObj: null currentMenuObj: null
} }
...@@ -16,11 +16,13 @@ export default { ...@@ -16,11 +16,13 @@ export default {
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.currentMenuObj = this.menus[0] this.currentMenuObj = this.menus[0]
this.$store.dispatch('app/setCurrentMenu', this.currentMenuObj)
}) })
}, },
methods: { methods: {
menuClick(item) { menuClick(item) {
this.currentMenuObj = item this.currentMenuObj = item
this.$router.push({ path: item.url || '/home' })
} }
} }
} }
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
data() { data() {
return { return {
menus: [ menus: [
{ name: '首页', active: true }, { name: '优质产品' }, { name: '优质供应商' }, { name: '解决方案与服务' }, { name: '软件系统' }, { name: '专业培训' }, { name: '行业资讯' }, { name: '信息发布' } { name: '首页', url: '/home' }, { name: '优质产品', url: '/product' }, { name: '优质供应商' }, { name: '解决方案与服务' }, { name: '软件系统' }, { name: '专业培训' }, { name: '行业资讯' }, { name: '信息发布' }
], ],
currentMenuObj: null currentMenuObj: null
} }
...@@ -25,11 +25,13 @@ export default { ...@@ -25,11 +25,13 @@ export default {
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.currentMenuObj = this.menus[this.menuIndex] this.currentMenuObj = this.menus[this.menuIndex]
this.$store.dispatch('app/setCurrentMenu', this.currentMenuObj)
}) })
}, },
methods: { methods: {
menuClick(item) { menuClick(item) {
this.currentMenuObj = item this.currentMenuObj = item
this.$router.push({ path: item.url || '/home' })
} }
} }
} }
......
...@@ -10,12 +10,7 @@ ...@@ -10,12 +10,7 @@
</div> </div>
</div> </div>
<div class="content-box"> <div class="content-box">
<div class="showcase"> <breadcrumb />
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>xxx</el-breadcrumb-item>
</el-breadcrumb>
</div>
</div> </div>
<div style="width:100vw;height: 100vh" /> <div style="width:100vw;height: 100vh" />
<home-footer ref="homeFooter" /> <home-footer ref="homeFooter" />
...@@ -25,10 +20,11 @@ ...@@ -25,10 +20,11 @@
import titleMenus from '../components/titleMenusV2' import titleMenus from '../components/titleMenusV2'
import userLogin from '../components/userLoginV2' import userLogin from '../components/userLoginV2'
import languageSetting from '../components/languageSettingV2' import languageSetting from '../components/languageSettingV2'
import breadcrumb from '../components/breadcrumb'
import homeFooter from '../components/homeFooter' import homeFooter from '../components/homeFooter'
export default { export default {
components: { titleMenus, userLogin, languageSetting, homeFooter }, components: { titleMenus, userLogin, languageSetting, breadcrumb, homeFooter },
dicts: ['product_type', 'area_province'], dicts: ['product_type', 'area_province'],
data() { data() {
return { return {
...@@ -45,20 +41,7 @@ export default { ...@@ -45,20 +41,7 @@ export default {
}) })
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {},
this.currentProductTypeObj = dict.product_type[0]
},
// 变更产品推送
changeProductPush(item) {
clearTimeout(this.throttle)
this.throttle = setTimeout(() => {
if (this.currentProductTypeObj === item) {
return
}
console.log(item)
this.currentProductTypeObj = item
}, this.throttleTime)
},
// 点击询价 // 点击询价
inquiry(item, type) { inquiry(item, type) {
console.log(item, type) console.log(item, type)
...@@ -110,7 +93,7 @@ export default { ...@@ -110,7 +93,7 @@ export default {
.content-box { .content-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 90px; margin-top: 94px;
user-select: none; user-select: none;
.showcase { .showcase {
width: 90%; width: 90%;
......
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