From 86e72a64a74a87c87bf5374efd9a85ade4a966ee Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Wed, 18 Jun 2025 21:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=AF=AD=E8=A8=80=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=80=89=E9=A1=B9=20=20=E7=A8=8B=E5=BA=8F=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/router/index.js | 11 ++ src/styles/myIcon.scss | 2 +- src/views/layout/components/headbar.vue | 159 ++++++++---------- src/views/layout/components/main/home/set.vue | 76 +++++++++ 4 files changed, 159 insertions(+), 89 deletions(-) create mode 100644 src/views/layout/components/main/home/set.vue 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 @@ + + + + +