From 3a7bbafc46ff748c6bc2a1b1259c549c9a570820 Mon Sep 17 00:00:00 2001 From: xiangsilian Date: Thu, 3 Sep 2026 21:01:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(app):=20Segment/@Prop=20=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E5=A4=8D=20+=20=E7=9B=B8=E5=86=8C=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E8=B6=85=E6=97=B6=20120s=20+=20=E6=8D=A2=E8=A3=85=205?= =?UTF-8?q?00=20=E7=BA=AF=E6=96=87=E6=9C=AC=20body=20=E5=8F=8B=E5=A5=BD?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Segment.selected 改 @Prop:发型页性别分段高亮不跟手(父层刷新不同步) - FormRow value/errorText 改 @Prop:诊断表单选择器行文案不回填(真机复测通过) - SELECT_TIMEOUT_MS 60s→120s:相册选择器冷启动超时后系统浮层成孤儿,点击全失效 - changeCloth 非 JSON body(服务端 500 Internal Server Error)→『服务繁忙,请稍后重试』 - 真机验证:换装请求链路 OK(cloth post 390KB/打点齐全);服务端 GPU(ComfyUI 正式+备份)当前宕机,生成结果待服务恢复后复验 --- app/entry/src/main/ets/components/f2/Segment.ets | 2 +- app/entry/src/main/ets/core/ImageCodec.ets | 2 +- app/entry/src/main/ets/core/TryonApi.ets | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/entry/src/main/ets/components/f2/Segment.ets b/app/entry/src/main/ets/components/f2/Segment.ets index 2b82f5e..ae27986 100644 --- a/app/entry/src/main/ets/components/f2/Segment.ets +++ b/app/entry/src/main/ets/components/f2/Segment.ets @@ -10,7 +10,7 @@ import { COLOR_PRIMARY, COLOR_IMAGE_BG, COLOR_TEXT_PRIMARY } from '../../core/Th @Component export struct Segment { items: string[] = [] - selected: number = 0 + @Prop selected: number = 0 onSelect: (idx: number) => void = (_idx: number) => {} build() { diff --git a/app/entry/src/main/ets/core/ImageCodec.ets b/app/entry/src/main/ets/core/ImageCodec.ets index 3b160db..2c24653 100644 --- a/app/entry/src/main/ets/core/ImageCodec.ets +++ b/app/entry/src/main/ets/core/ImageCodec.ets @@ -41,7 +41,7 @@ const LONG_EDGE: number = 1600 const JPEG_QUALITY: number = 85 const IMG_DOMAIN: number = 0x0001 const IMG_TAG: string = 'MEIDA_IMG' -const SELECT_TIMEOUT_MS: number = 60000 // 相册选图兜底:系统弹窗最多等 60s +const SELECT_TIMEOUT_MS: number = 120000 // 相册选图兜底:冷启动+用户浏览常超 60s(超时后系统浮层成孤儿,点击全失效) const CAMERA_TIMEOUT_MS: number = 120000 // 拍照兜底:给足取景与确认时间 export class ImageCodec { diff --git a/app/entry/src/main/ets/core/TryonApi.ets b/app/entry/src/main/ets/core/TryonApi.ets index 4aeaa5b..eb30043 100644 --- a/app/entry/src/main/ets/core/TryonApi.ets +++ b/app/entry/src/main/ets/core/TryonApi.ets @@ -181,7 +181,13 @@ export class TryonApi { const respText: string = (resp.result ?? '') as string hilog.info(TRYON_DOMAIN, TRYON_TAG, 'cloth resp code=%{public}d body=%{public}s', resp.responseCode, respText.substring(0, 300)) - const wire = JSON.parse(respText) as ChangeClothWire + let wire: ChangeClothWire + try { + wire = JSON.parse(respText) as ChangeClothWire + } catch (_p) { + // 服务端 500 等会回纯文本 body(如 "Internal Server Error"):按服务繁忙口径提示 + throw new ApiError(50000, '服务繁忙,请稍后重试', '换装服务暂时不可用') + } if (wire.ret === 0 && wire.data !== undefined && wire.data.length > 0) { return wire.data }