feat: 数据库迁移
This commit is contained in:
61
Yi.App.Vue3/src/components/AppCard.vue
Normal file
61
Yi.App.Vue3/src/components/AppCard.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
|
||||
<div class="out-div">
|
||||
<div class="card-div">
|
||||
|
||||
<van-image
|
||||
radius="1rem"
|
||||
width="100%"
|
||||
height="100%"
|
||||
src="https://unpkg.com/@vant/assets/cat.jpeg"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bottom-div">
|
||||
<div v-for="i of 10" :key="i" class="card-div-inside">
|
||||
<van-image
|
||||
radius="1rem"
|
||||
width="4rem"
|
||||
height="4rem"
|
||||
src="https://unpkg.com/@vant/assets/cat.jpeg"
|
||||
/>
|
||||
<br>
|
||||
¥79.0
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.out-div {
|
||||
width: 100%;
|
||||
min-height: 10rem;
|
||||
border-radius: 1rem;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.card-div {
|
||||
height: 6rem;
|
||||
width: 100%;
|
||||
}
|
||||
.bottom-div {
|
||||
display: flex;
|
||||
|
||||
/* justify-content: center; */
|
||||
width: 100%;
|
||||
height: 6rem;
|
||||
overflow: hidden;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-div-inside {
|
||||
flex: none;
|
||||
display: block;
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
37
Yi.App.Vue3/src/components/AppCreateTime.vue
Normal file
37
Yi.App.Vue3/src/components/AppCreateTime.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<span class="subtitle">{{ showTime }}</span>
|
||||
</template>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
const props = defineProps<{ time: string }>();
|
||||
const showTime = computed(() => {
|
||||
var dataTime=new Date(Date.parse(props.time));
|
||||
const hour:number= getHour(dataTime,new Date())
|
||||
if(hour<=0)
|
||||
{
|
||||
return "刚刚"
|
||||
}
|
||||
if(hour<=6)
|
||||
{
|
||||
return hour+"小时前"
|
||||
}
|
||||
return props.time;
|
||||
|
||||
});
|
||||
const getHour=(s1:Date, s2:Date)=> {
|
||||
var ms = s2.getTime() - s1.getTime();
|
||||
if (ms < 0) return 0;
|
||||
return Math.floor(ms / 1000 / 60 / 60); //小时
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.subtitle{
|
||||
color: #CBCBCB;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
34
Yi.App.Vue3/src/components/AppGrid.vue
Normal file
34
Yi.App.Vue3/src/components/AppGrid.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<van-row>
|
||||
<van-col span="24">
|
||||
<p > {{data.head}}</p>
|
||||
</van-col>
|
||||
<van-col class="col-body" span="6" v-for="item in data.body"><van-icon :name="item.icon" size="2rem" /> <br>{{item.title}}</van-col>
|
||||
</van-row>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import {AppGridData} from '@/type/class/AppGridData'
|
||||
defineProps<{ data: AppGridData }>()
|
||||
const count = ref(0)
|
||||
</script>
|
||||
<style scoped>
|
||||
.col-body
|
||||
{
|
||||
text-align: center;
|
||||
font-size: small;
|
||||
}
|
||||
.col-body .van-icon
|
||||
{
|
||||
|
||||
color: #FF689B;
|
||||
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
p{
|
||||
font-size: large;
|
||||
font-weight:bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
35
Yi.App.Vue3/src/components/AppUserIcon.vue
Normal file
35
Yi.App.Vue3/src/components/AppUserIcon.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<van-image
|
||||
round
|
||||
:width="width"
|
||||
:height="height"
|
||||
:src="url+(src??'0')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type } from 'os';
|
||||
import { ref } from 'vue'
|
||||
const props= defineProps({
|
||||
src: {type:String,default:'null',required:false},
|
||||
width:{type:String,default:'3rem',required:false},
|
||||
height:{type:String,default:'3rem',required:false}
|
||||
})
|
||||
|
||||
const url = `${import.meta.env.VITE_APP_BASE_API}/file/`;
|
||||
</script>
|
||||
<style scoped>
|
||||
.col-body
|
||||
{
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.col-body .van-icon
|
||||
{
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
p{
|
||||
font-size: large;
|
||||
font-weight:bold;
|
||||
}
|
||||
</style>
|
||||
19
Yi.App.Vue3/src/components/HelloWorld.vue
Normal file
19
Yi.App.Vue3/src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
defineProps<{ msg: string }>()
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user