Files
lanecarford_front/src/views/Workshop/creation.vue
2025-10-16 16:55:06 +08:00

123 lines
2.6 KiB
Vue

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import HeaderTitle from '@/components/HeaderTitle.vue'
import FooterNavigation from '@/components/FooterNavigation.vue'
import MyList from '@/components/myList.vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const emit = defineEmits(['view-type'])
onMounted(() => {
emit('view-type', 1)
})
const onSave = () => {
console.log('保存')
}
const onContinue = () => {
router.push({ name: 'end' })
}
const list = reactive([{},{},{},{},{},{}])
const loading = ref(false)
const finish = ref(false)
const onLoad = () => {
loading.value = true
setTimeout(() => {
list.push({},{},{},{},{},{})
loading.value = false
if (list.length >= 20) {
finish.value = true
}
}, 1500)
}
</script>
<template>
<header-title style-type="2" />
<div class="creation">
<div class="title">Your Creation</div>
<div class="list">
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
<div class="item" v-for="(v,i) in list" :key="i">
<img src="@/assets/images/workshop/posture/posture_1.png" />
</div>
</my-list>
</div>
<div class="btns">
<button @click="onSave">Save</button>
<button @click="onContinue">Continue</button>
</div>
</div>
<footer-navigation is-placeholder />
</template>
<style scoped lang="less">
.creation {
width: 100%;
flex: 1;
overflow: hidden;
background-color: #e3e3e3;
border-radius: 1rem;
position: relative;
color: #000;
display: flex;
flex-direction: column;
> .title {
font-family: satoshiRegular;
font-size: 9rem;
text-align: center;
line-height: 124%;
font-weight: 500;
margin: 7.2rem 0;
}
> .list {
flex: 1;
margin: 0 3.8rem;
overflow: hidden;
> .my-list {
padding: 0 6rem;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
// justify-content: space-around;
.item {
width: 47%;
height: 52.9rem;
overflow: hidden;
border-radius: 2rem;
background-color: #fff;
margin-bottom: 4rem;
border: 0.1rem solid #000;
> img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
}
}
> .btns {
margin: 9rem 0;
display: flex;
justify-content: center;
> button {
box-sizing: content-box;
font-family: satoshiRegular;
width: 35rem;
height: 8rem;
border-radius: 1.3rem;
background: #000;
font-weight: 400;
font-size: 4.2rem;
margin: 0 3.25rem;
color: #fff;
&:active {
opacity: 0.7;
}
}
}
}
</style>