feat(buyer): 增强搜索功能并提升用户体验

- 新增 `getStoreById` 接口方法,用于获取包含评分在内的店铺信息
- `Search.vue` 新增搜索建议面板,展示搜索历史和热词,优化搜索体验
- 新增 `SearchSuggest.vue` 组件,用于展示搜索建议和搜索历史
- `App.vue` 根据路由元信息按条件设置页面标题
- 优化多个组件的布局与样式,让整体风格更统一
- 重构多个组件的跳转逻辑,改用路由跳转(`router.push`)替代新开窗口(`window.open`),提升用户体验
This commit is contained in:
pikachu1995@126.com
2026-10-02 15:26:58 +08:00
parent 4777eb2dd6
commit 8410179885
44 changed files with 2116 additions and 674 deletions

View File

@@ -7,7 +7,7 @@
<el-icon :size="20"><component :is="resolveIcon(item.icon)" /></el-icon>
<p class="barTitle" v-if="item.titleShow"> {{item.title}}</p>
<div class="circle" v-if="item.title === '购物车'">
{{cartNum < 100 ? cartNum : 99}}
{{ Number(cartNum) > 99 ? '99+' : cartNum }}
</div>
</el-tooltip>
</div>
@@ -79,21 +79,15 @@ export default {
this.handleDrawer = false
switch (val.title) {
case '会员中心':
this.openBlank('/home')
this.$router.push('/home')
break;
case '我的资产':
this.openBlank('/home/MoneyManagement')
this.$router.push('/home/MoneyManagement')
break;
}
}
}
},
openBlank (path) { // 新页面打开地址
let routerUrl = this.$router.resolve({
path: path
})
window.open(routerUrl.href, '_blank')
},
getCartList () { // 获取购物车列表
cartCount().then(res => {
this.$store.commit('SET_CARTNUM', res.result)
@@ -131,11 +125,15 @@ export default {
}
.circle {
width: 20px;
min-width: 20px;
height: 20px;
border-radius: 50%;
padding: 0 4px;
border-radius: 10px;
color: #fff;
background: $theme_color;
font-size: 12px;
line-height: 20px;
box-sizing: border-box;
}
.wrapper {