feat: 根据是否是design/是否单品/是否成年展示不同的提示词
This commit is contained in:
@@ -197,17 +197,23 @@
|
|||||||
class="selectText"
|
class="selectText"
|
||||||
v-show="productimgMenu.value == 'ToProductImage' && speedData.value"
|
v-show="productimgMenu.value == 'ToProductImage' && speedData.value"
|
||||||
>
|
>
|
||||||
<div
|
<a-tooltip
|
||||||
:title="$t('poseTransfer.hint')"
|
v-for="(promptText, index) in promptTextList"
|
||||||
@click="
|
:key="index"
|
||||||
() => {
|
placement="bottom"
|
||||||
searchName[productimgMenu.value] = $t('poseTransfer.hint')
|
|
||||||
ifMaximumLength()
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ $t('poseTransfer.hint') }}
|
<template #title>{{ promptText }}</template>
|
||||||
</div>
|
<div
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
searchName[productimgMenu.value] = promptText
|
||||||
|
ifMaximumLength()
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ promptText }}
|
||||||
|
</div>
|
||||||
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="productImg_content_item_generate_btn input_border">
|
<div class="productImg_content_item_generate_btn input_border">
|
||||||
<div class="generage_btn_box">
|
<div class="generage_btn_box">
|
||||||
@@ -789,7 +795,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
// 设置默认prompt
|
// 设置默认prompt
|
||||||
if (!productImgData.searchName[props.productimgMenu.value]) {
|
if (!productImgData.searchName[props.productimgMenu.value]) {
|
||||||
const isFromDesignPage = props.source == 'design' || props.isDesignPage
|
const isFromDesignPage = props.source == 'design' || props.isDesignPage
|
||||||
const { ageGroup, httpType } = store.state.Workspace.probjects
|
const { ageGroup, httpType } = store.state.Workspace.probjects
|
||||||
const isSingleDesign = httpType === 'SINGLE_DESIGN'
|
const isSingleDesign = httpType === 'SINGLE_DESIGN'
|
||||||
|
|
||||||
@@ -1136,6 +1142,42 @@ export default defineComponent({
|
|||||||
ifMaximumLength()
|
ifMaximumLength()
|
||||||
console.log('来源:---', props.source, props.isDesignPage)
|
console.log('来源:---', props.source, props.isDesignPage)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 计算属性:根据条件生成提示词列表
|
||||||
|
const promptTextList = computed(() => {
|
||||||
|
const isFromDesignPage = props.source === 'design' || props.isDesignPage
|
||||||
|
const { ageGroup, httpType } = store.state.Workspace.probjects
|
||||||
|
const isSingleDesign = httpType === 'SINGLE_DESIGN'
|
||||||
|
const isAdult = ageGroup === 'Adult'
|
||||||
|
|
||||||
|
if (!isFromDesignPage) {
|
||||||
|
// 如果不是从design来的,返回两个提示词
|
||||||
|
return [
|
||||||
|
t('poseTransfer.UploadWithModel'),
|
||||||
|
t('poseTransfer.UploadWithoutModel')
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
// 如果是从design来的
|
||||||
|
if (isSingleDesign) {
|
||||||
|
// SINGLE_DESIGN: 两个提示词
|
||||||
|
const secondPrompt = isAdult
|
||||||
|
? t('poseTransfer.SingleAdultTryOn')
|
||||||
|
: t('poseTransfer.SingleChildTryOn')
|
||||||
|
return [
|
||||||
|
t('poseTransfer.SingleGarment'),
|
||||||
|
secondPrompt
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
// SERIES_DESIGN: 一个提示词
|
||||||
|
return [
|
||||||
|
isAdult
|
||||||
|
? t('poseTransfer.SeriesAdultTryOn')
|
||||||
|
: t('poseTransfer.SeriesChildTryOn')
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
upload,
|
upload,
|
||||||
driver__,
|
driver__,
|
||||||
@@ -1146,6 +1188,7 @@ export default defineComponent({
|
|||||||
productimgMenuList,
|
productimgMenuList,
|
||||||
RelightDirectionList,
|
RelightDirectionList,
|
||||||
RelightDirection,
|
RelightDirection,
|
||||||
|
promptTextList,
|
||||||
|
|
||||||
setproduct,
|
setproduct,
|
||||||
fileUploadChange,
|
fileUploadChange,
|
||||||
@@ -1494,12 +1537,13 @@ export default defineComponent({
|
|||||||
.selectText {
|
.selectText {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
> div {
|
> div {
|
||||||
background: #efeff1;
|
background: #efeff1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
margin-right: 1.2rem;
|
margin-bottom: 1.2rem;
|
||||||
border-radius: 1.6rem;
|
border-radius: 1.6rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 1.2rem;
|
padding: 1.2rem;
|
||||||
@@ -1509,8 +1553,8 @@ export default defineComponent({
|
|||||||
&:hover {
|
&:hover {
|
||||||
background: #f9fafa;
|
background: #f9fafa;
|
||||||
}
|
}
|
||||||
&:first-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user