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
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped
This commit is contained in:
@@ -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({
|
||||
//})
|
||||
@@ -33,7 +35,11 @@ const feedbackForm = ref({
|
||||
|
||||
const onContinue = ()=>{
|
||||
const query = router.currentRoute.value.query
|
||||
router.push({ path: 'uploadFace', query: {...query} })
|
||||
if(query?.flowType == FlowType.MAIN){
|
||||
router.push({ path: 'uploadFace', query: {...query} })
|
||||
}else{
|
||||
router.push({ path: 'creation', query: {...query} })
|
||||
}
|
||||
}
|
||||
|
||||
const changeModel = ()=>{
|
||||
|
||||
@@ -1,261 +1,392 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, inject } from 'vue'
|
||||
import router from '@/router'
|
||||
import { showConfirmDialog } from 'vant'
|
||||
import { useUserInfoStore, useOverallStore } from '@/stores'
|
||||
import { LogOut } from '@/api/login'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const overallStore = useOverallStore()
|
||||
const emit = defineEmits(['view-type'])
|
||||
const show = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const form = reactive({
|
||||
name: { msg: '', value: userInfoStore.state.userInfo.username },
|
||||
email: { msg: '', value: userInfoStore.state.userInfo.email },
|
||||
password: { show: false, msg: '', value: userInfoStore.state.userInfo.password }
|
||||
})
|
||||
const open = () => {
|
||||
isEdit.value = false
|
||||
show.value = true
|
||||
}
|
||||
const close = () => {
|
||||
show.value = false
|
||||
}
|
||||
const onEditItem = (item) => {
|
||||
if (!form[item]) return
|
||||
form[item].edit = true
|
||||
}
|
||||
const onSaveItem = (item) => {
|
||||
if (!form[item]) return
|
||||
form[item].edit = false
|
||||
}
|
||||
const switchCustomer = () => {
|
||||
console.log('switchCustomer')
|
||||
}
|
||||
const edit = () => {
|
||||
isEdit.value = true
|
||||
}
|
||||
const confirm = () => {
|
||||
overallStore.setLoading(true)
|
||||
setTimeout(() => {
|
||||
overallStore.setLoading(false)
|
||||
isEdit.value = false
|
||||
}, 1000)
|
||||
}
|
||||
const logout = () => {
|
||||
showConfirmDialog({
|
||||
title: 'Log out',
|
||||
message: 'Are you sure you want to log out?',
|
||||
confirmButtonText: 'Yes',
|
||||
cancelButtonText: 'Cancel'
|
||||
})
|
||||
.then(() => {
|
||||
LogOut().then(() => {
|
||||
userInfoStore.logOut()
|
||||
router.push({ path: '/welcome' })
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
defineExpose({ open })
|
||||
import { ref, reactive, onMounted, inject } from 'vue'
|
||||
import router from '@/router'
|
||||
import { showConfirmDialog } from 'vant'
|
||||
import { useUserInfoStore, useOverallStore } from '@/stores'
|
||||
import { LogOut } from '@/api/login'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const overallStore = useOverallStore()
|
||||
const emit = defineEmits(['view-type', 'selected-customer'])
|
||||
const show = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const form = reactive({
|
||||
name: { msg: '', value: userInfoStore.state.userInfo.username },
|
||||
email: { msg: '', value: userInfoStore.state.userInfo.email },
|
||||
password: { show: false, msg: '', value: userInfoStore.state.userInfo.password }
|
||||
})
|
||||
const open = () => {
|
||||
isEdit.value = false
|
||||
show.value = true
|
||||
}
|
||||
const close = () => {
|
||||
show.value = false
|
||||
}
|
||||
const onEditItem = (item) => {
|
||||
if (!form[item]) return
|
||||
form[item].edit = true
|
||||
}
|
||||
const onSaveItem = (item) => {
|
||||
if (!form[item]) return
|
||||
form[item].edit = false
|
||||
}
|
||||
const switchCustomer = () => {
|
||||
// console.log('switchCustomer')
|
||||
handleShowPopup(true)
|
||||
}
|
||||
const edit = () => {
|
||||
isEdit.value = true
|
||||
}
|
||||
const confirm = () => {
|
||||
overallStore.setLoading(true)
|
||||
setTimeout(() => {
|
||||
overallStore.setLoading(false)
|
||||
isEdit.value = false
|
||||
}, 1000)
|
||||
}
|
||||
const logout = () => {
|
||||
showConfirmDialog({
|
||||
title: 'Log out',
|
||||
message: 'Are you sure you want to log out?',
|
||||
confirmButtonText: 'Yes',
|
||||
cancelButtonText: 'Cancel'
|
||||
})
|
||||
.then(() => {
|
||||
LogOut().then(() => {
|
||||
userInfoStore.logOut()
|
||||
router.push({ path: '/welcome' })
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
const showSwitchCustomerPopup = ref(false)
|
||||
|
||||
const customerList = ref([
|
||||
{ id: 'CUST001', nickname: 'Customer One', checked: true },
|
||||
{ id: 'CUST002', nickname: 'Customer Two', checked: false },
|
||||
{ id: 'CUST003', nickname: 'Customer Three', checked: false },
|
||||
{ id: 'CUST004', nickname: 'Customer Four', checked: false },
|
||||
{ id: 'CUST005', nickname: 'Customer Five', checked: false }
|
||||
])
|
||||
// 打开customer选择时关闭profile弹窗 如果不是点击confirem关闭则重新打开profile弹窗
|
||||
const handleShowPopup = (flag: boolean) => {
|
||||
showSwitchCustomerPopup.value = flag
|
||||
show.value = !flag
|
||||
}
|
||||
const handleChangeChecked = (item) => {
|
||||
customerList.value.forEach((customer) => {
|
||||
customer.checked = customer.id === item.id
|
||||
})
|
||||
}
|
||||
const handleSelectCustomer = () => {
|
||||
const selectedCustomer = customerList.value.find((customer) => customer.checked)
|
||||
if (selectedCustomer) {
|
||||
emit('selected-customer', selectedCustomer)
|
||||
}
|
||||
showSwitchCustomerPopup.value = false
|
||||
}
|
||||
|
||||
const openSwitchCustomerPopup = (flag = true) => {
|
||||
showSwitchCustomerPopup.value = flag
|
||||
}
|
||||
|
||||
defineExpose({ open, close, openSwitchCustomerPopup })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<van-popup class="van-popup" v-model:show="show" position="bottom" round>
|
||||
<div class="profile">
|
||||
<div class="header">
|
||||
<span class="title">Profile</span>
|
||||
<van-icon name="cross" class="close" @click="close" />
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="form-item">
|
||||
<div class="label">Your Name</div>
|
||||
<label class="input">
|
||||
<div class="icon"><SvgIcon name="user" size="64" /></div>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Enter your name"
|
||||
v-model="form.name.value"
|
||||
:readonly="!isEdit"
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('name')">
|
||||
<van-popup class="van-popup" v-model:show="show" position="bottom" round>
|
||||
<div class="profile">
|
||||
<div class="header">
|
||||
<span class="title">Profile</span>
|
||||
<van-icon name="cross" class="close" @click="close" />
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="form-item">
|
||||
<div class="label">Your Name</div>
|
||||
<label class="input">
|
||||
<div class="icon"><SvgIcon name="user" size="64" /></div>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Enter your name"
|
||||
v-model="form.name.value"
|
||||
:readonly="!isEdit"
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('name')">
|
||||
<SvgIcon name="confirmation" size="37" />
|
||||
</div>
|
||||
<div class="icon" v-else @click="onEditItem('name')">
|
||||
<SvgIcon name="edit" size="37" />
|
||||
</div> -->
|
||||
</label>
|
||||
<p class="error" v-show="form.name.msg">{{ form.name.msg }}</p>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<div class="label">Your Email</div>
|
||||
<label class="input">
|
||||
<div class="icon"><SvgIcon name="email" size="64" /></div>
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Enter your email"
|
||||
v-model="form.email.value"
|
||||
:readonly="!isEdit"
|
||||
required
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('email')">
|
||||
</label>
|
||||
<p class="error" v-show="form.name.msg">{{ form.name.msg }}</p>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<div class="label">Your Email</div>
|
||||
<label class="input">
|
||||
<div class="icon"><SvgIcon name="email" size="64" /></div>
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Enter your email"
|
||||
v-model="form.email.value"
|
||||
:readonly="!isEdit"
|
||||
required
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('email')">
|
||||
<SvgIcon name="confirmation" size="37" />
|
||||
</div>
|
||||
<div class="icon" v-else @click="onEditItem('email')">
|
||||
<SvgIcon name="edit" size="37" />
|
||||
</div> -->
|
||||
</label>
|
||||
<p class="error" v-show="form.email.msg">{{ form.email.msg }}</p>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<div class="label">Password</div>
|
||||
<label class="input">
|
||||
<div class="icon" @click="form.password.show = !form.password.show">
|
||||
<SvgIcon :name="form.password.show ? 'password_1' : 'password_0'" size="64" />
|
||||
</div>
|
||||
<input
|
||||
:type="form.password.show ? 'text' : 'password'"
|
||||
placeholder="Enter your password"
|
||||
v-model="form.password.value"
|
||||
:readonly="!isEdit"
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('password')">
|
||||
</label>
|
||||
<p class="error" v-show="form.email.msg">{{ form.email.msg }}</p>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<div class="label">Password</div>
|
||||
<label class="input">
|
||||
<div class="icon" @click="form.password.show = !form.password.show">
|
||||
<SvgIcon :name="form.password.show ? 'password_1' : 'password_0'" size="64" />
|
||||
</div>
|
||||
<input
|
||||
:type="form.password.show ? 'text' : 'password'"
|
||||
placeholder="Enter your password"
|
||||
v-model="form.password.value"
|
||||
:readonly="!isEdit"
|
||||
/>
|
||||
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('password')">
|
||||
<SvgIcon name="confirmation" size="37" />
|
||||
</div>
|
||||
<div class="icon" v-else @click="onEditItem('password')">
|
||||
<SvgIcon name="edit" size="37" />
|
||||
</div> -->
|
||||
</label>
|
||||
<p class="error" v-show="form.password.msg">{{ form.password.msg }}</p>
|
||||
</div>
|
||||
</label>
|
||||
<p class="error" v-show="form.password.msg">{{ form.password.msg }}</p>
|
||||
</div>
|
||||
|
||||
<template v-if="isEdit">
|
||||
<button class="confirm" @click="confirm">Confirm</button>
|
||||
<p class="tip">Powered by AiDLab for Lane Crawford</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<button class="switch" @click="switchCustomer">Switch Customer</button>
|
||||
<button class="edit" @click="edit">Edit Profile</button>
|
||||
<button class="logout" @click="logout">Log out</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
<template v-if="isEdit">
|
||||
<button class="confirm" @click="confirm">Confirm</button>
|
||||
<p class="tip">Powered by AiDLab for Lane Crawford</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<button class="switch" @click="switchCustomer">Switch Customer</button>
|
||||
<button class="edit" @click="edit">Edit Profile</button>
|
||||
<button class="logout" @click="logout">Log out</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
<van-popup
|
||||
class="user-popup"
|
||||
v-model:show="showSwitchCustomerPopup"
|
||||
round
|
||||
position="bottom"
|
||||
teleport="body"
|
||||
>
|
||||
<div class="popup-title flex">
|
||||
<div class="title-txt">Saved Customer ID</div>
|
||||
<SvgIcon name="close_nocolor" color="#a1a1a1" size="40" @click="handleShowPopup(false)" />
|
||||
</div>
|
||||
<div class="cusomter-list">
|
||||
<div
|
||||
class="customer-item flex flex-align-center flex-between"
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
@click="handleChangeChecked(item)"
|
||||
>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.nickname }}</div>
|
||||
<div class="id">{{ item.id }}</div>
|
||||
</div>
|
||||
<div class="select-box">
|
||||
<div class="check-box flex flex-center" v-show="!item.checked">
|
||||
<div class="check"></div>
|
||||
</div>
|
||||
<img v-show="item.checked" class="checked-icon" src="@/assets/images/checked.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="confirm-btn" @click="handleSelectCustomer">Confirm</div>
|
||||
</van-popup>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.van-popup {
|
||||
max-height: 90%;
|
||||
--van-popup-round-radius: 7.8rem;
|
||||
}
|
||||
.profile {
|
||||
margin: 6.5rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
> .header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 0 7rem;
|
||||
margin-bottom: 8rem;
|
||||
> .title {
|
||||
font-family: satoshiBold;
|
||||
font-size: 4.6rem;
|
||||
color: #181725;
|
||||
}
|
||||
> .close {
|
||||
margin-left: auto;
|
||||
font-size: 5rem;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
}
|
||||
> .box {
|
||||
width: 100%;
|
||||
padding: 0 13rem;
|
||||
> div {
|
||||
width: 100%;
|
||||
margin-top: 5.1rem;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
> button {
|
||||
margin-top: 8.5rem;
|
||||
width: 100%;
|
||||
height: 14.5rem;
|
||||
border-radius: 2rem;
|
||||
font-size: 4rem;
|
||||
border: 0.2rem solid #3b3b3b;
|
||||
font-family: satoshiBold;
|
||||
}
|
||||
> .form-item {
|
||||
> .label {
|
||||
margin-bottom: 2.5rem;
|
||||
font-family: satoshiBold;
|
||||
font-size: 2.9rem;
|
||||
line-height: 120%;
|
||||
color: #262422;
|
||||
}
|
||||
> .input {
|
||||
// width: 100%;
|
||||
height: 13.9rem;
|
||||
border-radius: 2.5rem;
|
||||
border: 0.2rem solid #f1ecec;
|
||||
box-sizing: content-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
padding: 0 2.5rem;
|
||||
> * {
|
||||
margin-right: 2.5rem;
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
> .icon {
|
||||
// margin: 0 2.5rem;
|
||||
--svg-icon-color: #ababab;
|
||||
}
|
||||
> input {
|
||||
width: 0;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
font-family: satoshiMedium;
|
||||
font-size: 3.5rem;
|
||||
color: #000;
|
||||
border: none;
|
||||
&::placeholder {
|
||||
color: #ababab;
|
||||
}
|
||||
}
|
||||
}
|
||||
> .error {
|
||||
margin-top: 1rem;
|
||||
font-family: satoshiRegular;
|
||||
font-size: 2.5rem;
|
||||
line-height: 120%;
|
||||
color: #ff0000;
|
||||
}
|
||||
}
|
||||
> .switch {
|
||||
background-color: transparent;
|
||||
color: #222;
|
||||
}
|
||||
> .confirm,
|
||||
> .edit,
|
||||
> .logout {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
> .tip {
|
||||
font-family: satoshiRegular;
|
||||
text-align: center;
|
||||
font-size: 3rem;
|
||||
color: #a1a1a1;
|
||||
margin-top: 17.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.van-popup {
|
||||
max-height: 90%;
|
||||
--van-popup-round-radius: 7.8rem;
|
||||
}
|
||||
.profile {
|
||||
margin: 6.5rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
> .header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 0 7rem;
|
||||
margin-bottom: 8rem;
|
||||
> .title {
|
||||
font-family: satoshiBold;
|
||||
font-size: 4.6rem;
|
||||
color: #181725;
|
||||
}
|
||||
> .close {
|
||||
margin-left: auto;
|
||||
font-size: 5rem;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
}
|
||||
> .box {
|
||||
width: 100%;
|
||||
padding: 0 13rem;
|
||||
> div {
|
||||
width: 100%;
|
||||
margin-top: 5.1rem;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
> button {
|
||||
margin-top: 8.5rem;
|
||||
width: 100%;
|
||||
height: 14.5rem;
|
||||
border-radius: 2rem;
|
||||
font-size: 4rem;
|
||||
border: 0.2rem solid #3b3b3b;
|
||||
font-family: satoshiBold;
|
||||
}
|
||||
> .form-item {
|
||||
> .label {
|
||||
margin-bottom: 2.5rem;
|
||||
font-family: satoshiBold;
|
||||
font-size: 2.9rem;
|
||||
line-height: 120%;
|
||||
color: #262422;
|
||||
}
|
||||
> .input {
|
||||
// width: 100%;
|
||||
height: 13.9rem;
|
||||
border-radius: 2.5rem;
|
||||
border: 0.2rem solid #f1ecec;
|
||||
box-sizing: content-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
padding: 0 2.5rem;
|
||||
> * {
|
||||
margin-right: 2.5rem;
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
> .icon {
|
||||
// margin: 0 2.5rem;
|
||||
--svg-icon-color: #ababab;
|
||||
}
|
||||
> input {
|
||||
width: 0;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
font-family: satoshiMedium;
|
||||
font-size: 3.5rem;
|
||||
color: #000;
|
||||
border: none;
|
||||
&::placeholder {
|
||||
color: #ababab;
|
||||
}
|
||||
}
|
||||
}
|
||||
> .error {
|
||||
margin-top: 1rem;
|
||||
font-family: satoshiRegular;
|
||||
font-size: 2.5rem;
|
||||
line-height: 120%;
|
||||
color: #ff0000;
|
||||
}
|
||||
}
|
||||
> .switch {
|
||||
background-color: transparent;
|
||||
color: #222;
|
||||
}
|
||||
> .confirm,
|
||||
> .edit,
|
||||
> .logout {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
> .tip {
|
||||
font-family: satoshiRegular;
|
||||
text-align: center;
|
||||
font-size: 3rem;
|
||||
color: #a1a1a1;
|
||||
margin-top: 17.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.van-popup.user-popup {
|
||||
height: 116.1rem;
|
||||
color: #181725;
|
||||
border-top-left-radius: 7.8rem;
|
||||
border-top-right-radius: 7.8rem;
|
||||
.c-svg {
|
||||
width: initial;
|
||||
}
|
||||
.popup-title {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 700;
|
||||
font-family: 'satoshiBold';
|
||||
font-size: 4.8rem;
|
||||
padding: 12rem 7.4rem 7.8rem 6.7rem;
|
||||
border-bottom: 0.26rem solid #e2e2e2b2;
|
||||
}
|
||||
.cusomter-list {
|
||||
padding: 0 7rem 0 6.6rem;
|
||||
font-family: 'satoshiMedium';
|
||||
color: #000;
|
||||
/* Fixed list area: show up to 4 items, enable vertical scroll when overflow */
|
||||
height: 64.8rem; /* 4 * 16.2rem (customer-item height) */
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
.customer-item {
|
||||
height: 16.2rem;
|
||||
border-bottom: 0.26rem solid #e2e2e2b2;
|
||||
.info {
|
||||
.name {
|
||||
font-size: 3.6rem;
|
||||
}
|
||||
.id {
|
||||
font-size: 3.6rem;
|
||||
color: #b3b3b3;
|
||||
}
|
||||
}
|
||||
.checked-icon,
|
||||
.check-box {
|
||||
width: 6rem;
|
||||
height: 6rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.check {
|
||||
width: 4.8rem;
|
||||
height: 4.8rem;
|
||||
border-radius: 50%;
|
||||
border: 0.4rem solid #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
.confirm-btn {
|
||||
margin: 4.9rem 12.7rem 0 13.3rem;
|
||||
border: 0.25rem solid #3b3b3b;
|
||||
width: 82rem;
|
||||
height: 14.5rem;
|
||||
border-radius: 2rem;
|
||||
font-family: 'satoshiBold';
|
||||
font-weight: 700;
|
||||
font-size: 4rem;
|
||||
line-height: 14.5rem;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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({
|
||||
@@ -45,7 +47,11 @@ const toProduct = ()=>{
|
||||
generateStore.setIsGenerate(true)
|
||||
}
|
||||
const query = router.currentRoute.value.query
|
||||
router.push({ path: 'product', query: {...query} })
|
||||
if(query?.flowType == FlowType.MAIN){
|
||||
router.push({ path: 'product', query: {...query} })
|
||||
}else{
|
||||
router.push({ path: 'creation', query: {...query} })
|
||||
}
|
||||
}
|
||||
|
||||
const requestOutfit = ({num,index})=>{
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div
|
||||
class="customer-container safe-area-top flex flex-column"
|
||||
:class="{ 'form-mode': pageMode === 'form' }"
|
||||
:class="{ 'form-mode': pageMode !== 'entry' }"
|
||||
>
|
||||
<div class="setting flex flex-between">
|
||||
<SvgIcon name="left" size="70" @click.stop="handleBack" />
|
||||
<SvgIcon name="setting" size="70" />
|
||||
<SvgIcon name="profile_white" size="55" @click="handleOpenProfile" />
|
||||
</div>
|
||||
<template v-if="pageMode === 'entry'">
|
||||
<div class="content flex-1 flex flex-center flex-column">
|
||||
<div class="text">Who is Your Customer?</div>
|
||||
<div class="btn-list flex flex-center">
|
||||
<button class="sandblasted-blurred btn">
|
||||
<button class="sandblasted-blurred btn" @click="handleChangeMode('create')">
|
||||
<span>Create</span>
|
||||
</button>
|
||||
<button class="sandblasted-blurred btn" @click="handleChangeMode('form')">
|
||||
@@ -23,18 +23,27 @@
|
||||
<template v-else>
|
||||
<div class="form-container flex-1 flex flex-column flex-center">
|
||||
<div class="text">
|
||||
<div class="form-title">Customer ID</div>
|
||||
<div class="form-title">{{ formTitle }}</div>
|
||||
<div class="description">
|
||||
<p>Redefine the styling experience with AI.</p>
|
||||
<p>Use Styling Angel to speed up your fashion journey.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="glass-form">
|
||||
<div class="glass-form" :class="{ create: pageMode === 'create' }">
|
||||
<div class="form-field" v-if="pageMode === 'create'">
|
||||
<label class="field-label">VIP ID</label>
|
||||
<input
|
||||
v-model="customerData.vipId"
|
||||
type="text"
|
||||
placeholder="Enter your ID"
|
||||
class="form-input"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="field-label">Nickname</label>
|
||||
<input
|
||||
v-model="customerData.vipId"
|
||||
v-model="customerData.nickname"
|
||||
type="text"
|
||||
placeholder="Enter name"
|
||||
class="form-input"
|
||||
@@ -42,41 +51,45 @@
|
||||
</div>
|
||||
<button class="confirm-btn" @click="handleConfirm">Confirm</button>
|
||||
</div>
|
||||
<div class="show-all">Show All</div>
|
||||
<div v-if="pageMode === 'form'" class="show-all" @click="handleShowPopup(true)">
|
||||
Show All
|
||||
</div>
|
||||
<div class="copyright">Powered by AiDLab for Lane Crawford</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<Profile ref="profileRef" @selected-customer="handleSelectCustomer" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGenerateStore, useUserInfoStore } from '@/stores'
|
||||
import { showToast } from 'vant'
|
||||
import { customerCheckin } from '@/api/workshop'
|
||||
import Profile from '../Workshop/profile.vue'
|
||||
|
||||
const profileRef = ref<typeof Profile>(null)
|
||||
const handleOpenProfile = () => {
|
||||
profileRef.value.open()
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const generateStore = useGenerateStore()
|
||||
|
||||
type PageMode = 'form' | 'entry'
|
||||
type PageMode = 'form' | 'entry' | 'create'
|
||||
const pageMode = ref<PageMode>('entry')
|
||||
|
||||
const handleBack = (e?: Event) => {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
if (pageMode.value === 'form') {
|
||||
pageMode.value = 'entry'
|
||||
return
|
||||
}
|
||||
router.go(-1)
|
||||
}
|
||||
const formTitle = computed(() => {
|
||||
return pageMode.value === 'entry' ? 'Customer ID' : 'Create Profile'
|
||||
})
|
||||
|
||||
const handleChangeMode = (mode: PageMode) => {
|
||||
pageMode.value = mode
|
||||
}
|
||||
|
||||
const customerData = ref({
|
||||
vipId: ''
|
||||
vipId: '',
|
||||
nickname: ''
|
||||
// email: ''
|
||||
})
|
||||
|
||||
@@ -88,14 +101,41 @@ const handleConfirm = async () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (pageMode.value === 'form') {
|
||||
await customerCheckin({ nickname: customerData.value.nickname }).then((res) => {
|
||||
useUserInfoStore().resetGenerateParams()
|
||||
generateStore.setCustomerInfo(res)
|
||||
router.push('/workshop/home')
|
||||
})
|
||||
} else {
|
||||
// 创建接口
|
||||
}
|
||||
}
|
||||
|
||||
customerCheckin(customerData.value).then((res) => {
|
||||
useUserInfoStore().resetGenerateParams()
|
||||
// console.log('res', res)
|
||||
generateStore.setCustomerInfo(res)
|
||||
// router.push('/workshop/stylist/index')
|
||||
router.push('/workshop/home')
|
||||
})
|
||||
const handleShowPopup = (flag: Boolean) => {
|
||||
// showPopup.value = flag
|
||||
profileRef.value.openSwitchCustomerPopup(flag)
|
||||
}
|
||||
|
||||
const handleSelectCustomer = (value) => {
|
||||
console.log(value)
|
||||
// if (selected) {
|
||||
// customerData.value.nickname = selected.nickname
|
||||
// }
|
||||
}
|
||||
|
||||
const handleBack = (e?: Event) => {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
if (pageMode.value !== 'entry') {
|
||||
pageMode.value = 'entry'
|
||||
customerData.value = {
|
||||
vipId: '',
|
||||
nickname: ''
|
||||
}
|
||||
return
|
||||
}
|
||||
router.go(-1)
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@@ -180,6 +220,9 @@ const handleConfirm = async () => {
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&.create {
|
||||
height: 78.8rem;
|
||||
}
|
||||
|
||||
background: radial-gradient(
|
||||
100% 100% at 0% 0%,
|
||||
|
||||
Reference in New Issue
Block a user