Files
lanecarford_front/src/views/stylist/customer.vue

259 lines
6.6 KiB
Vue
Raw Normal View History

2025-10-13 10:13:54 +08:00
<template>
2025-10-14 16:42:09 +08:00
<div class="customer-container safe-area-top" :class="{ 'form-mode': pageMode === 'form' }">
2025-10-13 10:13:54 +08:00
<template v-if="pageMode === 'entry'">
<div class="setting flex flex-between">
2025-11-03 10:34:17 +08:00
<van-icon name="arrow-left" color="#fff" @click="handleBack" />
2025-10-16 17:07:36 +08:00
<SvgIcon name="setting" size="70" />
2025-10-13 10:13:54 +08:00
</div>
<div class="content flex flex-center flex-column">
<div class="text">Who is Your Customer?</div>
</div>
<div class="entry-btn flex flex-center" @click="handleChangeMode('form')">Entry</div>
</template>
2025-10-14 16:42:09 +08:00
<template v-else>
<div class="form-container">
<div class="back-container flex flex-center" @click="handleChangeMode('entry')">
2025-11-03 10:34:17 +08:00
<van-icon name="arrow-left" color="#fff" />
2025-10-14 16:42:09 +08:00
</div>
<div class="text">
<div class="form-title">Entry ID</div>
<div class="description">
Redefine the styling experience with AI.<br />
Use Styling Angel to speed up your fashion journey.
</div>
</div>
<div class="glass-form">
<div class="form-field">
2025-11-17 17:38:57 +08:00
<label class="field-label">VIP ID</label>
<input v-model="customerData.name" type="text" placeholder="Enter your ID" class="form-input" />
2025-10-14 16:42:09 +08:00
</div>
<div class="form-field email">
2025-11-17 17:38:57 +08:00
<label class="field-label">Email Address</label>
2025-10-27 11:43:07 +08:00
<input
v-model="customerData.email"
type="email"
2025-11-17 17:38:57 +08:00
placeholder="Enter your email"
2025-10-27 11:43:07 +08:00
class="form-input"
/>
2025-10-14 16:42:09 +08:00
</div>
<button class="confirm-btn" @click="handleConfirm">Confirm</button>
</div>
<div class="copyright">Powered by AiDLab for Lane Crawford</div>
</div>
</template>
2025-10-13 10:13:54 +08:00
</div>
</template>
<script setup lang="ts">
2025-10-28 15:17:47 +08:00
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
2025-11-03 10:34:17 +08:00
import { useGenerateStore, useUserInfoStore } from '@/stores'
2025-10-24 17:37:15 +08:00
import { showToast } from 'vant'
2025-10-27 11:43:07 +08:00
import { customerCheckin } from '@/api/workshop'
const router = useRouter()
2025-10-27 11:43:07 +08:00
const generateStore = useGenerateStore()
2025-10-13 10:13:54 +08:00
type PageMode = 'form' | 'entry'
const pageMode = ref<PageMode>('entry')
2025-10-27 11:08:26 +08:00
const handleBack = () => {
router.go(-1)
}
2025-10-13 10:13:54 +08:00
const handleChangeMode = (mode: PageMode) => {
pageMode.value = mode
}
2025-10-14 16:42:09 +08:00
2025-10-27 11:43:07 +08:00
const customerData = ref({
2025-10-24 17:37:15 +08:00
name: '',
email: ''
})
const handleConfirm = async () => {
2025-10-27 11:43:07 +08:00
if (customerData.value.name === '' || customerData.value.email === '') {
showToast({
message: 'please input name and email',
position: 'top'
})
2025-10-24 17:37:15 +08:00
return
}
2025-10-27 11:43:07 +08:00
customerCheckin(customerData.value).then((res) => {
2025-10-28 15:17:47 +08:00
useUserInfoStore().resetGenerateParams()
// console.log('res', res)
2025-10-27 11:43:07 +08:00
generateStore.setCustomerInfo(res)
2025-11-17 17:33:32 +08:00
// router.push('/stylist/index')
router.push('/homeNav')
2025-10-27 11:43:07 +08:00
})
2025-10-14 16:42:09 +08:00
}
2025-10-13 10:13:54 +08:00
</script>
<style lang="less" scoped>
.customer-container {
height: 100vh;
overflow: hidden;
color: #fff;
position: relative;
background: url('@/assets/images/no_shouder_bg.png') no-repeat center center;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
&.form-mode {
background: url('@/assets/images/has_shouder_bg.png') no-repeat center center;
2025-10-14 16:42:09 +08:00
padding-top: 21.47rem;
2025-10-13 10:13:54 +08:00
}
.setting {
z-index: 1;
padding: 3.17rem 4.9rem 0 8.4rem;
2025-11-03 10:34:17 +08:00
font-size: 7rem;
2025-10-16 17:07:36 +08:00
.c-svg {
width: initial;
}
2025-10-13 10:13:54 +08:00
}
.content {
margin-top: 55.3rem;
.text {
font-family: 'satoshiBold';
font-size: 13rem;
line-height: 112.99%;
text-align: center;
letter-spacing: 2;
}
.start-btn {
font-size: 5.6rem;
width: 32.5rem;
height: 8.1rem;
2025-11-03 10:17:54 +08:00
border: .2rem solid #fff;
2025-10-13 10:13:54 +08:00
display: flex;
align-items: center;
justify-content: center;
border-radius: 4rem;
}
}
.entry-btn {
position: absolute;
2025-11-03 10:17:54 +08:00
border: .2rem solid #fff;
2025-10-13 10:13:54 +08:00
bottom: 10.3rem;
right: 5.5rem;
height: 9rem;
width: 27.5rem;
line-height: 9rem;
font-size: 5.6rem;
}
2025-10-14 16:42:09 +08:00
.form-container {
.back-container {
width: 7.3rem;
height: 7.3rem;
2025-11-03 10:17:54 +08:00
border: .2rem solid #fff;
2025-10-14 16:42:09 +08:00
border-radius: 1.8rem;
2025-11-03 10:34:17 +08:00
font-size: 4.3rem;
2025-10-14 16:42:09 +08:00
background: rgba(0, 0, 0, 0.2);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
-moz-backdrop-filter: blur(20px);
-ms-backdrop-filter: blur(20px);
-o-backdrop-filter: blur(20px);
2025-10-14 16:42:09 +08:00
margin-left: 7rem;
position: relative;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 #000000;
.back-icon {
width: 2.08rem;
height: 3.47rem;
}
}
.text {
padding-left: 15.2rem;
margin-top: 7.9rem;
letter-spacing: 0.02rem;
}
.form-title {
font-family: 'satoshiBold';
font-size: 11rem;
line-height: 1.24em;
}
.description {
font-size: 3rem;
line-height: 141%;
letter-spacing: 0.08rem;
margin-top: 2.7rem;
font-family: 'satoshiRegular';
}
.glass-form {
height: 84.8rem;
2025-11-03 10:17:54 +08:00
border: .2rem solid #ffffff;
2025-10-14 16:42:09 +08:00
border-radius: 4.7rem;
margin: 0 14.2rem;
padding: 8.2rem 7.9rem;
margin-top: 7.5rem;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
background: radial-gradient(
100% 100% at 0% 0%,
rgba(115, 115, 115, 0.4) 0%,
rgba(0, 0, 0, 0) 100%
);
backdrop-filter: blur(35px);
2025-10-14 16:42:09 +08:00
.form-field {
margin-bottom: 3.6rem;
&.email {
margin-bottom: 6.8rem;
}
.field-label {
display: block;
color: #fff;
font-size: 3.6rem;
font-family: 'satoshiRegular';
margin-bottom: 3rem;
}
.form-input {
width: 100%;
height: 10rem;
line-height: 10rem;
2025-11-03 10:17:54 +08:00
border: .2rem solid #fff;
2025-10-14 16:42:09 +08:00
border-radius: 7rem;
padding: 0 5.5rem;
color: #fff;
font-size: 3.8rem;
font-family: 'satoshiRegular';
background: transparent;
&::placeholder {
color: rgba(255, 255, 255, 0.6);
}
}
}
.confirm-btn {
width: 100%;
height: 10rem;
line-height: 10rem;
background: #000;
border: none;
border-radius: 7rem;
color: #fff;
font-size: 4rem;
font-family: 'satoshiRegular';
cursor: pointer;
2025-11-03 10:17:54 +08:00
box-shadow: 0 .2rem 8px rgba(0, 0, 0, 0.2);
2025-10-14 16:42:09 +08:00
}
}
.copyright {
2025-10-14 16:42:09 +08:00
font-family: 'satoshiRegular';
font-size: 3rem;
line-height: 124%;
letter-spacing: 0.08rem;
margin-top: 2.7rem;
text-align: center;
font-weight: 400;
margin-top: 18.7rem;
}
}
2025-10-13 10:13:54 +08:00
}
</style>