Merge branch 'main' of http://18.167.251.121:10003/aidlab/lanecarford_front
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped

This commit is contained in:
2025-12-22 15:04:09 +08:00
16 changed files with 252 additions and 153 deletions

View File

@@ -3,7 +3,7 @@ button.sandblasted-blurred {
border: 0.4rem solid #fff;
font-family: satoshiMedium;
font-weight: 500;
font-size: 5.5rem;
font-size: 4rem;
color: #fff;
background-color: transparent;
position: relative;

View File

@@ -3,7 +3,7 @@ button.sandblasted-blurred {
border: 0.4rem solid #fff;
font-family: satoshiMedium;
font-weight: 500;
font-size: 5.5rem;
font-size: 4rem;
color: #fff;
background-color: transparent;
position: relative;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 242 KiB

View File

@@ -11,3 +11,8 @@ export const FlowType = {
/** 历史流程-AI */
H_AI: 'history-ai',
}
/** 是否是历史流程 */
export const IsHistoryFlow = (flowType: any) => {
const arr = [FlowType.HISTORY, FlowType.H_OUTFIT, FlowType.H_TRYON, FlowType.H_AI]
return arr.some((v) => v === flowType)
}

View File

@@ -35,12 +35,16 @@
{ label: 'Try-on', value: 'tryOn', flowType: FlowType.H_TRYON },
{ label: 'Gen-AI', value: 'genAi', flowType: FlowType.H_AI }
]
const navActive = ref('outfit')
const navActive = ref('outfit');
navLst.forEach((v) => {
if (v.flowType === query.value.flowType) navActive.value = v.value
})
const clickNav = (v) => {
navActive.value = v.value
console.log(v)
}
const onLoad = () => {
console.log(navActive.value)
loading.value = true
const http = visitRecordId.value ? getTryOnEffectFavoriteList : getTryOnEffectStyleList
const id = visitRecordId.value || generateStore.styleId
@@ -200,6 +204,14 @@
const selectedItem = list.find((v) => v.selected)
const nav = navLst.find((v) => v.value === navActive.value)
if (!selectedItem || !nav) return
generateStore.clearCustomizeInfoDemo();
generateStore.uploadCustomizeInfoDemo({
tryOnId: selectedItem.tryOnId,
tryOnUrl: selectedItem.tryOnUrl,
styleUrl: selectedItem.styleUrl,
isFavorite: selectedItem.isFavorite,
isRegenerated: selectedItem.isRegenerated,
})
router.push({ name: 'HomeNav', query: { flowType: nav.flowType } })
} else {
router.push({ name: 'end' })
@@ -248,7 +260,10 @@
</div>
</my-list>
</div>
<div class="btns" v-show="!visitRecordId">
<div class="creation-footer" v-if="isChooseOne">
<button @click="onContinue">Continue</button>
</div>
<div class="btns" v-else-if="!visitRecordId">
<template v-if="!isChooseSave">
<button @click="onChooseSave">Choose to Save</button>
<button @click="onContinue">Continue</button>
@@ -258,9 +273,6 @@
<button @click="onConfirm">Confirm ({{ selectCount }}/{{ maxSelectCount }})</button>
</template>
</div>
<div class="creation-footer" v-if="isChooseOne">
<button @click="onContinue">Continue</button>
</div>
</div>
</template>

View File

@@ -1,6 +1,4 @@
<script setup lang="ts">
import HeaderTitle from '@/components/HeaderTitle.vue'
import FooterNavigation from '@/components/FooterNavigation.vue'
import GenerateLoading from '@/views/asistant/components/GenerateLoading.vue'
import { ref, onMounted, computed } from 'vue'
import {
@@ -12,12 +10,15 @@
const emit = defineEmits(['viewType'])
import { useRouter, useRoute } from 'vue-router'
import { useGenerateStore } from '@/stores'
import { FlowType, IsHistoryFlow } from '@/types/enum'
const generateStore = useGenerateStore()
const router = useRouter()
const route = useRoute()
const isDemo = computed(() => route.query.demo === '1')
const customizeInfo = isDemo.value ? generateStore.customizeInfoDemo : generateStore.customizeInfo
const query = computed(() => route.query)
const isHistoryFlow = computed(() => IsHistoryFlow(query.value.flowType))
const customizeInfo = isHistoryFlow.value
? generateStore.customizeInfoDemo
: generateStore.customizeInfo
const loading = ref(false)
const onSend = () => {
if (customizeInfo.inputText === '') return
@@ -38,47 +39,26 @@
customizeInfo.oldInputText = customizeInfo.inputText
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
// }
const data = new FormData()
data.append('prompt', customizeInfo.inputText)
data.append('tryonUrl', customizeInfo.tryOnUrl)
if (generateStore.customerPhotoId && customizeInfo.count === 0) {
data.append('customerPhotoId', generateStore.customerPhotoId)
}
generateTryOnEffectDemo(data)
.then((res: any) => {
if(!res) return Promise.reject('生成失败');
customizeInfo.count++
customizeInfo.tryOnId = "1"
customizeInfo.tryOnUrl = res
// 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 = {
customerId: generateStore.customerId,
visitRecordId: generateStore.visitRecordId,
styleId: generateStore.styleId,
// styleId: generateStore.styleId,
// modelPhotoId: generateStore.modelPhotoId,
originalTryOnId: type === 'reload' ? customizeInfo.oldTryOnId : generateStore.originalTryOnId,
// originalTryOnId: type === 'reload' ? customizeInfo.oldTryOnId : generateStore.originalTryOnId,
isRegenerated: 1,
prompt: customizeInfo.inputText
}
if (generateStore.customerPhotoId && customizeInfo.count === 0)
if (generateStore.customerPhotoId && customizeInfo.count === 0) {
data['customerPhotoId'] = generateStore.customerPhotoId
}
if (isHistoryFlow.value) {
data['originalTryOnId'] =
type === 'reload' ? customizeInfo.oldTryOnId : generateStore.customizeInfoDemo.tryOnId
} else {
data['styleId'] = generateStore.styleId
data['originalTryOnId'] =
type === 'reload' ? customizeInfo.oldTryOnId : generateStore.originalTryOnId
}
generateTryOnEffect(data)
.then((res: any) => {
customizeInfo.count++
@@ -95,13 +75,11 @@
loading.value = false
})
}
}
if (customizeInfo.tryOnId === '') generate()
// 喜欢
const isLoveLoading = ref(false)
const onLove = () => {
if (isDemo.value) return
if (isLoveLoading.value) return
const http = customizeInfo.isFavorite ? cancelTryOnEffectFavorite : setTryOnEffectFavorite
customizeInfo.isFavorite = !customizeInfo.isFavorite
@@ -112,6 +90,7 @@
})
.catch((err) => {
console.error(err)
customizeInfo.isFavorite = !customizeInfo.isFavorite
isLoveLoading.value = false
})
}
@@ -122,11 +101,13 @@
router.back()
}
const onFinish = () => {
if (isDemo.value) {
router.push({ name: 'end' })
} else {
router.push({ name: 'creation' })
}
// router.push({ name: 'creation', query: query.value })
router.push({ name: 'creation', query: { flowType: FlowType.H_AI } })
// if (isHistoryFlow.value) {
// router.push({ name: 'end' })
// } else {
// router.push({ name: 'creation' })
// }
}
// 选择另一个穿搭
const onChooseOutfit = () => {
@@ -135,7 +116,6 @@
</script>
<template>
<header-title style-type="2" />
<div class="loading" v-if="loading"><generate-loading /></div>
<div class="customize" v-else>
<div class="title">Customize your Look!</div>
@@ -158,7 +138,7 @@
<div class="icon"><SvgIcon name="xialajiantou" size="29" /></div>
</div>
<div class="icons">
<div @click="onLove" v-if="!isDemo">
<div @click="onLove">
<SvgIcon :name="`love_${customizeInfo.isFavorite ? 1 : 0}`" size="35" />
</div>
<div @click="onReload" v-show="customizeInfo.oldInputText">
@@ -168,12 +148,12 @@
</div>
</div>
<div class="btns">
<button v-show="!isDemo" @click="onChooseOutfit">Choose Outfit</button>
<span></span>
<button @click="onFinish">Finish</button>
<button class="choose-outfit" v-if="!isHistoryFlow" @click="onChooseOutfit">
Choose Outfit
</button>
<button class="finish" @click="onFinish">Finish</button>
</div>
</div>
<footer-navigation />
</template>
<style scoped lang="less">
@@ -299,27 +279,37 @@
}
}
> .btns {
margin-top: 5rem;
margin-top: 4rem;
width: 68%;
display: flex;
// justify-content: center;
justify-content: space-between;
> button {
padding: 0;
box-sizing: content-box;
font-family: satoshiRegular;
border: none;
width: 34rem;
height: 7.4rem;
height: 9.2rem;
border-radius: 1.3rem;
background: #000;
font-weight: 400;
font-size: 3.8rem;
color: #fff;
&:active {
opacity: 0.7;
}
}
> :first-child.finish,
> .choose-outfit {
background-color: transparent;
color: #000;
border: 0.2rem solid #000;
}
> :first-child.finish {
width: 87.5rem;
}
> .finish {
background-color: #000;
color: #fff;
}
}
}
</style>

