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 @@ - - - - - - - - - - - - 编辑 - - - - - - - - - - 编辑 - - - - - - - - - - - - - - - - - - - 编辑 - - - - - - - - - - 编辑 - - - - - - - - - - - - - - - - - - - - - - - - 广告图片 - 1200*自定义 - - - - 编辑 - - - - - - - - - 删除 - - + + + + + + + + + + + 编辑 - - - - - - - - - - - - 建议尺寸:{{ selected.size }} - - - 图片链接:{{ selected.url }} 选择链接 - - - 选择图片:选择图片 - + + + + + + + + + + 编辑 + - - - - - - - + + + + + + + + + + + + + + + + + 编辑 + + + + + + + + + + 编辑 + + + + + + + + + + + + + + + + + + + + + + + + 广告图片 + 1200*自定义 + + + + 编辑 + + + + + + + + + 删除 + + + + + + + + + + + + + 建议尺寸:{{ selected.size }} + + + 图片链接:{{ selected.url }} + 选择链接 + + + 选择图片:选择图片 + + + + + + + + + + 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 @@ - - 保存模板 还原模板 + + + 保存模板 + 还原模板 +
广告图片
1200*自定义