fix:bug

This commit is contained in:
2026-09-13 23:32:35 +08:00
parent 323f520d7b
commit 1a11816839
14 changed files with 701 additions and 46 deletions
@@ -101,6 +101,9 @@ function statusToStep(status: number): number {
Page({
data: {
uuid: '',
// 来自穿搭分享的只读查看:携带 share_uuid,隐藏编辑/删除
shareUUID: '',
readonly: false,
attrGroups: ATTR_GROUPS,
colorPresets: COLOR_PRESETS,
detail: {} as ClothesItem,
@@ -123,8 +126,10 @@ Page({
onLoad(query: Record<string, string>) {
const uuid = query.uuid || ''
logger.debug(LOG, 'onLoad, uuid=', uuid)
this.setData({ uuid })
const shareUUID = query.share_uuid || ''
const readonly = !!shareUUID
logger.debug(LOG, 'onLoad, uuid=', uuid, 'readonly=', readonly)
this.setData({ uuid, shareUUID, readonly })
if (!uuid) {
// uuid 缺失时不请求不轮询,否则会停在空白页且无法退出
logger.warn(LOG, 'onLoad 缺少 uuid 参数')
@@ -132,7 +137,8 @@ Page({
return
}
this.fetchDetail()
this.pollStatus()
// 只读(来自穿搭分享)场景无需轮询 AI 处理状态
if (!readonly) this.pollStatus()
},
onBackWardrobe() {
@@ -143,7 +149,11 @@ Page({
},
fetchDetail(): Promise<void> {
return request<ClothesItem>({ url: `/clothes/${this.data.uuid}` })
// 只读场景携带 share_uuid,后端据此放行非属主读取衣物详情
const url = this.data.readonly
? `/clothes/${this.data.uuid}?share_uuid=${this.data.shareUUID}`
: `/clothes/${this.data.uuid}`
return request<ClothesItem>({ url })
.then((detail) => {
logger.debug(LOG, '详情加载成功, 处理状态=', detail && detail.image_process_status)
this.setData({ detail, loading: false })