git init
This commit is contained in:
110
tonecn/src/views/Blog.vue
Normal file
110
tonecn/src/views/Blog.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<script setup>
|
||||
// import ServerAPI from '@/assets/ServerAPI';
|
||||
// import router from '@/router';
|
||||
// import { nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
|
||||
// let load_fail = ref(false);
|
||||
// let load_ok = ref(false);
|
||||
|
||||
// let urlTo = (url) => {
|
||||
// window.location.href = url;
|
||||
// }
|
||||
// let blog_list = reactive([])
|
||||
// onBeforeMount(async () => {
|
||||
// let res = await ServerAPI.async_getRequest('GetBlogList');
|
||||
// try {
|
||||
// if(res.status == 'OK')
|
||||
// {
|
||||
// blog_list.push(...res.data);
|
||||
// load_ok.value = true;
|
||||
// }else{
|
||||
// throw new Error('获取列表失败');
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log('获取列表发生错误:' + error)
|
||||
// load_fail.value = true;
|
||||
// }
|
||||
// })
|
||||
// let formatTimestamp = (timestamp) => {
|
||||
// const date = new Date(timestamp);
|
||||
// // 获取日期的各个部分
|
||||
// const year = date.getFullYear();
|
||||
// const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的
|
||||
// const day = String(date.getDate()).padStart(2, '0');
|
||||
// const hours = String(date.getHours()).padStart(2, '0');
|
||||
// const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
// const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
// // 组装最终的字符串
|
||||
// if(hours == '00' && minutes == '00' && seconds == '00')
|
||||
// return `${year}/${month}/${day}`;
|
||||
// else
|
||||
// return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
|
||||
// }
|
||||
// let blogto = (uuid) => {
|
||||
// // router.push({name:'blogcontent',params: { 'uuid': uuid }})
|
||||
// let url = '/blogcontent/' + uuid;
|
||||
// window.open(url, '_blank');
|
||||
// }
|
||||
</script>
|
||||
<template>
|
||||
<div class="bcc"></div>
|
||||
<div class="content-container">
|
||||
<el-empty description="加载失败,刷新后重试" style="margin: 0 auto;" v-if="load_fail"/>
|
||||
<div style="gap: 30px;display: flex;flex-direction: column;" v-else>
|
||||
<div class="coding" v-if="!load_ok">加载中,请稍后...</div>
|
||||
<el-empty description="暂无数据" style="margin: 0 auto;" v-if="load_ok && !blog_list.length"/>
|
||||
<div class="blog-container" v-for="item of blog_list">
|
||||
<div class="title" @click="blogto(item.uuid)">{{ item.title }}</div>
|
||||
<div class="description">{{ item.description }}</div>
|
||||
<div class="publish-time">{{ formatTimestamp(+item.publish_time) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.bcc{
|
||||
position: fixed;
|
||||
z-index: -1;
|
||||
background-color: #f6f8f9;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.content-container{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 800px;
|
||||
margin: 50px auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.coding{
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 300px;
|
||||
}
|
||||
.blog-container{
|
||||
margin: 0 auto;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.blog-container .title{
|
||||
font-size: 26px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
.blog-container .title:hover{
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 3px;
|
||||
}
|
||||
.blog-container .description{
|
||||
color: #666;
|
||||
}
|
||||
.blog-container .publish-time{
|
||||
color: #888;
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
6
tonecn/src/views/Console/Console.vue
Normal file
6
tonecn/src/views/Console/Console.vue
Normal file
@@ -0,0 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
296
tonecn/src/views/Console/Login.vue
Normal file
296
tonecn/src/views/Console/Login.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<script setup>
|
||||
// import { ref, watch } from 'vue';
|
||||
// import { ElMessage } from 'element-plus'
|
||||
// import VerificationProcessVue from '@/components/RotationVerification.vue';
|
||||
// import router from '@/router';
|
||||
// import ServerAPI from '@/assets/ServerAPI';
|
||||
// import ServerSDK from '@/assets/ServerSDK';
|
||||
// let phone = ref("");
|
||||
// let code = ref("");
|
||||
// let sendSIMCodeCoolingTime = ref(-1);
|
||||
// let ShowVerificationProcessVue = ref(false);
|
||||
// // 监听phone,使其保持3-4-4分割格式
|
||||
// watch(phone,(newData)=>{
|
||||
// newData = newData.replace(/\D/g,'');
|
||||
// let newDatalen = newData.split('').length;
|
||||
// if(newDatalen >= 4 && newDatalen <= 7)
|
||||
// {
|
||||
// let part1 = newData.slice(0, 3);
|
||||
// let part2 = newData.slice(3);
|
||||
// newData = part1+ " " +part2;
|
||||
// }else if(newDatalen >= 8){
|
||||
// let part1 = newData.slice(0, 3);
|
||||
// let part2 = newData.slice(3, 7);
|
||||
// let part3 = newData.slice(7);
|
||||
// newData = part1 + " " + part2 + " " + part3;
|
||||
// }
|
||||
// phone.value = newData;
|
||||
// })
|
||||
// // 监听code,使其只能是数字
|
||||
// watch(code,(newData)=>{
|
||||
// code.value = newData.replace(/\D/g,'');
|
||||
// })
|
||||
|
||||
// // 按钮 - 发送验证码,先获取图像验证码,发短信由其他函数触发
|
||||
// let sendSIMCode = async () => {
|
||||
// // 冷却判定
|
||||
// if(sendSIMCodeCoolingTime.value >= 0)
|
||||
// {
|
||||
// // 还在冷却中,不允许发送
|
||||
// ElMessage({
|
||||
// message: '冷却中,稍后再来获取吧',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// // 手机号合法性验证
|
||||
// const regex = /^1[3-9]\d{9}$/;
|
||||
// if(!regex.test(phone.value.replace(/\D/g,'')))
|
||||
// {
|
||||
// ElMessage({
|
||||
// message: '请输入正确的手机号',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 准备发送验证码
|
||||
// // 滑动验证码验证
|
||||
// ShowVerificationProcessVue.value = true;
|
||||
// }
|
||||
|
||||
// // 按钮 - 登录
|
||||
// let login = async () => {
|
||||
// // 是否已经发送验证码
|
||||
// if(sendSIMCodeCoolingTime.value == -1)
|
||||
// {
|
||||
// // 其他情况(冷却倒数,冷却结束)都可以发送
|
||||
// ElMessage({
|
||||
// message: '请先获取验证码',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// // 手机号合法性验证
|
||||
// const regex = /^1[3-9]\d{9}$/;
|
||||
// if(!regex.test(phone.value.replace(/\D/g,'')))
|
||||
// {
|
||||
// ElMessage({
|
||||
// message: '请输入正确的手机号',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// // 验证码合法性验证
|
||||
// const regex2 = /\d{6}$/;
|
||||
// if(!regex2.test(code.value))
|
||||
// {
|
||||
// ElMessage({
|
||||
// message: '请输入正确的验证码',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// // ...可以登录
|
||||
// // console.log(localStorage.getItem('login_session'))
|
||||
// let loginRes = await ServerSDK.Login(
|
||||
// phone.value.replace(/\D/g,''),
|
||||
// code.value
|
||||
// )
|
||||
// if(loginRes == 1)
|
||||
// {
|
||||
// ElMessage({
|
||||
// message: '登录成功',
|
||||
// type: 'success',
|
||||
// });
|
||||
// setTimeout(() => {
|
||||
// router.push({name: 'console_console'});
|
||||
// }, 1000);
|
||||
// }else if(loginRes == 0){
|
||||
// ElMessage({
|
||||
// message: '验证码已过期',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// }else if(loginRes == -1){
|
||||
// ElMessage({
|
||||
// message: '验证码已失效',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// }else if(loginRes == -2){
|
||||
// ElMessage({
|
||||
// message: '验证码错误',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// }else{
|
||||
// ElMessage({
|
||||
// message: '登录失败,请重试',
|
||||
// type: 'error',
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 短信验证码发送成功,修改界面交互
|
||||
// let verify_success = async () => {
|
||||
// // 验证成功,等待接收验证码后登录
|
||||
// let sendSIMCodeRes = await ServerAPI.async_postRequest('SendSMSCode',{
|
||||
// 'phone': phone.value.replace(/\D/g,''),
|
||||
// 'session': localStorage.getItem('RVSession')
|
||||
// })
|
||||
// console.log(sendSIMCodeRes)
|
||||
// if(sendSIMCodeRes && sendSIMCodeRes.status == 'OK')
|
||||
// {
|
||||
// // 发送成功,等待接收验证码后登录
|
||||
// ElMessage({
|
||||
// message: '发送成功',
|
||||
// type: 'success',
|
||||
// });
|
||||
// }else{
|
||||
// // 发送失败
|
||||
// ElMessage({
|
||||
// message: '发送失败,请重试',
|
||||
// type: 'error',
|
||||
// });
|
||||
// }
|
||||
// ShowVerificationProcessVue.value = false;// 关闭验证码界面
|
||||
// sendSIMCodeCoolingTime.value = 59;// 冷却倒计时
|
||||
// let SIMCodeCoolingTimer = setInterval(() => {
|
||||
// sendSIMCodeCoolingTime.value--;
|
||||
// if(sendSIMCodeCoolingTime.value <= 0)
|
||||
// {
|
||||
// clearInterval(SIMCodeCoolingTimer);
|
||||
// sendSIMCodeCoolingTime.value = -2;
|
||||
// }
|
||||
// }, 1000);
|
||||
// }
|
||||
// // 图像验证码验证失败,短信验证码未发送
|
||||
// let verify_fail = () => {
|
||||
// ShowVerificationProcessVue.value = false;
|
||||
// ElMessage({
|
||||
// message: '发送失败,请重试',
|
||||
// type: 'error',
|
||||
// });
|
||||
// }
|
||||
|
||||
// let onDev = () => {
|
||||
// ElMessage({
|
||||
// message: '抱歉,当前内容暂未开放',
|
||||
// type: 'warning',
|
||||
// });
|
||||
// }
|
||||
</script>
|
||||
<template>
|
||||
<div class="bcc"></div>
|
||||
<div class="main-container">
|
||||
<h1>登录到控制台</h1>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
:width="300"
|
||||
trigger="click"
|
||||
>
|
||||
<!-- <p>控制台是特恩(TONE)网页中的一个控制器界面,您可以使用其中开放的一些控制器功能。普通访客可通过登录后的界面暂存合法文件(图片、视频、文档、音频、压缩包等),管理员可通过登录后编辑本网页中的内容(资源、工具、日记等),详情请见<strong style="cursor: pointer;">《特恩(TONE)控制台使用协议》</strong></p> -->
|
||||
<p>控制台是特恩(TONE)网页中的一个控制器界面,如果您是管理员,可通过登录后编辑本网页中的内容(资源、工具、日记等),详情请见<strong style="cursor: pointer;" @click="onDev">《特恩(TONE)控制台使用协议》</strong></p>
|
||||
<template #reference>
|
||||
<h3>控制台是什么?</h3>
|
||||
</template>
|
||||
</el-popover>
|
||||
<div class="form-container">
|
||||
<el-input
|
||||
v-model="phone"
|
||||
class="input"
|
||||
placeholder="请输入手机号"
|
||||
maxlength="13"
|
||||
inputmode="tel"
|
||||
clearable>
|
||||
<template #prepend> <div class="phone-prepend">+86</div></template>
|
||||
</el-input>
|
||||
<el-input
|
||||
v-model="code"
|
||||
class="input"
|
||||
maxlength="6"
|
||||
inputmode="numeric"
|
||||
placeholder="验证码">
|
||||
<template #append>
|
||||
<el-button class="sendSIMCode-button" :class="{ 'sendSIMCode-button-cooling' : (sendSIMCodeCoolingTime > 0) }" @click="sendSIMCode">{{ sendSIMCodeCoolingTime > 0 ? `${sendSIMCodeCoolingTime}秒后再获取` : "获取验证码"}}</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button class="login-botton" @click="login">登录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<VerificationProcessVue v-if="ShowVerificationProcessVue" @fail="verify_fail" @success="verify_success" :phone="phone" />
|
||||
</template>
|
||||
<style scoped>
|
||||
.bcc{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
background-color: #f6f8f9;
|
||||
}
|
||||
.main-container{
|
||||
padding: 30px;
|
||||
margin-bottom: 160px;
|
||||
}
|
||||
.main-container>h1{
|
||||
text-align: center;
|
||||
font-size: 42px;
|
||||
font-weight: 400;
|
||||
margin-top: 50px;
|
||||
cursor: default;
|
||||
}
|
||||
.main-container>h3{
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.main-container .form-container{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.phone-prepend{
|
||||
width: 20px;
|
||||
margin-left: -10px;
|
||||
cursor: default;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
.form-container .input{
|
||||
width: 260px;
|
||||
height: 35px;
|
||||
font-size: 16px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.input .sendSIMCode-button{
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
width: 120px;
|
||||
}
|
||||
.input .sendSIMCode-button:hover{
|
||||
color: #333;
|
||||
}
|
||||
.input .sendSIMCode-button-cooling{
|
||||
color: #888;
|
||||
}
|
||||
.input .sendSIMCode-button-cooling:hover{
|
||||
color: #888;
|
||||
}
|
||||
.login-botton{
|
||||
margin-top: 10px;
|
||||
width: 260px;
|
||||
height: 35px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.login-botton:hover{
|
||||
background-color: #fff;
|
||||
border-color: rgb(220, 223, 230);
|
||||
color: #222;
|
||||
}
|
||||
.login-botton:focus{
|
||||
background-color: #fff;
|
||||
border-color: rgb(220, 223, 230);
|
||||
color: #606266;
|
||||
}
|
||||
</style>
|
||||
266
tonecn/src/views/Download.vue
Normal file
266
tonecn/src/views/Download.vue
Normal file
@@ -0,0 +1,266 @@
|
||||
<script setup>
|
||||
// import { onBeforeMount, reactive, ref } from 'vue';
|
||||
// import Agreement from '../components/agreement.vue'
|
||||
// import ServerAPI from '@/assets/ServerAPI';
|
||||
// let urlTo = (url) => {
|
||||
// // window.location.href = url;
|
||||
// window.open(url, '_blank');
|
||||
// }
|
||||
// let showAgreement = ref(false);
|
||||
// let ResourceDatas = reactive({});
|
||||
// let loadStatus = ref(0);// 0加载中,1加载成功,2加载失败
|
||||
// onBeforeMount(async ()=>{
|
||||
// let res = await ServerAPI.async_getRequest('GetDownloadList');
|
||||
// try {
|
||||
// if(res.status == 'OK')
|
||||
// {
|
||||
// Object.assign(ResourceDatas, res.data);
|
||||
// loadStatus.value = 1;
|
||||
// }else{
|
||||
// console.log("获取资源失败:" + res.data)
|
||||
// loadStatus.value = 2;
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log("获取资源失败:" + error)
|
||||
// loadStatus.value = 2;
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
<template>
|
||||
<div class="main-container">
|
||||
<div class="bcc"></div>
|
||||
<div class="title">一些可以直接下载的工具</div>
|
||||
<div class="subtitle" v-if="loadStatus != 2">请在浏览此部分内容前阅读并同意<a
|
||||
@click="showAgreement = true">《网站使用协议》</a>,继续使用或浏览表示您接受协议条款。</div>
|
||||
<div class="load-fail" v-if="loadStatus == 2">加载失败,请刷新界面重试。</div>
|
||||
<div class="load-fail" v-if="loadStatus == 0">加载中,请稍后...</div>
|
||||
<div class="content-container" v-if="loadStatus == 1">
|
||||
<div class="content" @click="urlTo(`${item.src}`)" v-for="item of ResourceDatas">
|
||||
<div class="icon-container">
|
||||
<img :src="item.icon_src" alt="" class="icon">
|
||||
</div>
|
||||
<div class="describe-container">
|
||||
<div class="title">{{ item.title }}</div>
|
||||
<div class="describe">{{ item.describe }}</div>
|
||||
<div class="lable-container">
|
||||
<div class="lable" :class="{ 'lable-OS': lable.type === 'OS' }" v-for="lable of item.addition.lables">{{
|
||||
lable.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lable-relative" v-if="item.addition.lable.text">
|
||||
<div class="lable" :class="{ 'lable-2': (item.addition.lable.class.indexOf('lable-2') != -1) }">{{
|
||||
item.addition.lable.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content content-hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
<Agreement v-if="showAgreement" @closeAgreement="showAgreement = false" />
|
||||
</template>
|
||||
<style scoped>
|
||||
.main-container {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bcc {
|
||||
position: fixed;
|
||||
z-index: -1;
|
||||
background-color: #f6f8f9;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.main-container>.title {
|
||||
margin-top: 80px;
|
||||
font-size: 42px;
|
||||
cursor: default;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.main-container>.subtitle {
|
||||
margin-top: 20px;
|
||||
color: #666;
|
||||
cursor: default;
|
||||
font-size: 12px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.main-container>.subtitle>a {
|
||||
color: #222;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
border-bottom: 1px solid #f7f8f9;
|
||||
}
|
||||
|
||||
.main-container>.subtitle>a:hover {
|
||||
border-bottom: 1px solid #222;
|
||||
}
|
||||
|
||||
.load-fail {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
cursor: default;
|
||||
margin-bottom: 380px;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
max-width: 1000px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 380px;
|
||||
/* height: 135px; */
|
||||
margin: 20px 30px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 2px 5px 0px #ccc;
|
||||
transition: all 0.4s;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content>.lable-relative {
|
||||
position: relative;
|
||||
width: 0;
|
||||
height: 0;
|
||||
bottom: 18px;
|
||||
right: 38px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content>.lable-relative>.lable {
|
||||
width: 100px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
background-color: rgba(255, 25, 0, 0.7);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.content>.lable-relative>.lable-2 {
|
||||
background-color: rgba(255, 128, 0, 0.7);
|
||||
}
|
||||
|
||||
.content-hidden {
|
||||
opacity: 0;
|
||||
height: 1px;
|
||||
margin: 0 30px;
|
||||
padding: 0 30px;
|
||||
}
|
||||
|
||||
.content:hover {
|
||||
box-shadow: 0px 5px 12px 0px #ccc;
|
||||
}
|
||||
|
||||
.content .icon-container .icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
box-shadow: 0px 1px 4px 1px #ccc;
|
||||
border-radius: 10px;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.content .describe-container {
|
||||
margin-left: 20px;
|
||||
/* width: 200px; */
|
||||
flex: 1;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.describe-container .title {
|
||||
font-size: 23px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.describe-container .describe {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.describe-container .lable-container {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
margin-top: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.describe-container .lable-container .lable {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
background-color: #eceef1;
|
||||
padding: 1px 6px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.describe-container .lable-container .lable-OS {
|
||||
background-color: #d6eeff;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
.content {
|
||||
width: 410px;
|
||||
margin-left: 40px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 550px) {
|
||||
.main-container>.title {
|
||||
font-size: 28px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
flex-direction: column;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.load-fail {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 450px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.content {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
border-radius: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.content .icon-container .icon {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.describe-container .title {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
154
tonecn/src/views/HomeView.vue
Normal file
154
tonecn/src/views/HomeView.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
let containerHeight = ref('800px');
|
||||
onMounted(() => {
|
||||
// 主盒子高度根据初始视窗高度自适应
|
||||
containerHeight.value = window.innerHeight > 500 ? window.innerHeight - 90 + 'px' : '390px';
|
||||
|
||||
// 界面特效字体
|
||||
let nameElement = document.getElementById("my-name");
|
||||
if( nameElement == null){
|
||||
console.error('未找到元素my-name')
|
||||
return;
|
||||
}
|
||||
let colorNum = 66;
|
||||
let colorNumReverse = false;
|
||||
setInterval(() => {
|
||||
if(colorNumReverse)
|
||||
{
|
||||
colorNum--;
|
||||
if(colorNum<=66)
|
||||
colorNumReverse = !colorNumReverse;
|
||||
}else{
|
||||
colorNum++;
|
||||
if(colorNum>=255)
|
||||
colorNumReverse = !colorNumReverse;
|
||||
}
|
||||
nameElement.style.backgroundImage = `linear-gradient(45deg, rgb(${colorNum}, 66, ${255 - (66 - colorNum)}), rgb(${255 - (66 - colorNum)}, 66, ${colorNum}))`;
|
||||
}, 20);
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="bcc"></div>
|
||||
<div class="main-container" id="home-main">
|
||||
<img src="../assets/logo.jpg" alt="" class="logo">
|
||||
<div class="name" id="my-name">特恩(TONE)</div>
|
||||
<div class="self-introduction">一名计算机类专业在校本科大二学生</div>
|
||||
<div class="button-container">
|
||||
<a href="https://space.bilibili.com/474156211">
|
||||
<button class="button" id="button-resource">哔哩哔哩</button>
|
||||
</a>
|
||||
<a href="https://github.com/tonecn">
|
||||
<button class="button button-style2" id="button-code">GitHub</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.bcc {
|
||||
background-color: #fafafa;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: height 0.2s;
|
||||
height: v-bind(containerHeight);
|
||||
}
|
||||
|
||||
.logo {
|
||||
border-radius: 50%;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 42px;
|
||||
font-weight: 800;
|
||||
margin-top: 25px;
|
||||
cursor: default;
|
||||
background: linear-gradient(45deg, rgb(66, 66, 255), rgb(255, 66, 66));
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
transition: font-size 0.2s;
|
||||
}
|
||||
|
||||
.self-introduction {
|
||||
margin-top: 10px;
|
||||
font-size: 23px;
|
||||
cursor: default;
|
||||
color: #888;
|
||||
transition: font-size 0.2s;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
margin-top: 28px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.button {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 46px;
|
||||
background-color: #2591f0;
|
||||
color: #fff;
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
border-radius: 23px;
|
||||
margin: 0 10px;
|
||||
transition: background-color 0.2s;
|
||||
box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.button-style2 {
|
||||
background-color: #e87f29;
|
||||
}
|
||||
|
||||
#button-resource:hover {
|
||||
background-color: #1d74c0;
|
||||
}
|
||||
|
||||
#button-code:hover {
|
||||
background-color: #d5782c;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 470px) {
|
||||
.name {
|
||||
font-size: 34px;
|
||||
}
|
||||
|
||||
.self-introduction {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 180px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.main-container {
|
||||
height: calc(v-bind(containerHeight) + 15px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
257
tonecn/src/views/Resource.vue
Normal file
257
tonecn/src/views/Resource.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<script setup lang="ts">
|
||||
import { request } from '@/lib/request';
|
||||
import Agreement from '@/components/Common/Agreement.vue';
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
let showAgreement = ref(false);
|
||||
let loadStatus = ref(0);// 0加载中 1加载成功 2加载失败
|
||||
let ResourceDatas: any[] = reactive([])
|
||||
onMounted(async () => {
|
||||
// 用于获取数据的函数
|
||||
let res = await request.get('resource/list');
|
||||
console.log(res)
|
||||
if (res && res.code == 0) {
|
||||
loadStatus.value = 1;
|
||||
ResourceDatas.push(...res.data)
|
||||
} else {
|
||||
loadStatus.value = 2;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="main-container">
|
||||
<div class="bcc"></div>
|
||||
<div class="title">精心挑选并收藏的资源</div>
|
||||
<div class="subtitle" v-if="loadStatus != 2">请在浏览此部分内容前阅读并同意<a
|
||||
@click="showAgreement = true">《网站使用协议》</a>,继续使用或浏览表示您接受协议条款。</div>
|
||||
<div class="load-fail" v-if="loadStatus == 2">加载失败,请刷新界面重试。</div>
|
||||
<div class="load-fail" v-if="loadStatus == 0">加载中,请稍后...</div>
|
||||
<div class="content-container" v-if="loadStatus == 1">
|
||||
<div class="content" v-for="item of ResourceDatas">
|
||||
<div class="icon-container">
|
||||
<img :src="item.icon_src" alt="" class="icon">
|
||||
</div>
|
||||
<div class="describe-container">
|
||||
<div class="title">{{ item.title }}</div>
|
||||
<div class="describe">{{ item.describe }}</div>
|
||||
<div class="lable-container">
|
||||
<div class="lable" :class="{ 'lable-OS': lable.type === 'OS' }" v-for="lable of item.addition.lables">{{
|
||||
lable.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lable-relative" v-if="item.addition.lable.text">
|
||||
<div class="lable" :class="{ 'lable-2': (item.addition.lable.class.indexOf('lable-2') != -1) }">{{
|
||||
item.addition.lable.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content content-hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
<Agreement v-if="showAgreement" @closeAgreement="showAgreement = false" />
|
||||
</template>
|
||||
<style scoped>
|
||||
.main-container {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bcc {
|
||||
position: fixed;
|
||||
z-index: -1;
|
||||
background-color: #f6f8f9;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.main-container>.title {
|
||||
margin-top: 80px;
|
||||
font-size: 42px;
|
||||
cursor: default;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.main-container>.subtitle {
|
||||
margin-top: 20px;
|
||||
color: #666;
|
||||
cursor: default;
|
||||
font-size: 12px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.main-container>.subtitle>a {
|
||||
color: #222;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
border-bottom: 1px solid #f7f8f9;
|
||||
}
|
||||
|
||||
.main-container>.subtitle>a:hover {
|
||||
border-bottom: 1px solid #222;
|
||||
}
|
||||
|
||||
.load-fail {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
cursor: default;
|
||||
margin-bottom: 380px;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
max-width: 1000px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 380px;
|
||||
/* height: 135px; */
|
||||
margin: 20px 30px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 2px 5px 0px #ccc;
|
||||
transition: all 0.4s;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content>.lable-relative {
|
||||
position: relative;
|
||||
width: 0;
|
||||
height: 0;
|
||||
bottom: 18px;
|
||||
right: 38px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content>.lable-relative>.lable {
|
||||
width: 100px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
background-color: rgba(255, 25, 0, 0.7);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.content>.lable-relative>.lable-2 {
|
||||
background-color: rgba(255, 128, 0, 0.7);
|
||||
}
|
||||
|
||||
.content-hidden {
|
||||
opacity: 0;
|
||||
height: 1px;
|
||||
margin: 0 30px;
|
||||
padding: 0 30px;
|
||||
}
|
||||
|
||||
.content:hover {
|
||||
box-shadow: 0px 5px 12px 0px #ccc;
|
||||
}
|
||||
|
||||
.content .icon-container .icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
box-shadow: 0px 1px 4px 1px #ccc;
|
||||
border-radius: 10px;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
|
||||
.content .describe-container {
|
||||
margin-left: 20px;
|
||||
/* width: 200px; */
|
||||
flex: 1;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.describe-container .title {
|
||||
font-size: 23px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.describe-container .describe {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.describe-container .lable-container {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
margin-top: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.describe-container .lable-container .lable {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
background-color: #eceef1;
|
||||
padding: 1px 6px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.describe-container .lable-container .lable-OS {
|
||||
background-color: #d6eeff;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
.content {
|
||||
width: 410px;
|
||||
margin-left: 40px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 550px) {
|
||||
.main-container>.title {
|
||||
font-size: 28px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
flex-direction: column;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.load-fail {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 450px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.content {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
border-radius: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.content .icon-container .icon {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.describe-container .title {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user