fix: 修复导览按钮文案与三维路线显示联动

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
lyf
2026-06-26 04:17:03 +08:00
parent d4b97379bb
commit a7413ee037
5 changed files with 592 additions and 93 deletions

View File

@@ -67,7 +67,7 @@
<view v-if="startPoint && endPoint" class="route-options">
<view class="route-options-header">
<text class="route-options-title">线路预览</text>
<text class="route-options-title">{{ routeOptionsTitle }}</text>
<text class="route-options-note">偏好选择</text>
</view>
<view class="route-option-list">
@@ -84,7 +84,7 @@
</view>
<view v-if="loading || error || summary" class="panel-status">
<text v-if="loading" class="panel-status-text">线路预览生成中</text>
<text v-if="loading" class="panel-status-text">{{ loadingText }}</text>
<text v-else-if="error" class="panel-status-text error">{{ error }}</text>
<text v-else class="panel-status-text">{{ summary }}</text>
</view>
@@ -136,6 +136,7 @@ const props = withDefaults(defineProps<{
pickerLoading?: boolean
pickerError?: string
pickerEmptyText?: string
routeReady?: boolean
}>(), {
visible: true,
startPoint: null,
@@ -147,7 +148,8 @@ const props = withDefaults(defineProps<{
summary: '',
pickerLoading: false,
pickerError: '',
pickerEmptyText: '暂无匹配地点'
pickerEmptyText: '暂无匹配地点',
routeReady: false
})
const emit = defineEmits<{
@@ -194,7 +196,15 @@ const canViewRoute = computed(() => Boolean(
const canPrimaryAction = computed(() => canViewRoute.value && !props.error)
const primaryActionText = computed(() => (
props.hasRoutePreview ? '模拟导览' : '线路预览'
props.hasRoutePreview
? '开始导览'
: (props.routeReady ? '查看路线' : '查看位置关系')
))
const routeOptionsTitle = computed(() => '室内导览')
const loadingText = computed(() => (
props.routeReady ? '正在规划室内导览路线' : '正在生成室内位置关系'
))
const collapsedSummary = computed(() => {
@@ -207,26 +217,32 @@ const collapsedSummary = computed(() => {
const routeOptions = computed(() => {
const unavailable = Boolean(props.error)
const summaryText = props.summary || '选择后查看位置关系'
const summaryText = props.summary || (props.routeReady ? '选择后规划真实路线' : '选择后查看位置关系')
return [
{
id: 'recommended',
title: '推荐路线',
meta: unavailable ? '当前为路线示意状态' : props.hasRoutePreview ? summaryText : '优先展示位置关系',
meta: unavailable
? '当前暂不可用'
: props.hasRoutePreview
? summaryText
: props.routeReady
? '调用 SGS SDK 路线规划'
: '查看起点终点位置关系',
active: !unavailable,
disabled: unavailable
},
{
id: 'stairs',
title: '少走楼梯',
meta: '偏好预览,待路线数据验证',
meta: props.routeReady ? '偏好能力待接入' : '偏好预览,待路线数据验证',
active: false,
disabled: true
},
{
id: 'elevator',
title: '电梯优先',
meta: '偏好预览,待路线数据验证',
meta: props.routeReady ? '偏好能力待接入' : '偏好预览,待路线数据验证',
active: false,
disabled: true
}