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

199 lines
4.5 KiB
Vue
Raw Normal View History

2025-10-10 15:50:21 +08:00
<script setup lang="ts">
2025-10-16 14:49:01 +08:00
import { ref, reactive, onMounted, inject } from 'vue'
2025-10-16 11:01:54 +08:00
import HeaderTitle from '@/components/HeaderTitle.vue'
import FooterNavigation from '@/components/FooterNavigation.vue'
2025-10-17 09:49:30 +08:00
import MyList from '@/components/myList.vue'
2025-10-20 15:45:42 +08:00
import router from '@/router'
2025-10-16 11:01:54 +08:00
const emit = defineEmits(['view-type'])
2025-10-10 15:50:21 +08:00
2025-10-16 11:01:54 +08:00
onMounted(() => {
emit('view-type', 1)
})
2025-10-17 09:49:30 +08:00
const loading = ref(false)
const finish = ref(false)
const list = reactive([])
2025-10-10 15:50:21 +08:00
2025-10-17 09:49:30 +08:00
const onLoad = () => {
loading.value = true
setTimeout(() => {
for (var i = 0; i < 10; i++) {
list.push({
id: list.length + 1,
userID: 10000000 + list.length,
datetime: '7/22/2025 18:20',
lastopened: '18:20'
})
}
loading.value = false
if (list.length >= 50) finish.value = true
2025-10-20 15:45:42 +08:00
}, 500)
2025-10-17 09:49:30 +08:00
}
2025-10-20 15:45:42 +08:00
const onDetailsItem = (v) => {
// console.log('检索' + i)
router.push({ name: 'creation', query: { date: v.datetime } })
2025-10-16 11:01:54 +08:00
}
const deleteItem = (i: number) => {
2025-10-16 14:49:01 +08:00
list.splice(i, 1)
2025-10-16 11:01:54 +08:00
}
2025-10-10 15:50:21 +08:00
</script>
<template>
2025-10-16 11:01:54 +08:00
<header-title style-type="2" />
2025-10-10 15:50:21 +08:00
<div class="library">
<div class="title">Library</div>
<div class="list">
2025-10-17 09:49:30 +08:00
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
<div class="item" v-for="(v, i) in list" :key="v.id">
<div class="image">
<img src="@/assets/images/workshop/posture/posture_1.png" />
</div>
<div class="content">
2025-10-20 15:45:42 +08:00
<!-- <span class="userID">User ID: {{ v.userID }}</span> -->
2025-10-17 09:49:30 +08:00
<span class="datetime">{{ v.datetime }}</span>
<span class="lastopened">Last opened {{ v.lastopened }}</span>
2025-10-20 15:45:42 +08:00
<button @click="onDetailsItem(v)">Details</button>
2025-10-17 09:49:30 +08:00
</div>
<div class="delete" @click="deleteItem(i)"><SvgIcon name="delete2" size="30" /></div>
2025-10-10 15:50:21 +08:00
</div>
2025-10-17 09:49:30 +08:00
</my-list>
2025-10-10 15:50:21 +08:00
</div>
</div>
2025-10-16 11:01:54 +08:00
<footer-navigation is-placeholder />
2025-10-10 15:50:21 +08:00
</template>
<style scoped lang="less">
2025-10-16 11:01:54 +08:00
.workshop {
display: flex;
align-items: center;
justify-content: center;
}
2025-10-10 15:50:21 +08:00
.library {
width: 100%;
2025-10-16 11:01:54 +08:00
flex: 1;
overflow: hidden;
background-color: #fff;
2025-10-10 15:50:21 +08:00
border-radius: 1rem;
position: relative;
color: #000;
display: flex;
flex-direction: column;
2025-10-16 11:01:54 +08:00
&::before {
content: '';
position: absolute;
width: 92rem;
height: 92rem;
z-index: 0;
top: -40rem;
right: -40rem;
background: linear-gradient(88.42deg, #ffffff 32.58%, #d9d9d9 94.9%);
transform: rotate(-45deg);
}
2025-10-10 15:50:21 +08:00
> .title {
font-family: satoshiRegular;
font-size: 9rem;
text-align: left;
line-height: 124%;
margin: 5rem;
}
> .list {
flex: 1;
2025-10-17 09:49:30 +08:00
overflow: hidden;
2025-10-10 15:50:21 +08:00
margin: 0 3rem;
2025-10-17 09:49:30 +08:00
> .my-list {
padding: 0 3.8rem;
--my-list-footer-margin: 2rem 0;
> .item {
position: relative;
padding: 2.8rem;
width: 100%;
height: 34.4rem;
border-radius: 1.88rem;
background-color: #f3f3f3;
2025-10-10 15:50:21 +08:00
display: flex;
2025-10-17 09:49:30 +08:00
align-items: center;
margin-top: 7.66rem;
&:first-child {
margin-top: 0;
2025-10-16 11:01:54 +08:00
}
2025-10-17 09:49:30 +08:00
> .image {
width: 21.4rem;
height: 100%;
overflow: hidden;
border-radius: 2rem;
background-color: #fff;
> img {
width: 100%;
height: 100%;
object-fit: contain;
}
2025-10-10 15:50:21 +08:00
}
2025-10-17 09:49:30 +08:00
> .content {
margin-left: 5.6rem;
display: flex;
flex-direction: column;
height: 90%;
> .userID {
font-family: satoshiRegular;
font-weight: 500;
font-size: 3.8rem;
line-height: 89%;
color: #000;
}
> .datetime {
margin-top: 1.8rem;
font-family: satoshiRegular;
font-weight: 400;
font-size: 3.2rem;
line-height: 89%;
color: #000;
}
> .lastopened {
margin-top: 1rem;
font-family: satoshiRegular;
font-weight: 400;
font-style: Regular;
font-size: 2.6rem;
line-height: 89%;
color: #6f6f6f;
}
> button {
margin-top: auto;
width: 12.3rem;
height: 3.8rem;
border-radius: 0.5rem;
box-sizing: content-box;
border: 0.193rem solid #000;
background: transparent;
font-family: satoshiRegular;
font-weight: 400;
font-size: 2.576rem;
color: #000;
margin-right: 5rem;
&:active {
opacity: 0.7;
}
}
2025-10-10 15:50:21 +08:00
}
2025-10-17 09:49:30 +08:00
> .delete {
position: absolute;
top: 2.5rem;
right: 2rem;
width: 5.5rem;
height: 5.5rem;
border: 0.188rem solid #000;
border-radius: 1.88rem;
display: flex;
align-items: center;
justify-content: center;
2025-10-10 15:50:21 +08:00
&:active {
opacity: 0.7;
}
}
}
}
}
}
</style>