From 9f338a772d06043e1a2ba9776a2649c70644ad8b Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Tue, 30 Dec 2025 09:45:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AD=94=E6=94=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E5=88=B0outfit?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- src/stores/modules/generate.ts | 22 +++------------------- src/views/Workshop/customize.vue | 1 + src/views/Workshop/selectStyle/index.vue | 2 +- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 4eed819..6d33521 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -120,7 +120,7 @@ const router = createRouter({ }, { path: '/workshop/selectStyle', - name: 'selectStyle', + name: 'SelectStyle', component: () => import('../views/Workshop/selectStyle/index.vue'), meta: { verify: () => VerifyIDs(2) } }, diff --git a/src/stores/modules/generate.ts b/src/stores/modules/generate.ts index f985ef3..dbf34f2 100644 --- a/src/stores/modules/generate.ts +++ b/src/stores/modules/generate.ts @@ -95,28 +95,10 @@ export const useGenerateStore = defineStore({ ...data, } }, - clearStyle() { - this.style = { - id: '', - path: '', - isLike: false, - taskId:'', - status: '' - } - this.styleList = [ - {id:'',taskId:'',status:'',path:''}, - {id:'',taskId:'',status:'',path:''}, - {id:'',taskId:'',status:'',path:''}, - {id:'',taskId:'',status:'',path:''}, - ] - }, //模特相关 selectModel(data: any) { this.model.id = data.id }, - setIsGenerate(isGenerate: boolean) { - this.isGenerate = isGenerate - }, clearProductData() { this.styleList = [ {id:'',taskId:'',status:'',path:''}, @@ -134,12 +116,14 @@ export const useGenerateStore = defineStore({ this.model = { id: '' } + this.clearTryOn() + }, + clearTryOn() { this.originalTryOn = { id: '', isLike: false, tryOnUrl: '' } - this.isGenerate = false }, /** 更新顾客照片信息 */ updatePhotoInfo(data: any) { diff --git a/src/views/Workshop/customize.vue b/src/views/Workshop/customize.vue index a608968..7595a05 100644 --- a/src/views/Workshop/customize.vue +++ b/src/views/Workshop/customize.vue @@ -115,6 +115,7 @@ } // 选择另一个穿搭 const onChooseOutfit = () => { + generateStore.clearTryOn() router.push({ name: 'SelectStyle' }) } diff --git a/src/views/Workshop/selectStyle/index.vue b/src/views/Workshop/selectStyle/index.vue index 665b38a..16f6d3b 100644 --- a/src/views/Workshop/selectStyle/index.vue +++ b/src/views/Workshop/selectStyle/index.vue @@ -93,7 +93,7 @@ const requestOutfit = async ({num})=>{ } }) isLoading.value = true - generateStore.clearStyle() + generateStore.clearProductData() data.select.taskId = rv[0] rv.forEach((item,index)=>data.styleList[index].taskId = item) getRequestOutfitList(rv)