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

177 lines
3.4 KiB
Vue
Raw Normal View History

2025-10-09 16:04:55 +08:00
<script setup lang="ts">
2025-10-23 13:43:42 +08:00
import { onMounted, onUnmounted, reactive, toRefs, computed } from "vue";
2025-10-10 16:03:12 +08:00
import HeaderTitle from '@/components/HeaderTitle.vue'
import { useRouter } from 'vue-router'
2025-10-10 17:21:38 +08:00
import imgReturn from '@/assets/images/workshop/posture/posture_1.png'
2025-10-23 13:43:42 +08:00
import { useGenerateStore } from '@/stores'
2025-10-10 16:03:12 +08:00
const router = useRouter()
2025-10-09 16:04:55 +08:00
//const props = defineProps({
//})
const emit = defineEmits([
'view-type'
])
2025-10-23 13:43:42 +08:00
const generateStore = useGenerateStore()
2025-10-09 16:04:55 +08:00
let data = reactive({
modelList:
[
{
id:1,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
{
id:2,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
{
id:3,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
{
id:4,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
{
id:5,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
{
id:6,
2025-10-10 17:21:38 +08:00
imgUrl:imgReturn,
2025-10-09 16:04:55 +08:00
},
],
2025-10-23 13:43:42 +08:00
selectModel:computed(()=>generateStore.userData.model),
2025-10-09 16:04:55 +08:00
})
const setSelectedModelId = (item)=>{
2025-10-23 13:43:42 +08:00
generateStore.selectModel(item)
2025-10-09 16:04:55 +08:00
}
onMounted(()=>{
emit('view-type', 1)
})
2025-10-21 13:46:27 +08:00
const toProduct = ()=>{
router.push({ path: 'product' })
2025-10-10 16:03:12 +08:00
}
2025-10-09 16:04:55 +08:00
onUnmounted(()=>{
})
defineExpose({})
2025-10-23 13:43:42 +08:00
const { modelList, selectModel } = toRefs(data);
2025-10-09 16:04:55 +08:00
</script>
<template>
<header-title style-type="2" />
2025-10-09 16:04:55 +08:00
<div class="selectModel">
<div class="text">
<div class="title">
Pick a Model Photo!
</div>
<div class="info">
Try one of our sample images
</div>
</div>
<div class="selectContent">
<div class="modelList">
<div v-for="item in modelList" :key="item.id" class="item" @click.stop="setSelectedModelId(item)">
<img :src="item.imgUrl" alt="">
2025-10-23 13:43:42 +08:00
<div class="icon" v-if="item.id == selectModel.id">
2025-10-09 16:04:55 +08:00
<SvgIcon name="modelSelected" size="60" />
</div>
</div>
</div>
</div>
</div>
<div class="footer placeholder"></div>
2025-10-10 16:03:12 +08:00
<div class="footer">
2025-10-21 13:46:27 +08:00
<button @click.stop="toProduct">Continue</button>
2025-10-10 16:03:12 +08:00
</div>
2025-10-09 16:04:55 +08:00
</template>
<style lang="less" scoped>
.selectModel{
width: 100%;
2025-10-10 16:03:12 +08:00
// height: 100%;
2025-10-09 16:04:55 +08:00
position: relative;
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
2025-10-09 16:04:55 +08:00
> .text{
text-align: center;
width: 100%;
margin-top: 3.4rem;
margin-bottom: 6rem;
2025-10-09 16:04:55 +08:00
> .title{
font-family: satoshiBold;
font-weight: 700;
font-size: 9.6rem;
line-height: 124%;
}
> .info{
font-size: 4rem;
font-weight: 400;
line-height: 124%;
margin-top: 1.3rem;
}
}
> .selectContent{
flex: 1;
overflow-y: auto;
padding: 0 11.8rem;
> .modelList{
padding: .6rem 2rem;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
> .item{
width: calc((100% - 2.5rem * 2) / 3);
border: 2px solid #D9D9D9;
border-radius: 1rem;
margin-bottom: 5.4rem;
height: 75rem;
> img{
width: 100%;
height: 100%;
object-fit: cover;
}
> .icon{
position: absolute;
width: 6rem;
height: 6rem;
bottom: -1.8rem;
right: -2.1rem;
}
}
}
}
}
2025-10-10 16:03:12 +08:00
.footer {
position: fixed;
width: 100%;
bottom: 0;
left: 0;
height: 11.2rem;
display: flex;
align-items: center;
justify-content: flex-end;
background-color: #fff;
box-shadow: -2.6rem -1.4rem 3.47rem 0 rgba(0, 0, 0, 0.05);
&.placeholder{
position: relative;
}
2025-10-10 16:03:12 +08:00
> button {
width: 24.6rem;
height: 5.9rem;
border-radius: 0.7rem;
box-sizing: content-box;
border: 0.3rem solid #000;
background-color: #000;
font-family: satoshiBold;
font-weight: 700;
font-size: 3.6rem;
2025-10-10 16:03:12 +08:00
color: #fff;
margin-right: 5rem;
&:active {
opacity: 0.7;
}
}
}
2025-10-09 16:04:55 +08:00
</style>