fix:bug
This commit is contained in:
@@ -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 })
|
||||
|
||||
@@ -43,7 +43,7 @@ module.exports = { hex: hex, tags: tags }
|
||||
<view class="page detail-page">
|
||||
<navigation-bar title="衣物详情">
|
||||
<view
|
||||
wx:if="{{imageStatus !== 1 && imageStatus !== 2 && imageStatus !== 3}}"
|
||||
wx:if="{{!readonly && imageStatus !== 1 && imageStatus !== 2 && imageStatus !== 3}}"
|
||||
slot="right"
|
||||
class="nav-action"
|
||||
bindtap="onToggleEdit"
|
||||
@@ -198,7 +198,7 @@ module.exports = { hex: hex, tags: tags }
|
||||
|
||||
<!-- 底部操作:处理中隐藏,其他显示 -->
|
||||
<view
|
||||
wx:if="{{!notFound && imageStatus !== 1 && imageStatus !== 2 && imageStatus !== 3}}"
|
||||
wx:if="{{!readonly && !notFound && imageStatus !== 1 && imageStatus !== 2 && imageStatus !== 3}}"
|
||||
class="footer"
|
||||
>
|
||||
<block wx:if="{{editMode}}">
|
||||
|
||||
Reference in New Issue
Block a user