From 873764b59eae427fd7b58cae682530d9c93304ba Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Fri, 14 Jul 2023 09:19:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=AB=AF=E6=B7=BB=E5=8A=A0=E5=A4=9A=E6=A0=87=E7=AD=BETab?= =?UTF-8?q?=E9=A1=B5=E5=86=85=E5=B5=8C=E6=A8=A1=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/components/lili/config-drawer.vue | 78 ++++++++++++ manager/src/config/index.js | 3 + manager/src/config/setting.json | 6 + manager/src/store/index.js | 2 + manager/src/store/modules/setting.js | 15 +++ manager/src/utils/filters.js | 21 +++- manager/src/views/Main.vue | 111 +++++++++++------- manager/src/views/goods/goods-info/goods.vue | 4 +- .../src/views/goods/goods-info/goodsApply.vue | 4 +- manager/src/views/main.scss | 48 ++++---- manager/src/views/member/list/index.vue | 2 +- .../src/views/member/list/memberRecycle.vue | 3 +- .../order/after-order/afterSaleOrder.vue | 4 +- .../order/after-order/orderComplaint.vue | 4 +- .../views/order/order/fictitiousOrderList.vue | 6 +- manager/src/views/order/order/orderList.vue | 5 +- manager/src/views/seller/bill/bill.vue | 4 +- seller/src/utils/filters.js | 7 +- 18 files changed, 238 insertions(+), 89 deletions(-) create mode 100644 manager/src/components/lili/config-drawer.vue create mode 100644 manager/src/config/setting.json create mode 100644 manager/src/store/modules/setting.js diff --git a/manager/src/components/lili/config-drawer.vue b/manager/src/components/lili/config-drawer.vue new file mode 100644 index 00000000..7e45b6c6 --- /dev/null +++ b/manager/src/components/lili/config-drawer.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/manager/src/config/index.js b/manager/src/config/index.js index d8e2ebb6..c3987fb9 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -13,4 +13,7 @@ module.exports = { port: 10003, //端口 inputMaxLength:'140', //全局输入框默认最大输入长度字 mainColor:"#ff5c58", //主题色 + setting: { + isUseTabsRouter: true, //多标签Tab页模式 + }, }; diff --git a/manager/src/config/setting.json b/manager/src/config/setting.json new file mode 100644 index 00000000..44d624cf --- /dev/null +++ b/manager/src/config/setting.json @@ -0,0 +1,6 @@ +{ + "setting": { + "isUseTabsRouter": true, + "showFooter": false + } +} diff --git a/manager/src/store/index.js b/manager/src/store/index.js index 8f2cf2cf..ff09c5a2 100644 --- a/manager/src/store/index.js +++ b/manager/src/store/index.js @@ -2,6 +2,7 @@ import Vue from "vue"; import Vuex from "vuex"; import app from "./modules/app"; +import setting from './modules/setting'; import user from "./modules/user"; import dict from "./modules/dict"; @@ -21,6 +22,7 @@ const store = new Vuex.Store({ modules: { app, user, + setting, dict } }); diff --git a/manager/src/store/modules/setting.js b/manager/src/store/modules/setting.js new file mode 100644 index 00000000..9fe8e146 --- /dev/null +++ b/manager/src/store/modules/setting.js @@ -0,0 +1,15 @@ +const { setting } = require("@/config"); + +const localSetting = window.localStorage.getItem('admin-setting') +const settingData = { + state: { + setting:localSetting ? JSON.parse(localSetting) : setting, + }, + mutations: { + updateSetting(state, data) { + state.setting = data; + }, + }, +}; + +export default settingData; diff --git a/manager/src/utils/filters.js b/manager/src/utils/filters.js index 95c4d551..fb4e5042 100644 --- a/manager/src/utils/filters.js +++ b/manager/src/utils/filters.js @@ -15,7 +15,7 @@ export function unitPrice(val, unit, location) { } return (unit || '') + price } -// 转义 +// 转义 export function enCode(v1) { var entry = { "'": "'", @@ -32,6 +32,25 @@ export function enCode(v1) { return v1; } +import {router} from "@/router/index"; +/** + * 自定义跳转 + */ +export function customRouterPush(push){ + const setting = window.localStorage.getItem('admin-setting') ? JSON.parse(window.localStorage.getItem('admin-setting')) : {}; + + if(setting.isUseTabsRouter){ + router.push(push) + } + else{ + if(Object.keys(setting).length == 0){router.push(push)} + else{ + let url = router.resolve(push); + window.open(url.href, '_blank'); + } + } +} + /** * 订单来源 diff --git a/manager/src/views/Main.vue b/manager/src/views/Main.vue index 29b28649..5bd6a799 100644 --- a/manager/src/views/Main.vue +++ b/manager/src/views/Main.vue @@ -12,59 +12,67 @@ -
+
-
- - - -
- - + +
+ +
+
+ + + +
+ -
- {{ userInfo.nickName }} - - -
- - {{ - $t("userCenter") - }} - {{ - $t("changePass") - }} - {{ - $t("logout") - }} - - -
+ + +
+ {{ userInfo.nickName }} + +
+ + {{ + $t("userCenter") + }} + {{ + $t("changePass") + }} + {{ + $t("logout") + }} + +
+ +
-
+
-
+
@@ -73,6 +81,8 @@
+ +
@@ -81,29 +91,37 @@ import shrinkableMenu from "./main-parts/shrinkable-menu/shrinkable-menu.vue"; import tagsPageOpened from "./main-parts/tags-page-opened.vue"; import messageTip from "./main-parts/message-tip.vue"; import circleLoading from "@/components/lili/circle-loading.vue"; +import configDrawer from "@/components/lili/config-drawer.vue"; import Cookies from "js-cookie"; import util from "@/libs/util.js"; import { getNoticePage, logout } from "@/api/index"; import { getBaseSite } from "@/api/common"; var client; +const config = require("@/config/index.js"); export default { components: { shrinkableMenu, tagsPageOpened, messageTip, circleLoading, + configDrawer }, data() { return { + config, sliceNum: 5, // 展示nav数量 userInfo: "", // 用户信息 - navType: 1, // nav类型 tipsMessage: "", // 通知消息 domainLogo: "", }; }, computed: { + setting(){ + let data = this.$store.state.setting + + return data.setting + }, loading() { return this.$store.state.app.loading; }, @@ -119,6 +137,9 @@ export default { }, methods: { + handleClickSetting() { + this.$refs.config.open(); + }, init() { // 菜单初始化 let userInfo = JSON.parse(Cookies.get("userInfoManager")); diff --git a/manager/src/views/goods/goods-info/goods.vue b/manager/src/views/goods/goods-info/goods.vue index 94a3b332..7a5f7d38 100644 --- a/manager/src/views/goods/goods-info/goods.vue +++ b/manager/src/views/goods/goods-info/goods.vue @@ -422,10 +422,10 @@ export default { //查看商品详情 showDetail(v) { let id = v.id; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "goods-detail", query: { id: id }, - }); + }) }, }, mounted() { diff --git a/manager/src/views/goods/goods-info/goodsApply.vue b/manager/src/views/goods/goods-info/goodsApply.vue index 7c7080a0..fa7f7222 100644 --- a/manager/src/views/goods/goods-info/goodsApply.vue +++ b/manager/src/views/goods/goods-info/goodsApply.vue @@ -286,10 +286,10 @@ export default { //查看商品详情 showDetail(v) { let id = v.id; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "goods-detail", query: { id: id }, - }); + }) }, }, mounted() { diff --git a/manager/src/views/main.scss b/manager/src/views/main.scss index 814bcb99..f5691e76 100644 --- a/manager/src/views/main.scss +++ b/manager/src/views/main.scss @@ -145,9 +145,8 @@ .header-avator-con { display: flex; align-items: center; - position: absolute; - right: 0; - top: 0; + padding: 0 30px; + justify-content: space-between; height: 100%; @@ -188,27 +187,7 @@ align-items: center; } - .user-dropdown { - &-menu-con { - .main-user-name { - font-size: 14px; - display: inline-block; - cursor: pointer; - margin-right: 5px; - max-width: 200px; - overflow: hidden; - word-wrap: normal; - white-space: nowrap; - text-overflow: ellipsis; - - vertical-align: middle; - overflow: hidden; - - text-align: right; - } - } - } .full-screen-btn-con { display: inline-block; @@ -312,3 +291,26 @@ z-index: 100; top: 1px; } +.nav-item { + cursor: pointer; + width: 30px; + height: 30px; + border-radius: 50%; + border: 1px solid #ededed; + display: flex; + align-items: center; + justify-content: center; + margin: 0 10px; +} +.footer-page-on{ + + width: 100%; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + z-index: 999; +} +.user-module{ + align-items: center; +} diff --git a/manager/src/views/member/list/index.vue b/manager/src/views/member/list/index.vue index cfc86f2f..a85f23e8 100644 --- a/manager/src/views/member/list/index.vue +++ b/manager/src/views/member/list/index.vue @@ -439,7 +439,7 @@ export default { }, //查看会员 detail(row) { - this.$router.push({ name: "member-detail", query: { id: row.id } }); + this.$options.filters.customRouterPush({ name: "member-detail", query: { id: row.id } }) }, //禁用会员 diff --git a/manager/src/views/member/list/memberRecycle.vue b/manager/src/views/member/list/memberRecycle.vue index da293919..8d4a1e33 100644 --- a/manager/src/views/member/list/memberRecycle.vue +++ b/manager/src/views/member/list/memberRecycle.vue @@ -400,7 +400,8 @@ export default { //详细 detail(row) { - this.$router.push({ name: "member-detail", query: { id: row.id } }); + this.$options.filters.customRouterPush({ name: "member-detail", query: { id: row.id } }) + }, //启用会员 enable(v) { diff --git a/manager/src/views/order/after-order/afterSaleOrder.vue b/manager/src/views/order/after-order/afterSaleOrder.vue index 2da5aa25..75bf0c0c 100644 --- a/manager/src/views/order/after-order/afterSaleOrder.vue +++ b/manager/src/views/order/after-order/afterSaleOrder.vue @@ -354,10 +354,10 @@ export default { // 跳转售后详情 detail(v) { let sn = v.sn; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "after-order-detail", query: { sn: sn }, - }); + }) }, // 售后筛选 serviceStatusClick(item) { diff --git a/manager/src/views/order/after-order/orderComplaint.vue b/manager/src/views/order/after-order/orderComplaint.vue index b55dc829..fcbabb1e 100644 --- a/manager/src/views/order/after-order/orderComplaint.vue +++ b/manager/src/views/order/after-order/orderComplaint.vue @@ -244,10 +244,10 @@ //投诉详情 detail(v) { let id = v.id; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "order-complaint-detail", query: { id: id }, - }); + }) }, }, mounted() { diff --git a/manager/src/views/order/order/fictitiousOrderList.vue b/manager/src/views/order/order/fictitiousOrderList.vue index 2ce2abf1..24159e1d 100644 --- a/manager/src/views/order/order/fictitiousOrderList.vue +++ b/manager/src/views/order/order/fictitiousOrderList.vue @@ -267,13 +267,11 @@ export default { }, // 订单详情 detail (v) { - console.log(v.orderType); let sn = v.sn; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "order-detail", query: { sn: sn, orderType: v.orderType }, - }); - + }) }, // 订单筛选 orderStatusClick(item) { diff --git a/manager/src/views/order/order/orderList.vue b/manager/src/views/order/order/orderList.vue index 3bac0f1e..e19727c7 100644 --- a/manager/src/views/order/order/orderList.vue +++ b/manager/src/views/order/order/orderList.vue @@ -383,10 +383,11 @@ export default { // 跳转详情页面 detail(v) { let sn = v.sn; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "order-detail", query: { sn: sn }, - }); + }) + }, // 导出订单 async exportOrder() { diff --git a/manager/src/views/seller/bill/bill.vue b/manager/src/views/seller/bill/bill.vue index d5251960..c9490118 100644 --- a/manager/src/views/seller/bill/bill.vue +++ b/manager/src/views/seller/bill/bill.vue @@ -197,10 +197,10 @@ export default { }, detail(v) { // 账单详情 let id = v.id; - this.$router.push({ + this.$options.filters.customRouterPush({ name: "bill-detail", query: { id: id }, - }); + }) }, remove(v) { this.$Modal.confirm({ diff --git a/seller/src/utils/filters.js b/seller/src/utils/filters.js index 356d25f3..6f61e415 100644 --- a/seller/src/utils/filters.js +++ b/seller/src/utils/filters.js @@ -43,8 +43,11 @@ export function customRouterPush(push){ router.push(push) } else{ - let url = router.resolve(push); - window.open(url.href, '_blank'); + if(Object.keys(setting).length == 0){router.push(push)} + else{ + let url = router.resolve(push); + window.open(url.href, '_blank'); + } } }