123
This commit is contained in:
28
src/views/Workshop/creation/creation-details.vue
Normal file
28
src/views/Workshop/creation/creation-details.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const query = router.currentRoute.value.query
|
||||
|
||||
onMounted(() => {})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="creation-details">
|
||||
{{ query }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.creation-details {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
background-color: #e3e3e3;
|
||||
border-radius: 1rem;
|
||||
position: relative;
|
||||
color: #000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
195
src/views/Workshop/creation/creation-list.vue
Normal file
195
src/views/Workshop/creation/creation-list.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from '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 onDetailsItem = (v) => {
|
||||
if(v.isAi) return;
|
||||
console.log('详情', v)
|
||||
router.push({ query: { did: v.id } })
|
||||
|
||||
}
|
||||
|
||||
const onDownloadItem = (v) => {
|
||||
console.log('保存', v)
|
||||
}
|
||||
const onLoveItem = (v) => {
|
||||
// Outfit暂时不可以like
|
||||
console.log('喜欢', v)
|
||||
v.love = !v.love
|
||||
}
|
||||
const onSaveAll = () => {
|
||||
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(() => {
|
||||
for (var i = 0; i < 10; i++) list.push({id: list.length, love: Math.random() > 0.5, isAi: Math.random() > 0.5 })
|
||||
loading.value = false
|
||||
if (list.length >= 30) {
|
||||
finish.value = true
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="creation-list">
|
||||
<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" @click="onDetailsItem(v)">
|
||||
<img src="@/assets/images/workshop/posture/posture_1.png" />
|
||||
<div class="corner">
|
||||
<div class="ai" v-if="v.isAi">Gen-AI</div>
|
||||
<div class="tryon" v-else>Try-on</div>
|
||||
</div>
|
||||
<div class="icons">
|
||||
<div @click.stop="onLoveItem(v)">
|
||||
<SvgIcon :name="`love_${v.love ? '1' : '0'}`" size="27" />
|
||||
</div>
|
||||
<div @click.stop="onDownloadItem(v)"><SvgIcon name="download" size="27" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</my-list>
|
||||
</div>
|
||||
<div class="btns">
|
||||
<button @click="onSaveAll">Save All</button>
|
||||
<button @click="onContinue">Continue</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.creation-list {
|
||||
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;
|
||||
position: relative;
|
||||
> img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
> .corner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
> div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 12.6rem;
|
||||
height: 3.6rem;
|
||||
font-family: satoshiBold;
|
||||
font-size: 1.6rem;
|
||||
border-bottom-left-radius: 1.6rem;
|
||||
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
> .ai {
|
||||
color: #646464;
|
||||
background: linear-gradient(
|
||||
137.95deg,
|
||||
#7a96ac 2.28%,
|
||||
#eaeff3 19.8%,
|
||||
#c2d4e1 32.94%,
|
||||
#ffffff 50.16%,
|
||||
#d4dee5 62.15%,
|
||||
#abbdc8 78.69%,
|
||||
#bccad7 95.24%
|
||||
),
|
||||
linear-gradient(0deg, rgba(230, 219, 219, 0.5), rgba(230, 219, 219, 0.5));
|
||||
}
|
||||
}
|
||||
> .icons {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 1.7rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
> div {
|
||||
margin-bottom: 2.2rem;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
border-radius: 1rem;
|
||||
border: 0.2rem solid #000;
|
||||
--svg-icon-color: #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
> .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>
|
||||
30
src/views/Workshop/creation/index.vue
Normal file
30
src/views/Workshop/creation/index.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch, computed } from 'vue'
|
||||
import HeaderTitle from '@/components/HeaderTitle.vue'
|
||||
import FooterNavigation from '@/components/FooterNavigation.vue'
|
||||
import CreationList from '@/views/Workshop/creation/creation-list.vue'
|
||||
import CreationDetails from '@/views/Workshop/creation/creation-details.vue'
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const detailsID = computed(() => router.currentRoute.value.query.did);
|
||||
const emit = defineEmits(['view-type'])
|
||||
watch(
|
||||
() => router.currentRoute.value,
|
||||
() => emit('view-type', 1)
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
emit('view-type', 1)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header-title style-type="2" />
|
||||
<creation-list v-show="!detailsID" />
|
||||
<creation-details v-show="detailsID" />
|
||||
<footer-navigation is-placeholder />
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
Reference in New Issue
Block a user