Files
lanecarford_front/src/views/Workshop/uploadFace1.vue

109 lines
2.5 KiB
Vue
Raw Normal View History

2025-10-16 13:57:00 +08:00
<script setup lang="ts">
2025-11-17 17:33:32 +08:00
import { ref, onMounted, computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
2025-10-24 11:47:07 +08:00
import { useGenerateStore } from '@/stores'
2025-12-22 13:02:53 +08:00
import { IsHistoryFlow } from '@/types/enum'
2025-10-24 11:47:07 +08:00
const generateStore = useGenerateStore()
2025-10-16 13:57:00 +08:00
const emit = defineEmits(['view-type'])
onMounted(() => {
emit('view-type', 1)
})
const router = useRouter()
2025-11-17 17:33:32 +08:00
const route = useRoute()
const query = computed(() => route.query)
2025-12-22 13:02:53 +08:00
const isHistoryFlow = computed(() => IsHistoryFlow(query.value.flowType))
2025-10-16 13:57:00 +08:00
// 上传照片
const handleUploadFace = () => {
2025-10-24 16:21:04 +08:00
// generateStore.updatePhotoInfo({})
2025-11-17 17:33:32 +08:00
router.push({ name: 'uploadFace2', query: query.value })
2025-10-16 13:57:00 +08:00
}
2025-10-24 11:47:07 +08:00
// 跳过上传
2025-10-16 13:57:00 +08:00
const handleFinish = () => {
2025-12-22 13:02:53 +08:00
generateStore.updatePhotoInfo({})
generateStore.clearCustomizeInfo()
generateStore.uploadCustomizeInfo({
tryOnId: generateStore.originalTryOn.id,
tryOnUrl: generateStore.originalTryOn.tryOnUrl,
isFavorite: generateStore.originalTryOn.isLike
})
router.push({ name: 'customize', query: query.value })
2025-10-16 13:57:00 +08:00
}
</script>
<template>
<!-- 上传照片 -->
<div class="upload-face-1">
<img src="@/assets/images/workshop/bg/upload_bg.png" class="bg" />
<div class="texts">
<p class="title">Keep Styling with AI?</p>
<p class="desc">
Would you like to keep playing with<br />
our personalized AI tools?
</p>
</div>
<div class="btns">
2025-12-10 13:32:22 +08:00
<button class="sandblasted-blurred flex flex-center" @click="handleUploadFace">
2025-10-21 13:41:54 +08:00
<span>Upload Face</span>
</button>
2025-12-22 13:02:53 +08:00
<button
class="sandblasted-blurred flex flex-center"
@click="handleFinish"
v-if="!isHistoryFlow"
>
<span>Finish</span>
</button>
2025-10-16 13:57:00 +08:00
</div>
</div>
</template>
<style scoped lang="less">
.upload-face-1 {
width: 100%;
flex: 1;
overflow: hidden;
position: relative;
color: #fff;
> * {
position: absolute;
}
> .bg {
position: relative;
width: 100%;
height: auto;
2025-11-03 10:17:32 +08:00
min-height: 100%;
object-fit: cover;
2025-10-16 13:57:00 +08:00
}
> .texts {
top: 0;
left: 0;
padding: 9.9rem 0 0 7.2rem;
> .title {
font-family: 'satoshiBold';
font-size: 8.63rem;
}
> .desc {
font-family: 'satoshiMedium';
font-size: 4rem;
margin-top: 2rem;
line-height: 132%;
}
}
2025-10-24 11:47:07 +08:00
> .btns {
2025-10-21 13:41:54 +08:00
width: 100%;
display: flex;
justify-content: center;
2025-10-16 13:57:00 +08:00
bottom: 19.7rem;
2025-10-21 13:41:54 +08:00
> button {
2025-12-10 13:32:22 +08:00
width: 35rem;
2025-10-21 13:41:54 +08:00
height: 8.3rem;
2025-12-10 13:32:22 +08:00
box-sizing: border-box;
2025-10-21 13:41:54 +08:00
border-radius: 0.7rem;
margin: 0 1.8rem;
2025-12-10 13:32:22 +08:00
&.sandblasted-blurred {
2025-12-22 13:02:53 +08:00
// border-width: 0.2rem;
2025-12-10 13:32:22 +08:00
}
2025-10-21 13:41:54 +08:00
}
2025-10-16 13:57:00 +08:00
}
}
</style>