1
This commit is contained in:
@@ -78,8 +78,13 @@ func (s *poiService) Search(ctx context.Context, req *dto.SearchPoiReq) (res *dt
|
||||
page = maxPage
|
||||
}
|
||||
|
||||
// 按行业分类搜索(拆分子分类以突破单次2000条上限)
|
||||
if req.Types != "" {
|
||||
// 构建行业分类列表:若未选分类则使用全部分类
|
||||
types := req.Types
|
||||
if types == "" {
|
||||
types = strings.Join(data.GetLeafCodes(""), "|")
|
||||
}
|
||||
if types != "" {
|
||||
req.Types = types
|
||||
return s.searchByTypes(ctx, apiKey, req, page, offset)
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Pointly-Tel - 高德POI商户查询</title>
|
||||
<script type="module" crossorigin src="/assets/index-6-9Ls5rA.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BERqyvQy.css">
|
||||
<script type="module" crossorigin src="/assets/index-BggdCNJQ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-ihli0-Cw.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
+8
-2
@@ -34,7 +34,7 @@
|
||||
<span v-if="item.city" class="suggest-city">{{ item.city }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<CascaderSelect v-model="regionValues" :treeData="regionTree" placeholder="全部地区" :lazyLoad="loadDistricts" @change="onRegionChange" />
|
||||
<CascaderSelect v-model="regionValues" :treeData="regionTree" placeholder="全部地区" :lazyLoad="loadDistricts" />
|
||||
<CascaderSelect v-model="categoryValues" :treeData="categoryTree" placeholder="全部行业" />
|
||||
<select v-model="radius" class="select radius-select">
|
||||
<option v-for="r in radiusOptions" :key="r.value" :value="r.value">{{ r.label }}</option>
|
||||
@@ -189,7 +189,11 @@ const regions = {
|
||||
}
|
||||
|
||||
const radiusOptions = [
|
||||
{ value: 500, label: '500m' },
|
||||
{ value: 1000, label: '1km' },
|
||||
{ value: 2000, label: '2km' },
|
||||
{ value: 3000, label: '3km' },
|
||||
{ value: 5000, label: '5km' },
|
||||
]
|
||||
|
||||
// 城市中心坐标(用于选中城市时地图跳转)
|
||||
@@ -339,7 +343,7 @@ async function loadDistricts(node, path) {
|
||||
}
|
||||
|
||||
// 地区级联变化 → 地图跳转
|
||||
function onRegionChange({ values }) {
|
||||
function onRegionChange(values) {
|
||||
const map = mapRef.value
|
||||
if (!map || values.length === 0) return
|
||||
centerLat.value = 0
|
||||
@@ -360,6 +364,8 @@ function onRegionChange({ values }) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 监听地区选择变化(省/市/区县任一级别切换都触发地图跳转)
|
||||
watch(regionValues, onRegionChange)
|
||||
// 搜索建议:关键词输入防抖
|
||||
function fetchSuggestions(kw) {
|
||||
if (!kw.trim()) { suggestions.value = []; return }
|
||||
|
||||
@@ -132,6 +132,9 @@ async function selectItem(item, colIdx) {
|
||||
selectedPath.value = selectedPath.value.slice(0, colIdx)
|
||||
selectedPath.value.push(item)
|
||||
|
||||
// 每次选择都更新 v-model(非叶节点选择也触发地图跳转等副作用)
|
||||
emit('update:modelValue', selectedPath.value.map(n => n.value))
|
||||
|
||||
if (item.children && item.children.length > 0) {
|
||||
rebuildColumns()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user