View File

@@ -19,7 +19,7 @@ const newJourney = ()=>{
}
const historicalReview = ()=>{
router.push(`/workshop/creation?flowType=${FlowType.HISTORICAL}`)
router.push(`/workshop/creation?flowType=${FlowType.HISTORY}`)
}
onMounted(()=>{
@@ -70,7 +70,7 @@ defineExpose({})
margin-bottom: 8rem;
line-height: 13.1rem;
border: 1.16px solid #FFFFFF;
backdrop-filter: blur(40.50761795043945px);
backdrop-filter: blur(2.5rem);
background: radial-gradient(100% 100% at 0% 0%, rgba(115, 115, 115, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
&:last-child{
margin-bottom: 0;

View File

@@ -1,9 +1,14 @@
<script setup lang="ts">
import { onMounted, onUnmounted, reactive, toRefs, computed, onActivated } from "vue";
import { useRouter } from 'vue-router'
import { onMounted, onUnmounted, reactive, ref, computed, onActivated } from "vue";
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
import { showConfirmDialog } from 'vant'
import MyEvent from '@/utils/myEvent'
import { FlowType, IsHistoryFlow } from '@/types/enum'
import { useGenerateStore } from '@/stores'
const generateStore = useGenerateStore()
//const props = defineProps({
//})
@@ -11,6 +16,9 @@ const emit = defineEmits([
'view-type'
])
const navList = ref([])
const navDisabledList = ref([])
// const data = reactive({
// })
@@ -28,17 +36,54 @@ const clickSwitchVIPID = ()=>{
})
.catch(() => {})
}
const openFlow = (path:string,flowType:string)=>{
if(flowType == 'clientId')return clickSwitchVIPID()
if(flowType == 'main'){
router.push({ name: path })
}else{
router.push({ name: path, query: { demo: 1 } })
}
const openFlow = (item: any)=>{
item.click && item.click()
const query = route.query
router.push({ name: item.path, query: {...query} })
// if(flowType == 'clientId')return clickSwitchVIPID()
// if(flowType == 'main'){
// router.push({ name: path })
// }else{
// router.push({ name: path, query: { demo: 1 } })
// }
}
onMounted(()=>{
emit('view-type', 1)
let nav = [
{
path: 'selectStyle',
imgPath: new URL('@/assets/images/nav1.png',import.meta.url).href,
flowTypeList: [FlowType.H_TRYON,FlowType.H_AI],
},
{
path: 'recommended',
imgPath: new URL('@/assets/images/nav2.png',import.meta.url).href,
flowTypeList: [FlowType.H_OUTFIT],
},
{
path: 'uploadFace',
imgPath: new URL('@/assets/images/nav3.png',import.meta.url).href,
flowTypeList: [FlowType.H_TRYON,FlowType.H_AI],
},
{
path: 'customize',
imgPath: new URL('@/assets/images/nav4.png',import.meta.url).href,
flowTypeList: [FlowType.H_TRYON,FlowType.H_AI],
click(){
generateStore.updatePhotoInfo({})
},
},
]
nav.forEach((item)=>{
const query = computed(() => router.currentRoute.value.query)
if(item.flowTypeList.includes(query.value?.flowType as string)){
navList.value.push(item)
}else{
navDisabledList.value.push(item)
}
})
})
onUnmounted(()=>{
})
@@ -47,27 +92,37 @@ defineExpose({})
</script>
<template>
<div class="homeNavPage">
<div class="shadow top"></div>
<div class="shadow bottom"></div>
<div class="titleBox">
<div class="title">
Welcome Back,
What can I help you today?
Choose one<br/>
function to explore.
</div>
<div class="info">
Welcome back! What can I help you today?
</div>
</div>
<div class="navBox">
<div class="navTitle">
Explore
</div>
<div class="navList">
<div class="item" @click="openFlow('index','main')">
<div class="item active" v-for="item in navList" :key="item.path" @click="openFlow(item)">
<img :src="item.imgPath" alt="">
</div>
<div class="item" v-for="item in navDisabledList" :key="item.path" @click="openFlow(item)">
<img :src="item.imgPath" alt="">
</div>
<!-- <div class="item" @click="openFlow('index')">
<img src="@/assets/images/nav1.png" alt="">
</div>
<div class="item" @click="openFlow('recommended','reinventing')">
<div class="item" :class="{'active': ['history-outfit','history-ai'].includes($route.query?.flowType as string)}" @click="openFlow('recommended','reinventing')">
<img src="@/assets/images/nav2.png" alt="">
</div>
<div class="item" @click="openFlow('index','stylist')">
<div class="item" :class="{'active': ['history-outfit','history-ai'].includes($route.query?.flowType as string)}" @click="openFlow('index','stylist')">
<img src="@/assets/images/nav3.png" alt="">
</div>
<div class="item" @click="openFlow('','clientId')">
<div class="item" :class="{'active': ['history-ai'].includes($route.query?.flowType as string)}" @click="openFlow('','clientId')">
<img src="@/assets/images/nav4.png" alt="">
</div>
</div> -->
</div>
</div>
</div>
@@ -78,28 +133,46 @@ defineExpose({})
--header-title-height: 12rem !important;
}
.homeNavPage{
> .title{
padding: 0 8.4rem;
font-family: satoshiBold;
font-weight: 700;
margin-top: 6.8rem;
font-size: 9.6rem;
line-height: 124%;
background: #B3B3B3;
> .shadow{
position: absolute;
width: 91rem;
height: 92rem;
background: linear-gradient(88.42deg, #FFFFFF 32.58%, #D9D9D9 94.9%);
transform: rotate(312deg);
&.top{
top: -20%;
right: -20%;
}
&.bottom{
bottom: -30%;
left: -20%;
transform: rotate(134deg);
}
}
> .titleBox{
padding-left: 7.9rem;
margin-top: 13.4rem;
margin-bottom: 11.2rem;
> div{
background: linear-gradient(120deg, #b3b3b3 1%, rgba(0, 0, 0, 0) 48%), linear-gradient(
344deg, #B3B3B2 16%, #000000 66%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
> .navBox{
> .navTitle{
padding: 0 8.4rem;
> .title{
font-family: satoshiBold;
font-weight: 700;
font-size: 5.2rem;
margin: 6.3rem 0;
font-size: 10rem;
line-height: 124%;
}
> .info{
margin-top: 4.7rem;
font-size: 4rem;
font-family: satoshiRegular;
}
}
> .navBox{
> .navList{
display: flex;
flex-wrap: wrap;
@@ -110,6 +183,12 @@ defineExpose({})
// height: 41.6rem;
height: auto;
width: calc(50% - 4.8rem / 2);
pointer-events: none;
opacity: .5;
&.active{
pointer-events: auto;
opacity: 1;
}
> img{
width: 100%;
height: 100%;

View File

@@ -6,6 +6,8 @@ import { useRouter, useRoute } from 'vue-router'
import GenerateLoading from '@/views/asistant/components/GenerateLoading.vue'
import { useGenerateStore } from '@/stores'
import { generateTryOnEffect, setTryOnEffectFavorite, cancelTryOnEffectFavorite, addTryOnEffectComment } from '@/api/workshop'
import { FlowType } from '@/types/enum'
const router = useRouter()
//const props = defineProps({
//})
@@ -32,7 +34,12 @@ const feedbackForm = ref({
const onContinue = ()=>{
router.push('uploadFace')
const query = router.currentRoute.value.query
if(query?.flowType == FlowType.MAIN){
router.push({ path: 'uploadFace', query: {...query} })
}else{
router.push({ path: 'creation', query: {...query} })
}
}
const changeModel = ()=>{
@@ -124,7 +131,6 @@ defineExpose({})
const { isLoading } = toRefs(data);
</script>
<template>
<header-title style-type="2" />
<div class="product" v-if="!isLoading">
<div class="text">
<div class="title">
@@ -155,7 +161,6 @@ const { isLoading } = toRefs(data);
</div>
</div>
</div>
<footer-navigation is-placeholder v-if="!isLoading"/>
<van-dialog v-model:show="vanDialogShow" :show-confirm-button="false" width="52.8rem">
<div class="feedback">
<div class="feedbackClose" @click="closeFeedback"><SvgIcon name="close" size="40" /></div>
@@ -181,7 +186,6 @@ const { isLoading } = toRefs(data);
<div class="loading-container" v-if="isLoading">
<GenerateLoading title="Generating Results..." />
</div>
<footer-navigation is-placeholder/>
</template>
<style lang="less" scoped>
.product{

View File

@@ -57,7 +57,6 @@ defineExpose({})
const { modelList, selectModel } = toRefs(data);
</script>
<template>
<header-title style-type="2" />
<div class="selectModel">
<div class="text">
<div class="title">

View File

@@ -7,6 +7,8 @@ import { useRouter } from 'vue-router'
import { useGenerateStore, useUserInfoStore } from '@/stores'
import { showToast } from 'vant';
import { generateRequestOutfit, getRequestOutfit } from '@/api/workshop'
import { FlowType } from '@/types/enum'
const router = useRouter()
//const props = defineProps({
@@ -44,7 +46,12 @@ const toProduct = ()=>{
if(generateStore.style.id != generateStore.style.oldId){
generateStore.setIsGenerate(true)
}
router.push({ path: 'product' })
const query = router.currentRoute.value.query
if(query?.flowType == FlowType.MAIN){
router.push({ path: 'product', query: {...query} })
}else{
router.push({ path: 'creation', query: {...query} })
}
}
const requestOutfit = ({num,index})=>{
@@ -108,7 +115,6 @@ defineExpose({})
const { styleList, select } = toRefs(data);
</script>
<template>
<header-title style-type="2" />
<div class="selectStyle">
<div class="text">
<div class="title">
@@ -126,7 +132,6 @@ const { styleList, select } = toRefs(data);
</div>
</div>
<!-- <div class="footer placeholder"></div> -->
<footer-navigation is-placeholder />
</template>
<style lang="less" scoped>
.header-title {

View File

@@ -2,6 +2,7 @@
import { ref, onMounted, computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useGenerateStore } from '@/stores'
import { IsHistoryFlow } from '@/types/enum'
const generateStore = useGenerateStore()
const emit = defineEmits(['view-type'])
onMounted(() => {
@@ -10,7 +11,7 @@
const router = useRouter()
const route = useRoute()
const query = computed(() => route.query)
const isDemo = computed(() => route.query.demo === '1')
const isHistoryFlow = computed(() => IsHistoryFlow(query.value.flowType))
// 上传照片
const handleUploadFace = () => {
// generateStore.updatePhotoInfo({})
@@ -18,9 +19,6 @@
}
// 跳过上传
const handleFinish = () => {
if (isDemo.value) {
handleUploadFace();
} else {
generateStore.updatePhotoInfo({})
generateStore.clearCustomizeInfo()
generateStore.uploadCustomizeInfo({
@@ -30,7 +28,6 @@
})
router.push({ name: 'customize', query: query.value })
}
}
</script>
<template>
@@ -48,7 +45,13 @@
<button class="sandblasted-blurred flex flex-center" @click="handleUploadFace">
<span>Upload Face</span>
</button>
<button class="sandblasted-blurred flex flex-center" @click="handleFinish" v-if="!isDemo"><span>Finish</span></button>
<button
class="sandblasted-blurred flex flex-center"
@click="handleFinish"
v-if="!isHistoryFlow"
>
<span>Finish</span>
</button>
</div>
</div>
</template>
@@ -97,7 +100,7 @@
border-radius: 0.7rem;
margin: 0 1.8rem;
&.sandblasted-blurred {
border-width: 0.2rem;
// border-width: 0.2rem;
}
}
}

View File

@@ -3,6 +3,7 @@
import { useRouter, useRoute } from 'vue-router'
import { uploadCustomerPhoto } from '@/api/workshop'
import { useGenerateStore } from '@/stores'
import { IsHistoryFlow } from '@/types/enum'
const generateStore = useGenerateStore()
const emit = defineEmits(['view-type'])
@@ -12,7 +13,7 @@
const router = useRouter()
const route = useRoute()
const query = computed(() => route.query)
const isDemo = computed(() => route.query.demo === '1')
const isHistoryFlow = computed(() => IsHistoryFlow(query.value.flowType))
const fileData = generateStore.photoInfo
if (!fileData.file?.size) generateStore.updatePhotoInfo({})
// 上传照片
@@ -46,7 +47,7 @@
formData.append('file', fileData.file)
uploadCustomerPhoto(formData).then((res) => {
generateStore.updatePhotoInfo({ ...res, file: fileData.file })
isDemo.value ? generateStore.clearCustomizeInfoDemo() : generateStore.clearCustomizeInfo()
isHistoryFlow.value ? generateStore.clearCustomizeInfoDemo() : generateStore.clearCustomizeInfo()
router.push({ name: 'customize', query: query.value })
})
}
@@ -144,10 +145,11 @@
display: flex;
justify-content: center;
> button {
width: 34.5rem;
height: 8.6rem;
border-radius: 4.3rem;
width: 35rem;
height: 8.3rem;
margin: 0 5rem;
// border-radius: 4.3rem;
border-width: 0.25rem;
}
}
}