2025-12-19 13:46:59 +08:00
< script setup lang = "ts" >
2025-12-22 11:29:38 +08:00
import { onMounted , onUnmounted , reactive , ref , computed , onActivated } from "vue" ;
2025-12-22 13:45:04 +08:00
import { useRouter , useRoute } from 'vue-router'
2025-12-19 13:46:59 +08:00
const router = useRouter ( )
2025-12-22 13:45:04 +08:00
const route = useRoute ( )
2025-12-19 13:46:59 +08:00
import { showConfirmDialog } from 'vant'
import MyEvent from '@/utils/myEvent'
2025-12-22 13:42:55 +08:00
import { FlowType , IsHistoryFlow } from '@/types/enum'
2025-12-23 09:30:33 +08:00
import { useHGenerateStore } from '@/stores'
const hGenerateStore = useHGenerateStore ( )
2025-12-22 13:42:55 +08:00
2025-12-19 13:46:59 +08:00
//const props = defineProps({
//})
2025-12-22 11:29:38 +08:00
const navList = ref ( [ ] )
const navDisabledList = ref ( [ ] )
2025-12-19 13:46:59 +08:00
// const data = reactive({
// })
2025-12-22 13:42:55 +08:00
const openFlow = ( item : any ) => {
item . click && item . click ( )
2025-12-22 13:45:04 +08:00
const query = route . query
router . push ( { name : item . path , query : { ... query } } )
2025-12-22 11:29:38 +08:00
// if(flowType == 'clientId')return clickSwitchVIPID()
// if(flowType == 'main'){
// router.push({ name: path })
// }else{
// router.push({ name: path, query: { demo: 1 } })
// }
2025-12-19 13:46:59 +08:00
}
onMounted ( ( ) => {
2025-12-22 11:29:38 +08:00
let nav = [
{
path : 'selectStyle' ,
imgPath : new URL ( '@/assets/images/nav1.png' , import . meta . url ) . href ,
2025-12-22 13:42:55 +08:00
flowTypeList : [ FlowType . H _TRYON , FlowType . H _AI ] ,
2025-12-22 11:29:38 +08:00
} ,
{
2025-12-23 14:00:30 +08:00
path : 'product' ,
2025-12-22 11:29:38 +08:00
imgPath : new URL ( '@/assets/images/nav2.png' , import . meta . url ) . href ,
2025-12-22 13:42:55 +08:00
flowTypeList : [ FlowType . H _OUTFIT ] ,
2025-12-22 11:29:38 +08:00
} ,
{
path : 'uploadFace' ,
imgPath : new URL ( '@/assets/images/nav3.png' , import . meta . url ) . href ,
2025-12-22 13:42:55 +08:00
flowTypeList : [ FlowType . H _TRYON , FlowType . H _AI ] ,
2025-12-23 09:30:33 +08:00
click ( ) {
hGenerateStore . clearCustomizeInfo ( )
} ,
2025-12-22 11:29:38 +08:00
} ,
{
path : 'customize' ,
imgPath : new URL ( '@/assets/images/nav4.png' , import . meta . url ) . href ,
2025-12-22 13:42:55 +08:00
flowTypeList : [ FlowType . H _TRYON , FlowType . H _AI ] ,
click ( ) {
2025-12-23 09:30:33 +08:00
hGenerateStore . clearCustomizeInfo ( )
hGenerateStore . uploadCustomizeInfo ( {
tryOnId : hGenerateStore . originalTryOn . id ,
tryOnUrl : hGenerateStore . originalTryOn . tryOnUrl ,
isFavorite : hGenerateStore . originalTryOn . isLike ,
styleUrl : hGenerateStore . style . url ,
} )
2025-12-22 13:42:55 +08:00
} ,
2025-12-22 11:29:38 +08:00
} ,
]
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 )
}
} )
2025-12-19 13:46:59 +08:00
} )
onUnmounted ( ( ) => {
} )
defineExpose ( { } )
// const { } = toRefs(data);
< / script >
< template >
< div class = "homeNavPage" >
2025-12-22 13:39:34 +08:00
< div class = "shadow top" > < / div >
< div class = "shadow bottom" > < / div >
< div class = "titleBox" >
< div class = "title" >
Choose one < br / >
function to explore .
< / div >
< div class = "info" >
Welcome back ! What can I help you today ?
< / div >
2025-12-19 13:46:59 +08:00
< / div >
< div class = "navBox" >
< div class = "navList" >
2025-12-22 13:42:55 +08:00
< div class = "item active" v-for = "item in navList" :key="item.path" @click="openFlow(item)" >
2025-12-22 11:29:38 +08:00
< img :src = "item.imgPath" alt = "" >
< / div >
2025-12-22 13:42:55 +08:00
< div class = "item" v-for = "item in navDisabledList" :key="item.path" @click="openFlow(item)" >
2025-12-22 11:29:38 +08:00
< img :src = "item.imgPath" alt = "" >
< / div >
<!-- < div class = "item" @click ="openFlow('index')" >
2025-12-19 13:46:59 +08:00
< img src = "@/assets/images/nav1.png" alt = "" >
< / div >
2025-12-22 11:29:38 +08:00
< div class = "item" : class = "{'active': ['history-outfit','history-ai'].includes($route.query?.flowType as string)}" @click ="openFlow('recommended','reinventing')" >
2025-12-19 13:46:59 +08:00
< img src = "@/assets/images/nav2.png" alt = "" >
< / div >
2025-12-22 11:29:38 +08:00
< div class = "item" : class = "{'active': ['history-outfit','history-ai'].includes($route.query?.flowType as string)}" @click ="openFlow('index','stylist')" >
2025-12-19 13:46:59 +08:00
< img src = "@/assets/images/nav3.png" alt = "" >
< / div >
2025-12-22 11:29:38 +08:00
< div class = "item" : class = "{'active': ['history-ai'].includes($route.query?.flowType as string)}" @click ="openFlow('','clientId')" >
2025-12-19 13:46:59 +08:00
< img src = "@/assets/images/nav4.png" alt = "" >
2025-12-22 11:29:38 +08:00
< / div > -- >
2025-12-19 13:46:59 +08:00
< / div >
< / div >
< / div >
< / template >
< style lang = "less" scoped >
. header - title {
-- header - title - background : # fff ;
-- header - title - height : 12 rem ! important ;
}
. homeNavPage {
2025-12-22 13:39:34 +08:00
> . shadow {
position : absolute ;
width : 91 rem ;
height : 92 rem ;
background : linear - gradient ( 88.42 deg , # FFFFFF 32.58 % , # D9D9D9 94.9 % ) ;
transform : rotate ( 312 deg ) ;
& . top {
top : - 20 % ;
right : - 20 % ;
}
& . bottom {
bottom : - 30 % ;
left : - 20 % ;
transform : rotate ( 134 deg ) ;
}
2025-12-19 13:46:59 +08:00
}
2025-12-22 13:39:34 +08:00
> . titleBox {
padding - left : 7.9 rem ;
margin - top : 13.4 rem ;
margin - bottom : 11.2 rem ;
> div {
background : linear - gradient ( 120 deg , # b3b3b3 1 % , rgba ( 0 , 0 , 0 , 0 ) 48 % ) , linear - gradient (
344 deg , # B3B3B2 16 % , # 000000 66 % ) ;
- webkit - background - clip : text ;
- webkit - text - fill - color : transparent ;
background - clip : text ;
}
> . title {
2025-12-19 13:46:59 +08:00
font - family : satoshiBold ;
font - weight : 700 ;
2025-12-22 13:39:34 +08:00
font - size : 10 rem ;
line - height : 124 % ;
2025-12-19 13:46:59 +08:00
}
2025-12-22 13:39:34 +08:00
> . info {
margin - top : 4.7 rem ;
font - size : 4 rem ;
font - family : satoshiRegular ;
}
}
> . navBox {
2025-12-19 13:46:59 +08:00
> . navList {
display : flex ;
flex - wrap : wrap ;
padding : 0 7.4 rem ;
gap : 4.8 rem ;
> . item {
// width: 44.2rem;
// height: 41.6rem;
height : auto ;
width : calc ( 50 % - 4.8 rem / 2 ) ;
2025-12-22 11:29:38 +08:00
pointer - events : none ;
opacity : .5 ;
& . active {
pointer - events : auto ;
opacity : 1 ;
}
2025-12-19 13:46:59 +08:00
> img {
width : 100 % ;
height : 100 % ;
object - fit : contain ;
}
}
}
}
}
< / style >