完善登录页面

This commit is contained in:
陈淳
2022-10-12 14:20:03 +08:00
parent 24cda70cbc
commit 4a54eb56a7
34 changed files with 353 additions and 54 deletions

View File

@@ -5,6 +5,7 @@
<div class="div-bottom">
<!-- <van-field v-model="value" label="文本" placeholder="请输入用户名" /> -->
</div>
真不错
</template>
<script setup lang="ts">
import {ref} from 'vue';

View File

@@ -79,7 +79,7 @@ import AppCreateTime from "@/components/AppCreateTime.vue";
import articleApi from "@/api/articleApi.ts";
import { ArticleEntity } from "@/type/interface/ArticleEntity.ts";
const VanImagePreview = ImagePreview.Component;
const url = `${import.meta.env.VITE_APP_BASE_API}/file/image/`;
const url = `${import.meta.env.VITE_APP_BASE_API}/file/`;
const data = reactive({
queryParams: {
pageNum: 1,

View File

@@ -1,18 +1,100 @@
<template >
<template>
<div class="div-top">
<span class="title">农夫山泉</span>
<br>
<span class="subtitle">农夫山泉有点甜</span>
</div>
<div class="div-bottom">
<h5>密码登录</h5>
<van-field class="van-field-username" v-model="value" label="文本" placeholder="请输入用户名" />
<van-field class="van-field-password" v-model="value" label="文本" placeholder="请输入密码" />
<van-button type="primary">进入农夫山泉</van-button>
<p>其他方式登录<van-icon name="arrow" /></p>
<van-row style="margin-top: 6rem;" >
<van-col span="24"><p> 第三方登录</p></van-col>
<van-col span="3"></van-col>
<van-col span="6"><van-icon name="like" size="2rem" /></van-col>
<van-col span="6"><van-icon name="like" size="2rem" /></van-col>
<van-col span="6"><van-icon name="like" size="2rem"/></van-col>
<van-col span="3"></van-col>
</van-row>
</div>
<van-row class="test ">
<van-col span="24">
这里是广场
</van-col>
</van-row>
<van-col span="24"></van-col>
</template>
<style scoped>
</style>
<script lang="ts" setup>
import {ref} from 'vue'
<script setup lang="ts">
import {ref} from 'vue';
const value=ref("")
</script>
</script>
<style scoped>
.div-top{
background-color: aqua;
position:absolute;
top: 0;
left: 0;
right: 0;
bottom: 60%;
}
.div-bottom{
background-color: bisque;
position:absolute;
top: 25%;
left: 0;
right: 0;
bottom: 0;
border-radius: 3rem 3rem 0rem 0rem;
padding: 1rem 2rem 2rem 2rem;
/* min-height: 70%; */
}
.title{
position: absolute;
top: 15%;
transform: translateX(-50%);
font-size: 1.8rem;
font-weight: bolder;
}
.subtitle
{
transform: translateX(-50%);
position: absolute;
top: 30%;
font-weight:lighter;
}
.van-field-username
{
margin-top:2rem;
}
.van-field-password
{
margin-top: 1rem;
}
h5{
text-align: left;
font-size: 1.2rem;
font-weight: bolder;
}
.div-bottom .van-button
{
margin-top: 1rem;
width: 100%;
border-radius: 0.4rem;
}
.div-bottom p{
text-align: center;
};
.row-bottom{
}
</style>

View File

@@ -66,13 +66,25 @@ onMounted(() => {
visible.value = true;
});
const afterRead = (file: any) => {
file.status = "uploading";
file.message = "上传中...";
var formData = new FormData();
formData.append("file", file.file);
//一个文件
if(file.length==undefined)
{
formData.append("file", file.file);
}
else
{
//多个文件
file.forEach((f:any) => {
formData.append("file", f.file);
});
}
fileApi.upload("image", formData)
.then((response: any) => {
images.value.push(response.data);
images.value.push(...response.data);
file.status = "done";
file.message = "成功";
})