Files
lanecarford_front/src/views/stylist/index.vue
2025-10-13 10:13:54 +08:00

332 lines
7.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="stylist-page">
<!-- 主要内容区域 -->
<div class="content">
<!-- 标题 -->
<div class="header">
<div class="title">CHOOSE YOUR STYLIST</div>
</div>
<!-- 轮播容器 -->
<div class="carousel-container">
<!-- 左箭头 -->
<div class="nav-arrow left" @click="handleChangeSwiper('prev')">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
<path
d="M15 18L9 12L15 6"
stroke="white"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<van-swipe touchable ref="swiperRef">
<van-swipe-item v-for="item in stylists" :key="item.id">
<div class="swiper-container" @click="handleClickStylist(item)">
<img :src="item.image" />
<div class="text-container">
<div class="name">{{ item.name }}</div>
<div class="description">
{{ item.description }}
</div>
</div>
</div>
</van-swipe-item>
</van-swipe>
<div class="nav-arrow right" @click="handleChangeSwiper('next')">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
<path
d="M9 18L15 12L9 6"
stroke="white"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
</div>
<!-- Continue按钮 -->
<div class="continue-button" @click="handleContinue">Continue</div>
<van-dialog
class="video-dialog"
:show-confirm-button="false"
:show-cancel-button="false"
v-model:show="showVideo"
title=""
show-cancel-button
>
<div class="close-btn" @click="showVideo = false">
<van-icon name="cross" class="close-icon" />
</div>
<Video ref="videoRef" />
</van-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import Video from './components/Video.vue'
const router = useRouter()
// stylist数据
const stylists = ref<array>([
{
id: 1,
name: 'Vera Lo',
description: 'Contemporary, Classic, Simple Silhouettes, Statement Pieces',
image: '/src/assets/images/female.png'
},
{
id: 2,
name: 'Sarah Chen',
description: 'Modern, Edgy, Bold Colors, Street Style',
image: '/src/assets/images/male.png'
},
{
id: 3,
name: 'Emma Wilson',
description: 'Elegant, Feminine, Vintage Inspired, Soft Tones',
image: '/src/assets/images/female.png'
},
{
id: 4,
name: 'Alex Johnson',
description: 'Minimalist, Professional, Neutral Palette, Clean Lines',
image: '/src/assets/images/male.png'
}
])
const swiperRef = ref<any>(null)
const showVideo = ref<boolean>(false)
const videoRef = ref<any>(null)
const handleChangeSwiper = (type: 'next' | 'prev') => {
if (type === 'next') {
swiperRef.value.next()
} else {
swiperRef.value.prev()
}
}
const handleClickStylist = (item: any) => {
console.log(item)
showVideo.value = true
}
const handleContinue = () => {
// 跳转到下一个页面
router.push('/workshop')
}
// 监听showVideo变化关闭时暂停视频
watch(showVideo, (newValue) => {
if (!newValue && videoRef.value) {
videoRef.value.pause()
videoRef.value.reset()
}
})
</script>
<style scoped lang="less">
.stylist-page {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
color: #fff;
background: url('@/assets/images/stylist_bg.png') no-repeat center center;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.content {
position: relative;
z-index: 2;
flex: 1;
display: flex;
flex-direction: column;
padding: 2rem;
padding-top: 6rem;
}
.header {
text-align: center;
margin-bottom: 4rem;
.title {
font-size: 15rem;
font-weight: 400;
color: white;
font-family: 'boskaRegular';
}
}
.carousel-container {
position: relative;
display: flex;
// align-items: center;
// justify-content: center;
// flex: 1;
margin: 2rem 0;
}
.nav-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 5rem;
height: 5rem;
background: rgba(255, 255, 255, 0.15);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
z-index: 3;
box-shadow: 0 0.4rem 0.8rem rgba(0, 0, 0, 0.2), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1),
inset 0 0.1rem 0.2rem rgba(255, 255, 255, 0.3);
border: 0.1rem solid rgba(255, 255, 255, 0.2);
&:active {
transform: translateY(-50%) scale(0.95);
box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2), inset 0 0.1rem 0.2rem rgba(0, 0, 0, 0.1);
}
&.left {
left: 1rem;
}
&.right {
right: 1rem;
}
}
.van-swipe {
.van-swipe-item {
display: flex;
justify-content: center;
.swiper-container {
width: 66rem;
height: 100rem;
border: 2px solid #fff;
border-radius: 12px;
display: flex;
flex-direction: column;
align-items: center;
padding: 4.25rem 0 2.65rem;
img {
width: 59rem;
height: 63rem;
object-fit: cover;
}
.text-container {
padding: 0 5.25rem;
width: 100%;
font-weight: 400;
.name {
line-height: 6rem;
font-size: 4.8rem;
margin: 2.6rem 0 2.2rem;
}
.description {
// line-height: 3rem;
font-size: 2.8rem;
// width: 100%;
}
}
}
}
:deep(.van-swipe__indicators) {
bottom: 2.65rem;
background: #fff;
border-radius: 25px;
padding: 1rem 2rem;
.van-swipe__indicator {
width: 1rem;
height: 1rem;
background-color: #d9d9d9;
opacity: 1;
}
.van-swipe__indicator--active {
background-color: #000;
opacity: 1;
width: 3rem;
border-radius: 3px;
}
}
}
.continue-button {
position: absolute;
bottom: 6.4rem;
right: 7.6rem;
padding: 1.2rem 2.4rem;
border: 1px solid #fff;
border-radius: 1rem;
color: white;
font-size: 4rem;
font-weight: 500;
cursor: pointer;
z-index: 3;
font-family: 'satoshiRegular';
}
:deep(.video-dialog) {
width: 80%;
background: rgba(0, 0, 0, 0.3);
.close-btn {
width: 8.6rem;
height: 8.4rem;
position: absolute;
right: 0;
top: 0;
z-index: 3;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(145deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
border-radius: 50%;
cursor: pointer;
backdrop-filter: blur(1rem);
border: 1px solid rgba(255, 255, 255, 0.3);
box-shadow:
0 0.8rem 1.6rem rgba(0, 0, 0, 0.4),
inset 0 0.2rem 0.4rem rgba(255, 255, 255, 0.1),
inset 0 -0.2rem 0.4rem rgba(0, 0, 0, 0.3);
transition: all 0.3s ease;
&:hover {
transform: translateY(-0.2rem);
box-shadow:
0 1.2rem 2.4rem rgba(0, 0, 0, 0.5),
inset 0 0.2rem 0.4rem rgba(255, 255, 255, 0.15),
inset 0 -0.2rem 0.4rem rgba(0, 0, 0, 0.4);
}
&:active {
transform: translateY(0.1rem);
box-shadow:
0 0.4rem 0.8rem rgba(0, 0, 0, 0.3),
inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
}
.close-icon {
color: white;
font-size: 2.4rem;
text-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.5);
}
}
}
</style>