add:fronted

This commit is contained in:
lan
2023-08-11 19:26:49 +08:00
parent a39cdadc96
commit 490b3605a4
31 changed files with 3752 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
<script setup lang="ts">
import { Upload, TakeawayBox } from '@element-plus/icons-vue';
import { ref } from 'vue'
import { useRouter } from "vue-router";
import CardTools from "@/components/CardTools.vue";
import { useFileBoxStore } from "@/stores/fileBox";
const fileBoxStore = useFileBoxStore();
const router = useRouter()
const code = ref('')
const listenInput = (num: number) => {
console.log('listenInput',num)
};
</script>
<template>
<main>
<el-card class="card" style="padding-bottom: 1rem">
<CardTools/>
<el-row style="text-align: center">
<el-col :span="24">
<el-input v-model="code" class="code-input" round autofocus clearable maxlength="5" placeholder="请输入五位取件码"/>
</el-col>
<el-col :span=8 v-for="i in 9" :key="i">
<el-button class="key-button" round @click="listenInput(i)">{{ i }}</el-button>
</el-col>
<el-col :span=8>
<el-button @click="router.push({'name':'send'})" class="key-button" :icon="Upload" round>
</el-button>
</el-col>
<el-col :span=8>
<el-button class="key-button" round @click="listenInput(0)">0</el-button>
</el-col>
<el-col :span=8>
<el-button class="key-button" round :icon="TakeawayBox" @click="fileBoxStore.showFileBox=true">
</el-button>
</el-col>
</el-row>
</el-card>
</main>
</template>
<style lang='scss'>
.key-button{
width: 6rem;
height: 6rem;
margin: 0.2rem;
font-size: 2rem;
font-weight: bold;
text-align: center;
}
.code-input {
height: 100px;
font-size: 30px;
font-weight: bold;
margin: 1rem 0;
.el-input__wrapper{
border-radius: 20px !important;
}
}
</style>
+53
View File
@@ -0,0 +1,53 @@
<script setup lang="ts">
import { ref } from 'vue'
import CardTools from "@/components/CardTools.vue";
import UploadFile from "@/components/UploadFile.vue";
import UploadText from "@/components/UploadText.vue";
const shareData = ref({
expireValue: 1,
expireStyle: 'day',
targetType: 'file',
})
</script>
<template>
<main>
<el-card class="card" style="padding: 1rem;position: relative" :body-style="{ padding: '0px 0px 20px 0px' }">
<card-tools/>
<div style="display: flex;margin-top: 1rem">
<div>
<el-input
v-model="shareData.expireValue"
style="width: 200px"
placeholder="请输入值"
>
<template #prepend>
<el-select v-model="shareData.expireStyle" placeholder="过期方式" style="width: 75px">
<el-option label="天数" value="day" />
<el-option label="小时" value="hour" />
<el-option label="分钟" value="minute" />
<el-option label="永久" value="forever" />
<el-option label="次数" value="count" />
</el-select>
</template>
<template #append>
<span v-if="shareData.expireStyle=='day'"></span>
<span v-else-if="shareData.expireStyle=='hour'"></span>
<span v-else-if="shareData.expireStyle=='minute'"></span>
<span v-else-if="shareData.expireStyle=='forever'">👌</span>
<span v-else-if="shareData.expireStyle=='count'"></span>
</template>
</el-input>
</div>
<el-radio-group v-model="shareData.targetType" style="margin-left: 1rem;">
<el-radio label="file">文件</el-radio>
<el-radio label="text">文本</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 1rem">
<upload-file :shareData="shareData" v-if="shareData.targetType=='file'"/>
<upload-text :shareData="shareData" v-else-if="shareData.targetType=='text'"/>
</div>
</el-card>
</main>
</template>