From 726ae1f8568d53f8cb4491a28bb7820881172fca Mon Sep 17 00:00:00 2001 From: mabo Date: Wed, 4 Aug 2021 17:07:39 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E7=AC=AC=E4=B8=80=E6=AC=A1=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=86=E7=B1=BB=E6=9C=AA=E5=B1=95=E7=A4=BA=202.=20?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=80=89=E6=8B=A9=E5=99=A8=EF=BC=8C=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E5=BC=80=E5=90=AF=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=203.=20=E4=BB=8E=E6=96=B0=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=E6=A5=BC=E5=B1=82=EF=BC=8C=E6=A5=BC=E5=B1=82bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=204.=20=E6=90=9C=E7=B4=A2=E7=83=AD=E8=AF=8D=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=98=AF=E8=BF=94=E5=9B=9Enull=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=8A=A5=E9=94=99=205.=20=E9=A6=96=E9=A1=B5=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98=206.=20=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=A1=B9=E7=BC=93=E5=AD=98=E3=80=81=E6=B7=BB=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=207.=20=E5=BA=97=E9=93=BA=E5=88=86=E7=B1=BB=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB=E4=BF=AE=E6=94=B9=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E7=88=B6=E7=BA=A7=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/Search.vue | 8 +- buyer/src/components/nav/CateNav.vue | 5 +- buyer/src/components/nav/GoodsClassNav.vue | 18 +- buyer/src/components/nav/cateNav.vue | 5 +- buyer/src/pages/Index.vue | 1 - .../pages/home/memberCenter/CommentList.vue | 2 +- buyer/src/vuex/store.js | 4 +- manager/src/store/modules/app.js | 28 +- manager/src/views/Main.vue | 18 +- .../views/change-password/change-password.vue | 1 - .../lili-floor-renovation/modelFormItem.vue | 797 +++++++++------- .../lili-floor-renovation/renovation.vue | 895 +++++++++++++++++- .../views/personal-center/personal-center.vue | 2 - seller/src/config/index.js | 16 +- .../src/views/goods/goods-manage/category.vue | 69 +- 15 files changed, 1383 insertions(+), 486 deletions(-) diff --git a/buyer/src/components/Search.vue b/buyer/src/components/Search.vue index d82ef8cc..6c8afeac 100644 --- a/buyer/src/components/Search.vue +++ b/buyer/src/components/Search.vue @@ -82,13 +82,17 @@ export default { }, computed: { promotionTags () { - return JSON.parse(this.$store.state.hotWordsList) + if (this.$store.state.hotWordsList) { + return JSON.parse(this.$store.state.hotWordsList) + } else { + return [] + } } }, created () { this.searchData = this.$route.query.keyword if (!this.hover) { // 首页顶部固定搜索栏不调用热词接口 - // 搜索热词每一小时请求一次 + // 搜索热词每5分钟请求一次 const reloadTime = storage.getItem('hotWordsReloadTime') const time = new Date().getTime() - 5 * 60 * 1000 if (!reloadTime) { diff --git a/buyer/src/components/nav/CateNav.vue b/buyer/src/components/nav/CateNav.vue index e64111d1..95e90d5c 100644 --- a/buyer/src/components/nav/CateNav.vue +++ b/buyer/src/components/nav/CateNav.vue @@ -81,10 +81,10 @@ export default { }, data () { return { - cateList: [], // 分类数据 panel: false, // 二级分类展示 panelData: [], // 二级分类数据 - showFirstList: false // 始终展示一级列表 + showFirstList: false, // 始终展示一级列表 + cateList: [] // 商品分类 } }, computed: { @@ -98,6 +98,7 @@ export default { getCategory(0).then(res => { if (res.success) { this.cateList = res.result; + this.$store.commit('SET_CATEGORY', res.result) // 过期时间 var expirationTime = new Date().setHours(new Date().getHours() + 1); // 存放过期时间 diff --git a/buyer/src/components/nav/GoodsClassNav.vue b/buyer/src/components/nav/GoodsClassNav.vue index f249f8cc..9a3db4c0 100644 --- a/buyer/src/components/nav/GoodsClassNav.vue +++ b/buyer/src/components/nav/GoodsClassNav.vue @@ -183,10 +183,14 @@ export default { multSelected: [], // 多选分类 selectedItem: [], // 已选分类集合 顶部展示 brandIds: [], // 品牌id合集 - params: {}, // 请求参数 - cateList: [] // 全部商品分类 + params: {} // 请求参数 }; }, + computed: { + cateList () { // 商品分类 + return this.$store.state.category + } + }, watch: { selectedItem: { // 监听已选条件,来调用列表接口 @@ -228,8 +232,12 @@ export default { methods: { getNav () { // 获取商品分类,分类下展示 if (!this.$route.query.categoryId) return - - this.cateList = JSON.parse(localStorage.getItem('category')) + if (!this.cateList.length) { // 商品分类存储在localstorage,接口未调用成功前再次刷新数据 + setTimeout(() => { + this.getNav() + }, 500) + return + } const arr = this.$route.query.categoryId.split(',') if (arr.length > 0) { this.tabBar = this.cateList.filter(e => { @@ -416,7 +424,7 @@ export default { background: #fff; border: 1px solid #999; padding: 0 8px; - width: 85px; + min-width: 85px; text-align: center; margin: 0 3px; &:hover { diff --git a/buyer/src/components/nav/cateNav.vue b/buyer/src/components/nav/cateNav.vue index e64111d1..95e90d5c 100644 --- a/buyer/src/components/nav/cateNav.vue +++ b/buyer/src/components/nav/cateNav.vue @@ -81,10 +81,10 @@ export default { }, data () { return { - cateList: [], // 分类数据 panel: false, // 二级分类展示 panelData: [], // 二级分类数据 - showFirstList: false // 始终展示一级列表 + showFirstList: false, // 始终展示一级列表 + cateList: [] // 商品分类 } }, computed: { @@ -98,6 +98,7 @@ export default { getCategory(0).then(res => { if (res.success) { this.cateList = res.result; + this.$store.commit('SET_CATEGORY', res.result) // 过期时间 var expirationTime = new Date().setHours(new Date().getHours() + 1); // 存放过期时间 diff --git a/buyer/src/pages/Index.vue b/buyer/src/pages/Index.vue index 58b25703..5ed806ed 100644 --- a/buyer/src/pages/Index.vue +++ b/buyer/src/pages/Index.vue @@ -3,7 +3,6 @@ - diff --git a/buyer/src/pages/home/memberCenter/CommentList.vue b/buyer/src/pages/home/memberCenter/CommentList.vue index a9e2612f..0ebaa688 100644 --- a/buyer/src/pages/home/memberCenter/CommentList.vue +++ b/buyer/src/pages/home/memberCenter/CommentList.vue @@ -34,7 +34,7 @@ {{item.grade==='GOOD'?'好评' : item.grade === 'WORSE'?'差评' : '中评'}} - +
{{item.content}}
{{item.content}} diff --git a/buyer/src/vuex/store.js b/buyer/src/vuex/store.js index f3bdb17e..faaebfc9 100644 --- a/buyer/src/vuex/store.js +++ b/buyer/src/vuex/store.js @@ -9,11 +9,11 @@ Vue.use(Vuex); export default new Vuex.Store({ state: { - category: [], // 全部分类 navList: [], // 首页快捷导航 cartNum: storage.getItem('cartNum') || 0, logoImg: require('@/assets/images/logo2.png'), - hotWordsList: storage.getItem('hotWordsList') || [] + hotWordsList: storage.getItem('hotWordsList'), + category: localStorage.getItem('category') }, getters, actions, diff --git a/manager/src/store/modules/app.js b/manager/src/store/modules/app.js index 91636214..a205b31e 100644 --- a/manager/src/store/modules/app.js +++ b/manager/src/store/modules/app.js @@ -1,7 +1,6 @@ import { otherRouter } from '@/router/router'; import { router } from '@/router/index'; import Util from '@/libs/util'; -import Cookies from 'js-cookie'; import Vue from 'vue'; const app = { @@ -14,11 +13,7 @@ const app = { currNavTitle: "", // 当前顶部菜单标题 cachePage: [], lang: '', - isFullScreen: false, - openedSubmenuArr: [], // 要展开的菜单数组 - menuTheme: 'dark', // 主题 - themeColor: '', - pageOpenedList: [{ + pageOpenedList: [{ // 打开过的页面,顶部历史菜单项 title: '首页', path: '', name: 'home_index' @@ -34,9 +29,7 @@ const app = { // 面包屑数组 左侧菜单 menuList: [], tagsList: [...otherRouter.children], //这块是面包屑的内容不能删除 - routers: [ - otherRouter - ], + routers: [otherRouter], messageCount: 0, // 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js) dontCache: ['test', 'test'] @@ -67,25 +60,11 @@ const app = { state.currNavTitle = v; }, setTagsList(state, list) { - state.tagsList.push(...list); }, updateMenulist(state, routes) { state.menuList = routes; }, - addOpenSubmenu(state, name) { - let hasThisName = false; - let isEmpty = false; - if (name.length == 0) { - isEmpty = true; - } - if (state.openedSubmenuArr.indexOf(name) > -1) { - hasThisName = true; - } - if (!hasThisName && !isEmpty) { - state.openedSubmenuArr.push(name); - } - }, closePage(state, name) { state.cachePage.forEach((item, index) => { if (item == name) { @@ -158,9 +137,6 @@ const app = { localStorage.lang = lang; Vue.config.lang = lang; }, - clearOpenedSubmenu(state) { - state.openedSubmenuArr.length = 0; - }, setMessageCount(state, count) { state.messageCount = count; }, diff --git a/manager/src/views/Main.vue b/manager/src/views/Main.vue index e2d81c79..564ee54a 100644 --- a/manager/src/views/Main.vue +++ b/manager/src/views/Main.vue @@ -88,9 +88,6 @@ export default { avatarPath() { return localStorage.avatorImgPath; }, - cachePage() { - return this.$store.state.app.cachePage; - }, lang() { return this.$store.state.app.lang; } @@ -99,10 +96,6 @@ export default { methods: { init() { // 菜单初始化 - let pathArr = util.setCurrentPath(this, this.$route.name); - if (pathArr.length >= 2) { - this.$store.commit("addOpenSubmenu", pathArr[1].name); - } let userInfo = JSON.parse(Cookies.get("userInfo")); this.userInfo = userInfo; @@ -138,9 +131,7 @@ export default { } // 退出登录 else if (name === "loginOut") { - Cookies.set("accessToken", ""); this.$store.commit("logout", this); - this.$store.commit("clearOpenedSubmenu"); this.setStore("accessToken", ""); this.setStore("refreshToken", ""); this.$router.push({ path: "/login" }); @@ -177,16 +168,9 @@ export default { watch: { $route(to, from) { this.$store.commit("setCurrentPageName", to.name); - let pathArr = util.setCurrentPath(this, to.name); - if (pathArr.length > 2) { - this.$store.commit("addOpenSubmenu", pathArr[1].name); - } this.checkTag(to.name); localStorage.currentPageName = to.name; - }, - lang() { - util.setCurrentPath(this, this.$route.name); // 在切换语言时用于刷新面包屑 - }, + } }, mounted() { this.init(); diff --git a/manager/src/views/change-password/change-password.vue b/manager/src/views/change-password/change-password.vue index a24f9254..5633d9ac 100644 --- a/manager/src/views/change-password/change-password.vue +++ b/manager/src/views/change-password/change-password.vue @@ -116,7 +116,6 @@ export default { content: "修改密码成功,需重新登录", onOk: () => { this.$store.commit("logout", this); - this.$store.commit("clearOpenedSubmenu"); this.$router.push({ name: "login", }); diff --git a/manager/src/views/lili-floor-renovation/modelFormItem.vue b/manager/src/views/lili-floor-renovation/modelFormItem.vue index fc47c4a6..f468fe3a 100644 --- a/manager/src/views/lili-floor-renovation/modelFormItem.vue +++ b/manager/src/views/lili-floor-renovation/modelFormItem.vue @@ -1,389 +1,484 @@ diff --git a/manager/src/views/lili-floor-renovation/renovation.vue b/manager/src/views/lili-floor-renovation/renovation.vue index 9bbbb822..a2cda18b 100644 --- a/manager/src/views/lili-floor-renovation/renovation.vue +++ b/manager/src/views/lili-floor-renovation/renovation.vue @@ -14,8 +14,11 @@
- -
+ +
+ + +