进度:需要一个弹出组件

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2025-06-06 20:29:12 +08:00
parent 1f85b9cc10
commit 2c8fc07ebb
15 changed files with 325 additions and 115 deletions
@@ -0,0 +1,68 @@
<template>
<footer class="footer footer-transparent d-print-none my_footer">
<div class="container-xl">
<div class="row text-center align-items-center flex-row-reverse">
<div class="col-lg-auto ms-lg-auto">
<ul class="list-inline list-inline-dots mb-0">
<li class="list-inline-item"><a href="https://git.lmve.net/kevin/gin_saas/-/blob/main/readme.md?ref_type=heads" target="_blank"
class="link-secondary" rel="noopener">文档</a></li>
<li class="list-inline-item"><a href="https://git.lmve.net/kevin/gin_saas/-/blob/main/LICENSE?ref_type=heads" target="_blank" class="link-secondary">开源协议</a>
</li>
<li class="list-inline-item"><a href="https://git.lmve.net/kevin/gin_saas" target="_blank"
class="link-secondary" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" class="icon text-orange" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M21 14l-9 7l-9 -7l3 -11l3 7h6l3 -7z" />
</svg>
源码</a></li>
<li class="list-inline-item">
<a href="https://wnfed.com" target="_blank" class="link-secondary" rel="noopener">
<!-- Download SVG icon from http://tabler-icons.io/i/heart -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon text-pink icon-filled icon-inline" width="24"
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
</svg>
博客
</a>
</li>
</ul>
</div>
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
<ul class="list-inline list-inline-dots mb-0">
<li class="list-inline-item">
Copyright &copy; 2025
<a href="https://lmve.net" target="_blank" class="link-secondary">Lmve.NET</a>.
All rights reserved.
</li>
<li class="list-inline-item">
<a href="https://git.lmve.net/kevin/gin_saas/-/commits/main" target="_blank" class="link-secondary" rel="noopener">
v0.0.1
</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
</template>
<script>
export default {
name:"tabler-footer",
data() {
return {
};
}
}
</script>
<style>
</style>
+31
View File
@@ -0,0 +1,31 @@
export const my_network_func = {
host: "",
port: 0,
head_path: "/api/v1",
post_json(path, json,callback) {
var re_data = {}
uni.request({
header: {
'Content-Type': 'application/json'
},
url: this.head_path + path,
method: 'POST',
data: json,
timeout: 10000,
success(res) {
re_data["statusCode"] = res.statusCode
re_data["data"] = res.data
callback(re_data)
},
fail() {
re_data["statusCode"] = -1
callback(re_data)
}
});
},
}
+21 -4
View File
@@ -1,9 +1,26 @@
.my-input-field {
height: 80rpx;
padding: 16rpx 1rpx;
.my_input_field {
height: 70rpx;
padding: 16rpx 16rpx;
border-radius: 18rpx;
border: 2rpx solid rgba(58, 77, 128, 0.08);
border: 2rpx solid #e3e3e3;
font-size: 36rpx;
box-shadow: 0 4rpx 12rpx rgba(58, 77, 128, 0.08);
}
.my_input_placeholder {
font-size: 30rpx;
color: #cfcfcf;
}
.my_input_placeholder_error {
font-size: 30rpx;
color: #d48686;
}
.my_footer{
margin-top: auto;
}
+9 -10
View File
@@ -1,14 +1,13 @@
<template>
<view class="d-flex flex-column">
<tabler-header ></tabler-header>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
<view class="d-flex flex-column ">
<div class="page">
<tabler-header></tabler-header>
<tabler-footer></tabler-footer>
</div>
</view>
</template>
<script>
@@ -53,4 +52,4 @@
font-size: 36rpx;
color: #8f8f94;
}
</style>
</style>
+102 -36
View File
@@ -1,43 +1,50 @@
<template>
<view class="d-flex flex-column">
<tabler-header type="mini"></tabler-header>
<div class="page page-center">
<div class="container container-normal py-4">
<div class="row align-items-center g-4">
<div class="col-lg">
<div class="container-tight">
<div class="text-center mb-4">
<div class="navbar-brand navbar-brand-autodark"><img src="/static/logo.svg"
height="36" alt=""></div>
<div class="navbar-brand navbar-brand-autodark"><img src="/static/logo.svg" height="36"
alt=""></div>
</div>
<div class="card card-md">
<div class="card-body">
<h2 class="h2 text-center mb-4">登录你的账号</h2>
<div class="mb-3">
<label class="form-label">用户名</label>
<input type="text" class="my-input-field" placeholder="输入你的用户名" autocomplete="off" maxlength="25">
<label class="form-label mb-0 ms-1">用户名</label>
<input type="text" class="my_input_field"
:placeholder-class="is_username_err?'my_input_placeholder_error':'my_input_placeholder'"
:placeholder="ph_username" autocomplete="off" maxlength="25"
v-model="post_data.username">
</div>
<div class="mb-2">
<label class="form-label">
密码
</label>
<input type="password" class="my-input-field" password="true" placeholder="输入你的密码" autocomplete="off" maxlength="100">
<label class="form-label mb-0 ms-1">密码</label>
<input type="password" class="my_input_field"
:placeholder-class="is_password_err?'my_input_placeholder_error':'my_input_placeholder'"
password="true" :placeholder="ph_password" autocomplete="off"
maxlength="100" v-model="post_data.password">
</div>
<div class="mb-2">
<label class="d-flex">
<checkbox />
<span class="form-check-label">保持登录</span>
</label>
<checkbox-group @change="chack_box_change">
<label class="d-flex">
<checkbox value="keep_login_in" />
<span class="form-check-label">保持登录</span>
</label>
</checkbox-group>
</div>
<div class="form-footer">
<button class="btn btn-primary w-100">登录</button>
<button class="btn btn-primary w-100" @click="submit_data">登录</button>
</div>
</div>
@@ -51,6 +58,7 @@
<a href="./forgot-password.html">忘记密码</a>
</span>
</div>
</div>
</div>
<div class="col-lg d-none d-lg-block">
@@ -61,38 +69,96 @@
</div>
</div>
<tabler-footer></tabler-footer>
</view>
</template>
<script>
import {
my_network_func
} from '../my_network_func'
import {
Offcanvas
} from 'bootstrap'
export default {
data() {
return {
ph_username: "输入你的用户名",
ph_password: "输入你的密码",
is_username_err: false,
is_password_err: false,
post_data: {
is_keep_login: false,
username: "",
password: "",
}
}
},
methods: {
chack_box_change(val) {
//console.log(val.detail.value[0])
if (val.detail.value[0] === 'keep_login_in') {
this.post_data.is_keep_login = true
} else {
this.post_data.is_keep_login = false
}
},
submit_data() {
//提交登录数据,
//先验证数据合法性
if (this.post_data.username == "") {
this.is_username_err = true
this.ph_username = "用户名不能为空"
} else {
this.is_username_err = false
}
if (this.post_data.password == "") {
this.is_password_err = true
this.ph_password = "密码不能为空"
} else {
this.is_password_err = false
}
if (this.is_username_err === false && this.is_password_err === false) {
console.log(this.post_data)
my_network_func.post_json("/user/login", this.post_data, (c) => {
console.log(c)
})
} else {
}
}
}
}
</script>
<style>
.my123{
/* 设置边框:宽度、样式、颜色 */
border: 1px solid #e3e3e3; /* 2像素宽的红色实线边框 */
/* 设置圆角,值越大,角越圆 */
border-radius: 3px; /* 也可以使用百分比,例如50%会变成圆形 */
font-size: 24px;
}
.my123 {
/* 设置边框:宽度、样式、颜色 */
border: 1px solid #e3e3e3;
/* 2像素宽的红色实线边框 */
/* 设置圆角,值越大,角越圆 */
border-radius: 3px;
/* 也可以使用百分比,例如50%会变成圆形 */
font-size: 24px;
}
</style>