feat: api创建
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<van-icon name="arrow-left" color="#fff" size="40" />
|
||||
</div>
|
||||
|
||||
<van-swipe touchable ref="swiperRef">
|
||||
<van-swipe touchable ref="swiperRef" @change="handleChangeCurrent">
|
||||
<van-swipe-item v-for="item in stylists" :key="item.id">
|
||||
<div class="swiper-container" @click="handleClickStylist(item)">
|
||||
<img :src="item.image" />
|
||||
@@ -64,9 +64,10 @@
|
||||
import { ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import Video from './components/Video.vue'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const userInfoStore = useUserInfoStore()
|
||||
// stylist数据
|
||||
const stylists = ref<any[]>([
|
||||
{
|
||||
@@ -94,11 +95,17 @@ const stylists = ref<any[]>([
|
||||
image: '/src/assets/images/male.png'
|
||||
}
|
||||
])
|
||||
const currentChoosed=ref('')
|
||||
|
||||
const swiperRef = ref<any>(null)
|
||||
const showVideo = ref<boolean>(false)
|
||||
const videoRef = ref<any>(null)
|
||||
|
||||
|
||||
const handleChangeCurrent=(index:number)=>{
|
||||
currentChoosed.value = stylists.value[index].id
|
||||
}
|
||||
|
||||
const handleChangeSwiper = (type: 'next' | 'prev') => {
|
||||
if (type === 'next') {
|
||||
swiperRef.value.next()
|
||||
@@ -113,7 +120,10 @@ const handleClickStylist = (item: any) => {
|
||||
}
|
||||
|
||||
const handleContinue = () => {
|
||||
// 跳转到下一个页面
|
||||
const generateParams = userInfoStore.getGenerateParams()
|
||||
generateParams.stylistId = currentChoosed.value
|
||||
userInfoStore.setGenerateParams(generateParams)
|
||||
|
||||
router.push('/stylist/sex')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user