fix: 门店详情加载失败显示提示页替代空白,导航条标题为详情

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-08-31 16:43:33 +08:00
co-authored by Claude Fable 5
parent eb33144f2a
commit 4be46bcb79
+31 -1
View File
@@ -1,4 +1,5 @@
<template>
<view>
<view class="page" v-if="store">
<!-- xuchao: 顶部导航(返回+页面名称) -->
<view class="nav-bar">
@@ -63,13 +64,27 @@
</view>
</view>
</view>
<!-- xuchao: 门店不存在或加载失败时的提示态,避免纯空白 -->
<view class="page" v-else-if="loaded">
<view class="nav-bar">
<view class="nav-back" @click="goBack">
<u-icon name="arrow-left" color="#1a1818" size="40"></u-icon>
</view>
<text class="nav-title">详情</text>
</view>
<view class="load-failed">
<text class="load-failed-text">门店信息加载失败,该门店可能不存在或已下架</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
store: null
store: null,
loaded: false
}
},
computed: {
@@ -129,6 +144,9 @@ export default {
if (res.errcode === 0 && res.data) {
this.store = res.data
}
this.loaded = true
}).catch(() => {
this.loaded = true
})
},
goBack() {
@@ -276,6 +294,18 @@ export default {
color: #0088ff;
}
/* xuchao: 加载失败提示态 */
.load-failed {
display: flex;
justify-content: center;
padding: 80px 24px;
}
.load-failed-text {
font-size: 14px;
color: #999999;
}
/* xuchao: 顶部返回导航条 */
.nav-bar {
display: flex;