diff --git a/src/router/index.js b/src/router/index.js index 33817c3..4e8610b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -36,6 +36,17 @@ const routes = [ roles: ['admin', 'editor'], tapName: 'plane' } + }, + { + path: '/home/set', + component: () => import('@/views/layout/components/main/home/set'), + meta: { + title: '设置', + icon: 'iconfont icon-shezhi', + roles: ['admin', 'editor'], + tapName: 'plane', + hidden: true + } } ] }, diff --git a/src/styles/myIcon.scss b/src/styles/myIcon.scss index 8791a8c..6534b34 100644 --- a/src/styles/myIcon.scss +++ b/src/styles/myIcon.scss @@ -1 +1 @@ -@import 'https://at.alicdn.com/t/c/font_3703467_1z89u99sr5w.css'; //iconfont阿里巴巴 \ No newline at end of file +@import 'https://at.alicdn.com/t/c/font_3703467_793cqnnxv0f.css'; //iconfont阿里巴巴 \ No newline at end of file diff --git a/src/views/layout/components/headbar.vue b/src/views/layout/components/headbar.vue index 022ef80..dc84547 100644 --- a/src/views/layout/components/headbar.vue +++ b/src/views/layout/components/headbar.vue @@ -2,75 +2,59 @@
- +
- +
+ - - 退出登录 + + + + + 简体中文 + + + + 语言设置 + + + 设置 + 退出登录
+
- +
- - + + - + @@ -161,7 +126,9 @@ export default { shop_id: this.$store.state.user.shop_id, // 商铺id(默认为本店) 过滤条件 drawer: false, getQuestInterval: null, // 用于销毁时间轴 - animationTrumpet: true // 喇叭动画 + animationTrumpet: true, // 喇叭动画 + currentLang: 'zh-CN', + languagePopoverVisible: false // 控制语言弹出框可见 } }, components: { @@ -266,9 +233,9 @@ export default { orderIcon () { if ( this.pendingCount + - this.processingCount + - this.shippedCount + - this.requestedCount === + this.processingCount + + this.shippedCount + + this.requestedCount === 0 ) { return 'iconfont icon-meiyoudingdan-01' @@ -292,7 +259,7 @@ export default { /** * @description: 计算订单数量 订单变化播放声音 显示在图标右上角小红圈内 */ - computeQuestList () {}, + computeQuestList () { }, /** * @description: 刷新当前页面 */ @@ -304,6 +271,7 @@ export default { this.$store.dispatch('fetchAdminList') // 获取管理员列表 this.$store.dispatch('fetchSiteList') // 获取站点列表 this.$store.dispatch('fetchRouteList') // 获取航线列表 + this.$store.dispatch('fetchNoflyData', this.$store.state.user.shop_id)// 获取禁飞区数据 注意这里要有shopid 总管理员再操作其他商铺飞机时 要刷新此缓存 需要对应商铺的禁飞区数据 this.$store.dispatch('fetchCategoryList') // 获取分类列表(小程序) this.$store.dispatch('fetchPaidOrderList') // 获取订单列表 this.$store.dispatch('fetchMessageList')// 获取管理员公告列表 并弹出公告框 @@ -315,6 +283,21 @@ export default { this.$store .dispatch('user/destroyUserAsync') .then(this.$router.push('/login')) + }, + handleCommand (command) { + if (command === 'go-setting') { + this.$router.push('/home/set') + } else if (command === 'logout') { + this.logout() + } + }, + changeLang (lang) { + this.currentLang = lang + // 如果用 vue-i18n: + // this.$i18n.locale = lang; + localStorage.setItem('lang', lang) + this.$message.success(`语言切换为:${lang === 'zh-CN' ? '简体中文' : lang}`) + this.languagePopoverVisible = false // 切换后关闭子菜单 } }, watch: { @@ -346,7 +329,7 @@ export default { } } }, - created () {} + created () { } } diff --git a/src/views/layout/components/main/home/set.vue b/src/views/layout/components/main/home/set.vue new file mode 100644 index 0000000..4edb614 --- /dev/null +++ b/src/views/layout/components/main/home/set.vue @@ -0,0 +1,76 @@ + + + + +