fix: 门店详情加载失败显示提示页替代空白,导航条标题为详情
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
eb33144f2a
commit
4be46bcb79
+32
-2
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page" v-if="store">
|
<view>
|
||||||
|
<view class="page" v-if="store">
|
||||||
<!-- xuchao: 顶部导航(返回+页面名称) -->
|
<!-- xuchao: 顶部导航(返回+页面名称) -->
|
||||||
<view class="nav-bar">
|
<view class="nav-bar">
|
||||||
<view class="nav-back" @click="goBack">
|
<view class="nav-back" @click="goBack">
|
||||||
@@ -62,6 +63,19 @@
|
|||||||
<text class="discount-item" v-for="(item, index) in discountList" :key="index">{{ item }}</text>
|
<text class="discount-item" v-for="(item, index) in discountList" :key="index">{{ item }}</text>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -69,7 +83,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
store: null
|
store: null,
|
||||||
|
loaded: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -129,6 +144,9 @@ export default {
|
|||||||
if (res.errcode === 0 && res.data) {
|
if (res.errcode === 0 && res.data) {
|
||||||
this.store = res.data
|
this.store = res.data
|
||||||
}
|
}
|
||||||
|
this.loaded = true
|
||||||
|
}).catch(() => {
|
||||||
|
this.loaded = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
@@ -276,6 +294,18 @@ export default {
|
|||||||
color: #0088ff;
|
color: #0088ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* xuchao: 加载失败提示态 */
|
||||||
|
.load-failed {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 80px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-failed-text {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
/* xuchao: 顶部返回导航条 */
|
/* xuchao: 顶部返回导航条 */
|
||||||
.nav-bar {
|
.nav-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user