fix(plan-detail): 增加加载/错误/重试/未找到四态,杜绝静默空白

- 此前详情页请求失败时仅 setData(loading:false),plan 仍为 null,
  整页只显示一行小字,用户感知为「空白」且无法定位原因。
- 现明确区分 loading / error(带重试按钮) / not-found 三种空态;
  request 失败时按 statusCode 给具体提示(401 登录失效 / 404 未找到 / 其他网络错误)。
- onLoad 对 getApp().globalData 取值加防御;缺失 id 直接报错不发起请求。
This commit is contained in:
2026-07-22 23:58:48 +08:00
parent c4639d0703
commit 54a5ae858d
2 changed files with 35 additions and 8 deletions

View File

@@ -35,5 +35,11 @@
</view>
<view wx:else class="empty-page">
<view class="empty">{{ loading ? '加载中…' : '未找到该计划' }}</view>
<view wx:if="{{loading}}" class="empty">加载中…</view>
<view wx:elif="{{error}}" class="empty-box">
<view class="empty-box__emoji"><fc-icon name="alert-circle" size="64" color="var(--text-3)" /></view>
<view class="empty-box__t">{{errorMsg || '加载失败'}}</view>
<view class="empty-box__btn" bindtap="onRetry">重试</view>
</view>
<view wx:else class="empty">未找到该计划</view>
</view>