fix
This commit is contained in:
@@ -52,18 +52,13 @@ export function generateTryOnEffect(data: Object) {
|
|||||||
/**
|
/**
|
||||||
* 生成试穿效果-演示
|
* 生成试穿效果-演示
|
||||||
* @param data 试穿效果数据
|
* @param data 试穿效果数据
|
||||||
* @param data.customerId 顾客ID
|
|
||||||
* @param data.visitRecordId 进店记录id
|
|
||||||
* @param data.styleId 样式id
|
|
||||||
* @param data.modelPhotoId 模型照片id
|
|
||||||
* @param data.customerPhotoId 顾客照片id
|
* @param data.customerPhotoId 顾客照片id
|
||||||
* @param data.prompt 提示词
|
* @param data.prompt 提示词
|
||||||
* @param data.originalTryOnId 原始试穿效果id
|
* @param data.tryonUrl AI魔改url
|
||||||
* @param data.isRegenerated 是否重新生成 0-否,1-是
|
|
||||||
*/
|
*/
|
||||||
export function generateTryOnEffectDemo(data: Object) {
|
export function generateTryOnEffectDemo(data: Object) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/try-on-effects/reFace/{customerPhotold}o',
|
url: '/api/try-on-effects/reFace',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -37,6 +37,30 @@
|
|||||||
const generate = (type?: 'reload') => {
|
const generate = (type?: 'reload') => {
|
||||||
customizeInfo.oldInputText = customizeInfo.inputText
|
customizeInfo.oldInputText = customizeInfo.inputText
|
||||||
customizeInfo.oldTryOnId = customizeInfo.tryOnId
|
customizeInfo.oldTryOnId = customizeInfo.tryOnId
|
||||||
|
loading.value = true
|
||||||
|
if (isDemo.value) {
|
||||||
|
const data = {
|
||||||
|
prompt: customizeInfo.inputText,
|
||||||
|
tryonUrl: customizeInfo.tryOnUrl
|
||||||
|
}
|
||||||
|
if (generateStore.customerPhotoId && customizeInfo.count === 0) {
|
||||||
|
data['customerPhotoId'] = generateStore.customerPhotoId
|
||||||
|
}
|
||||||
|
generateTryOnEffectDemo(data)
|
||||||
|
.then((res: any) => {
|
||||||
|
customizeInfo.count++
|
||||||
|
// customizeInfo.tryOnId = res.tryOnId
|
||||||
|
customizeInfo.tryOnUrl = res.tryOnUrl
|
||||||
|
// customizeInfo.styleUrl = res.styleUrl
|
||||||
|
// customizeInfo.isRegenerated = res.isRegenerated
|
||||||
|
// customizeInfo.isFavorite = !!res.isFavorite
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
const data = {
|
const data = {
|
||||||
customerId: generateStore.customerId,
|
customerId: generateStore.customerId,
|
||||||
visitRecordId: generateStore.visitRecordId,
|
visitRecordId: generateStore.visitRecordId,
|
||||||
@@ -48,8 +72,7 @@
|
|||||||
}
|
}
|
||||||
if (generateStore.customerPhotoId && customizeInfo.count === 0)
|
if (generateStore.customerPhotoId && customizeInfo.count === 0)
|
||||||
data['customerPhotoId'] = generateStore.customerPhotoId
|
data['customerPhotoId'] = generateStore.customerPhotoId
|
||||||
loading.value = true;
|
generateTryOnEffect(data)
|
||||||
(isDemo.value ? generateTryOnEffectDemo : generateTryOnEffect)(data)
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
customizeInfo.count++
|
customizeInfo.count++
|
||||||
customizeInfo.tryOnId = res.tryOnId
|
customizeInfo.tryOnId = res.tryOnId
|
||||||
@@ -64,6 +87,7 @@
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (customizeInfo.tryOnId === '') generate()
|
if (customizeInfo.tryOnId === '') generate()
|
||||||
|
|
||||||
// 喜欢
|
// 喜欢
|
||||||
@@ -96,6 +120,10 @@
|
|||||||
router.push({ name: 'creation' })
|
router.push({ name: 'creation' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 选择另一个穿搭
|
||||||
|
const onChooseAnotherOutfit = () => {
|
||||||
|
router.push({ name: 'SelectStyle' })
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -132,6 +160,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
|
<button v-show="!isDemo" @click="onChooseAnotherOutfit">Choose another outfit</button>
|
||||||
|
<span></span>
|
||||||
<button @click="onFinish">Finish</button>
|
<button @click="onFinish">Finish</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -262,16 +292,18 @@
|
|||||||
}
|
}
|
||||||
> .btns {
|
> .btns {
|
||||||
margin-top: 5rem;
|
margin-top: 5rem;
|
||||||
width: 100%;
|
width: 85%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
// justify-content: center;
|
||||||
|
justify-content: space-between;
|
||||||
> button {
|
> button {
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
font-family: satoshiRegular;
|
font-family: satoshiRegular;
|
||||||
// margin: 0 1.8rem;
|
// margin: 0 1.8rem;
|
||||||
border: none;
|
border: none;
|
||||||
margin: 0 5.2rem 0 auto;
|
// margin: 0 5.2rem 0 auto;
|
||||||
width: 23.8rem;
|
min-width: 18rem;
|
||||||
|
padding: 0 3.5rem;
|
||||||
height: 6.9rem;
|
height: 6.9rem;
|
||||||
border-radius: 1.3rem;
|
border-radius: 1.3rem;
|
||||||
background: #000;
|
background: #000;
|
||||||
|
|||||||
@@ -20,17 +20,19 @@
|
|||||||
}
|
}
|
||||||
// 跳过上传
|
// 跳过上传
|
||||||
const handleFinish = () => {
|
const handleFinish = () => {
|
||||||
|
if (isDemo.value) {
|
||||||
|
handleUploadFace();
|
||||||
|
} else {
|
||||||
generateStore.updatePhotoInfo({})
|
generateStore.updatePhotoInfo({})
|
||||||
if (!isDemo.value) {
|
|
||||||
generateStore.clearCustomizeInfo()
|
generateStore.clearCustomizeInfo()
|
||||||
generateStore.uploadCustomizeInfo({
|
generateStore.uploadCustomizeInfo({
|
||||||
tryOnId: generateStore.originalTryOn.id,
|
tryOnId: generateStore.originalTryOn.id,
|
||||||
tryOnUrl: generateStore.originalTryOn.tryOnUrl,
|
tryOnUrl: generateStore.originalTryOn.tryOnUrl,
|
||||||
isFavorite: generateStore.originalTryOn.isLike
|
isFavorite: generateStore.originalTryOn.isLike
|
||||||
})
|
})
|
||||||
}
|
|
||||||
router.push({ name: 'customize', query: query.value })
|
router.push({ name: 'customize', query: query.value })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import HeaderTitle from '@/components/HeaderTitle.vue'
|
|||||||
import FooterNavigation from '@/components/FooterNavigation.vue'
|
import FooterNavigation from '@/components/FooterNavigation.vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { showToast } from 'vant'
|
||||||
import {useUserInfoStore} from '@/stores'
|
import {useUserInfoStore} from '@/stores'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const userInfoStore = useUserInfoStore()
|
const userInfoStore = useUserInfoStore()
|
||||||
@@ -32,6 +33,9 @@ const options = ref<any[]>([
|
|||||||
])
|
])
|
||||||
|
|
||||||
const handleSelect = (value: string) => {
|
const handleSelect = (value: string) => {
|
||||||
|
if (value === 'male') {// 男性开发中
|
||||||
|
return showToast(`This feature is currently under development. Please select the 'Female' option for now.`)
|
||||||
|
}
|
||||||
const generateParams = userInfoStore.getGenerateParams()
|
const generateParams = userInfoStore.getGenerateParams()
|
||||||
generateParams.sex = value
|
generateParams.sex = value
|
||||||
userInfoStore.setGenerateParams(generateParams)
|
userInfoStore.setGenerateParams(generateParams)
|
||||||
|
|||||||
Reference in New Issue
Block a user