Browse Source

feat: 前端问题修复

v1.0.1
jiannibang 3 years ago
parent
commit
934b6bb137
  1. 4
      src/components/Search/Search.vue
  2. 16
      src/router/index.js
  3. 3
      src/views/Index/Index.vue

4
src/components/Search/Search.vue

@ -222,6 +222,7 @@ function close() {
width: 264px;
margin-top: 40px;
gap: 12px 24px;
align-items: start;
}
}
.tabs-wrapper {
@ -289,7 +290,8 @@ function close() {
white-space: nowrap;
text-overflow: ellipsis;
padding: 0 32px;
display: inline-flex;
display: inline-block;
max-width: 170px;
align-items: center;
}
.medal {

16
src/router/index.js

@ -30,19 +30,17 @@ router.beforeEach(async to => {
const { data, code } = res
if (code === ERR_OK) {
if (!router.hasRoute('home')) {
//推荐卡片列表长度为0时说明不需要推荐页面 直接从导航栏列表删除
if (!data.columnList.length) {
store.SET_SIDEBAR_LIST(store.sidebarList.slice(1))
}
//store存储的首页卡片数据长度不等于请求的卡片数据长度时才能去重新提交到store中 防止重复提交
if (store.indexList?.columnList?.length !== data.columnList.length) {
const {
data: { searchList, recommendList }
} = await getQMGoShopData()
store.SET_INDEX_LIST({ ...data, recommendList, hotSearch: searchList })
}
store.SET_SELECTED_MODULE(store.sidebarList[0].title)
router.addRoute(dynamicRoutes(data.columnList))
router.addRoute({
path: '/index',
name: 'home',
component: import(/* webpackChunkName: "Home" */ '@/views/Index/Index')
})
return to.fullPath
}
}

3
src/views/Index/Index.vue

@ -274,8 +274,9 @@ const handleFood = id => {
white-space: nowrap;
text-overflow: ellipsis;
padding: 0 32px;
display: inline-flex;
display: inline-block;
align-items: center;
max-width: 176px;
}
.medal {

Loading…
Cancel
Save