poetize-ui 1.0

master
Abby 2 years ago
commit 88feff285c

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

@ -0,0 +1,16 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}

23
.gitignore vendored

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,71 @@
# 寻国记poetry-uiVue2
## 网站示例
[寻国记poetize.cn](https://poetize.cn)
## 技术栈
前端技术Vue2博客系统Vue3聊天室系统Element UIVue2Element-Plus UIVue3Naive UIVue3
后端技术JavaSpring Bootspring-boot-starter-mailMysqlMybatis-Plust-ioqiniu-java-sdk
## 网站简介
这是一个 Spring Boot + Vue2 + Vue3 的产物。
网站分两个模块:
- 博客系统:具有文章,留言,友链,时间线,后台管理等功能。
- 聊天室系统:具有朋友圈(时间线),好友,群等功能。
本网站搭建于阿里云采用前后端分离进行实现两个前端项目通过Nginx代理。
### 首页
![首页](首页.jpg)
### 推荐
![推荐](推荐.jpg)
### 留言
![留言](留言.jpg)
### 树洞
![树洞](树洞.jpg)
### 朋友圈(时间线)
![朋友圈(时间线)](朋友圈(时间线).jpg)
### 友链
![友链](友链.jpg)
### 聊天室
![聊天室](聊天室.jpg)
## 安装
```
npm install
```
## 启动
```
npm run serve
```
## 编译
```
npm run build
```
## 配置
全局搜索:$$$$
替换成自己自定义的内容因为Https无法跨域这些内容需要用自己的。
## 欢迎进群
1. 交流(摸鱼)
2. 安装部署:互相帮助,争取每个人都零基础拥有自己的个人网站
3. 博客答疑:每段代码都是我自己写的,爱学习的小伙伴可以在这里提问,互相学习,互相进步
4. 隐藏功能介绍:博客隐藏了很多功能,除了最重要的文章浏览,聊天室,还有朋友圈,网站后台基本信息管理,用户管理,评论管理,留言管理,友链管理,建群,加群,加好友等等等等
5. 漏洞反馈欢迎提交BUG
6. 迭代升级:呼声高的功能可能会采纳,能力有限,时间有限,欢迎创作。
群名片七天有效,如果需要请加作者好友,然后拉进交流群
<img src="https://github.com/aLittleDonkey/poetize-ui/blob/master/Sara.jpg" width="146.6" height="200" alt="作者名片"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}
]
]
}

28918
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,43 @@
{
"name": "poetry-ui",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"crypto-js": "^4.1.1",
"element-ui": "^2.4.5",
"markdown-it": "^12.2.0",
"mavon-editor": "^2.9.1",
"qs": "^6.10.3",
"vue": "^2.6.11",
"vue-baberrage": "^3.2.4",
"vue-ripple-directive": "^2.0.1",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
}
}

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="icon" href="$$$$head地址" sizes="16x16">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Sara</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/wow/1.1.2/wow.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.8/clipboard.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qiniu-js/3.4.0/qiniu.min.js"></script>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script>
new WOW().init();
</script>
</html>

@ -0,0 +1,31 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {}
}
</script>
<style scoped>
</style>

@ -0,0 +1,171 @@
/* 以my-animation-开头的class */
[class*=my-animation-] {
animation-duration: 1s;
animation-timing-function: ease-out;
animation-fill-mode: both;
}
.my-animation-slide-top {
animation-name: slide-top
}
.my-animation-slide-bottom {
animation-name: slide-bottom
}
.my-animation-hideToShow {
animation-name: hideToShow
}
/* 上移 */
@keyframes slide-top {
0% {
opacity: 0;
transform: translateY(-20%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
/* 下移 */
@keyframes slide-bottom {
0% {
opacity: 0;
transform: translateY(20%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
/* 首图动画:下移 */
@keyframes header-effect {
0% {
opacity: 0;
transform: translateY(-50px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/* 旋转 */
@keyframes rotate {
0% {
opacity: 1;
transform: rotate(0deg);
}
100% {
opacity: 1;
transform: rotate(360deg);
}
}
/* 显示 */
@keyframes hideToShow {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* 下移 */
@keyframes my-shake {
0% {
opacity: 1;
transform: translateY(0px);
}
30% {
opacity: 0.5;
transform: translateY(25px);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
/* 上移 */
@keyframes scatter {
0% {
top: 0;
}
50% {
top: -15px;
}
100% {
top: 0;
}
}
/* 放大 */
@keyframes scale {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
/* 背景位置移动 */
@keyframes gradientBG {
0% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0 50%;
}
}
/* 阴影变化 */
@keyframes weiYanShadowFlashing {
0% {
box-shadow: none;
}
50% {
box-shadow: 0 0 15px var(--red);
}
100% {
box-shadow: none;
}
}
/* 有小变大 */
@keyframes zoomIn {
0% {
opacity: 0;
transform: scale3d(.3, .3, .3);
}
50% {
opacity: 1;
}
}

@ -0,0 +1,83 @@
:root {
/* 背景 */
--background: white;
--gradualBackground: linear-gradient(to right bottom, #ee7752, #e73c7e, #23a6d5, #23d5ab);
/* 字体 */
--fontColor: black;
/* 边框 */
--borderColor: rgba(0, 0, 0, 0.5);
/* 边框 */
--borderHoverColor: rgba(110, 110, 110, 0.4);
/* 文章字体 */
--articleFontColor: #1f1f1f;
/* 文章灰色字体 */
--articleGreyFontColor: #616161;
/* 评论背景颜色 */
--commentContent: #F7F9FE;
/* 主题背景 */
--themeBackground: orange;
/* 主题悬停背景 */
--gradualRed: linear-gradient(to right, #ff4b2b, #ff416c);
/* 水波纹 */
--rippleColor: rgba(0, 0, 0, 0.5);
/* 导航栏字体 */
--toolbarFont: #333333;
/* 导航栏背景 */
--toolbarBackground: rgba(255, 255, 255, 1);
/* 灰色字体 */
--greyFont: #797979;
--maxGreyFont: #595A5A;
/* footer背景 */
--gradientBG: linear-gradient(-90deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
/* 白色遮罩 */
--whiteMask: rgba(255, 255, 255, 0.3);
/* max白色遮罩 */
--maxWhiteMask: rgba(255, 255, 255, 0.5);
--maxMaxWhiteMask: rgba(255, 255, 255, 0.7);
/* mini白色遮罩 */
--miniWhiteMask: rgba(255, 255, 255, 0.15);
/* 透明 */
--transparent: rgba(0, 0, 0, 0);
/* mini黑色遮罩 */
--miniMask: rgba(0, 0, 0, 0.15);
/* 黑色遮罩 */
--mask: rgba(0, 0, 0, 0.3);
/* 半透明 */
--translucent: rgba(0, 0, 0, 0.5);
/* 深黑遮罩 */
--maxMask: rgba(0, 0, 0, 0.7);
--white: white;
--red: red;
--lightRed: #ff4b2b;
--maxLightRed: #ff416c;
--orangeRed: #EF794F;
--azure: #ECF7FE;
--blue: rgb(3, 169, 244);
--lightGray: #DDDDDD;
--maxLightGray: #EEEEEE;
--maxMaxLightGray: rgba(242, 242, 242, 0.5);
--lightGreen: #39c5bb;
--green: #67C23A;
--black: black;
--lightYellow: #F4E1C0;
--globalFont: $$$$;
--commentURL: url("$$$$图片地址");
--toTop: url("$$$$图片地址");
--bannerWave1: url("$$$$图片地址") repeat-x;
--bannerWave2: url("$$$$图片地址") repeat-x;
--verifyImage: url("$$$$图片地址");
--toolbar: url("$$$$图片地址");
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,257 @@
/* 通用css */
* {
box-sizing: border-box;
}
body {
color: var(--fontColor);
font-family: var(--globalFont), serif;
word-break: break-word;
}
/* 图片 */
.background-image {
width: 100vw;
height: 100vh;
/* 固定位置,不随滚动条滚动 */
position: fixed;
z-index: -1;
}
.background-image::before {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .2);
content: '';
}
.background-image-error {
background-color: var(--lightGreen);
width: 100vw;
height: 100vh;
/* 固定位置,不随滚动条滚动 */
position: fixed;
z-index: -1;
}
/* 模块化背景色及透明度 */
.background-opacity {
/*background: var(--background);*/
/*opacity: 0.88;*/
}
.my-el-image {
width: 100%;
height: 100%;
}
.my-el-image .image-slot {
width: 100%;
height: 100%;
}
/* 遮罩 */
.poem-image::before {
position: absolute;
width: 100%;
height: 100%;
background-color: var(--maxMask);
content: "";
}
.user-avatar {
cursor: pointer;
transition: all 0.3s;
user-select: none;
}
.user-avatar:hover {
transform: rotate(360deg);
}
/* 滚动条 */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background-color: rgba(73, 177, 245, 0.2);
}
::-webkit-scrollbar-thumb {
background-color: #49b1f5;
background-image: linear-gradient(
45deg,
rgba(255, 255, 255, 0.4) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.4) 50%,
rgba(255, 255, 255, 0.4) 75%,
transparent 75%,
transparent
);
border-radius: 1em;
}
.el-select-dropdown.el-popper ::-webkit-scrollbar {
display: none;
}
/* 选中样式 */
::selection {
background: var(--lightYellow);
color: var(--black);
}
/* 居中 */
.myCenter {
display: flex;
justify-content: center;
align-items: center;
}
.transformCenter {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
/* 两边 */
.myBetween {
display: flex;
justify-content: space-between;
align-items: center;
}
/* 阴影 */
.shadow-box-mini {
box-shadow: 1px 1px 3px var(--mask);
}
.shadow-box {
box-shadow: 0 1px 20px -6px var(--borderColor);
transition: all 0.3s ease;
}
.shadow-box:hover {
box-shadow: 0 5px 10px 5px var(--borderHoverColor);
}
/* el弹出框样式 */
.el-message {
top: 80px !important;
border: 0;
}
.el-message * {
color: var(--white) !important;
font-weight: 600;
}
.el-message--success {
background: var(--themeBackground);
}
.el-message--warning {
background: var(--gradientBG);
}
.el-message--error {
background: var(--gradualRed);
}
/* 看板娘 */
#waifu-toggle, #waifu {
z-index: 100;
}
#waifu-tips {
border: unset;
animation: unset;
width: 200px;
min-height: 60px;
}
#waifu-tool {
right: -10px;
bottom: 20px;
top: unset;
}
#waifu #live2d {
height: 250px;
width: 250px;
}
/* 图标旋转 */
.iconRotate {
animation: rotate 2s linear infinite;
}
/* 树洞留言 */
.baberrage-item .baberrage-msg {
padding-right: 5px;
}
.baberrage-item .normal .baberrage-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.el-upload.el-upload--picture {
width: 100%;
}
.el-upload-dragger {
width: 100% !important;
height: 100px !important;
}
/* 导航栏 */
.toolbarDrawer {
position: relative;
background: var(--toolbar) center center / cover no-repeat;
letter-spacing: 3px;
}
.toolbarDrawer .el-drawer__header {
font-size: 22px;
color: var(--white);
text-align: center;
position: relative;
}
.toolbarDrawer::before {
position: absolute;
width: 100%;
height: 100%;
background-color: var(--maxMask);
content: "";
}
.small-menu {
color: var(--white);
font-size: 20px;
user-select: none;
position: relative;
}
.small-menu > li {
list-style: none;
height: 50px;
line-height: 50px;
cursor: pointer;
}
@media screen and (max-width: 400px) {
.el-dialog {
width: 75% !important;
}
}

@ -0,0 +1,380 @@
/* markdown样式 */
.entry-content {
position: relative;
}
.entry-content blockquote {
margin: 0;
padding: 15px 50px;
position: relative;
word-break: break-word;
text-align: center;
}
.entry-content blockquote:before {
content: "\f10d";
font-size: 1.5rem;
position: absolute;
top: 0;
left: 0;
color: orange;
font-family: FontAwesome;
}
.entry-content blockquote:after {
content: '\f10e';
font-size: 1.5rem;
position: absolute;
bottom: 0;
right: 0;
color: orange;
font-family: FontAwesome;
}
.entry-content code:not(.hljs) {
background: #fefac7;
color: #e67474;
word-break: break-word;
padding: 4px 6px;
border-radius: 5px;
}
.entry-content ul {
list-style: disc;
padding: 0 10px 0 35px;
color: var(--articleGreyFontColor);
border-radius: 10px;
}
.entry-content ol {
list-style: decimal;
padding: 0 10px 0 35px;
color: var(--articleGreyFontColor);
border-radius: 10px;
}
.entry-content ol li,
.entry-content ul li {
padding: 8px 0;
Letter-spacing: 1px;
line-height: 24px;
}
.entry-content h3 {
padding-bottom: 8px;
border-bottom: 1px dashed #ddd;
}
.entry-content h1,
.entry-content h2,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
margin-top: 30px;
margin-bottom: 20px;
}
.entry-content h2 {
padding-left: 40px;
}
.entry-content h3 {
padding-left: 20px;
font-size: 22px;
}
.entry-content h4 {
padding-left: 20px;
font-size: 20px;
}
.entry-content h5 {
font-size: 18px;
padding-left: 28px;
}
.entry-content h2:before {
content: "🌺";
position: absolute;
left: 0;
font-size: 1.03em;
margin-top: -2px;
}
.entry-content h3:before {
content: "#";
left: 0;
position: absolute;
margin-top: 2px;
color: #ff6d6d;
}
.entry-content h4:before {
content: "▌";
left: 0;
position: absolute;
color: #ff6d6d;
}
.entry-content h5:before {
content: "🌷";
left: 0;
position: absolute;
}
.entry-content a {
color: #e67474;
position: relative;
text-decoration: none;
}
.entry-content a:hover {
color: orange;
}
.entry-content a:after {
content: '';
position: absolute;
width: 100%;
transform: scaleX(0);
height: 1.5px;
bottom: -2px;
left: 0;
background-color: orange;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.entry-content a:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
.entry-content p {
color: var(--articleFontColor);
line-height: 35px;
word-break: break-word;
font-size: 18px;
}
.entry-content hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0.5px dashed #fc625d;
}
.entry-content img {
max-width: 100%;
border-radius: 5px;
}
/* 高亮代码块 */
.highlight-wrap {
position: relative;
background: #21252b;
border-radius: 5px;
font: 15px/22px "Microsoft YaHei", "Arial";
line-height: 1.6;
margin-bottom: 1.6em;
width: 100%;
padding-top: 30px;
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.4);
}
.highlight-wrap:before {
content: "";
position: absolute;
border-radius: 50%;
background: #fc625d;
width: 12px;
height: 12px;
left: 12px;
margin-top: -18px;
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
z-index: 2;
}
.highlight-wrap .copy-code {
color: #fff;
position: absolute;
right: 10px;
top: 5px;
font-size: 16px;
z-index: 2;
}
.highlight-wrap .copy-code:hover {
color: rgba(255, 255, 255, 0.5);
}
.highlight-wrap code::-webkit-scrollbar {
height: 6px;
width: 6px;
}
.highlight-wrap code {
word-break: break-word;
border-radius: 0 0 5px 5px;
}
.highlight-wrap code[data-rel]:before {
color: #fff;
content: attr(data-rel);
height: 30px;
line-height: 23px;
background: #21252b;
font-size: 16px;
position: absolute;
left: 0;
margin-top: -30px;
width: 100%;
font-family: Ubuntu;
font-weight: 700;
text-align: center;
pointer-events: none;
z-index: 1;
}
.hljs {
color: #a9b7c6;
background: #1d1f21;
display: block;
overflow-x: auto;
padding: 0.5em;
}
.hljs-ln-line span::selection,
.hljs-ln-line::selection {
background: #fff;
color: #21252b;
}
.hljs-ln {
margin: 6px 0 0;
width: 100%;
}
.hljs-ln-line.hljs-ln-code {
padding-left: 25px;
padding-right: 10px;
}
.hljs-ln-line.hljs-ln-code:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.hljs-ln-line.hljs-ln-numbers {
user-select: none;
text-align: center;
color: #888f96;
position: absolute;
left: 0;
width: 30px;
background: #1d1f21;
}
.hljs-comment,
.hljs-quote {
color: #888f96;
font-style: italic;
}
.hljs-doctag,
.hljs-formula,
.hljs-keyword {
color: #c678dd;
}
.hljs-deletion,
.hljs-name,
.hljs-section,
.hljs-selector-tag,
.hljs-subst {
color: #e06c75;
}
.hljs-literal {
color: #56b6c2;
}
.hljs-addition,
.hljs-attribute,
.hljs-meta-string,
.hljs-regexp,
.hljs-string {
color: #98c379;
}
.hljs-built_in,
.hljs-class .hljs-title {
color: #e6c07b;
}
.hljs-attr,
.hljs-number,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-pseudo,
.hljs-template-variable,
.hljs-type,
.hljs-variable {
color: #d19a66;
}
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-symbol,
.hljs-title {
color: #61aeee;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: 700;
}
.hljs-link {
text-decoration: underline;
}
/* 表格 */
.table-wrapper::-webkit-scrollbar {
height: 6px;
width: 6px;
}
.table-wrapper > table {
border-collapse: collapse;
}
.table-wrapper > table th {
background-color: rgba(0, 0, 0, 0.1);
}
.table-wrapper > table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.table-wrapper > table td,
.table-wrapper > table th {
padding: 8px 16px;
border: 1px solid #dfe2e5;
line-height: 1.5;
font-size: 90%;
text-align: center;
}
.table-wrapper > table tbody > tr {
transition: all 0.28s ease;
}
.table-wrapper > table tbody > tr:hover {
background-color: rgba(0, 0, 0, 0.2);
}

@ -0,0 +1,66 @@
.toc {
overflow-y: auto;
width: 150px;
max-height: 300px;
position: fixed;
top: 50vh;
right: 50px;
background: var(--background);
border-radius: 5px;
z-index: 100;
transition: all 1s;
}
.toc::-webkit-scrollbar {
display: none;
}
.toc > .toc-list {
overflow: hidden;
position: relative;
}
.toc > .toc-list li {
list-style: none;
}
.toc .toc-list {
margin: 0;
padding: 4px 4px 4px 10px;
}
.toc a.toc-link {
color: currentColor;
height: 100%;
text-decoration: none;
}
.toc .is-collapsible {
max-height: 1000px;
overflow: hidden;
transition: all 300ms ease-in-out;
}
.toc .is-collapsed {
max-height: 0;
}
.toc .is-active-link {
font-weight: 700;
color: var(--green) !important;
}
.toc .toc-link::before {
background-color: #EEE;
content: ' ';
display: inline-block;
height: inherit;
left: 0;
margin-top: -1px;
position: absolute;
width: 2px;
}
.toc .is-active-link::before {
background-color: var(--green);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

@ -0,0 +1,190 @@
<template>
<div>
<!-- 两句诗 -->
<div class="my-animation-slide-top">
<twoPoem :isHitokoto="false"></twoPoem>
</div>
<div style="background: var(--background)" class="my-animation-slide-bottom">
<div class="about-wrap">
<h1 style="font-size: 40px;font-weight: 500;letter-spacing: 5px;">两只毛驴鸣翠柳</h1>
<!-- 对话框 -->
<div class="about-box">
<h4> {{$store.state.webInfo.webName}} 对话中...</h4>
<div v-if="sayShow" id="say-container"></div>
</div>
</div>
<!-- 页脚 -->
<myFooter></myFooter>
</div>
</div>
</template>
<script>
const twoPoem = () => import( "./common/twoPoem");
const myFooter = () => import( "./common/myFooter");
export default {
components: {
twoPoem,
myFooter
},
data() {
return {
sayShow: false,
sayContent: [
{
"talk": ["Hi, there👋", "这是一个 Vue2 Vue3 与 SpringBoot 结合的产物~"],
"reply": ["然后呢? 😃", "少废话! 🙄"]
}, {
"talk": ["😘",
"本站平时仅用于交流和学习新知识",
"如涉及侵权请联系站长删除对应资源,谢谢!!!"],
"reply": ["这个网站有什么用吗? 😂"]
}, {
"talk": ["拥有自己的独立网站难道不酷吗🚀",
"那就摸鱼吧👋",
"摸鱼大军请在聊天室集合🥝"],
"reply": []
}
],
sayIndex: 0
}
},
computed: {},
watch: {},
created() {
setTimeout(() => {
this.sayShow = true;
this.say();
}, 2000);
},
mounted() {
},
methods: {
answer(index, value) {
$(".say-select").remove();
let htmlStr = `<div class="say-right my-animation-slide-bottom"><span class="say-item-right">${value}</span></div>`;
let frag = document.createRange().createContextualFragment(htmlStr);
document.getElementById("say-container").appendChild(frag);
if (index === 0) {
setTimeout(() => {
this.say();
}, 500);
} else {
let htmlStr = `<div class="say-left my-animation-slide-bottom"><span class="say-item-left">👋 👋 👋</span></div>`;
let frag = document.createRange().createContextualFragment(htmlStr);
document.getElementById("say-container").appendChild(frag);
}
},
say() {
if (!this.$common.isEmpty(this.sayContent[this.sayIndex]) && !this.$common.isEmpty(this.sayContent[this.sayIndex].talk)) {
this.sayContent[this.sayIndex].talk.forEach((value, index, talk) => {
setTimeout(() => {
let htmlStr = `<div class="say-left my-animation-slide-bottom"><span class="say-item-left">${value}</span></div>`;
let frag = document.createRange().createContextualFragment(htmlStr);
document.getElementById("say-container").appendChild(frag);
if (talk.length === index + 1) {
if (!this.$common.isEmpty(this.sayContent[this.sayIndex].reply)) {
setTimeout(() => {
if (this.sayContent[this.sayIndex].reply.length === 2) {
let reply0 = this.sayContent[this.sayIndex].reply[0];
let reply1 = this.sayContent[this.sayIndex].reply[1];
let htmlStr = `<div class="say-left my-animation-slide-bottom"><span class="say-select">${reply0}</span><span class="say-select">${reply1}</span></div>`;
let frag = document.createRange().createContextualFragment(htmlStr);
document.getElementById("say-container").appendChild(frag);
document.getElementsByClassName("say-select")[0].onclick = () => {
this.answer(0, reply0);
}
document.getElementsByClassName("say-select")[1].onclick = () => {
this.answer(1, reply1);
}
} else if (this.sayContent[this.sayIndex].reply.length === 1) {
let reply0 = this.sayContent[this.sayIndex].reply[0];
let htmlStr = `<div class="say-left my-animation-slide-bottom"><span class="say-select">${reply0}</span></div>`;
let frag = document.createRange().createContextualFragment(htmlStr);
document.getElementById("say-container").appendChild(frag);
document.getElementsByClassName("say-select")[0].onclick = () => {
this.answer(0, reply0);
}
}
this.sayIndex += 1;
}, 500);
}
}
}, index * 500);
});
}
}
}
}
</script>
<style>
.about-wrap {
text-align: center;
width: 95%;
max-width: 800px;
margin: 0 auto;
padding: 40px 20px 80px;
}
.about-box {
min-height: 450px;
padding: 5px;
background-color: var(--maxMaxLightGray);
border-radius: 10px;
}
.say-item-left {
padding: 5px 12px;
border-radius: 1rem;
color: var(--maxGreyFont);
background-color: var(--lightGray);
}
.say-item-right {
padding: 5px 12px;
border-radius: 1rem;
color: var(--white);
background-color: var(--translucent);
}
.say-left {
display: flex;
justify-content: left;
margin: 15px;
}
.say-right {
display: flex;
justify-content: right;
margin: 15px;
}
.say-select {
cursor: pointer;
background: var(--black);
border-radius: 5px;
padding: 5px 10px;
margin-right: 12px;
margin-top: 20px;
color: var(--white);
border: 1px solid var(--black);
}
.say-select:hover {
border: 1px solid var(--themeBackground);
color: var(--themeBackground);
box-shadow: 0 0 5px var(--themeBackground);
}
</style>

@ -0,0 +1,61 @@
<template>
<div>
<myHeader></myHeader>
<sidebar></sidebar>
<div class="content-box">
<div class="content">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script>
import myHeader from "./common/myHeader.vue";
import sidebar from "./common/sidebar.vue";
export default {
components: {
myHeader,
sidebar
},
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {}
}
</script>
<style scoped>
.content-box {
position: absolute;
left: 200px;
right: 0;
top: 70px;
bottom: 0;
transition: left .3s ease-in-out;
}
.content {
width: auto;
height: 100%;
padding: 30px;
overflow-y: scroll;
}
</style>

@ -0,0 +1,152 @@
<template>
<div>
<div style="margin-bottom: 20px">
<el-input class="my-input" type="number" style="width: 140px;margin-right: 10px" v-model="pagination.source"
placeholder="文章ID"></el-input>
<el-button type="primary" icon="el-icon-search" @click="searchComments()"></el-button>
<el-button type="danger" @click="clearSearch()"></el-button>
</div>
<el-table :data="comments" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="source" label="文章ID" align="center"></el-table-column>
<el-table-column prop="userId" label="发表用户ID" align="center"></el-table-column>
<el-table-column prop="likeCount" label="点赞数" align="center"></el-table-column>
<el-table-column prop="commentContent" label="评论内容" align="center"></el-table-column>
<el-table-column prop="commentInfo" label="评论额外信息" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
isBoss: this.$store.state.currentAdmin.isBoss,
pagination: {
current: 1,
size: 10,
total: 0,
source: null
},
comments: []
}
},
computed: {},
watch: {},
created() {
this.getComments();
},
mounted() {
},
methods: {
clearSearch() {
this.pagination = {
current: 1,
size: 10,
total: 0,
source: null
}
this.getComments();
},
getComments() {
let url = "";
if (this.isBoss) {
url = "/admin/comment/boss/list";
} else {
url = "/admin/comment/user/list";
}
this.$http.post(this.$constant.baseURL + url, this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.comments = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handlePageChange(val) {
this.pagination.current = val;
this.getComments();
},
searchComments() {
this.pagination.total = 0;
this.pagination.current = 1;
this.getComments();
},
handleDelete(item) {
let url = "";
if (this.isBoss) {
url = "/admin/comment/boss/deleteComment";
} else {
url = "/admin/comment/user/deleteComment";
}
this.$confirm('删除评论后,所有该评论的回复均不可见。确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + url, {id: item.id}, true)
.then((res) => {
this.pagination.current = 1;
this.getComments();
this.$message({
message: "删除成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
}
}
}
</script>
<style scoped>
.pagination {
margin: 20px 0;
text-align: right;
}
.my-input >>> input::-webkit-inner-spin-button {
appearance: none;
}
</style>

@ -0,0 +1,113 @@
<template>
<div class="my-header myBetween">
<div class="logo">后台管理</div>
<div class="header-right">
<div class="admin-index" @click="$router.push({path: '/'})">
<svg viewBox="0 0 1024 1024" width="25" height="25" style="vertical-align: -6px;">
<path d="M221.4 152.6h141.8V396h-141.8V152.6z" fill="#FAD996"></path>
<path
d="M363.4 152.6c-9-16.6-138.2-14.2-142 0-3 11.4-23.6 287 15.8 182.4 10.4-27.4 22.6-47.6 37.2-78.6 10.6-22.6 22-42.4 32.6-54.4 16.6-18.6 18 9.6 33.6 22.6 41.6 34.4 31.8-55.6 22.8-72z"
fill="#F9F8F7"></path>
<path
d="M834.2 851c0 24.8-20.2 45-45 45H234.8c-24.8 0-45-20.2-45-45v-370h1.2l321.2-270 321.2 270h0.6l0.2 370z"
fill="#FAD996"></path>
<path d="M833.4 481l-321.2-270-1.8 1.6V896h278.8c24.8 0 45-20.2 45-45l-0.2-370h-0.6z" fill="#F7C872"
p-id="16219"></path>
<path
d="M62 548L432.6 166.2s81.2-90.6 171.8 0c79 79 343.6 400 343.6 400s-55.4 41-125.2 14.2c-37.8-14.4-118.2-68-133.4-150.8-11-60.2-45.8 29-60.8-38.2-9.4-42.2-67.2-96.6-67.2-96.6s-48.4-55.4-100.2 0c-13.8 14.8-11.4 134.6-44 128-26.4-5.2-20-105.6-27-81.2-9.6 33-25 61-54.4 47.2-33.2-15.6-42.4 79.6-64.8 112.8-17.2 25.4-23.8-45.8-40.4-29.2-21.2 21-2.4 94-39.4 108s-132.8-2-129.2-32.4z"
fill="#F9F8F7"></path>
<path
d="M512 126.2v144c28.8 1 49.4 24.6 49.4 24.6s57.8 54.4 67.2 96.6c15 67.2 49.8-22 60.8 38.2 15.2 82.8 95.6 136.4 133.4 150.8 69.8 26.8 125.2-14.2 125.2-14.2s-264.6-321-343.6-400c-33.2-33.2-65.2-42-92.4-40z"
fill="#EFEBE8"></path>
<path d="M405.2 495h99.8v99.8h-99.8v-99.8zM405.2 609.2h99.8v99.8h-99.8v-99.8z" fill="#FB8A5D"></path>
<path d="M519 495h99.8v99.8h-99.8v-99.8zM519 609.2h99.8v99.8h-99.8v-99.8z" fill="#EA6D4B"></path>
</svg>
<span>&nbsp;首页</span>
</div>
<div class="header-user-con">
<el-dropdown placement="bottom">
<el-avatar class="user-avatar" :size="40"
:src="$store.state.currentAdmin.avatar">
</el-avatar>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="logout()">退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {
logout() {
this.$http.get(this.$constant.baseURL + "/user/logout", {}, true)
.then((res) => {
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.$store.commit("loadCurrentAdmin", {});
localStorage.removeItem("adminToken");
this.$router.push({path: '/'});
}
}
}
</script>
<style scoped>
.my-header {
position: relative;
width: 100%;
height: 70px;
color: black;
background-color: #ebf1f6;
}
.my-header .logo {
line-height: 70px;
margin-left: 70PX;
font-size: 22px;
}
.header-right {
display: flex;
justify-content: flex-end;
margin-right: 40px;
}
.admin-index {
height: 70px;
line-height: 70px;
font-size: 15px;
margin-right: 20px;
cursor: pointer;
}
.header-user-con {
display: flex;
align-items: center;
}
</style>

@ -0,0 +1,125 @@
<template>
<div class="sidebar">
<el-menu class="sidebar-el-menu"
default-active="/main"
background-color="#ebf1f6"
text-color="#606266"
active-text-color="#20a0ff"
unique-opened
router>
<template v-for="item in items">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span>{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
<template slot="title">
{{ subItem.title }}
</template>
<el-menu-item v-for="threeItem in subItem.subs" :key="threeItem.index" :index="threeItem.index">
{{ threeItem.title }}
</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="subItem.index" :key="subItem.index">
{{ subItem.title }}
</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
{{ item.title }}
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
export default {
data() {
return {
items: [{
icon: "el-icon-s-home",
index: "/main",
title: "系统首页",
}, {
icon: "el-icon-s-tools",
index: "/webEdit",
title: "网站设置",
}, {
icon: "el-icon-user-solid",
index: "/userList",
title: "用户管理"
}, {
icon: "el-icon-postcard",
index: "/postList",
title: "文章管理"
}, {
icon: "el-icon-notebook-2",
index: "/sortList",
title: "分类管理"
}, {
icon: "el-icon-edit-outline",
index: "/commentList",
title: "评论管理"
}, {
icon: "el-icon-s-comment",
index: "/treeHoleList",
title: "留言管理"
}, {
icon: "el-icon-paperclip",
index: "/resourceList",
title: "资源管理"
}, {
icon: "el-icon-bank-card",
index: "/resourcePathList",
title: "资源路径管理"
}]
}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {}
}
</script>
<style scoped>
.sidebar {
display: block;
position: absolute;
left: 0;
top: 70px;
bottom: 0;
overflow-y: scroll;
}
.sidebar::-webkit-scrollbar {
width: 0;
}
.sidebar-el-menu {
width: 200px;
}
.sidebar > ul {
height: 100%;
}
</style>

@ -0,0 +1,31 @@
<template>
<div>
</div>
</template>
<script>
export default {
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {}
}
</script>
<style scoped>
</style>

@ -0,0 +1,341 @@
<template>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path d="M0 0h1024v1024H0V0z" fill="#202425" opacity=".01"></path>
<path
d="M682.666667 204.8h238.933333a34.133333 34.133333 0 0 1 34.133333 34.133333v648.533334a68.266667 68.266667 0 0 1-68.266666 68.266666h-204.8V204.8z"
fill="#FFAA44"></path>
<path
d="M68.266667 921.6a34.133333 34.133333 0 0 0 34.133333 34.133333h785.066667a68.266667 68.266667 0 0 1-68.266667-68.266666V102.4a34.133333 34.133333 0 0 0-34.133333-34.133333H102.4a34.133333 34.133333 0 0 0-34.133333 34.133333v819.2z"
fill="#11AA66"></path>
<path
d="M238.933333 307.2a34.133333 34.133333 0 0 0 0 68.266667h136.533334a34.133333 34.133333 0 1 0 0-68.266667H238.933333z m0 204.8a34.133333 34.133333 0 1 0 0 68.266667h409.6a34.133333 34.133333 0 1 0 0-68.266667H238.933333z m0 204.8a34.133333 34.133333 0 1 0 0 68.266667h204.8a34.133333 34.133333 0 1 0 0-68.266667H238.933333z"
fill="#FFFFFF"></path>
</svg>
文章信息
</el-tag>
<el-form :model="article" :rules="rules" ref="ruleForm" label-width="150px"
class="demo-ruleForm">
<el-form-item label="标题" prop="articleTitle">
<el-input v-model="article.articleTitle"></el-input>
</el-form-item>
<el-form-item label="内容" prop="articleContent">
<mavon-editor ref="md" @imgAdd="imgAdd" v-model="article.articleContent"/>
</el-form-item>
<el-form-item label="是否启用评论" prop="commentStatus">
<el-tag :type="article.commentStatus === false ? 'danger' : 'success'"
disable-transitions>
{{article.commentStatus === false ? '否' : '是'}}
</el-tag>
<el-switch v-model="article.commentStatus"></el-switch>
</el-form-item>
<el-form-item label="是否推荐" prop="recommendStatus">
<el-tag :type="article.recommendStatus === false ? 'danger' : 'success'"
disable-transitions>
{{article.recommendStatus === false ? '否' : '是'}}
</el-tag>
<el-switch v-model="article.recommendStatus"></el-switch>
</el-form-item>
<el-form-item label="是否可见" prop="viewStatus">
<el-tag :type="article.viewStatus === false ? 'danger' : 'success'"
disable-transitions>
{{article.viewStatus === false ? '否' : '是'}}
</el-tag>
<el-switch v-model="article.viewStatus"></el-switch>
</el-form-item>
<el-form-item v-if="article.viewStatus === false" label="不可见时的访问密码" prop="password">
<el-input v-model="article.password"></el-input>
</el-form-item>
<el-form-item label="封面" prop="articleCover">
<div style="display: flex">
<el-input v-model="article.articleCover"></el-input>
<el-image class="table-td-thumb"
style="margin-left: 10px"
:preview-src-list="[article.articleCover]"
:src="article.articleCover"
fit="cover"></el-image>
</div>
<uploadPicture :isAdmin="true" :prefix="'articleCover'" style="margin-top: 10px" @addPicture="addArticleCover"
:maxSize="5"
:maxNumber="1"></uploadPicture>
</el-form-item>
<el-form-item label="分类" prop="sortId">
<el-select v-model="article.sortId" placeholder="请选择分类">
<el-option
v-for="item in sorts"
:key="item.id"
:label="item.sortName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标签" prop="labelId">
<el-select v-model="article.labelId" placeholder="请选择标签">
<el-option
v-for="item in labelsTemp"
:key="item.id"
:label="item.labelName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="myCenter" style="margin-bottom: 22px">
<el-button type="primary" @click="submitForm('ruleForm')"></el-button>
<el-button type="danger" @click="resetForm('ruleForm')"></el-button>
</div>
</div>
</template>
<script>
const uploadPicture = () => import( "../common/uploadPicture");
export default {
components: {
uploadPicture
},
data() {
return {
id: this.$route.query.id,
token: "",
article: {
articleTitle: "",
articleContent: "",
commentStatus: true,
recommendStatus: false,
viewStatus: true,
password: "",
articleCover: "",
sortId: null,
labelId: null
},
sorts: [],
labels: [],
labelsTemp: [],
rules: {
articleTitle: [
{required: true, message: '请输入标题', trigger: 'change'}
],
articleContent: [
{required: true, message: '请输入内容', trigger: 'change'}
],
commentStatus: [
{required: true, message: '是否启用评论', trigger: 'change'}
],
recommendStatus: [
{required: true, message: '是否推荐', trigger: 'change'}
],
viewStatus: [
{required: true, message: '是否可见', trigger: 'change'}
],
articleCover: [
{required: true, message: '封面', trigger: 'change'}
],
sortId: [
{required: true, message: '分类', trigger: 'change'}
],
labelId: [
{required: true, message: '标签', trigger: 'blur'}
]
}
}
},
computed: {},
watch: {
'article.sortId'(newVal, oldVal) {
if (oldVal !== null) {
this.article.labelId = null;
}
if (!this.$common.isEmpty(newVal) && !this.$common.isEmpty(this.labels)) {
this.labelsTemp = this.labels.filter(l => l.sortId === newVal);
}
}
},
created() {
this.getSortAndLabel();
this.getUpToken();
},
mounted() {
},
methods: {
getUpToken() {
this.$http.get(this.$constant.baseURL + "/qiniu/getUpToken", {}, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.token = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
imgAdd(pos, file) {
if (this.$common.isEmpty(this.token)) {
this.$message({
message: "上传出错!",
type: "warning"
});
return;
}
let fd = new FormData();
fd.append("file", file);
fd.append("token", this.token);
fd.append("key", "articlePicture" + "/" + this.$store.state.currentAdmin.username.replace(/[^a-zA-Z]/g, '') + this.$store.state.currentAdmin.id + new Date().getTime());
this.$http.uploadQiniu(this.$constant.qiniuUrl, fd)
.then((res) => {
if (!this.$common.isEmpty(res.key)) {
let url = this.$constant.qiniuDownload + res.key;
this.$common.saveResource(this, "articlePicture", url, true);
this.$refs.md.$img2Url(pos, url);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
addArticleCover(res) {
this.article.articleCover = res;
},
getSortAndLabel() {
this.$http.get(this.$constant.baseURL + "/webInfo/listSortAndLabel")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.sorts = res.data.sorts;
this.labels = res.data.labels;
if (!this.$common.isEmpty(this.id)) {
this.getArticle();
}
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
getArticle() {
this.$http.get(this.$constant.baseURL + "/admin/article/getArticleById", {id: this.id}, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.article = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitForm(formName) {
if (this.article.viewStatus === false && this.$common.isEmpty(this.article.password)) {
this.$message({
message: "文章不可见时必须输入密码!",
type: "error"
});
return;
}
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.$common.isEmpty(this.id)) {
this.saveArticle(this.article, "/article/saveArticle")
} else {
this.article.id = this.id;
this.saveArticle(this.article, "/article/updateArticle")
}
} else {
this.$message({
message: "请完善必填项!",
type: "error"
});
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
if (!this.$common.isEmpty(this.id)) {
this.getArticle();
}
},
saveArticle(value, url) {
this.$confirm('确认保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.post(this.$constant.baseURL + url, value, true)
.then((res) => {
this.$message({
message: "保存成功!",
type: "success"
});
this.$router.push({path: '/postList'});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消保存!'
});
});
}
}
}
</script>
<style scoped>
.my-tag {
margin-bottom: 20px;
width: 100%;
text-align: left;
background: var(--lightYellow);
border: none;
height: 40px;
line-height: 40px;
font-size: 16px;
color: var(--black);
}
.table-td-thumb {
border-radius: 2px;
width: 40px;
height: 40px;
}
.el-switch {
margin-left: 10px;
}
.el-form-item {
margin-bottom: 40px;
}
</style>

@ -0,0 +1,304 @@
<template>
<div>
<div class="handle-box">
<el-select v-model="pagination.recommendStatus" placeholder="是否推荐" style="width: 120px" class="mrb10">
<el-option key="1" label="是" :value="true"></el-option>
<el-option key="2" label="否" :value="false"></el-option>
</el-select>
<el-select style="width: 140px" class="mrb10" v-model="pagination.sortId" placeholder="请选择分类">
<el-option
v-for="item in sorts"
:key="item.id"
:label="item.sortName"
:value="item.id">
</el-option>
</el-select>
<el-select style="width: 140px" class="mrb10" v-model="pagination.labelId" placeholder="请选择标签">
<el-option
v-for="item in labelsTemp"
:key="item.id"
:label="item.labelName"
:value="item.id">
</el-option>
</el-select>
<el-input v-model="pagination.searchKey" placeholder="文章标题" class="handle-input mrb10"></el-input>
<el-button type="primary" icon="el-icon-search" @click="searchArticles()"></el-button>
<el-button type="danger" @click="clearSearch()"></el-button>
<el-button type="primary" @click="$router.push({path: '/postEdit'})">新增文章</el-button>
</div>
<el-table :data="articles" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="username" label="作者" align="center"></el-table-column>
<el-table-column prop="articleTitle" label="文章标题" align="center"></el-table-column>
<el-table-column prop="sort.sortName" label="分类" align="center"></el-table-column>
<el-table-column prop="label.labelName" label="标签" align="center"></el-table-column>
<el-table-column prop="viewCount" label="浏览量" align="center"></el-table-column>
<el-table-column prop="likeCount" label="点赞数" align="center"></el-table-column>
<el-table-column label="是否可见" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.viewStatus === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.viewStatus === false ? '不可见' : '可见'}}
</el-tag>
<el-switch @click.native="changeStatus(scope.row, 1)" v-model="scope.row.viewStatus"></el-switch>
</template>
</el-table-column>
<el-table-column label="封面" align="center">
<template slot-scope="scope">
<el-image class="table-td-thumb" :src="scope.row.articleCover" fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column label="是否启用评论" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.commentStatus === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.commentStatus === false ? '否' : '是'}}
</el-tag>
<el-switch @click.native="changeStatus(scope.row, 2)" v-model="scope.row.commentStatus"></el-switch>
</template>
</el-table-column>
<el-table-column label="是否推荐" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.recommendStatus === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.recommendStatus === false ? '否' : '是'}}
</el-tag>
<el-switch @click.native="changeStatus(scope.row, 3)" v-model="scope.row.recommendStatus"></el-switch>
</template>
</el-table-column>
<el-table-column prop="commentCount" label="评论数" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="updateTime" label="最终修改时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)"></el-button>
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
isBoss: this.$store.state.currentAdmin.isBoss,
pagination: {
current: 1,
size: 10,
total: 0,
searchKey: "",
recommendStatus: null,
sortId: null,
labelId: null
},
articles: [],
sorts: [],
labels: [],
labelsTemp: []
}
},
computed: {},
watch: {
'pagination.sortId'(newVal) {
this.pagination.labelId = null;
if(!this.$common.isEmpty(newVal) && !this.$common.isEmpty(this.labels)){
this.labelsTemp = this.labels.filter(l => l.sortId === newVal);
}
}
},
created() {
this.getArticles();
this.getSortAndLabel();
},
mounted() {
},
methods: {
getSortAndLabel() {
this.$http.get(this.$constant.baseURL + "/webInfo/listSortAndLabel")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.sorts = res.data.sorts;
this.labels = res.data.labels;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
clearSearch() {
this.pagination = {
current: 1,
size: 10,
total: 0,
searchKey: "",
recommendStatus: null,
sortId: null,
labelId: null
}
this.getArticles();
},
getArticles() {
let url = "";
if (this.isBoss) {
url = "/admin/article/boss/list";
} else {
url = "/admin/article/user/list";
}
this.$http.post(this.$constant.baseURL + url, this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.articles = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handlePageChange(val) {
this.pagination.current = val;
this.getArticles();
},
searchArticles() {
this.pagination.total = 0;
this.pagination.current = 1;
this.getArticles();
},
changeStatus(article, flag) {
let param;
if (flag === 1) {
param = {
articleId: article.id,
viewStatus: article.viewStatus
}
} else if (flag === 2) {
param = {
articleId: article.id,
commentStatus: article.commentStatus
}
} else if (flag === 3) {
param = {
articleId: article.id,
recommendStatus: article.recommendStatus
}
}
this.$http.get(this.$constant.baseURL + "/admin/article/changeArticleStatus", param, true)
.then((res) => {
if (flag === 1) {
this.$message({
duration: 0,
showClose: true,
message: "修改成功!注意,文章不可见时必须设置密码才能访问!",
type: "warning"
});
} else {
this.$message({
message: "修改成功!",
type: "success"
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handleDelete(item) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + "/article/deleteArticle", {id: item.id}, true)
.then((res) => {
this.pagination.current = 1;
this.getArticles();
this.$message({
message: "删除成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
handleEdit(item) {
this.$router.push({path: '/postEdit', query: {id: item.id}});
}
}
}
</script>
<style scoped>
.handle-box {
margin-bottom: 20px;
}
.handle-input {
width: 160px;
display: inline-block;
}
.table {
width: 100%;
font-size: 14px;
}
.mrb10 {
margin-right: 10px;
margin-bottom: 10px;
}
.table-td-thumb {
display: block;
margin: auto;
width: 40px;
height: 40px;
}
.pagination {
margin: 20px 0;
text-align: right;
}
.el-switch {
margin: 5px;
}
</style>

@ -0,0 +1,234 @@
<template>
<div>
<div>
<div class="handle-box">
<el-select v-model="pagination.resourceType" placeholder="资源类型" class="handle-select mrb10">
<el-option key="10" label="表情包" value="internetMeme"></el-option>
<el-option key="1" label="用户头像" value="userAvatar"></el-option>
<el-option key="2" label="文章封面" value="articleCover"></el-option>
<el-option key="3" label="文章图片" value="articlePicture"></el-option>
<el-option key="5" label="网站头像" value="webAvatar"></el-option>
<el-option key="4" label="背景图片" value="webBackgroundImage"></el-option>
<el-option key="6" label="随机头像" value="randomAvatar"></el-option>
<el-option key="7" label="随机封面" value="randomCover"></el-option>
<el-option key="8" label="画笔图片" value="graffiti"></el-option>
<el-option key="9" label="评论图片" value="commentPicture"></el-option>
<el-option key="11" label="聊天群头像" value="im/groupAvatar"></el-option>
<el-option key="12" label="群聊天图片" value="im/groupMessage"></el-option>
<el-option key="13" label="朋友聊天图片" value="im/friendMessage"></el-option>
</el-select>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button type="primary" @click="addResources()"></el-button>
</div>
<el-table :data="resources" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="userId" label="用户ID" align="center"></el-table-column>
<el-table-column prop="type" label="资源类型" align="center"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.status === false ? '禁用' : '启用'}}
</el-tag>
<el-switch @click.native="changeStatus(scope.row)" v-model="scope.row.status"></el-switch>
</template>
</el-table-column>
<el-table-column label="路径" align="center">
<template slot-scope="scope">
<el-image :preview-src-list="[scope.row.path]" class="table-td-thumb" :src="scope.row.path"
fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)"
@click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
<el-dialog title="图片"
:visible.sync="resourceDialog"
width="25%"
:append-to-body="true"
destroy-on-close
center>
<div>
<uploadPicture :isAdmin="true" :prefix="pagination.resourceType" @addPicture="addPicture" :maxSize="5"
:maxNumber="10"></uploadPicture>
</div>
</el-dialog>
</div>
</template>
<script>
const uploadPicture = () => import( "../common/uploadPicture");
export default {
components: {
uploadPicture
},
data() {
return {
pagination: {
current: 1,
size: 10,
total: 0,
resourceType: ""
},
resources: [],
resourceDialog: false
}
},
computed: {},
watch: {},
created() {
this.getResources();
},
mounted() {
},
methods: {
handleDelete(item) {
this.$confirm('确认删除资源?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.post(this.$constant.baseURL + "/resource/deleteResource", {path: item.path}, true, false)
.then((res) => {
this.pagination.current = 1;
this.getResources();
this.$message({
message: "删除成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
addPicture(res) {
},
addResources() {
if (this.$common.isEmpty(this.pagination.resourceType)) {
this.$message({
message: "请选择资源类型!",
type: "error"
});
return;
}
this.resourceDialog = true;
},
search() {
this.pagination.total = 0;
this.pagination.current = 1;
this.getResources();
},
getResources() {
this.$http.post(this.$constant.baseURL + "/resource/listResource", this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.resources = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
changeStatus(item) {
this.$http.get(this.$constant.baseURL + "/resource/changeResourceStatus", {
id: item.id,
flag: item.status
}, true)
.then((res) => {
this.$message({
message: "修改成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handlePageChange(val) {
this.pagination.current = val;
this.getResources();
}
}
}
</script>
<style scoped>
.handle-box {
margin-bottom: 20px;
}
.handle-select {
width: 200px;
}
.table {
width: 100%;
font-size: 14px;
}
.mrb10 {
margin-right: 10px;
margin-bottom: 10px;
}
.table-td-thumb {
display: block;
margin: auto;
width: 40px;
height: 40px;
}
.pagination {
margin: 20px 0;
text-align: right;
}
.el-switch {
margin: 5px;
}
</style>

@ -0,0 +1,337 @@
<template>
<div>
<div>
<div class="handle-box">
<el-select v-model="pagination.resourceType" placeholder="资源路径类型" class="handle-select mrb10">
<el-option
v-for="(item, i) in resourceTypes"
:key="i"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="pagination.resourceStatus" placeholder="状态" class="handle-select mrb10">
<el-option key="1" label="启用" :value="true"></el-option>
<el-option key="2" label="禁用" :value="false"></el-option>
</el-select>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button type="primary" @click="addResourcePathDialog = true">新增资源路径</el-button>
</div>
<el-table :data="resourcePaths" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="title" label="标题" align="center"></el-table-column>
<el-table-column prop="url" label="链接" align="center"></el-table-column>
<el-table-column prop="type" label="资源类型" align="center"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.status === false ? '禁用' : '启用'}}
</el-tag>
<el-switch @click.native="changeStatus(scope.row)" v-model="scope.row.status"></el-switch>
</template>
</el-table-column>
<el-table-column label="封面" align="center">
<template slot-scope="scope">
<el-image :preview-src-list="[scope.row.cover]" class="table-td-thumb" :src="scope.row.cover"
fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column prop="introduction" label="简介" align="center"></el-table-column>
<el-table-column prop="remark" label="备注" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)"></el-button>
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)"
@click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
<el-dialog title="图片"
:visible.sync="coverDialog"
width="25%"
:append-to-body="true"
destroy-on-close
center>
<div>
<uploadPicture :isAdmin="true" :prefix="resourcePath.type" @addPicture="addPicture" :maxSize="5"
:maxNumber="1"></uploadPicture>
</div>
</el-dialog>
<el-dialog title="资源路径"
:visible.sync="addResourcePathDialog"
width="50%"
:before-close="clearDialog"
:append-to-body="true"
:close-on-click-modal="false"
center>
<div>
<div>
<div style="margin-bottom: 5px">标题</div>
<el-input v-model="resourcePath.title"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">简介</div>
<el-input v-model="resourcePath.introduction"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">封面</div>
<el-input v-model="resourcePath.cover"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">链接</div>
<el-input v-model="resourcePath.url"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">资源类型</div>
<el-select v-model="resourcePath.type" placeholder="资源路径类型" class="handle-select mrb10">
<el-option
v-for="(item, i) in resourceTypes"
:key="i"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div style="margin-top: 10px;margin-bottom: 5px">备注</div>
<el-input v-model="resourcePath.remark" type="textarea"></el-input>
</div>
<div style="display: flex;margin-top: 30px" class="myCenter">
<proButton :info="'上传封面'"
@click.native="addResourcePathCover()"
:before="$constant.before_color_1"
:after="$constant.after_color_1"
style="margin-right: 20px">
</proButton>
<proButton :info="'提交'"
@click.native="addResourcePath()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
const uploadPicture = () => import( "../common/uploadPicture");
const proButton = () => import( "../common/proButton");
export default {
components: {
uploadPicture,
proButton
},
data() {
return {
resourceTypes: [{label: "友链", value: "friendUrl"}],
pagination: {
current: 1,
size: 10,
total: 0,
resourceType: "",
resourceStatus: null
},
resourcePaths: [],
coverDialog: false,
addResourcePathDialog: false,
isUpdate: false,
resourcePath: {
title: "",
introduction: "",
cover: "",
url: "",
type: "",
remark: ""
}
}
},
computed: {},
watch: {},
created() {
this.getResourcePaths();
},
mounted() {
},
methods: {
addPicture(res) {
this.resourcePath.cover = res;
this.coverDialog = false;
},
addResourcePathCover() {
if (this.addResourcePathDialog === false) {
return;
}
if (this.$common.isEmpty(this.resourcePath.type)) {
this.$message({
message: "请选择资源类型!",
type: "error"
});
return;
}
this.coverDialog = true;
},
addResourcePath() {
if (this.$common.isEmpty(this.resourcePath.title) || this.$common.isEmpty(this.resourcePath.type)) {
this.$message({
message: "标题和资源类型不能为空!",
type: "error"
});
return;
}
this.$http.post(this.$constant.baseURL + "/webInfo/" + (this.isUpdate ? "updateResourcePath" : "saveResourcePath"), this.resourcePath, true)
.then((res) => {
this.$message({
message: "保存成功!",
type: "success"
});
this.addResourcePathDialog = false;
this.clearDialog();
this.search();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
search() {
this.pagination.total = 0;
this.pagination.current = 1;
this.getResourcePaths();
},
getResourcePaths() {
this.$http.post(this.$constant.baseURL + "/webInfo/listResourcePath", this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.resourcePaths = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
changeStatus(item) {
this.$http.post(this.$constant.baseURL + "/webInfo/updateResourcePath", item, true)
.then((res) => {
this.$message({
message: "修改成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handlePageChange(val) {
this.pagination.current = val;
this.getResourcePaths();
},
handleDelete(item) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + "/webInfo/deleteResourcePath", {id: item.id}, true)
.then((res) => {
this.search();
this.$message({
message: "删除成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
handleEdit(item) {
this.resourcePath = JSON.parse(JSON.stringify(item));
this.addResourcePathDialog = true;
this.isUpdate = true;
},
clearDialog() {
this.isUpdate = false;
this.addResourcePathDialog = false;
this.resourcePath = {
title: "",
introduction: "",
cover: "",
url: "",
type: "",
remark: ""
}
}
}
}
</script>
<style scoped>
.handle-box {
margin-bottom: 20px;
}
.handle-select {
width: 200px;
}
.table {
width: 100%;
font-size: 14px;
}
.mrb10 {
margin-right: 10px;
margin-bottom: 10px;
}
.table-td-thumb {
display: block;
margin: auto;
width: 40px;
height: 40px;
}
.pagination {
margin: 20px 0;
text-align: right;
}
.el-switch {
margin: 5px;
}
</style>

@ -0,0 +1,330 @@
<template>
<div>
<div style="margin-bottom: 20px">
<el-button type="primary" @click="sortDialog = true">新增分类</el-button>
</div>
<el-table :data="sortInfo" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="sortName" label="分类名称" align="center"></el-table-column>
<el-table-column prop="sortDescription" label="分类描述" align="center"></el-table-column>
<el-table-column label="分类类型" align="center">
<template slot-scope="scope">
<span v-if="scope.row.sortType === 0"></span>
<span v-else-if="scope.row.sortType === 1">普通分类</span>
</template>
</el-table-column>
<el-table-column prop="priority" label="导航栏分类优先级" align="center"></el-table-column>
<el-table-column prop="countOfSort" label="文章总数" align="center"></el-table-column>
<el-table-column label="操作" width="380" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" @click="editSort(scope.row)">
编辑分类
</el-button>
<el-button type="text" icon="el-icon-edit" @click="sayLabel(scope.row)">
查看标签
</el-button>
<el-button type="text" icon="el-icon-edit" @click="insertLabel(scope.row)">
新增标签
</el-button>
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)"
@click="deleteHandle(scope.row.id, 1)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table v-if="!$common.isEmpty(sort)" :data="sort.labels" border class="table"
style="margin-top: 40px"
header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column label="分类名称" align="center">
<span>{{sort.sortName}}</span>
</el-table-column>
<el-table-column prop="labelName" label="标签名称" align="center"></el-table-column>
<el-table-column prop="labelDescription" label="标签描述" align="center"></el-table-column>
<el-table-column prop="countOfLabel" label="文章总数" align="center"></el-table-column>
<el-table-column label="操作" width="320" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" @click="editLabel(scope.row)">
编辑标签
</el-button>
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)"
@click="deleteHandle(scope.row.id, 2)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="分类"
:visible.sync="sortDialog"
width="30%"
:before-close="handleClose"
:append-to-body="true"
destroy-on-close
center>
<div class="my-dialog">
<div class="myCenter">
<el-radio-group v-model="sortForHttp.sortType">
<el-radio-button :label="0">导航栏分类</el-radio-button>
<el-radio-button :label="1">普通分类</el-radio-button>
</el-radio-group>
</div>
<el-input placeholder="请输入分类名称" v-model="sortForHttp.sortName">
<template slot="prepend">分类名称</template>
</el-input>
<el-input placeholder="请输入分类描述" v-model="sortForHttp.sortDescription">
<template slot="prepend">分类描述</template>
</el-input>
<el-input type="number" v-if="sortForHttp.sortType === 0" placeholder="请输入整数,数字小的在前面"
v-model="sortForHttp.priority">
<template slot="prepend">导航栏分类优先级</template>
</el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="saveSortEdit()"> </el-button>
</span>
</el-dialog>
<el-dialog title="标签"
:visible.sync="labelDialog"
width="30%"
:before-close="handleClose"
:append-to-body="true"
destroy-on-close
center>
<div class="my-dialog">
<el-input placeholder="请输入标签名称" v-model="labelForHttp.labelName">
<template slot="prepend">标签名称</template>
</el-input>
<el-input placeholder="请输入标签描述" v-model="labelForHttp.labelDescription">
<template slot="prepend">标签描述</template>
</el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="saveLabelEdit()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
sortDialog: false,
labelDialog: false,
sortInfo: [],
sort: {},
sortForHttp: {
id: null,
sortName: "",
sortDescription: "",
sortType: null,
priority: null
},
labelForHttp: {
id: null,
sortId: null,
labelName: "",
labelDescription: ""
}
}
},
computed: {},
watch: {},
created() {
this.getSortInfo();
},
mounted() {
},
methods: {
deleteHandle(id, flag) {
let url;
if (flag === 1) {
url = "/webInfo/deleteSort";
} else if (flag === 2) {
url = "/webInfo/deleteLabel";
} else {
return;
}
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + url, {id: id}, true)
.then((res) => {
this.$message({
message: "删除成功!",
type: "success"
});
this.getSortInfo();
this.sort = {};
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
saveSortEdit() {
if (this.$common.isEmpty(this.sortForHttp.sortType) ||
this.$common.isEmpty(this.sortForHttp.sortName) ||
this.$common.isEmpty(this.sortForHttp.sortDescription)) {
this.$message({
message: "请完善所有分类信息!",
type: "error"
});
return;
}
if (this.sortForHttp.sortType === 0 && this.$common.isEmpty(this.sortForHttp.priority)) {
this.$message({
message: "导航栏分类必须输入优先级!",
type: "error"
});
return;
}
let url;
if (this.$common.isEmpty(this.sortForHttp.id)) {
url = "/webInfo/saveSort";
} else {
url = "/webInfo/updateSort";
}
this.$http.post(this.$constant.baseURL + url, this.sortForHttp, true)
.then((res) => {
this.$message({
message: "保存成功!",
type: "success"
});
this.getSortInfo();
this.handleClose();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
saveLabelEdit() {
if (this.$common.isEmpty(this.labelForHttp.labelName) ||
this.$common.isEmpty(this.labelForHttp.labelDescription)) {
this.$message({
message: "请完善所有标签信息!",
type: "error"
});
return;
}
let url;
if (this.$common.isEmpty(this.labelForHttp.id)) {
url = "/webInfo/saveLabel";
} else {
url = "/webInfo/updateLabel";
}
this.$http.post(this.$constant.baseURL + url, this.labelForHttp, true)
.then((res) => {
this.$message({
message: "保存成功!",
type: "success"
});
this.getSortInfo();
this.handleClose();
this.sort = {};
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
editSort(sort) {
this.sortDialog = true;
this.sortForHttp.id = sort.id;
this.sortForHttp.sortName = sort.sortName;
this.sortForHttp.sortDescription = sort.sortDescription;
this.sortForHttp.sortType = sort.sortType;
this.sortForHttp.priority = sort.priority;
},
editLabel(label) {
this.labelDialog = true;
this.labelForHttp.id = label.id;
this.labelForHttp.sortId = label.sortId;
this.labelForHttp.labelName = label.labelName;
this.labelForHttp.labelDescription = label.labelDescription;
},
insertLabel(sort) {
this.labelForHttp.sortId = sort.id;
this.labelDialog = true;
},
handleClose() {
this.labelForHttp = {
id: null,
sortId: null,
labelName: "",
labelDescription: ""
};
this.sortForHttp = {
id: null,
sortName: "",
sortDescription: "",
sortType: null,
priority: null
};
this.sortDialog = false;
this.labelDialog = false;
},
sayLabel(sort) {
this.sort = sort;
},
getSortInfo() {
this.$http.get(this.$constant.baseURL + "/webInfo/getSortInfo")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.sortInfo = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.my-dialog > div {
margin: 12px;
}
.my-dialog >>> input::-webkit-inner-spin-button {
appearance: none;
}
</style>

@ -0,0 +1,137 @@
<template>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path d="M0 0h1024v1024H0V0z" fill="#202425" opacity=".01"></path>
<path
d="M682.666667 204.8h238.933333a34.133333 34.133333 0 0 1 34.133333 34.133333v648.533334a68.266667 68.266667 0 0 1-68.266666 68.266666h-204.8V204.8z"
fill="#FFAA44"></path>
<path
d="M68.266667 921.6a34.133333 34.133333 0 0 0 34.133333 34.133333h785.066667a68.266667 68.266667 0 0 1-68.266667-68.266666V102.4a34.133333 34.133333 0 0 0-34.133333-34.133333H102.4a34.133333 34.133333 0 0 0-34.133333 34.133333v819.2z"
fill="#11AA66"></path>
<path
d="M238.933333 307.2a34.133333 34.133333 0 0 0 0 68.266667h136.533334a34.133333 34.133333 0 1 0 0-68.266667H238.933333z m0 204.8a34.133333 34.133333 0 1 0 0 68.266667h409.6a34.133333 34.133333 0 1 0 0-68.266667H238.933333z m0 204.8a34.133333 34.133333 0 1 0 0 68.266667h204.8a34.133333 34.133333 0 1 0 0-68.266667H238.933333z"
fill="#FFFFFF"></path>
</svg>
留言列表
</el-tag>
<el-table :data="treeHoles" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="message" label="留言内容" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-delete" style="color: var(--orangeRed)" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
pagination: {
current: 1,
size: 10,
total: 0
},
treeHoles: []
}
},
computed: {},
watch: {},
created() {
this.getTreeHoles()
},
mounted() {
},
methods: {
getTreeHoles() {
this.$http.post(this.$constant.baseURL + "/admin/treeHole/boss/list", this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.treeHoles = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
handlePageChange(val) {
this.pagination.current = val;
this.getTreeHoles();
},
handleDelete(item) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + "/webInfo/deleteTreeHole", {id: item.id}, true)
.then((res) => {
this.pagination.current = 1;
this.getTreeHoles();
this.$message({
message: "删除成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
}
}
}
</script>
<style scoped>
.my-tag {
margin-bottom: 40px;
width: 100%;
text-align: left;
background: var(--lightYellow);
border: none;
height: 40px;
line-height: 40px;
font-size: 16px;
color: var(--black);
}
.pagination {
margin: 20px 0;
text-align: right;
}
</style>

@ -0,0 +1,281 @@
<template>
<div>
<div>
<div class="handle-box">
<el-select v-model="pagination.userType" placeholder="用户类型" class="handle-select mrb10">
<el-option key="1" label="Boss" :value="0"></el-option>
<el-option key="2" label="管理员" :value="1"></el-option>
<el-option key="3" label="普通用户" :value="2"></el-option>
</el-select>
<el-select v-model="pagination.userStatus" placeholder="用户状态" class="handle-select mrb10">
<el-option key="1" label="启用" :value="true"></el-option>
<el-option key="2" label="禁用" :value="false"></el-option>
</el-select>
<el-input v-model="pagination.searchKey" placeholder="用户名/手机号" class="handle-input mrb10"></el-input>
<el-button type="primary" icon="el-icon-search" @click="searchUser()"></el-button>
<el-button type="danger" @click="clearSearch()"></el-button>
</div>
<el-table :data="users" border class="table" header-cell-class-name="table-header">
<el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
<el-table-column prop="username" label="用户名" align="center"></el-table-column>
<el-table-column prop="phoneNumber" label="手机号" align="center"></el-table-column>
<el-table-column prop="email" label="邮箱" align="center"></el-table-column>
<el-table-column label="用户状态" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.userStatus === false ? 'danger' : 'success'"
disable-transitions>
{{scope.row.userStatus === false ? '禁用' : '启用'}}
</el-tag>
<el-switch @click.native="changeUserStatus(scope.row)" v-model="scope.row.userStatus"></el-switch>
</template>
</el-table-column>
<el-table-column label="头像" align="center">
<template slot-scope="scope">
<el-image class="table-td-thumb" :src="scope.row.avatar" fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column label="性别" align="center">
<template slot-scope="scope">
<el-tag type="success"
v-if="scope.row.gender === 1"
disable-transitions>
</el-tag>
<el-tag type="success"
v-else-if="scope.row.gender === 2"
disable-transitions>
</el-tag>
<el-tag type="success"
v-else
disable-transitions>
保密
</el-tag>
</template>
</el-table-column>
<el-table-column prop="introduction" label="简介" align="center"></el-table-column>
<el-table-column label="用户类型" width="100" align="center">
<template slot-scope="scope">
<el-tag type="success"
v-if="scope.row.userType === 0"
style="cursor: pointer"
@click.native="editUser(scope.row)"
disable-transitions>
Boss
</el-tag>
<el-tag type="success"
v-else-if="scope.row.userType === 1"
style="cursor: pointer"
@click.native="editUser(scope.row)"
disable-transitions>
管理员
</el-tag>
<el-tag type="success"
v-else
style="cursor: pointer"
@click.native="editUser(scope.row)"
disable-transitions>
普通用户
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="注册时间" align="center"></el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@current-change="handlePageChange">
</el-pagination>
</div>
</div>
<!-- 编辑弹出框 -->
<el-dialog title="修改用户类型"
:visible.sync="editVisible"
width="30%"
:before-close="handleClose"
:append-to-body="true"
destroy-on-close
center>
<div class="myCenter">
<el-radio-group v-model="changeUser.userType">
<el-radio-button :label="0">Boss</el-radio-button>
<el-radio-button :label="1">管理员</el-radio-button>
<el-radio-button :label="2">普通用户</el-radio-button>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="saveEdit()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
pagination: {
current: 1,
size: 10,
total: 0,
searchKey: "",
userStatus: null,
userType: null
},
users: [],
changeUser: {
id: null,
userType: null
},
editVisible: false
}
},
computed: {},
watch: {},
created() {
this.getUsers();
},
mounted() {
},
methods: {
clearSearch() {
this.pagination = {
current: 1,
size: 10,
total: 0,
searchKey: "",
userStatus: null,
userType: null
}
this.getUsers();
},
getUsers() {
this.$http.post(this.$constant.baseURL + "/admin/user/list", this.pagination, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.users = res.data.records;
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
changeUserStatus(user) {
this.$http.get(this.$constant.baseURL + "/admin/user/changeUserStatus", {
userId: user.id,
flag: user.userStatus
}, true)
.then((res) => {
this.$message({
message: "修改成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
editUser(user) {
this.changeUser.id = user.id;
this.changeUser.userType = user.userType;
this.editVisible = true;
},
handlePageChange(val) {
this.pagination.current = val;
this.getUsers();
},
searchUser() {
this.pagination.total = 0;
this.pagination.current = 1;
this.getUsers();
},
handleClose() {
this.changeUser = {
id: null,
userType: null
};
this.editVisible = false;
},
saveEdit() {
this.$http.get(this.$constant.baseURL + "/admin/user/changeUserType", {
userId: this.changeUser.id,
userType: this.changeUser.userType
}, true)
.then((res) => {
this.handleClose();
this.getUsers();
this.$message({
message: "修改成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.handle-box {
margin-bottom: 20px;
}
.handle-select {
width: 120px;
}
.handle-input {
width: 160px;
display: inline-block;
}
.table {
width: 100%;
font-size: 14px;
}
.mrb10 {
margin-right: 10px;
margin-bottom: 10px;
}
.table-td-thumb {
display: block;
margin: auto;
width: 40px;
height: 40px;
}
.pagination {
margin: 20px 0;
text-align: right;
}
.el-switch {
margin: 5px;
}
</style>

@ -0,0 +1,111 @@
<template>
<div class="myCenter verify-container">
<div class="verify-content">
<div>
<el-avatar :size="50" :src="$store.state.webInfo.avatar"></el-avatar>
</div>
<div>
<el-input v-model="account">
<template slot="prepend">账号</template>
</el-input>
</div>
<div>
<el-input v-model="password" type="password">
<template slot="prepend">密码</template>
</el-input>
</div>
<div>
<proButton :info="'提交'"
@click.native="login()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
</div>
</template>
<script>
const proButton = () => import( "../common/proButton");
export default {
components: {
proButton
},
data() {
return {
redirect: this.$route.query.redirect,
account: "",
password: ""
}
},
computed: {},
created() {
},
methods: {
login() {
if (this.$common.isEmpty(this.account) || this.$common.isEmpty(this.password)) {
this.$message({
message: "请输入账号或密码!",
type: "error"
});
return;
}
let user = {
account: this.account.trim(),
password: this.$common.encrypt(this.password.trim()),
isAdmin: true
};
this.$http.post(this.$constant.baseURL + "/user/login", user, true, false)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
localStorage.setItem("adminToken", res.data.accessToken);
this.$store.commit("loadCurrentAdmin", res.data);
this.account = "";
this.password = "";
this.$router.push({path: this.redirect});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.verify-container {
height: 100vh;
background: var(--verifyImage) center center / cover repeat;
}
.verify-content {
background: var(--maxWhiteMask);
padding: 30px 40px 5px;
position: relative;
}
.verify-content > div:first-child {
position: absolute;
left: 50%;
transform: translate(-50%);
top: -25px;
}
.verify-content > div:not(:first-child) {
margin: 25px 0;
}
.verify-content > div:last-child > div {
margin: 0 auto;
}
</style>

@ -0,0 +1,552 @@
<template>
<div>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M767.1296 808.6528c16.8448 0 32.9728 2.816 48.0256 8.0384 20.6848 7.1168 43.52 1.0752 57.1904-15.9744a459.91936 459.91936 0 0 0 70.5024-122.88c7.8336-20.48 1.0752-43.264-15.9744-57.088-49.6128-40.192-65.0752-125.3888-31.3856-185.856a146.8928 146.8928 0 0 1 30.3104-37.9904c16.2304-14.5408 22.1696-37.376 13.9264-57.6a461.27104 461.27104 0 0 0-67.5328-114.9952c-13.6192-16.9984-36.4544-22.9376-57.0368-15.8208a146.3296 146.3296 0 0 1-48.0256 8.0384c-70.144 0-132.352-50.8928-145.2032-118.7328-4.096-21.6064-20.736-38.5536-42.4448-41.8304-22.0672-3.2768-44.6464-5.0176-67.6864-5.0176-21.4528 0-42.5472 1.536-63.232 4.4032-22.3232 3.1232-40.2432 20.48-43.52 42.752-6.912 46.6944-36.0448 118.016-145.7152 118.4256-17.3056 0.0512-33.8944-2.9696-49.3056-8.448-21.0432-7.4752-44.3904-1.4848-58.368 15.9232A462.14656 462.14656 0 0 0 80.4864 348.16c-7.6288 20.0192-2.7648 43.008 13.4656 56.9344 55.5008 47.8208 71.7824 122.88 37.0688 185.1392a146.72896 146.72896 0 0 1-31.6416 39.168c-16.8448 14.7456-23.0912 38.1952-14.5408 58.9312 16.896 41.0112 39.5776 79.0016 66.9696 113.0496 13.9264 17.3056 37.2736 23.1936 58.2144 15.7184 15.4112-5.4784 32-8.4992 49.3056-8.4992 71.2704 0 124.7744 49.408 142.1312 121.2928 4.9664 20.48 21.4016 36.0448 42.24 39.168 22.2208 3.328 44.9536 5.0688 68.096 5.0688 23.3984 0 46.4384-1.792 68.864-5.1712 21.3504-3.2256 38.144-19.456 42.7008-40.5504 14.8992-68.8128 73.1648-119.7568 143.7696-119.7568z"
fill="#8C7BFD"></path>
<path
d="M511.8464 696.3712c-101.3248 0-183.7568-82.432-183.7568-183.7568s82.432-183.7568 183.7568-183.7568 183.7568 82.432 183.7568 183.7568-82.432 183.7568-183.7568 183.7568z m0-265.1648c-44.8512 0-81.3568 36.5056-81.3568 81.3568S466.9952 593.92 511.8464 593.92s81.3568-36.5056 81.3568-81.3568-36.5056-81.3568-81.3568-81.3568z"
fill="#FFE37B"></path>
</svg>
基础信息
</el-tag>
<el-form :model="webInfo" :rules="rules" ref="ruleForm" label-width="100px"
class="demo-ruleForm">
<el-form-item label="网站名称" prop="webName">
<el-input v-model="webInfo.webName"></el-input>
</el-form-item>
<el-form-item label="网站标题" prop="webTitle">
<el-input v-model="webInfo.webTitle"></el-input>
</el-form-item>
<el-form-item label="页脚" prop="footer">
<el-input v-model="webInfo.footer"></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch @click.native="changeWebStatus(webInfo)" v-model="webInfo.status"></el-switch>
</el-form-item>
<el-form-item label="背景" prop="backgroundImage">
<div style="display: flex">
<el-input v-model="webInfo.backgroundImage"></el-input>
<el-image class="table-td-thumb"
style="margin-left: 10px"
:preview-src-list="[webInfo.backgroundImage]"
:src="webInfo.backgroundImage"
fit="cover"></el-image>
</div>
<uploadPicture :isAdmin="true" :prefix="'webBackgroundImage'" style="margin-top: 15px"
@addPicture="addBackgroundImage"
:maxSize="5"
:maxNumber="1"></uploadPicture>
</el-form-item>
<el-form-item label="头像" prop="avatar">
<div style="display: flex">
<el-input v-model="webInfo.avatar"></el-input>
<el-image class="table-td-thumb"
style="margin-left: 10px"
:preview-src-list="[webInfo.avatar]"
:src="webInfo.avatar"
fit="cover"></el-image>
</div>
<uploadPicture :isAdmin="true" :prefix="'webAvatar'" style="margin-top: 15px" @addPicture="addAvatar"
:maxSize="5"
:maxNumber="1"></uploadPicture>
</el-form-item>
<el-form-item label="提示" prop="waifuJson">
<div style="display: flex">
<el-input :disabled="disabled" :rows="6" type="textarea" v-model="webInfo.waifuJson"></el-input>
<i class="el-icon-edit my-icon" @click="disabled = !disabled"></i>
</div>
</el-form-item>
</el-form>
<div class="myCenter" style="margin-bottom: 22px">
<el-button type="primary" @click="submitForm('ruleForm')"></el-button>
</div>
</div>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M767.1296 808.6528c16.8448 0 32.9728 2.816 48.0256 8.0384 20.6848 7.1168 43.52 1.0752 57.1904-15.9744a459.91936 459.91936 0 0 0 70.5024-122.88c7.8336-20.48 1.0752-43.264-15.9744-57.088-49.6128-40.192-65.0752-125.3888-31.3856-185.856a146.8928 146.8928 0 0 1 30.3104-37.9904c16.2304-14.5408 22.1696-37.376 13.9264-57.6a461.27104 461.27104 0 0 0-67.5328-114.9952c-13.6192-16.9984-36.4544-22.9376-57.0368-15.8208a146.3296 146.3296 0 0 1-48.0256 8.0384c-70.144 0-132.352-50.8928-145.2032-118.7328-4.096-21.6064-20.736-38.5536-42.4448-41.8304-22.0672-3.2768-44.6464-5.0176-67.6864-5.0176-21.4528 0-42.5472 1.536-63.232 4.4032-22.3232 3.1232-40.2432 20.48-43.52 42.752-6.912 46.6944-36.0448 118.016-145.7152 118.4256-17.3056 0.0512-33.8944-2.9696-49.3056-8.448-21.0432-7.4752-44.3904-1.4848-58.368 15.9232A462.14656 462.14656 0 0 0 80.4864 348.16c-7.6288 20.0192-2.7648 43.008 13.4656 56.9344 55.5008 47.8208 71.7824 122.88 37.0688 185.1392a146.72896 146.72896 0 0 1-31.6416 39.168c-16.8448 14.7456-23.0912 38.1952-14.5408 58.9312 16.896 41.0112 39.5776 79.0016 66.9696 113.0496 13.9264 17.3056 37.2736 23.1936 58.2144 15.7184 15.4112-5.4784 32-8.4992 49.3056-8.4992 71.2704 0 124.7744 49.408 142.1312 121.2928 4.9664 20.48 21.4016 36.0448 42.24 39.168 22.2208 3.328 44.9536 5.0688 68.096 5.0688 23.3984 0 46.4384-1.792 68.864-5.1712 21.3504-3.2256 38.144-19.456 42.7008-40.5504 14.8992-68.8128 73.1648-119.7568 143.7696-119.7568z"
fill="#8C7BFD"></path>
<path
d="M511.8464 696.3712c-101.3248 0-183.7568-82.432-183.7568-183.7568s82.432-183.7568 183.7568-183.7568 183.7568 82.432 183.7568 183.7568-82.432 183.7568-183.7568 183.7568z m0-265.1648c-44.8512 0-81.3568 36.5056-81.3568 81.3568S466.9952 593.92 511.8464 593.92s81.3568-36.5056 81.3568-81.3568-36.5056-81.3568-81.3568-81.3568z"
fill="#FFE37B"></path>
</svg>
公告
</el-tag>
<el-tag
:key="i"
v-for="(notice, i) in notices"
closable
:disable-transitions="false"
@close="handleClose(notices, notice)">
{{notice}}
</el-tag>
<el-input
class="input-new-tag"
v-if="inputNoticeVisible"
v-model="inputNoticeValue"
ref="saveNoticeInput"
size="small"
@keyup.enter.native="handleInputNoticeConfirm"
@blur="handleInputNoticeConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showNoticeInput()">+ </el-button>
<div class="myCenter" style="margin-bottom: 22px">
<el-button type="primary" @click="saveNotice()"></el-button>
</div>
</div>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M767.1296 808.6528c16.8448 0 32.9728 2.816 48.0256 8.0384 20.6848 7.1168 43.52 1.0752 57.1904-15.9744a459.91936 459.91936 0 0 0 70.5024-122.88c7.8336-20.48 1.0752-43.264-15.9744-57.088-49.6128-40.192-65.0752-125.3888-31.3856-185.856a146.8928 146.8928 0 0 1 30.3104-37.9904c16.2304-14.5408 22.1696-37.376 13.9264-57.6a461.27104 461.27104 0 0 0-67.5328-114.9952c-13.6192-16.9984-36.4544-22.9376-57.0368-15.8208a146.3296 146.3296 0 0 1-48.0256 8.0384c-70.144 0-132.352-50.8928-145.2032-118.7328-4.096-21.6064-20.736-38.5536-42.4448-41.8304-22.0672-3.2768-44.6464-5.0176-67.6864-5.0176-21.4528 0-42.5472 1.536-63.232 4.4032-22.3232 3.1232-40.2432 20.48-43.52 42.752-6.912 46.6944-36.0448 118.016-145.7152 118.4256-17.3056 0.0512-33.8944-2.9696-49.3056-8.448-21.0432-7.4752-44.3904-1.4848-58.368 15.9232A462.14656 462.14656 0 0 0 80.4864 348.16c-7.6288 20.0192-2.7648 43.008 13.4656 56.9344 55.5008 47.8208 71.7824 122.88 37.0688 185.1392a146.72896 146.72896 0 0 1-31.6416 39.168c-16.8448 14.7456-23.0912 38.1952-14.5408 58.9312 16.896 41.0112 39.5776 79.0016 66.9696 113.0496 13.9264 17.3056 37.2736 23.1936 58.2144 15.7184 15.4112-5.4784 32-8.4992 49.3056-8.4992 71.2704 0 124.7744 49.408 142.1312 121.2928 4.9664 20.48 21.4016 36.0448 42.24 39.168 22.2208 3.328 44.9536 5.0688 68.096 5.0688 23.3984 0 46.4384-1.792 68.864-5.1712 21.3504-3.2256 38.144-19.456 42.7008-40.5504 14.8992-68.8128 73.1648-119.7568 143.7696-119.7568z"
fill="#8C7BFD"></path>
<path
d="M511.8464 696.3712c-101.3248 0-183.7568-82.432-183.7568-183.7568s82.432-183.7568 183.7568-183.7568 183.7568 82.432 183.7568 183.7568-82.432 183.7568-183.7568 183.7568z m0-265.1648c-44.8512 0-81.3568 36.5056-81.3568 81.3568S466.9952 593.92 511.8464 593.92s81.3568-36.5056 81.3568-81.3568-36.5056-81.3568-81.3568-81.3568z"
fill="#FFE37B"></path>
</svg>
随机名称
</el-tag>
<el-tag
:key="i"
effect="dark"
v-for="(name, i) in randomName"
closable
:disable-transitions="false"
:type="types[Math.floor(Math.random() * 5)]"
@close="handleClose(randomName, name)">
{{name}}
</el-tag>
<el-input
class="input-new-tag"
v-if="inputRandomNameVisible"
v-model="inputRandomNameValue"
ref="saveRandomNameInput"
size="small"
@keyup.enter.native="handleInputRandomNameConfirm"
@blur="handleInputRandomNameConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showRandomNameInput">+ </el-button>
<div class="myCenter" style="margin-bottom: 22px">
<el-button type="primary" @click="saveRandomName()"></el-button>
</div>
</div>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M767.1296 808.6528c16.8448 0 32.9728 2.816 48.0256 8.0384 20.6848 7.1168 43.52 1.0752 57.1904-15.9744a459.91936 459.91936 0 0 0 70.5024-122.88c7.8336-20.48 1.0752-43.264-15.9744-57.088-49.6128-40.192-65.0752-125.3888-31.3856-185.856a146.8928 146.8928 0 0 1 30.3104-37.9904c16.2304-14.5408 22.1696-37.376 13.9264-57.6a461.27104 461.27104 0 0 0-67.5328-114.9952c-13.6192-16.9984-36.4544-22.9376-57.0368-15.8208a146.3296 146.3296 0 0 1-48.0256 8.0384c-70.144 0-132.352-50.8928-145.2032-118.7328-4.096-21.6064-20.736-38.5536-42.4448-41.8304-22.0672-3.2768-44.6464-5.0176-67.6864-5.0176-21.4528 0-42.5472 1.536-63.232 4.4032-22.3232 3.1232-40.2432 20.48-43.52 42.752-6.912 46.6944-36.0448 118.016-145.7152 118.4256-17.3056 0.0512-33.8944-2.9696-49.3056-8.448-21.0432-7.4752-44.3904-1.4848-58.368 15.9232A462.14656 462.14656 0 0 0 80.4864 348.16c-7.6288 20.0192-2.7648 43.008 13.4656 56.9344 55.5008 47.8208 71.7824 122.88 37.0688 185.1392a146.72896 146.72896 0 0 1-31.6416 39.168c-16.8448 14.7456-23.0912 38.1952-14.5408 58.9312 16.896 41.0112 39.5776 79.0016 66.9696 113.0496 13.9264 17.3056 37.2736 23.1936 58.2144 15.7184 15.4112-5.4784 32-8.4992 49.3056-8.4992 71.2704 0 124.7744 49.408 142.1312 121.2928 4.9664 20.48 21.4016 36.0448 42.24 39.168 22.2208 3.328 44.9536 5.0688 68.096 5.0688 23.3984 0 46.4384-1.792 68.864-5.1712 21.3504-3.2256 38.144-19.456 42.7008-40.5504 14.8992-68.8128 73.1648-119.7568 143.7696-119.7568z"
fill="#8C7BFD"></path>
<path
d="M511.8464 696.3712c-101.3248 0-183.7568-82.432-183.7568-183.7568s82.432-183.7568 183.7568-183.7568 183.7568 82.432 183.7568 183.7568-82.432 183.7568-183.7568 183.7568z m0-265.1648c-44.8512 0-81.3568 36.5056-81.3568 81.3568S466.9952 593.92 511.8464 593.92s81.3568-36.5056 81.3568-81.3568-36.5056-81.3568-81.3568-81.3568z"
fill="#FFE37B"></path>
</svg>
随机头像
</el-tag>
<div :key="i"
style="display: flex"
v-for="(avatar, i) in randomAvatar">
<el-tag
style="white-space: normal;height: unset"
closable
:disable-transitions="false"
@close="handleClose(randomAvatar, avatar)">
{{avatar}}
</el-tag>
<div>
<el-image class="table-td-thumb"
style="margin: 10px"
:preview-src-list="[avatar]"
:src="avatar"
fit="cover"></el-image>
</div>
</div>
<el-input
class="input-new-tag"
v-if="inputRandomAvatarVisible"
v-model="inputRandomAvatarValue"
ref="saveRandomAvatarInput"
size="small"
@keyup.enter.native="handleInputRandomAvatarConfirm"
@blur="handleInputRandomAvatarConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showRandomAvatarInput">+ </el-button>
<uploadPicture :isAdmin="true" :prefix="'randomAvatar'" style="margin: 10px" @addPicture="addRandomAvatar"
:maxSize="1"
:maxNumber="5"></uploadPicture>
<div class="myCenter" style="margin-bottom: 22px">
<el-button type="primary" @click="saveRandomAvatar()"></el-button>
</div>
</div>
<div>
<el-tag effect="dark" class="my-tag">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M767.1296 808.6528c16.8448 0 32.9728 2.816 48.0256 8.0384 20.6848 7.1168 43.52 1.0752 57.1904-15.9744a459.91936 459.91936 0 0 0 70.5024-122.88c7.8336-20.48 1.0752-43.264-15.9744-57.088-49.6128-40.192-65.0752-125.3888-31.3856-185.856a146.8928 146.8928 0 0 1 30.3104-37.9904c16.2304-14.5408 22.1696-37.376 13.9264-57.6a461.27104 461.27104 0 0 0-67.5328-114.9952c-13.6192-16.9984-36.4544-22.9376-57.0368-15.8208a146.3296 146.3296 0 0 1-48.0256 8.0384c-70.144 0-132.352-50.8928-145.2032-118.7328-4.096-21.6064-20.736-38.5536-42.4448-41.8304-22.0672-3.2768-44.6464-5.0176-67.6864-5.0176-21.4528 0-42.5472 1.536-63.232 4.4032-22.3232 3.1232-40.2432 20.48-43.52 42.752-6.912 46.6944-36.0448 118.016-145.7152 118.4256-17.3056 0.0512-33.8944-2.9696-49.3056-8.448-21.0432-7.4752-44.3904-1.4848-58.368 15.9232A462.14656 462.14656 0 0 0 80.4864 348.16c-7.6288 20.0192-2.7648 43.008 13.4656 56.9344 55.5008 47.8208 71.7824 122.88 37.0688 185.1392a146.72896 146.72896 0 0 1-31.6416 39.168c-16.8448 14.7456-23.0912 38.1952-14.5408 58.9312 16.896 41.0112 39.5776 79.0016 66.9696 113.0496 13.9264 17.3056 37.2736 23.1936 58.2144 15.7184 15.4112-5.4784 32-8.4992 49.3056-8.4992 71.2704 0 124.7744 49.408 142.1312 121.2928 4.9664 20.48 21.4016 36.0448 42.24 39.168 22.2208 3.328 44.9536 5.0688 68.096 5.0688 23.3984 0 46.4384-1.792 68.864-5.1712 21.3504-3.2256 38.144-19.456 42.7008-40.5504 14.8992-68.8128 73.1648-119.7568 143.7696-119.7568z"
fill="#8C7BFD"></path>
<path
d="M511.8464 696.3712c-101.3248 0-183.7568-82.432-183.7568-183.7568s82.432-183.7568 183.7568-183.7568 183.7568 82.432 183.7568 183.7568-82.432 183.7568-183.7568 183.7568z m0-265.1648c-44.8512 0-81.3568 36.5056-81.3568 81.3568S466.9952 593.92 511.8464 593.92s81.3568-36.5056 81.3568-81.3568-36.5056-81.3568-81.3568-81.3568z"
fill="#FFE37B"></path>
</svg>
随机封面
</el-tag>
<div :key="i"
style="display: flex"
v-for="(cover, i) in randomCover">
<el-tag
style="white-space: normal;height: unset"
closable
:disable-transitions="false"
@close="handleClose(randomCover, cover)">
{{cover}}
</el-tag>
<div>
<el-image class="table-td-thumb"
style="margin: 10px"
:preview-src-list="[cover]"
:src="cover"
fit="cover"></el-image>
</div>
</div>
<el-input
class="input-new-tag"
v-if="inputRandomCoverVisible"
v-model="inputRandomCoverValue"
ref="saveRandomCoverInput"
size="small"
@keyup.enter.native="handleInputRandomCoverConfirm"
@blur="handleInputRandomCoverConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showRandomCoverInput">+ </el-button>
<uploadPicture :isAdmin="true" :prefix="'randomCover'" style="margin: 10px" @addPicture="addRandomCover"
:maxSize="5"
:maxNumber="5"></uploadPicture>
<div class="myCenter" style="margin-bottom: 40px">
<el-button type="primary" @click="saveRandomCover()"></el-button>
</div>
</div>
<div>
<el-button type="danger" @click="resetForm('ruleForm')"></el-button>
</div>
</div>
</template>
<script>
const uploadPicture = () => import( "../common/uploadPicture");
export default {
components: {
uploadPicture
},
data() {
return {
disabled: true,
types: ['', 'success', 'info', 'danger', 'warning'],
inputNoticeVisible: false,
inputNoticeValue: "",
inputRandomNameVisible: false,
inputRandomNameValue: "",
inputRandomAvatarVisible: false,
inputRandomAvatarValue: "",
inputRandomCoverVisible: false,
inputRandomCoverValue: "",
webInfo: {
id: null,
webName: "",
webTitle: "",
footer: "",
backgroundImage: "",
avatar: "",
waifuJson: "",
status: false
},
notices: [],
randomAvatar: [],
randomName: [],
randomCover: [],
rules: {
webName: [
{required: true, message: '请输入网站名称', trigger: 'blur'},
{min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'change'}
],
webTitle: [
{required: true, message: '请输入网站标题', trigger: 'blur'}
],
footer: [
{required: true, message: '请输入页脚', trigger: 'blur'}
],
backgroundImage: [
{required: true, message: '请输入背景', trigger: 'change'}
],
status: [
{required: true, message: '请设置网站状态', trigger: 'change'}
],
avatar: [
{required: true, message: '请上传头像', trigger: 'change'}
]
}
}
},
computed: {},
watch: {},
created() {
this.getWebInfo();
},
mounted() {
},
methods: {
addBackgroundImage(res) {
this.webInfo.backgroundImage = res;
},
addAvatar(res) {
this.webInfo.avatar = res;
},
addRandomAvatar(res) {
this.randomAvatar.push(res);
},
addRandomCover(res) {
this.randomCover.push(res);
},
changeWebStatus(webInfo) {
this.$http.post(this.$constant.baseURL + "/webInfo/updateWebInfo", {
id: webInfo.id,
status: webInfo.status
}, true)
.then((res) => {
this.getWebInfo();
this.$message({
message: "保存成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
getWebInfo() {
this.$http.get(this.$constant.baseURL + "/admin/webInfo/getAdminWebInfo", {}, true)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.webInfo.id = res.data.id;
this.webInfo.webName = res.data.webName;
this.webInfo.webTitle = res.data.webTitle;
this.webInfo.footer = res.data.footer;
this.webInfo.backgroundImage = res.data.backgroundImage;
this.webInfo.avatar = res.data.avatar;
this.webInfo.waifuJson = res.data.waifuJson;
this.webInfo.status = res.data.status;
this.notices = JSON.parse(res.data.notices);
this.randomAvatar = JSON.parse(res.data.randomAvatar);
this.randomName = JSON.parse(res.data.randomName);
this.randomCover = JSON.parse(res.data.randomCover);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.updateWebInfo(this.webInfo)
} else {
this.$message({
message: "请完善必填项!",
type: "error"
});
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.getWebInfo();
},
handleClose(array, item) {
array.splice(array.indexOf(item), 1);
},
handleInputNoticeConfirm() {
if (this.inputNoticeValue) {
this.notices.push(this.inputNoticeValue);
}
this.inputNoticeVisible = false;
this.inputNoticeValue = '';
},
showNoticeInput() {
this.inputNoticeVisible = true;
this.$nextTick(() => {
this.$refs.saveNoticeInput.$refs.input.focus();
});
},
saveNotice() {
let param = {
id: this.webInfo.id,
notices: JSON.stringify(this.notices)
}
this.updateWebInfo(param);
},
handleInputRandomNameConfirm() {
if (this.inputRandomNameValue) {
this.randomName.push(this.inputRandomNameValue);
}
this.inputRandomNameVisible = false;
this.inputRandomNameValue = '';
},
showRandomNameInput() {
this.inputRandomNameVisible = true;
this.$nextTick(() => {
this.$refs.saveRandomNameInput.$refs.input.focus();
});
},
saveRandomName() {
let param = {
id: this.webInfo.id,
randomName: JSON.stringify(this.randomName)
}
this.updateWebInfo(param);
},
handleInputRandomAvatarConfirm() {
if (this.inputRandomAvatarValue) {
this.randomAvatar.push(this.inputRandomAvatarValue);
}
this.inputRandomAvatarVisible = false;
this.inputRandomAvatarValue = '';
},
showRandomAvatarInput() {
this.inputRandomAvatarVisible = true;
this.$nextTick(() => {
this.$refs.saveRandomAvatarInput.$refs.input.focus();
});
},
saveRandomAvatar() {
let param = {
id: this.webInfo.id,
randomAvatar: JSON.stringify(this.randomAvatar)
}
this.updateWebInfo(param);
},
handleInputRandomCoverConfirm() {
if (this.inputRandomCoverValue) {
this.randomCover.push(this.inputRandomCoverValue);
}
this.inputRandomCoverVisible = false;
this.inputRandomCoverValue = '';
},
showRandomCoverInput() {
this.inputRandomCoverVisible = true;
this.$nextTick(() => {
this.$refs.saveRandomCoverInput.$refs.input.focus();
});
},
saveRandomCover() {
let param = {
id: this.webInfo.id,
randomCover: JSON.stringify(this.randomCover)
}
this.updateWebInfo(param);
},
updateWebInfo(value) {
this.$confirm('确认保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.post(this.$constant.baseURL + "/webInfo/updateWebInfo", value, true)
.then((res) => {
this.getWebInfo();
this.$message({
message: "保存成功!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消保存!'
});
});
}
}
}
</script>
<style scoped>
.my-tag {
margin-bottom: 20px !important;
width: 100%;
text-align: left;
background: var(--lightYellow);
border: none;
height: 40px;
line-height: 40px;
font-size: 16px;
color: var(--black);
}
.el-tag {
margin: 10px;
}
.button-new-tag {
margin: 10px;
height: 32px;
line-height: 32px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 200px;
margin: 10px;
}
.my-icon {
cursor: pointer;
margin-left: 10px;
font-size: 18px;
font-weight: bold;
color: var(--blue);
}
.table-td-thumb {
border-radius: 2px;
width: 40px;
height: 40px;
}
</style>

@ -0,0 +1,594 @@
<template>
<div v-if="!$common.isEmpty(article)">
<!-- 封面 -->
<div class="article-head my-animation-slide-top">
<!-- 背景图片 -->
<el-image class="article-image my-el-image"
v-once
:src="!$common.isEmpty(article.articleCover)?article.articleCover:$constant.random_image+new Date()+Math.floor(Math.random()*10)"
fit="cover">
<div slot="error" class="image-slot">
<div class="article-image"></div>
</div>
</el-image>
<!-- 文章信息 -->
<div class="article-info-container">
<div class="article-title">{{ article.articleTitle }}</div>
<div class="article-info">
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path
d="M510.4 65.5l259.69999999 0 1e-8 266.89999999c0 147.50000001-116.2 266.89999999-259.7 266.90000001-143.4 0-259.7-119.5-259.7-266.90000001 0.1-147.5 116.3-266.9 259.7-266.89999999z"
fill="#FF9FCF"></path>
<path
d="M698.4 525.2l-13 0c53-48.4 86.5-117.8 86.5-195.20000001 0-10.2-0.7-20.3-1.8-30.19999999C613.8 377.50000001 438.6 444.9 266 437.7c15 33.4 36.7 63.1 63.5 87.5l-5.3 0c-122.6 0-225.5 88.1-248.8 204.1C340 677.2 597.7 609.2 862.2 585.7c-44.3-37.6-101.5-60.5-163.8-60.5z"
fill="#FF83BB"></path>
<path
d="M862.2 585.7C597.7 609.2 340 677.2 75.4 729.3c-3.2 16.1-5 32.6-5 49.6 0 99.8 81.7 181.5 181.5 181.5l518.6 0c99.8 0 181.5-81.7 181.5-181.5 0.1-77.2-35-146.5-89.8-193.2z"
fill="#FF5390"></path>
<path
d="M770.1 299.8C755.1 168 643.3 65.5 507.4 65.5c-146.1 0-264.5 118.4-264.5 264.5 0 38.4 8.3 74.8 23.1 107.7 172.6 7.2 347.8-60.2 504.1-137.9z"
fill="#FF9FCF"></path>
<path
d="M436.4 282.1c0 24.1-19.6 43.7-43.7 43.7S349 306.2 349 282.1s19.6-43.7 43.7-43.7c24.19999999 0 43.7 19.6 43.7 43.7z"
fill="#FFFFFF"></path>
<path d="M625 282.1m-43.7 0a43.7 43.7 0 1 0 87.4 0 43.7 43.7 0 1 0-87.4 0Z" fill="#FFFFFF"></path>
</svg>
<span>&nbsp;{{ article.username }}</span>
<span>·</span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#409EFF"></path>
<path
d="M654.222222 256c-17.066667 0-28.444444 11.377778-28.444444 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444444 28.444445s28.444444-11.377778 28.444445-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444445-28.444444zM369.777778 256c-17.066667 0-28.444444 11.377778-28.444445 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444445 28.444445s28.444444-11.377778 28.444444-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444444-28.444444z"
fill="#FFFFFF"></path>
<path
d="M725.333333 312.888889H711.111111v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-170.666666v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-14.222222c-22.755556 0-42.666667 19.911111-42.666667 42.666667v341.333333c0 22.755556 19.911111 42.666667 42.666667 42.666667h426.666666c22.755556 0 42.666667-19.911111 42.666667-42.666667v-341.333333c0-22.755556-19.911111-42.666667-42.666667-42.666667zM426.666667 654.222222h-56.888889c-17.066667 0-28.444444-11.377778-28.444445-28.444444s11.377778-28.444444 28.444445-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444444 28.444445s-11.377778 28.444444-28.444444 28.444444z m227.555555 0h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444445s-11.377778 28.444444-28.444445 28.444444z m0-113.777778h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444444h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444444s-11.377778 28.444444-28.444445 28.444444z"
fill="#FFFFFF"></path>
</svg>
<span>&nbsp;{{ article.createTime }}</span>
<span>·</span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path d="M14.656 512a497.344 497.344 0 1 0 994.688 0 497.344 497.344 0 1 0-994.688 0z"
fill="#FF0000"></path>
<path
d="M374.976 872.64c-48.299-100.032-22.592-157.44 14.421-211.37 40.448-58.966 51.115-117.611 51.115-117.611s31.659 41.386 19.115 106.005c56.149-62.72 66.816-162.133 58.325-200.405 127.317 88.746 181.59 281.002 108.181 423.381C1016 652.501 723.093 323.2 672.277 285.867c16.939 37.333 20.054 100.032-14.101 130.474-58.027-219.84-201.664-265.002-201.664-265.002 16.96 113.536-61.781 237.397-137.344 330.24-2.816-45.163-5.632-76.544-29.483-119.808-5.333 82.176-68.373 149.269-85.29 231.445-22.912 111.637 17.237 193.173 170.581 279.424z"
fill="#FFFFFF"></path>
</svg>
<span>&nbsp;{{ article.viewCount }}</span>
<span>·</span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path
d="M113.834667 291.84v449.194667a29.013333 29.013333 0 0 0 28.842666 29.013333h252.928v90.453333l160.597334-90.453333h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333h-665.6a29.013333 29.013333 0 0 0-29.696 29.013333z"
fill="#FFDEAD"></path>
<path
d="M809.130667 262.826667h-665.6a29.013333 29.013333 0 0 0-28.842667 29.013333v40.106667a29.013333 29.013333 0 0 1 28.842667-29.013334h665.6a29.013333 29.013333 0 0 1 29.013333 29.013334V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333z"
fill="#FFF3DB"></path>
<path
d="M556.202667 770.048h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V362.837333s-59.733333 392.533333-724.309333 314.709334v63.488a29.013333 29.013333 0 0 0 28.842666 29.013333h253.098667v90.453333z"
fill="#F2C182"></path>
<path
d="M619.008 632.32l101.888-35.157333-131.754667-76.117334 29.866667 111.274667zM891.904 148.992a61.44 61.44 0 0 0-84.138667 22.528l-19.968 34.133333 106.666667 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-22.528-84.138667z"
fill="#69BAF9"></path>
<path d="M775.338667 198.775467l131.669333 76.032-186.026667 322.218666-131.6864-76.032z"
fill="#F7FBFF"></path>
<path
d="M775.168 198.826667l-5.290667 9.216 59.221334 34.133333a34.133333 34.133333 0 0 1 12.458666 46.592l-139.946666 242.346667a34.133333 34.133333 0 0 1-46.762667 12.629333l-59.050667-34.133333-6.656 11.434666 88.746667 51.2L720.896 597.333333l186.026667-322.56z"
fill="#D8E3F0"></path>
<path
d="M616.448 622.592l2.56 9.728 101.888-35.157333-44.885333-25.941334-59.562667 51.370667zM891.904 148.992c-1.024 0-2.218667-0.853333-3.242667-1.536A61.610667 61.610667 0 0 1 887.466667 204.8l-19.968 34.133333-73.728-42.496-5.12 8.704 106.666666 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-23.381333-83.626667z"
fill="#599ED4"></path>
<path
d="M265.898667 417.621333H494.933333a17.066667 17.066667 0 1 0 0-34.133333H265.898667a17.066667 17.066667 0 1 0 0 34.133333zM265.898667 533.504H494.933333a17.066667 17.066667 0 0 0 0-34.133333H265.898667a17.066667 17.066667 0 0 0 0 34.133333z"
fill="#3D3D63"></path>
<path
d="M959.488 354.645333a99.84 99.84 0 0 0-23.722667-127.488 78.677333 78.677333 0 0 0-142.848-64.170666l-11.605333 20.138666a17.066667 17.066667 0 0 0-20.821333 7.168l-32.085334 55.466667H142.677333a46.250667 46.250667 0 0 0-45.909333 46.08v449.194667a46.08 46.08 0 0 0 45.909333 46.08h236.032v73.386666a17.066667 17.066667 0 0 0 8.362667 14.848 17.066667 17.066667 0 0 0 8.704 2.218667 17.066667 17.066667 0 0 0 8.362667-2.218667l156.672-88.234666h248.32a46.08 46.08 0 0 0 46.08-46.08V398.677333L921.6 283.306667a17.066667 17.066667 0 0 0-4.266667-21.504l1.877334-3.413334a65.365333 65.365333 0 0 1 10.410666 79.189334l-53.077333 91.989333a56.832 56.832 0 0 0 20.821333 77.653333 17.066667 17.066667 0 0 0 24.234667-6.314666 17.066667 17.066667 0 0 0-6.997333-23.04 23.04 23.04 0 0 1-8.362667-31.061334z m-138.410667 386.389334a11.946667 11.946667 0 0 1-11.946666 11.946666H556.202667a17.066667 17.066667 0 0 0-8.362667 2.218667l-134.997333 76.117333v-61.269333a17.066667 17.066667 0 0 0-17.066667-17.066667H142.677333a11.946667 11.946667 0 0 1-11.776-11.946666V291.84a11.946667 11.946667 0 0 1 11.776-11.946667h565.930667L574.464 512a17.066667 17.066667 0 0 0-1.706667 12.970667L597.333333 615.253333H265.898667a17.066667 17.066667 0 1 0 0 34.133334h352.938666a17.066667 17.066667 0 0 0 5.802667 0l102.4-35.328a17.066667 17.066667 0 0 0 9.216-7.509334l85.333333-147.968z m-204.8-184.661334l63.829334 36.864-49.322667 17.066667z m206.848-170.666666v1.365333l-108.373333 186.709333-102.4-59.050666L781.482667 221.866667l102.4 59.050666z m76.458667-161.28L887.466667 244.224l-76.970667-44.373333 11.264-19.797334a44.544 44.544 0 1 1 77.141333 44.544z"
fill="#3D3D63"></path>
</svg>
<span>&nbsp;{{ article.commentCount }}</span>
<span>·</span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path
d="M510.671749 348.792894S340.102978 48.827055 134.243447 254.685563C-97.636714 486.565724 510.671749 913.435858 510.671749 913.435858s616.107079-419.070494 376.428301-658.749272c-194.095603-194.096626-376.428302 94.106308-376.428301 94.106308z"
fill="#FF713C"></path>
<path
d="M510.666632 929.674705c-3.267417 0-6.534833-0.983397-9.326413-2.950192-16.924461-11.872399-414.71121-293.557896-435.220312-529.448394-5.170766-59.482743 13.879102-111.319341 56.643068-154.075121 51.043536-51.043536 104.911398-76.930113 160.095231-76.930114 112.524796 0 196.878996 106.48115 228.475622 153.195078 33.611515-45.214784 122.406864-148.20646 234.04343-148.20646 53.930283 0 105.46603 24.205285 153.210428 71.941496 45.063335 45.063335 64.954361 99.200326 59.133795 160.920016C935.306982 641.685641 536.758893 915.327952 519.80271 926.859589a16.205077 16.205077 0 0 1-9.136078 2.815116zM282.857183 198.75574c-46.25344 0-92.396363 22.682605-137.127124 67.413365-36.149315 36.157501-51.614541 78.120218-47.25321 128.291898 17.575284 202.089671 352.199481 455.119525 412.332023 499.049037 60.434417-42.86732 395.406538-289.147446 414.567947-492.458945 4.933359-52.344159-11.341303-96.465029-49.759288-134.88199-41.431621-41.423435-85.24243-62.424748-130.242319-62.424748-122.041544 0-220.005716 152.203494-220.989114 153.742547-3.045359 4.806469-8.53335 7.883551-14.101159 7.534603a16.257266 16.257266 0 0 1-13.736863-8.184403c-0.902556-1.587148-91.569532-158.081365-213.690893-158.081364z"
fill="#885F44"></path>
</svg>
<span>&nbsp;{{ article.likeCount }}</span>
</div>
</div>
<div class="article-info-news"
@click="weiYanDialogVisible = true"
v-if="!$common.isEmpty($store.state.currentUser) && $store.state.currentUser.id === article.userId">
<svg width="30" height="30" viewBox="0 0 1024 1024">
<path d="M0 0h1024v1024H0V0z" fill="#202425" opacity=".01"></path>
<path
d="M989.866667 512c0 263.918933-213.947733 477.866667-477.866667 477.866667S34.133333 775.918933 34.133333 512 248.081067 34.133333 512 34.133333s477.866667 213.947733 477.866667 477.866667z"
fill="#FF7744"></path>
<path
d="M512 221.866667A51.2 51.2 0 0 1 563.2 273.066667v187.733333H750.933333a51.2 51.2 0 0 1 0 102.4h-187.733333V750.933333a51.2 51.2 0 0 1-102.4 0v-187.733333H273.066667a51.2 51.2 0 0 1 0-102.4h187.733333V273.066667A51.2 51.2 0 0 1 512 221.866667z"
fill="#FFFFFF"></path>
</svg>
</div>
</div>
<!-- 文章 -->
<div style="background: var(--background);">
<div class="article-container my-animation-slide-bottom">
<!-- 最新进展 -->
<div v-if="!$common.isEmpty(treeHoleList)" class="process-wrap">
<el-collapse accordion value="1">
<el-collapse-item title="最新进展" name="1">
<process :treeHoleList="treeHoleList" @deleteTreeHole="deleteTreeHole"></process>
</el-collapse-item>
</el-collapse>
<hr>
</div>
<!-- 文章内容 -->
<div v-html="articleContentHtml" class="entry-content"></div>
<!-- 最后更新时间 -->
<div class="article-update-time">
<span>文章最后更新于 {{ article.updateTime }}</span>
</div>
<!-- 分类 -->
<div class="article-sort">
<span @click="$router.push({path: '/sort', query: {sortId: article.sortId, labelId: article.labelId}})">{{ article.sort.sortName +" ▶ "+ article.label.labelName}}</span>
</div>
<!-- 作者信息 -->
<blockquote>
<div>
作者{{article.username}}
</div>
<div>
版权声明转载请注明文章出处
</div>
</blockquote>
<!-- 点赞 -->
<div class="myCenter" id="article-like">
<i class="el-icon-thumb article-like-icon" :class="{'article-like': article.likeCount}"></i>
</div>
<!-- 评论 -->
<div v-if="article.commentStatus === true">
<comment :source="article.id" :userId="article.userId"></comment>
</div>
</div>
<div id="toc" class="toc"></div>
</div>
<div style="background: var(--background)">
<myFooter></myFooter>
</div>
<el-dialog title="最新进展"
:visible.sync="weiYanDialogVisible"
width="40%"
:append-to-body="true"
destroy-on-close
center>
<div>
<div class="myCenter" style="margin-bottom: 20px">
<el-date-picker
v-model="newsTime"
type="datetime"
align="center"
placeholder="选择日期时间">
</el-date-picker>
</div>
<commentBox :disableGraffiti="true"
@submitComment="submitWeiYan">
</commentBox>
</div>
</el-dialog>
</div>
</template>
<script>
const myFooter = () => import( "./common/myFooter");
const comment = () => import( "./comment/comment");
const process = () => import( "./common/process");
const commentBox = () => import( "./comment/commentBox");
import MarkdownIt from 'markdown-it';
export default {
components: {
myFooter,
comment,
commentBox,
process
},
data() {
return {
id: this.$route.query.id,
article: {},
articleContentHtml: "",
treeHoleList: [],
weiYanDialogVisible: false,
newsTime: ""
};
},
created() {
this.getArticle();
},
mounted() {
// window.addEventListener("scroll", this.onScrollPage);
},
methods: {
deleteTreeHole(id) {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + "/weiYan/deleteWeiYan", {id: id})
.then((res) => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getNews();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
submitWeiYan(content) {
let weiYan = {
content: content,
createTime: this.newsTime,
source: this.article.id
};
this.$http.post(this.$constant.baseURL + "/weiYan/saveNews", weiYan)
.then((res) => {
this.weiYanDialogVisible = false;
this.newsTime = "";
this.getNews();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
getNews() {
this.$http.post(this.$constant.baseURL + "/weiYan/listNews", {
current: 1,
size: 9999,
source: this.article.id
})
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
res.data.records.forEach(c => {
c.content = c.content.replace(/\n{2,}/g, '<div style="height: 12px"></div>');
c.content = c.content.replace(/\n/g, '<br/>');
c.content = this.$common.faceReg(c.content);
c.content = this.$common.pictureReg(c.content);
});
this.treeHoleList = res.data.records;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
onScrollPage() {
let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop < (window.innerHeight / 4)) {
$(".toc").css("top", window.innerHeight / 2);
$(".toc").css("display", "unset");
} else if (scrollTop > (window.innerHeight / 4) && scrollTop < ($("#article-like").offset().top - window.innerHeight)) {
$(".toc").css("top", "100px");
$(".toc").css("display", "unset");
} else {
$(".toc").css("display", "none");
}
},
getTocbot() {
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = this.$constant.tocbot;
document.getElementsByTagName('head')[0].appendChild(script);
//
script.onload = function () {
tocbot.init({
tocSelector: '#toc',
contentSelector: '.entry-content',
headingSelector: 'h1, h2, h3, h4, h5, h6',
scrollSmooth: true,
fixedSidebarOffset: 'auto',
scrollSmoothOffset: -100,
hasInnerContainers: false
});
}
},
addId() {
let headings = $(".entry-content").find("h1, h2, h3, h4, h5, h6");
headings.attr('id', (i, id) => id || 'toc-' + i);
},
getArticle() {
this.$http.get(this.$constant.baseURL + "/article/getArticleById", {id: this.id, flag: true})
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.article = res.data;
this.getNews();
const md = new MarkdownIt({breaks: true});
this.articleContentHtml = md.render(this.article.articleContent);
this.$nextTick(() => {
this.highlight();
this.addId();
// todo toc
// this.getTocbot();
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
highlight() {
let attributes = {
autocomplete: "off",
autocorrect: "off",
autocapitalize: "off",
spellcheck: "false",
contenteditable: "false"
};
$("pre").each(function (i, item) {
let preCode = $(item).children("code");
let classNameStr = preCode[0].className;
let classNameArr = classNameStr.split(" ");
let lang = "";
classNameArr.some(function (className) {
if (className.indexOf("language-") > -1) {
lang = className.substring(className.indexOf("-") + 1, className.length);
return true;
}
});
//
let language = hljs.getLanguage(lang.toLowerCase());
if (language === undefined) {
//
let autoLanguage = hljs.highlightAuto(preCode.text());
preCode.removeClass("language-" + lang);
lang = autoLanguage.language;
if (lang === undefined) {
lang = "java";
}
preCode.addClass("language-" + lang);
} else {
lang = language.name;
}
$(item).addClass("highlight-wrap");
$(item).attr(attributes);
preCode.attr("data-rel", lang.toUpperCase()).addClass(lang.toLowerCase());
//
hljs.highlightBlock(preCode[0]);
//
hljs.lineNumbersBlock(preCode[0]);
});
$("pre code").each(function (i, block) {
$(block).attr({
id: "hljs-" + i,
});
$(block).after(
'<a class="copy-code" href="javascript:" data-clipboard-target="#hljs-' +
i +
'"><i class="fa fa-clipboard" aria-hidden="true"></i></a>'
);
new ClipboardJS(".copy-code");
});
if ($(".entry-content").children("table").length > 0) {
$(".entry-content")
.children("table")
.wrap("<div class='table-wrapper'></div>");
}
}
}
}
</script>
<style scoped>
.article-head {
height: 40vh;
position: relative;
}
.article-image::before {
position: absolute;
width: 100%;
height: 100%;
background-color: var(--miniMask);
content: "";
}
.article-info-container {
position: absolute;
bottom: 15px;
left: 20%;
color: var(--white);
}
.article-info-news {
position: absolute;
bottom: 10px;
right: 20%;
cursor: pointer;
animation: scale 1s ease-in-out infinite;
}
.article-title {
font-size: 28px;
margin-bottom: 15px;
}
.article-info {
font-size: 14px;
user-select: none;
}
.article-info i {
margin-right: 6px;
}
.article-info span:not(:last-child) {
margin-right: 5px;
}
.article-container {
max-width: 800px;
margin: 0 auto;
padding: 40px 20px;
}
.article-update-time {
color: var(--greyFont);
font-size: 12px;
margin: 20px 0;
user-select: none;
}
blockquote {
line-height: 2;
border-left: 0.2rem solid var(--blue);
padding: 10px 1rem;
background-color: var(--azure);
border-radius: 4px;
margin: 0 0 40px 0;
user-select: none;
color: var(--black);
}
.article-sort {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
.article-sort span {
padding: 3px 10px;
background-color: var(--themeBackground);
border-radius: 5px;
font-size: 14px;
color: var(--white);
transition: all 0.3s;
margin-right: 25px;
cursor: pointer;
user-select: none;
}
.article-sort span:hover {
background-color: var(--red);
}
.article-like {
color: var(--red) !important;
}
.article-like-icon {
font-size: 60px;
cursor: pointer;
color: var(--greyFont);
transition: all 0.5s;
border-radius: 50%;
margin-bottom: 20px;
}
.article-like-icon:hover {
transform: rotate(360deg);
}
.process-wrap {
margin: 0 0 40px;
}
.process-wrap hr {
position: relative;
margin: 10px auto 60px;
border: 2px dashed var(--lightGreen);
overflow: visible;
}
.process-wrap hr:before {
position: absolute;
top: -14px;
left: 5%;
color: var(--lightGreen);
content: '❄';
font-size: 30px;
line-height: 1;
transition: all 1s ease-in-out;
}
.process-wrap hr:hover:before {
left: calc(95% - 20px);
}
.process-wrap >>> .el-collapse-item__header {
border-bottom: unset;
font-size: 20px;
background-color: var(--background);
color: var(--lightGreen);
}
.process-wrap >>> .el-collapse-item__wrap {
background-color: var(--background);
}
.process-wrap .el-collapse {
border-top: unset;
border-bottom: unset;
}
.process-wrap >>> .el-collapse-item__wrap {
border-bottom: unset;
}
@media screen and (max-width: 700px) {
.article-info-container {
left: 20px;
max-width: 320px;
}
.article-info-news {
right: 20px;
}
}
</style>

@ -0,0 +1,323 @@
<template>
<div v-if="!$common.isEmpty(articleList)" class="recent-post-container">
<div class="article-first">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -2px;">
<path
d="M224.2 472.3c-13-5.7-3.7-23.5 8.2-19 91 34 146.8 108.7 182.4 138.5 5.6 4.7 14 2.9 17.3-3.5 16.8-32 45.8-113.7-57.1-168.6-87.3-46.5-188-53.6-247.3-82.2-14.5-7-31.1 4.6-29.9 20.7 5 69.7 28.9 124.7 62.3 181.5 67.3 114.3 140.6 132.9 216.6 104 2.2-0.9 4.5-1.8 7-3 7-3.4 8.3-12.9 2.5-18.1 0.1 0-45.7-69.3-162-150.3z"
fill="#FFD401"></path>
<path
d="M282.7 849.9c79.5-137 172.4-263.1 385.4-401.3 9.8-6.4 2.1-21.5-8.9-17.4C497.7 492.8 429.7 585 373.3 640.8c-8.7 8.7-23.4 6.3-29.1-4.6-27.2-51.8-69.5-174.1 97.3-263.1 147.7-78.8 319.9-91.4 429.7-93.3 18.9-0.3 31.5 19.4 23.3 36.4C863.7 380 842.6 478 789.9 567.6 680.8 753.1 545.5 766.7 422.2 719.8c-8.8-3.4-18.8-0.2-24 7.7-16.6 25.2-50.3 80.1-58.7 122.4-11.4 56.8-82.2 43.9-56.8 0z"
fill="#8BC03C"></path>
<path
d="M375 419.6c-30.1 28.2-45.8 57.7-52.4 86.1 40.6 32.4 70.2 67.7 92.1 85.9 1.2 1 2.5 1.6 3.9 2.1 6.5-6.7 13.3-13.7 20.4-20.7 15.2-37.9 25.3-105.7-64-153.4zM318.8 548.2c1.6 36.1 14.7 67.6 25.5 88.1 5.7 10.9 20.3 13.3 29.1 4.6 4.9-4.9 10-10 15.1-15.4-0.6-1-1.3-2-2.2-2.8 0-0.1-20.1-30.5-67.5-74.5z"
fill="#8BA000"></path>
</svg>
发现
</div>
<div class="recent-post-item shadow-box background-opacity wow"
v-for="(article, index) in articleList"
:key="index"
:class="{'my-animation-slide-top': index % 2 !== 0,'my-animation-slide-bottom': index % 2 === 0}"
@click="$router.push({path: '/article', query: {id: article.id}})">
<!-- 封面 -->
<div class="recent-post-item-image" :class="{ leftImage: index % 2 !== 0, rightImage: index % 2 === 0 }">
<el-image class="my-el-image"
v-once
:src="!$common.isEmpty(article.articleCover)?article.articleCover:$constant.random_image+new Date()+Math.floor(Math.random()*10)"
fit="cover">
<div slot="error" class="image-slot myCenter" style="background-color: var(--lightGreen)">
<div class="error-text">
<div>遇事不决可问春风</div>
</div>
</div>
</el-image>
</div>
<!-- 内容 -->
<div class="recent-post-item-post" :class="{ leftImage: index % 2 === 0, rightImage: index % 2 !== 0 }">
<!-- 时间 -->
<div class="post-meta">
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#409EFF"></path>
<path
d="M654.222222 256c-17.066667 0-28.444444 11.377778-28.444444 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444444 28.444445s28.444444-11.377778 28.444445-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444445-28.444444zM369.777778 256c-17.066667 0-28.444444 11.377778-28.444445 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444445 28.444445s28.444444-11.377778 28.444444-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444444-28.444444z"
fill="#FFFFFF"></path>
<path
d="M725.333333 312.888889H711.111111v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-170.666666v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-14.222222c-22.755556 0-42.666667 19.911111-42.666667 42.666667v341.333333c0 22.755556 19.911111 42.666667 42.666667 42.666667h426.666666c22.755556 0 42.666667-19.911111 42.666667-42.666667v-341.333333c0-22.755556-19.911111-42.666667-42.666667-42.666667zM426.666667 654.222222h-56.888889c-17.066667 0-28.444444-11.377778-28.444445-28.444444s11.377778-28.444444 28.444445-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444444 28.444445s-11.377778 28.444444-28.444444 28.444444z m227.555555 0h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444445s-11.377778 28.444444-28.444445 28.444444z m0-113.777778h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444444h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444444s-11.377778 28.444444-28.444445 28.444444z"
fill="#FFFFFF"></path>
</svg>
发布于 {{ article.createTime }}
</div>
<!-- 标题 -->
<h3>{{ article.articleTitle }}</h3>
<!-- 信息 -->
<div class="post-meta" style="margin-bottom: 15px">
<span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path d="M14.656 512a497.344 497.344 0 1 0 994.688 0 497.344 497.344 0 1 0-994.688 0z"
fill="#FF0000"></path>
<path
d="M374.976 872.64c-48.299-100.032-22.592-157.44 14.421-211.37 40.448-58.966 51.115-117.611 51.115-117.611s31.659 41.386 19.115 106.005c56.149-62.72 66.816-162.133 58.325-200.405 127.317 88.746 181.59 281.002 108.181 423.381C1016 652.501 723.093 323.2 672.277 285.867c16.939 37.333 20.054 100.032-14.101 130.474-58.027-219.84-201.664-265.002-201.664-265.002 16.96 113.536-61.781 237.397-137.344 330.24-2.816-45.163-5.632-76.544-29.483-119.808-5.333 82.176-68.373 149.269-85.29 231.445-22.912 111.637 17.237 193.173 170.581 279.424z"
fill="#FFFFFF"></path>
</svg> {{ article.viewCount }} 热度
</span>
<span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path
d="M113.834667 291.84v449.194667a29.013333 29.013333 0 0 0 28.842666 29.013333h252.928v90.453333l160.597334-90.453333h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333h-665.6a29.013333 29.013333 0 0 0-29.696 29.013333z"
fill="#FFDEAD"></path>
<path
d="M809.130667 262.826667h-665.6a29.013333 29.013333 0 0 0-28.842667 29.013333v40.106667a29.013333 29.013333 0 0 1 28.842667-29.013334h665.6a29.013333 29.013333 0 0 1 29.013333 29.013334V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333z"
fill="#FFF3DB"></path>
<path
d="M556.202667 770.048h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V362.837333s-59.733333 392.533333-724.309333 314.709334v63.488a29.013333 29.013333 0 0 0 28.842666 29.013333h253.098667v90.453333z"
fill="#F2C182"></path>
<path
d="M619.008 632.32l101.888-35.157333-131.754667-76.117334 29.866667 111.274667zM891.904 148.992a61.44 61.44 0 0 0-84.138667 22.528l-19.968 34.133333 106.666667 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-22.528-84.138667z"
fill="#69BAF9"></path>
<path d="M775.338667 198.775467l131.669333 76.032-186.026667 322.218666-131.6864-76.032z"
fill="#F7FBFF"></path>
<path
d="M775.168 198.826667l-5.290667 9.216 59.221334 34.133333a34.133333 34.133333 0 0 1 12.458666 46.592l-139.946666 242.346667a34.133333 34.133333 0 0 1-46.762667 12.629333l-59.050667-34.133333-6.656 11.434666 88.746667 51.2L720.896 597.333333l186.026667-322.56z"
fill="#D8E3F0"></path>
<path
d="M616.448 622.592l2.56 9.728 101.888-35.157333-44.885333-25.941334-59.562667 51.370667zM891.904 148.992c-1.024 0-2.218667-0.853333-3.242667-1.536A61.610667 61.610667 0 0 1 887.466667 204.8l-19.968 34.133333-73.728-42.496-5.12 8.704 106.666666 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-23.381333-83.626667z"
fill="#599ED4"></path>
<path
d="M265.898667 417.621333H494.933333a17.066667 17.066667 0 1 0 0-34.133333H265.898667a17.066667 17.066667 0 1 0 0 34.133333zM265.898667 533.504H494.933333a17.066667 17.066667 0 0 0 0-34.133333H265.898667a17.066667 17.066667 0 0 0 0 34.133333z"
fill="#3D3D63"></path>
<path
d="M959.488 354.645333a99.84 99.84 0 0 0-23.722667-127.488 78.677333 78.677333 0 0 0-142.848-64.170666l-11.605333 20.138666a17.066667 17.066667 0 0 0-20.821333 7.168l-32.085334 55.466667H142.677333a46.250667 46.250667 0 0 0-45.909333 46.08v449.194667a46.08 46.08 0 0 0 45.909333 46.08h236.032v73.386666a17.066667 17.066667 0 0 0 8.362667 14.848 17.066667 17.066667 0 0 0 8.704 2.218667 17.066667 17.066667 0 0 0 8.362667-2.218667l156.672-88.234666h248.32a46.08 46.08 0 0 0 46.08-46.08V398.677333L921.6 283.306667a17.066667 17.066667 0 0 0-4.266667-21.504l1.877334-3.413334a65.365333 65.365333 0 0 1 10.410666 79.189334l-53.077333 91.989333a56.832 56.832 0 0 0 20.821333 77.653333 17.066667 17.066667 0 0 0 24.234667-6.314666 17.066667 17.066667 0 0 0-6.997333-23.04 23.04 23.04 0 0 1-8.362667-31.061334z m-138.410667 386.389334a11.946667 11.946667 0 0 1-11.946666 11.946666H556.202667a17.066667 17.066667 0 0 0-8.362667 2.218667l-134.997333 76.117333v-61.269333a17.066667 17.066667 0 0 0-17.066667-17.066667H142.677333a11.946667 11.946667 0 0 1-11.776-11.946666V291.84a11.946667 11.946667 0 0 1 11.776-11.946667h565.930667L574.464 512a17.066667 17.066667 0 0 0-1.706667 12.970667L597.333333 615.253333H265.898667a17.066667 17.066667 0 1 0 0 34.133334h352.938666a17.066667 17.066667 0 0 0 5.802667 0l102.4-35.328a17.066667 17.066667 0 0 0 9.216-7.509334l85.333333-147.968z m-204.8-184.661334l63.829334 36.864-49.322667 17.066667z m206.848-170.666666v1.365333l-108.373333 186.709333-102.4-59.050666L781.482667 221.866667l102.4 59.050666z m76.458667-161.28L887.466667 244.224l-76.970667-44.373333 11.264-19.797334a44.544 44.544 0 1 1 77.141333 44.544z"
fill="#3D3D63"></path>
</svg> {{ article.commentCount }} 条评论
</span>
<span>
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path
d="M510.671749 348.792894S340.102978 48.827055 134.243447 254.685563C-97.636714 486.565724 510.671749 913.435858 510.671749 913.435858s616.107079-419.070494 376.428301-658.749272c-194.095603-194.096626-376.428302 94.106308-376.428301 94.106308z"
fill="#FF713C"></path>
<path
d="M510.666632 929.674705c-3.267417 0-6.534833-0.983397-9.326413-2.950192-16.924461-11.872399-414.71121-293.557896-435.220312-529.448394-5.170766-59.482743 13.879102-111.319341 56.643068-154.075121 51.043536-51.043536 104.911398-76.930113 160.095231-76.930114 112.524796 0 196.878996 106.48115 228.475622 153.195078 33.611515-45.214784 122.406864-148.20646 234.04343-148.20646 53.930283 0 105.46603 24.205285 153.210428 71.941496 45.063335 45.063335 64.954361 99.200326 59.133795 160.920016C935.306982 641.685641 536.758893 915.327952 519.80271 926.859589a16.205077 16.205077 0 0 1-9.136078 2.815116zM282.857183 198.75574c-46.25344 0-92.396363 22.682605-137.127124 67.413365-36.149315 36.157501-51.614541 78.120218-47.25321 128.291898 17.575284 202.089671 352.199481 455.119525 412.332023 499.049037 60.434417-42.86732 395.406538-289.147446 414.567947-492.458945 4.933359-52.344159-11.341303-96.465029-49.759288-134.88199-41.431621-41.423435-85.24243-62.424748-130.242319-62.424748-122.041544 0-220.005716 152.203494-220.989114 153.742547-3.045359 4.806469-8.53335 7.883551-14.101159 7.534603a16.257266 16.257266 0 0 1-13.736863-8.184403c-0.902556-1.587148-91.569532-158.081365-213.690893-158.081364z"
fill="#885F44"></path>
</svg> {{ article.likeCount }} 点赞
</span>
</div>
<!-- 内容 -->
<div class="recent-post-desc">
{{ article.articleContent }}
</div>
<!-- 分类 标签 -->
<div class="sort-label">
<span style="margin-right: 12px"
@click.stop="$router.push({path: '/sort', query: {sortId: article.sortId}})">
<svg viewBox="0 0 1024 1024" width="15" height="15" style="vertical-align: -3px;">
<path
d="M179.2 153.6m89.6 0l588.8 0q89.6 0 89.6 89.6l0 486.4q0 89.6-89.6 89.6l-588.8 0q-89.6 0-89.6-89.6l0-486.4q0-89.6 89.6-89.6Z"
fill="#FF9C55"></path>
<path
d="M25.6 193.4208A91.0208 91.0208 0 0 1 116.6208 102.4H382.592a91.0208 91.0208 0 0 1 87.5008 65.9712l24.5504 85.7216h412.7488A91.0208 91.0208 0 0 1 998.4 345.1392v485.4528A91.0208 91.0208 0 0 1 907.3792 921.6H116.608A91.0208 91.0208 0 0 1 25.6 830.5792V193.408z"
fill="#FFD977"></path>
<path
d="M128 665.6m25.6 0l76.8 0q25.6 0 25.6 25.6l0 0q0 25.6-25.6 25.6l-76.8 0q-25.6 0-25.6-25.6l0 0q0-25.6 25.6-25.6Z"
fill="#FFF1C9"></path>
<path
d="M128 768m25.6 0l179.2 0q25.6 0 25.6 25.6l0 0q0 25.6-25.6 25.6l-179.2 0q-25.6 0-25.6-25.6l0 0q0-25.6 25.6-25.6Z"
fill="#FFF1C9"></path>
<path
d="M128 486.4m51.2 0l0 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l0 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"
fill="#FFA86A"></path>
</svg> {{ article.sort.sortName }}
</span>
<span @click.stop="$router.push({path: '/sort', query: {sortId: article.sortId, labelId: article.labelId}})">
<svg viewBox="0 0 1024 1024" width="15" height="15" style="vertical-align: -3px;">
<path
d="M905.0112 560.4352l-342.784 342.784c-56.7808 56.7808-148.7872 56.7808-205.568 0l-231.5776-231.5776c-56.7808-56.7808-56.7808-148.7872 0-205.568l342.9376-342.9376a114.8928 114.8928 0 0 1 84.224-33.5872l266.3936 7.2192c60.7744 1.6384 109.7216 50.3808 111.5648 111.1552l8.2944 267.8272c1.024 31.6928-11.1104 62.3104-33.4848 84.6848z"
fill="#8C7BFD"></path>
<path
d="M675.2256 491.4688c-82.176 0-149.0432-66.8672-149.0432-149.0432s66.8672-149.0432 149.0432-149.0432 149.0432 66.8672 149.0432 149.0432-66.8672 149.0432-149.0432 149.0432z m0-192.2048c-23.808 0-43.2128 19.3536-43.2128 43.2128 0 23.808 19.3536 43.2128 43.2128 43.2128 23.808 0 43.2128-19.3536 43.2128-43.2128s-19.4048-43.2128-43.2128-43.2128z"
fill="#FFE37B"></path>
</svg> {{ article.label.labelName }}
</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
articleList: {
type: Array
}
},
methods: {}
}
</script>
<style scoped>
.article-first {
color: var(--greyFont);
border-bottom: 1px dashed var(--lightGray);
padding-bottom: 5px;
margin-bottom: 50px;
}
.recent-post-container {
max-width: 780px;
margin: auto;
}
.recent-post-container .recent-post-item:not(:last-child) {
margin-bottom: 40px;
}
.recent-post-item {
height: 300px;
position: relative;
display: flex;
flex-direction: row;
user-select: none;
cursor: pointer;
overflow: hidden;
border-radius: 10px;
animation: zoomIn 0.8s ease-in-out;
}
.recent-post-item-image {
width: 50%;
height: 100%;
}
.recent-post-item-image >>> .el-image__inner {
transition: all 1s;
}
.recent-post-item-image >>> .el-image__inner:hover {
transform: scale(1.2);
}
.leftImage {
position: absolute;
left: 0;
}
.rightImage {
position: absolute;
right: 0;
text-align: right;
}
.recent-post-item-post {
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
padding: 20px 35px;
}
.recent-post-item-post h3 {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.post-meta {
font-size: 12px;
color: var(--greyFont);
}
.post-meta i {
font-size: 15px;
}
.post-meta span:not(:last-child) {
margin-right: 10px;
}
.recent-post-desc {
font-size: 15px;
line-height: 1.7;
/* 超出4行就... */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
}
.leftImage .sort-label {
position: absolute;
bottom: 20px;
}
.rightImage .sort-label {
position: absolute;
bottom: 20px;
right: 35px;
}
.sort-label span {
padding: 3px 10px;
background-color: var(--maxLightGray);
border-radius: 3px;
font-size: 14px;
color: var(--greyFont);
transition: all 0.3s;
cursor: pointer;
user-select: none;
}
.sort-label span:hover {
background-color: var(--themeBackground);
color: var(--white);
}
.error-text {
font-size: 20px;
line-height: 1.8;
letter-spacing: 8px;
color: var(--white);
}
@media screen and (max-width: 700px) {
.recent-post-item {
height: 450px;
position: unset;
display: block;
flex-direction: unset;
}
.recent-post-item-image {
width: 100%;
height: 170px;
}
.leftImage {
position: unset;
left: unset;
}
.rightImage {
position: unset;
right: unset;
text-align: unset;
}
.recent-post-item-post {
width: 100%;
height: 280px;
position: relative;
}
.leftImage .sort-label {
position: absolute;
bottom: 20px;
}
.rightImage .sort-label {
position: absolute;
bottom: 20px;
right: unset;
}
}
</style>

@ -0,0 +1,413 @@
<template>
<div>
<!-- 评论框 -->
<div style="margin-bottom: 40px">
<div class="comment-head">
<i class="el-icon-edit-outline" style="font-weight: bold;font-size: 22px;"></i> 评论
</div>
<div>
<!-- 文字评论 -->
<div v-show="!isGraffiti">
<commentBox @showGraffiti="isGraffiti = !isGraffiti"
@submitComment="submitComment">
</commentBox>
</div>
<!-- 画笔 -->
<!-- <div v-show="isGraffiti">-->
<!-- <graffiti @showComment="isGraffiti = !isGraffiti"-->
<!-- @addGraffitiComment="addGraffitiComment">-->
<!-- </graffiti>-->
<!-- </div>-->
</div>
</div>
<!-- 评论内容 -->
<div v-if="comments.length > 0">
<!-- 评论数量 -->
<div class="commentInfo-title">
<span style="font-size: 1.15rem">Comments | </span>
<span>{{ total }} 条评论</span>
</div>
<!-- 评论详情 -->
<div id="comment-content" class="commentInfo-detail"
v-for="(item, index) in comments"
:key="index">
<!-- 头像 -->
<el-avatar shape="square" class="commentInfo-avatar" :size="35" :src="item.avatar"></el-avatar>
<div style="flex: 1;padding-left: 12px">
<!-- 评论信息 -->
<div style="display: flex;justify-content: space-between">
<div>
<span class="commentInfo-username">{{ item.username }}</span>
<span class="commentInfo-master" v-if="item.userId === userId"></span>
<span class="commentInfo-other">{{ $common.getDateDiff(item.createTime) }}</span>
</div>
<div class="commentInfo-reply" @click="replyDialog(item, item)">
<span v-if="item.childComments.total > 0">{{item.childComments.total}} </span><span>回复</span>
</div>
</div>
<!-- 评论内容 -->
<div class="commentInfo-content">
<span v-html="item.commentContent"></span>
</div>
<!-- 回复模块 -->
<div v-if="!$common.isEmpty(item.childComments) && !$common.isEmpty(item.childComments.records)">
<div class="commentInfo-detail" v-for="(childItem, i) in item.childComments.records" :key="i">
<!-- 头像 -->
<el-avatar shape="square" class="commentInfo-avatar" :size="30" :src="childItem.avatar"></el-avatar>
<div style="flex: 1;padding-left: 12px">
<!-- 评论信息 -->
<div style="display: flex;justify-content: space-between">
<div>
<span class="commentInfo-username-small">{{ childItem.username }}</span>
<span class="commentInfo-master" v-if="childItem.userId === userId"></span>
<span class="commentInfo-other">{{ $common.getDateDiff(childItem.createTime) }}</span>
</div>
<div>
<span class="commentInfo-reply" @click="replyDialog(childItem, item)">回复</span>
</div>
</div>
<!-- 评论内容 -->
<div class="commentInfo-content">
<template v-if="childItem.parentCommentId !== item.id &&
childItem.parentUserId !== childItem.userId">
<span style="color: var(--blue)">@{{ childItem.parentUsername }} </span>:
</template>
<span v-html="childItem.commentContent"></span>
</div>
</div>
</div>
<!-- 分页 -->
<div class="pagination-wrap" v-if="item.childComments.records.length < item.childComments.total">
<div class="pagination"
@click="toChildPage(item)">
展开
</div>
</div>
</div>
</div>
</div>
<!-- 分页 -->
<proPage :current="pagination.current"
:size="pagination.size"
:total="pagination.total"
:buttonSize="6"
:color="$constant.commentPageColor"
@toPage="toPage">
</proPage>
</div>
<div v-else class="myCenter" style="color: var(--greyFont)">
<i>来发第一个评论啦~</i>
</div>
<el-dialog title="评论"
:visible.sync="replyDialogVisible"
width="30%"
:before-close="handleClose"
:append-to-body="true"
destroy-on-close
center>
<div>
<commentBox :disableGraffiti="true"
@submitComment="submitReply">
</commentBox>
</div>
</el-dialog>
</div>
</template>
<script>
// const graffiti = () => import( "./graffiti");
const commentBox = () => import( "./commentBox");
const proPage = () => import( "../common/proPage");
export default {
components: {
// graffiti,
commentBox,
proPage
},
props: {
source: {
type: Number
},
userId: {
type: Number
}
},
data() {
return {
isGraffiti: false,
total: 0,
replyDialogVisible: false,
floorComment: {},
replyComment: {},
comments: [],
pagination: {
current: 1,
size: 10,
total: 0,
source: this.source,
floorCommentId: null
}
};
},
computed: {},
created() {
this.getComments(this.pagination);
this.getTotal();
},
methods: {
toPage(page) {
this.pagination.current = page;
window.scrollTo({
top: document.getElementById('comment-content').offsetTop
});
this.getComments(this.pagination);
},
getTotal() {
this.$http.get(this.$constant.baseURL + "/comment/getCommentCount", {source: this.source})
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.total = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
toChildPage(floorComment) {
floorComment.childComments.current += 1;
let pagination = {
current: floorComment.childComments.current,
size: 5,
total: 0,
source: this.source,
floorCommentId: floorComment.id
}
this.getComments(pagination, floorComment, true);
},
emoji(comments, flag) {
comments.forEach(c => {
c.commentContent = c.commentContent.replace(/\n/g, '<br/>');
c.commentContent = this.$common.faceReg(c.commentContent);
c.commentContent = this.$common.pictureReg(c.commentContent);
if (flag) {
if (!this.$common.isEmpty(c.childComments) && !this.$common.isEmpty(c.childComments.records)) {
c.childComments.records.forEach(cc => {
c.commentContent = c.commentContent.replace(/\n/g, '<br/>');
cc.commentContent = this.$common.faceReg(cc.commentContent);
cc.commentContent = this.$common.pictureReg(cc.commentContent);
});
}
}
});
},
getComments(pagination, floorComment = {}, isToPage = false) {
this.$http.post(this.$constant.baseURL + "/comment/listComment", pagination)
.then((res) => {
if (!this.$common.isEmpty(res.data) && !this.$common.isEmpty(res.data.records)) {
if (this.$common.isEmpty(floorComment)) {
this.comments = res.data.records;
pagination.total = res.data.total;
this.emoji(this.comments, true);
} else {
if (isToPage === false) {
floorComment.childComments = res.data;
} else {
floorComment.childComments.total = res.data.total;
floorComment.childComments.records = floorComment.childComments.records.concat(res.data.records);
}
this.emoji(floorComment.childComments.records, false);
}
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
addGraffitiComment(graffitiComment) {
this.submitComment(graffitiComment);
},
submitComment(commentContent) {
let comment = {
source: this.source,
commentContent: commentContent
};
this.$http.post(this.$constant.baseURL + "/comment/saveComment", comment)
.then((res) => {
this.$message({
type: 'success',
message: '保存成功!'
});
this.pagination = {
current: 1,
size: 10,
total: 0,
source: this.source,
floorCommentId: null
}
this.getComments(this.pagination);
this.getTotal();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitReply(commentContent) {
let comment = {
source: this.source,
floorCommentId: this.floorComment.id,
commentContent: commentContent,
parentCommentId: this.replyComment.id,
parentUserId: this.replyComment.userId
};
let floorComment = this.floorComment;
this.$http.post(this.$constant.baseURL + "/comment/saveComment", comment)
.then((res) => {
let pagination = {
current: 1,
size: 5,
total: 0,
source: this.source,
floorCommentId: floorComment.id
}
this.getComments(pagination, floorComment);
this.getTotal();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.handleClose();
},
replyDialog(comment, floorComment) {
this.replyComment = comment;
this.floorComment = floorComment;
this.replyDialogVisible = true;
},
handleClose() {
this.replyDialogVisible = false;
this.floorComment = {};
this.replyComment = {};
}
}
}
</script>
<style scoped>
.comment-head {
display: flex;
align-items: center;
font-size: 20px;
font-weight: bold;
margin: 40px 0 20px 0;
user-select: none;
color: var(--themeBackground);
}
.commentInfo-title {
margin-bottom: 20px;
color: var(--greyFont);
user-select: none;
}
.commentInfo-detail {
display: flex;
}
.commentInfo-avatar {
border-radius: 5px;
}
.commentInfo-username {
color: var(--orangeRed);
font-size: 16px;
font-weight: 600;
margin-right: 5px;
}
.commentInfo-username-small {
color: var(--orangeRed);
font-size: 14px;
font-weight: 600;
margin-right: 5px;
}
.commentInfo-master {
color: var(--green);
border: 1px solid var(--green);
border-radius: 0.2rem;
font-size: 12px;
padding: 2px 4px;
margin-right: 5px;
}
.commentInfo-other {
font-size: 12px;
color: var(--greyFont);
user-select: none;
}
.commentInfo-reply {
font-size: 12px;
cursor: pointer;
user-select: none;
color: var(--white);
background: var(--themeBackground);
border-radius: 0.2rem;
padding: 3px 6px;
}
.commentInfo-content {
margin: 15px 0 25px;
padding: 18px 20px;
background: var(--commentContent);
border-radius: 12px;
color: var(--black);
word-break: break-word;
}
.pagination-wrap {
display: flex;
justify-content: center;
margin-bottom: 10px;
}
.pagination {
padding: 6px 20px;
border: 1px solid var(--lightGray);
border-radius: 3rem;
color: var(--greyFont);
user-select: none;
cursor: pointer;
text-align: center;
font-size: 12px;
}
.pagination:hover {
border: 1px solid var(--themeBackground);
color: var(--themeBackground);
box-shadow: 0 0 5px var(--themeBackground);
}
</style>

@ -0,0 +1,209 @@
<template>
<div>
<!-- -->
<textarea
class="comment-textarea"
v-model="commentContent"
placeholder="写下点什么..."
maxlength="2500"/>
<!-- 按钮 -->
<div class="myBetween" style="margin-bottom: 10px">
<div style="display: flex">
<div :class="{'emoji-active':showEmoji}"
@click="showEmoji = !showEmoji">
<i class="el-icon-orange myEmoji"></i>
</div>
<div @click="openPicture()">
<i class="el-icon-picture myPicture"></i>
</div>
</div>
<div style="display: flex">
<!-- <proButton :info="'涂鸦'"-->
<!-- v-show="!$common.mobile() && !disableGraffiti"-->
<!-- @click.native="showGraffiti()"-->
<!-- :before="$constant.before_color_1"-->
<!-- :after="$constant.after_color_1"-->
<!-- style="margin-right: 6px">-->
<!-- </proButton>-->
<proButton :info="'提交'"
@click.native="submitComment()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
<!-- 表情 -->
<emoji @addEmoji="addEmoji" :showEmoji="showEmoji"></emoji>
<el-dialog title="图片"
:visible.sync="showPicture"
width="25%"
:append-to-body="true"
destroy-on-close
center>
<div>
<uploadPicture :prefix="'commentPicture'" @addPicture="addPicture" :maxSize="5"
:maxNumber="1"></uploadPicture>
</div>
</el-dialog>
</div>
</template>
<script>
const emoji = () => import( "../common/emoji");
const proButton = () => import( "../common/proButton");
const uploadPicture = () => import( "../common/uploadPicture");
export default {
components: {
emoji,
proButton,
uploadPicture
},
props: {
disableGraffiti: {
type: Boolean,
default: false
}
},
data() {
return {
commentContent: "",
showEmoji: false,
showPicture: false,
picture: {
name: this.$store.state.currentUser.username,
url: ""
}
};
},
methods: {
openPicture() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
this.showPicture = true;
},
addPicture(res) {
this.picture.url = res;
this.savePicture();
},
savePicture() {
let img = "<" + this.picture.name + "," + this.picture.url + ">";
this.commentContent += img;
this.picture.url = "";
this.showPicture = false;
},
addEmoji(key) {
this.commentContent += key;
},
showGraffiti() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
this.commentContent = "";
this.$emit("showGraffiti");
},
submitComment() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
if (this.commentContent.trim() === "") {
this.$message({
message: "你还没写呢~",
type: "warning",
});
return;
}
this.$emit("submitComment", this.commentContent.trim());
this.commentContent = "";
}
}
}
</script>
<style scoped>
.comment-textarea {
border: 1px solid var(--lightGray);
width: 100%;
font-size: 14px;
padding: 15px;
min-height: 180px;
/* 不改变大小 */
resize: none;
/* 不改变边框 */
outline: none;
border-radius: 4px;
background-image: var(--commentURL);
background-size: contain;
background-repeat: no-repeat;
background-position: 100%;
margin-bottom: 10px;
}
.comment-textarea:focus {
border-color: var(--themeBackground);
}
.myEmoji {
font-size: 18px;
cursor: pointer;
transition: all 0.5s;
margin-right: 12px;
}
.myEmoji:hover {
transform: rotate(360deg);
font-size: 22px;
}
.myPicture {
font-size: 18px;
cursor: pointer;
}
.emoji-active {
color: var(--red);
}
</style>

@ -0,0 +1,390 @@
<template>
<div>
<!-- 画布 -->
<div style="padding: 5px" @mousemove="canvasOutMove($event)" @touchmove="canvasOutMove($event)">
<div class="graffiti-container">
<canvas id="canvas"
width="766"
height="400"
@mousedown="canvasDown($event)"
@mouseup="canvasUp($event)"
@mousemove="canvasMove($event)"
@touchstart="canvasDown($event)"
@touchend="canvasUp($event)"
@touchmove="canvasMove($event)">
</canvas>
</div>
</div>
<div style="padding: 10px 0 0 5px;">
<!-- 颜色 -->
<div class="graffiti-tools">
<span class="graffiti-title">画笔颜色</span>
<div class="myCenter" style="margin-left: 2rem">
<div v-for="(color, index) in colors"
:class="{ activeColor: config.lineColor === color }"
:style="{ background: color }"
@click="setColor(color)"
class="graffiti-color"
:key="index">
</div>
</div>
</div>
<!-- 大小 -->
<div class="graffiti-tools">
<span class="graffiti-title">画笔大小</span>
<div class="myCenter" style="margin-left: 2rem">
<i v-for="(pen, index) in brushSize"
:key="index"
class="graffiti-size"
:class="[pen.className, { activeSize: config.lineWidth === pen.lineWidth }]"
@click="setBrush(pen.lineWidth)">
</i>
</div>
</div>
<!-- 操作 -->
<div class="graffiti-tools">
<span class="graffiti-title">操作</span>
<div class="myCenter" style="margin-left: 3.7rem">
<i v-for="(control, index) in controls"
:title="control.title"
:class="control.className"
class="graffiti-operate"
@click="controlCanvas(control.action)"
:key="index">
</i>
</div>
</div>
<!-- 按钮 -->
<div class="graffiti-tools" style="justify-content: center">
<proButton :info="'文字'"
@click.native="showComment()"
:before="$constant.before_color_1"
:after="$constant.after_color_1"
style="margin-right: 6px">
</proButton>
<proButton :info="'提交'"
@click.native="getImage()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
</div>
</template>
<script>
const proButton = () => import( "../common/proButton");
export default {
components: {
proButton
},
data() {
return {
token: "",
context: {},
canvasMoveUse: false,
// -
preDrawAry: [],
// -
nextDrawAry: [],
//
middleAry: [],
//
config: {
lineWidth: 5,
lineColor: "#8154A3",
shadowBlur: 2,
},
colors: ["#8154A3", "#fef4ac", "#0018ba", "#ffc200", "#f32f15", "#cccccc", "#5ab639"],
brushSize: [{
className: "small el-icon-edit",
lineWidth: 5,
}, {
className: "middle el-icon-edit",
lineWidth: 10,
}, {
className: "big el-icon-edit",
lineWidth: 15,
}]
};
},
computed: {
controls() {
return [{
title: "上一步",
action: "prev",
className: this.preDrawAry.length
? "active el-icon-arrow-left"
: "ban el-icon-arrow-left",
}, {
title: "下一步",
action: "next",
className: this.nextDrawAry.length
? "active el-icon-arrow-right"
: "ban el-icon-arrow-right",
}, {
title: "清除",
action: "clear",
className:
this.preDrawAry.length || this.nextDrawAry.length
? "active el-icon-refresh"
: "ban el-icon-refresh",
}];
}
},
mounted() {
const canvas = document.querySelector("#canvas");
this.context = canvas.getContext("2d", {willReadFrequently: true});
this.initDraw();
this.setCanvasStyle();
},
created() {
if (!this.$common.isEmpty(this.$store.state.currentUser) && !this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.getUpToken();
}
},
methods: {
getUpToken() {
this.$http.get(this.$constant.baseURL + "/qiniu/getUpToken")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.token = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
canvasOutMove(e) {
const canvas = document.querySelector("#canvas");
if (e.target !== canvas) {
this.canvasMoveUse = false;
}
},
initDraw() {
const preData = this.context.getImageData(0, 0, 1200, 600);
//
this.middleAry.push(preData);
},
canvasUp(e) {
const preData = this.context.getImageData(0, 0, 1200, 600);
if (!this.nextDrawAry.length) {
//
this.middleAry.push(preData);
} else {
this.middleAry = [];
this.middleAry = this.middleAry.concat(this.preDrawAry);
this.middleAry.push(preData);
this.nextDrawAry = [];
}
this.canvasMoveUse = false;
this.context.beginPath();
},
canvasDown(e) {
this.canvasMoveUse = true;
// client
// offsetcanvas
this.setCanvasStyle();
//
this.context.beginPath();
this.context.moveTo(e.layerX, e.layerY);
//
const preData = this.context.getImageData(0, 0, 1200, 600);
//
this.preDrawAry.push(preData);
},
canvasMove(e) {
if (this.canvasMoveUse) {
this.context.lineTo(e.layerX, e.layerY);
this.context.stroke();
}
},
//
setCanvasStyle() {
this.context.lineWidth = this.config.lineWidth;
this.context.shadowBlur = this.config.shadowBlur;
this.context.shadowColor = this.config.lineColor;
this.context.strokeStyle = this.config.lineColor;
},
//
setColor(color) {
this.config.lineColor = color;
},
//
setBrush(size) {
this.config.lineWidth = size;
},
controlCanvas(action) {
switch (action) {
case "prev":
if (this.preDrawAry.length) {
const popData = this.preDrawAry.pop();
const midData = this.middleAry[this.preDrawAry.length + 1];
this.nextDrawAry.push(midData);
this.context.putImageData(popData, 0, 0);
}
break;
case "next":
if (this.nextDrawAry.length) {
const popData = this.nextDrawAry.pop();
const midData = this.middleAry[this.middleAry.length - this.nextDrawAry.length - 2];
this.preDrawAry.push(midData);
this.context.putImageData(popData, 0, 0);
}
break;
case "clear":
this.clearContext();
this.middleAry = [this.middleAry[0]];
break;
}
},
clearContext() {
this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height);
this.preDrawAry = [];
this.nextDrawAry = [];
},
showComment() {
this.clearContext();
this.$emit("showComment");
},
getImage() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.token)) {
this.$message({
message: "上传出错!",
type: "warning"
});
return;
}
if (this.preDrawAry.length < 1) {
this.$message({
message: "你还没画呢~",
type: "warning",
});
return;
}
const canvas = document.querySelector("#canvas");
const dataURL = canvas.toDataURL("image/png");
let arr = dataURL.split(","),
mine = arr[0].match(/:(.*?);/)[1],
str = atob(arr[1]),
n = str.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = str.charCodeAt(n);
}
let obj = new Blob([u8arr], {type: mine});
let fd = new FormData();
fd.append("file", obj);
fd.append("token", this.token);
fd.append("key", "graffiti" + "/" + this.$store.state.currentUser.username.replace(/[^a-zA-Z]/g, '') + this.$store.state.currentUser.id + new Date().getTime());
this.$http.uploadQiniu(this.$constant.qiniuUrl, fd)
.then((res) => {
if (!this.$common.isEmpty(res.key)) {
this.clearContext();
let url = this.$constant.qiniuDownload + res.key;
this.$common.saveResource(this, "graffiti", url);
let img = "<你画我猜," + url + ">";
this.$emit("addGraffitiComment", img);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.graffiti-container {
overflow: hidden;
border: 2px var(--lightGray) solid;
border-radius: 4px;
}
.graffiti-tools {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.graffiti-title {
font-size: 14px;
}
.graffiti-color {
width: 1rem;
height: 1rem;
border-radius: 50%;
float: left;
margin-right: 20px;
cursor: pointer;
transition: all 0.2s;
}
.graffiti-color:hover {
width: 1.3rem;
height: 1.3rem;
}
.activeColor {
width: 1.3rem;
height: 1.3rem;
}
.graffiti-size {
cursor: pointer;
margin-right: 20px;
}
.graffiti-size.small {
font-size: 14px;
}
.graffiti-size.middle {
font-size: 16px;
}
.graffiti-size.big {
font-size: 18px;
}
.activeSize {
background-color: var(--themeBackground);
color: var(--white);
border-radius: 50%;
padding: 2px;
}
.graffiti-operate {
margin-right: 20px;
cursor: pointer;
font-size: 18px;
}
.graffiti-operate.ban {
cursor: not-allowed
}
</style>

@ -0,0 +1,160 @@
<template>
<div class="card-container" v-if="!$common.isEmpty(resourcePathList)">
<div v-for="(resourcePath, index) in resourcePathList"
:key="index"
class="card-item shadow-box wow"
@click="clickResourcePath(resourcePath)">
<div class="card-image">
<el-image class="my-el-image"
v-once
:src="resourcePath.cover"
fit="cover">
<div slot="error" class="image-slot myCenter" style="background-color: var(--lightGreen)">
<div class="error-text">
<div>遇事不决可问春风</div>
</div>
</div>
</el-image>
</div>
<div class="card-body">
<div class="card-title">
<span v-if="resourcePath.recommendStatus">
🔥
</span>
{{resourcePath.title}}
</div>
<div class="card-desc">
{{resourcePath.introduction}}
</div>
<div class="card-time">
<svg viewBox="0 0 1024 1024" width="14" height="14" style="vertical-align: -2px;">
<path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#409EFF"></path>
<path
d="M654.222222 256c-17.066667 0-28.444444 11.377778-28.444444 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444444 28.444445s28.444444-11.377778 28.444445-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444445-28.444444zM369.777778 256c-17.066667 0-28.444444 11.377778-28.444445 28.444444v56.888889c0 17.066667 11.377778 28.444444 28.444445 28.444445s28.444444-11.377778 28.444444-28.444445v-56.888889c0-17.066667-11.377778-28.444444-28.444444-28.444444z"
fill="#FFFFFF"></path>
<path
d="M725.333333 312.888889H711.111111v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-170.666666v28.444444c0 31.288889-25.6 56.888889-56.888889 56.888889s-56.888889-25.6-56.888889-56.888889v-28.444444h-14.222222c-22.755556 0-42.666667 19.911111-42.666667 42.666667v341.333333c0 22.755556 19.911111 42.666667 42.666667 42.666667h426.666666c22.755556 0 42.666667-19.911111 42.666667-42.666667v-341.333333c0-22.755556-19.911111-42.666667-42.666667-42.666667zM426.666667 654.222222h-56.888889c-17.066667 0-28.444444-11.377778-28.444445-28.444444s11.377778-28.444444 28.444445-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444444 28.444445s-11.377778 28.444444-28.444444 28.444444z m227.555555 0h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444445h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444445s-11.377778 28.444444-28.444445 28.444444z m0-113.777778h-56.888889c-17.066667 0-28.444444-11.377778-28.444444-28.444444s11.377778-28.444444 28.444444-28.444444h56.888889c17.066667 0 28.444444 11.377778 28.444445 28.444444s-11.377778 28.444444-28.444445 28.444444z"
fill="#FFFFFF"></path>
</svg>
发布于 {{ $common.getDateDiff(resourcePath.createTime) }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
resourcePathList: {
type: Array
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {
clickResourcePath(resourcePath) {
this.$emit("clickResourcePath", resourcePath.url);
}
}
}
</script>
<style scoped>
.card-container {
display: flex;
flex-wrap: wrap;
}
.card-item {
position: relative;
border-radius: 10px;
background: rgba(255, 255, 255, .88);
overflow: hidden;
margin: 10px;
height: 300px;
flex-shrink: 0;
width: calc(100% / 3 - 20px);
cursor: pointer;
animation: zoomIn 0.8s ease-in-out;
}
.card-image {
width: 100%;
height: 180px;
}
.card-image >>> .el-image__inner {
transition: all 1s;
}
.card-image >>> .el-image__inner:hover {
transform: scale(1.2);
}
.card-body {
padding: 10px 20px;
}
.card-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 10px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
transition: all .2s ease-in-out;
}
.card-title:hover {
color: var(--lightGreen);
}
.card-desc {
font-size: 14px;
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
letter-spacing: 1px;
}
.card-time {
position: absolute;
bottom: 10px;
font-size: 12px;
color: var(--greyFont);
}
@media screen and (max-width: 700px) {
.card-item {
width: calc(100% / 2 - 20px);
}
}
@media screen and (max-width: 500px) {
.card-item {
width: calc(100% - 20px);
}
}
</style>

@ -0,0 +1,79 @@
<template>
<div>
<transition name="body">
<div v-show="showEmoji">
<span class="emoji-item"
v-for="(value, key, index) in emojiListURL"
:key="index"
@click="addEmoji(key)">
<img class="emoji" :src="value" :title="key" width="24px" height="24px"/>
</span>
</div>
</transition>
</div>
</template>
<script>
export default {
props: {
showEmoji: {
type: Boolean
}
},
data() {
return {
emojiList: this.$constant.emojiList,
emojiListURL: {}
};
},
created() {
this.emojiListURL = this.getEmojiList(this.emojiList);
},
methods: {
addEmoji(key) {
this.$emit("addEmoji", key);
},
getEmojiList(emojiList) {
let emojiName;
let url;
let result = {}
for (let i = 0; i < emojiList.length; i++) {
emojiName = "[" + emojiList[i] + "]";
let j = i + 1;
url = "https://pzh-blog-photo.oss-cn-shenzhen.aliyuncs.com/emoji/q" + j + ".gif";
result[emojiName] = url;
}
return result;
}
}
}
</script>
<style scoped>
.emoji-item {
cursor: pointer;
display: inline-block;
}
.emoji-item:hover {
transition: all 0.2s;
border-radius: 0.25rem;
background: var(--lightGray);
}
.emoji {
margin: 0.25rem;
/* 把此元素放置在父元素的中部 */
vertical-align: middle;
}
.body-enter-active, .body-leave-active {
transition: all 0.3s;
}
.body-enter, .body-leave-to {
opacity: 0;
transform: scale(0.5);
}
</style>

@ -0,0 +1,66 @@
<template>
<div>
<!-- 加载动画 -->
<transition name="loader">
<div v-show="loaderVisible">
<slot name="loader"></slot>
</div>
</transition>
<!-- 内容 -->
<transition name="body">
<div v-show="bodyVisible">
<slot name="body"></slot>
</div>
</transition>
</div>
</template>
<script>
export default {
props: {
loading: {
type: Boolean,
default: false
}
},
data() {
return {
loaderVisible: this.loading,
bodyVisible: !this.loading
};
},
watch: {
loading(loading) {
this.loaderVisible = loading;
setTimeout(() => {
this.bodyVisible = !loading;
}, 300);
}
}
};
</script>
<style scoped>
/*
v-enter定义进入过渡的开始状态
v-enter-active定义进入过渡生效时的状态
v-enter-to2.1.8 版及以上定义进入过渡的结束状态
v-leave定义离开过渡的开始状态
v-leave-active定义离开过渡生效时的状态
v-leave-to2.1.8 版及以上定义离开过渡的结束状态
*/
.loader-enter-active,
.loader-leave-active,
.body-enter-active,
.body-leave-active {
transition: all 0.5s;
}
.loader-enter, .loader-leave-to {
opacity: 0;
}
.body-enter, .body-leave-to {
opacity: 0;
transform: scale(0.5) translateY(50%);
}
</style>

@ -0,0 +1,65 @@
<template>
<div class="myFooter-wrap" v-show="showFooter">
<div class="myFooter">
<div class="footer-title">{{$store.state.webInfo.footer}}</div>
<div class="icp">本网站由 <a href="https://poetize.cn" target="_blank">寻国记</a> 强力支持</div>
</div>
</div>
</template>
<script>
export default {
props: {
showFooter: {
type: Boolean,
default: true
}
},
data() {
return {}
},
created() {
}
}
</script>
<style scoped>
.myFooter-wrap {
user-select: none;
animation: hideToShow 2s;
}
.myFooter {
border-radius: 1.5rem 1.5rem 0 0;
background: var(--gradientBG);
text-align: center;
color: var(--white);
background-size: 300% 300%;
animation: gradientBG 10s ease infinite;
}
.footer-title {
padding-top: 10px;
font-size: 16px;
}
.icp, .icp a {
color: var(--maxGreyFont);
font-size: 13px;
}
.icp {
padding-top: 10px;
padding-bottom: 10px;
}
.icp a {
text-decoration: none;
transition: all 0.3s;
}
.icp a:hover {
color: var(--themeBackground);
}
</style>

@ -0,0 +1,121 @@
<template>
<div>
<slot name="paper" :content="content"></slot>
</div>
</template>
<script>
export default {
props: {
//
printerInfo: {
type: String,
default: ""
},
//
duration: {
type: Number,
default: 100
},
//
delay: {
type: Number,
default: 3000
},
working: {
type: Boolean,
default: true
},
once: {
type: Boolean,
default: false
}
},
data() {
return {
content: "",
cursor: 0,
timer: null,
timeout: null,
print: true
};
},
created() {
if (this.working) {
//this.work
//this.work()
this.start(this.work);
} else {
this.content = this.printerInfo
}
},
watch: {
working(newVal) {
this.toBegin();
},
printerInfo(newVal) {
this.toBegin();
},
cursor(cursor) {
//slice(start,end)end
this.content = this.printerInfo.slice(0, cursor)
}
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
/**
* 定时
*/
start(work) {
//
this.timeout = setTimeout(() => {
//
this.timer = setInterval(() => {
work();
if (this.cursor === 0 || (this.cursor === this.printerInfo.length && !this.once)) {
//
clearInterval(this.timer);
this.start(this.work);
} else if (this.cursor === this.printerInfo.length && this.once) {
clearInterval(this.timer);
}
}, this.duration);
}, this.delay)
},
/**
* 逻辑
*/
work() {
let cursor = this.cursor;
cursor += this.print ? 1 : -1;
if (this.print) {
if (cursor === this.printerInfo.length + 1) {
cursor -= 2;
this.print = !this.print;
}
} else {
if (cursor === -1) {
cursor += 2;
this.print = !this.print;
}
}
this.cursor = cursor;
},
toBegin() {
this.cursor = 0;
if (this.timeout !== null) {
clearTimeout(this.timeout);
if (this.timer !== null) {
clearInterval(this.timer);
}
}
if (this.working) {
this.start(this.work);
} else {
this.content = this.printerInfo;
}
}
}
};
</script>

@ -0,0 +1,72 @@
<template>
<div class="myButton">
<div :style="beforeColor">{{info}}</div>
<div :style="afterColor">{{info}}</div>
<div :style="afterColor">{{info}}</div>
</div>
</template>
<script>
export default {
props: {
info: {
type: String,
default: "确定"
},
before: {
type: String
},
after: {
type: String
}
},
data() {
return {
beforeColor: {"background": this.before},
afterColor: {"background": this.after}
};
}
}
</script>
<style scoped>
.myButton {
cursor: pointer;
user-select: none;
position: relative;
width: 66px;
height: 33px;
border-radius: 4px;
color: var(--white);
font-size: 14px;
overflow: hidden;
}
.myButton div {
width: 66px;
height: 33px;
line-height: 33px;
border-radius: 4px;
text-align: center;
position: absolute;
}
.myButton div:nth-child(2) {
width: 100px;
transition: all 0.3s ease;
transform: translateX(-120px) skewX(-30deg);
}
.myButton div:nth-child(3) {
transition: all 0.3s ease;
transform: translateX(-120px);
}
.myButton:hover div:nth-child(2) {
transform: translateX(20px) skewX(-30deg);
}
.myButton:hover div:nth-child(3) {
transform: translateX(0px);
}
</style>

@ -0,0 +1,131 @@
<template>
<div v-if="total > size" class="myCenter">
<ul class="page-content">
<li class="page-item" v-if="current !== 1" @click="toPage(-1)">
👈
</li>
<template v-if="current === 1">
<li class="page-item"
:style="{background: index === 1 ? color : '', color: index === 1 ? 'var(--white)' : ''}"
v-for="index of realButtonSize"
:key="index"
@click="toPage(index)">
{{index}}
</li>
</template>
<template v-else-if="current === totalSize">
<li class="page-item"
:style="{background: index === realButtonSize ? color : '', color: index === realButtonSize ? 'var(--white)' : ''}"
v-for="index of realButtonSize"
:key="index"
@click="toPage(current - (realButtonSize - index))">
{{current - (realButtonSize - index)}}
</li>
</template>
<template v-else>
<li class="page-item"
:style="{background: Math.ceil(realButtonSize/2) - index === 0 ? color : '', color: Math.ceil(realButtonSize/2) - index === 0 ? 'var(--white)' : ''}"
v-for="index of realButtonSize"
:key="index"
@click="toPage(current - (Math.ceil(realButtonSize/2) - index))">
{{current - (Math.ceil(realButtonSize/2) - index)}}
</li>
</template>
<li class="page-item" v-if="current !== totalSize" @click="toPage(-2)">
👉
</li>
</ul>
</div>
</template>
<script>
export default {
props: {
current: {
type: Number,
default: 1
},
size: {
type: Number,
default: 10
},
total: {
type: Number,
default: 0
},
buttonSize: {
type: Number,
default: 3
},
color: {
type: String,
default: ""
}
},
data() {
return {
totalSize: 0,
realButtonSize: 0
}
},
computed: {},
watch: {
total(newVal) {
this.totalSize = Math.ceil(this.total / this.size);
this.realButtonSize = this.buttonSize < this.totalSize ? this.buttonSize : this.totalSize;
}
},
created() {
this.totalSize = Math.ceil(this.total / this.size);
this.realButtonSize = this.buttonSize < this.totalSize ? this.buttonSize : this.totalSize;
},
mounted() {
},
methods: {
toPage(flag) {
if (flag === -1) {
this.$emit("toPage", this.current - 1);
} else if (flag === -2) {
this.$emit("toPage", this.current + 1);
} else {
this.$emit("toPage", flag);
}
}
}
}
</script>
<style scoped>
.page-content {
display: flex;
padding: 0;
margin: 30px 0;
}
.page-item {
margin: 0 10px;
list-style: none;
border: 1px solid var(--lightGray);
width: 40px;
height: 40px;
line-height: 38px;
text-align: center;
border-radius: 50%;
color: var(--black);
font-size: 14px;
cursor: pointer;
}
.page-item:hover {
border: 1px solid var(--themeBackground);
box-shadow: 0 0 5px var(--themeBackground);
}
</style>

@ -0,0 +1,39 @@
<template>
<div class="myTag" :style="bg">
<span class="name">🔖 {{info}}</span>
</div>
</template>
<script>
export default {
props: {
info: {
type: String,
default: "一只小毛驴"
},
color: {
type: String
}
},
data() {
return {
bg: {"background": this.color}
};
}
}
</script>
<style scoped>
.myTag {
cursor: pointer;
color: var(--white);
border-radius: 5px;
padding: 8px;
}
.myTag:hover {
background: var(--gradualRed) !important;
}
</style>

@ -0,0 +1,112 @@
<template>
<div v-if="!$common.isEmpty(treeHoleList)">
<div class="process-line">
<div class="process-item"
v-for="(treeHole, index) in treeHoleList"
:key="index">
<div class="timeline-item-time">
<span>
{{$common.getDateDiff(treeHole.createTime)}}
</span>
<span @click="deleteTreeHole(treeHole.id)"
class="process-delete"
v-if="!$common.isEmpty($store.state.currentUser) && $store.state.currentUser.id === treeHole.userId">
<svg viewBox="0 0 1024 1024" width="16" height="16" style="vertical-align: -3px">
<path
d="M921.1392 155.392h-270.592v-48.2816c0-22.7328-18.432-41.1648-41.1648-41.1648H426.3424a41.1648 41.1648 0 0 0-41.1648 41.1648v48.2816H110.6432c-14.1312 0-25.6 11.4688-25.6 25.6s11.4688 25.6 25.6 25.6h810.496c14.1312 0 25.6-11.4688 25.6-25.6s-11.4688-25.6-25.6-25.6zM170.8032 260.0448v592.8448c0 50.8928 41.2672 92.16 92.16 92.16h500.6848c50.8928 0 92.16-41.2672 92.16-92.16V260.0448H170.8032z m249.1392 462.7968c0 14.1312-11.4688 25.6-25.6 25.6s-25.6-11.4688-25.6-25.6V443.0848c0-14.1312 11.4688-25.6 25.6-25.6s25.6 11.4688 25.6 25.6v279.7568z m243.1488 0c0 14.1312-11.4688 25.6-25.6 25.6s-25.6-11.4688-25.6-25.6V443.0848c0-14.1312 11.4688-25.6 25.6-25.6s25.6 11.4688 25.6 25.6v279.7568z"
fill="#FF623E"></path>
</svg>
</span>
</div>
<div class="timeline-item-content" v-html="treeHole.content"></div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
treeHoleList: {
type: Array
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {
deleteTreeHole(id) {
this.$emit("deleteTreeHole", id);
}
}
}
</script>
<style scoped>
.process-line {
border-left: 2px solid var(--lightGreen);
padding: 50px 20px 10px;
margin-left: 20px;
position: relative;
}
.process-line:before {
content: '';
width: 8px;
height: 8px;
border: 4px solid var(--maxLightRed);
border-radius: 50%;
position: absolute;
top: 15px;
left: -1px;
transform: translateX(-50%);
background-color: var(--white);
animation: weiYanShadowFlashing 1.5s linear infinite;
}
.process-item {
position: relative;
margin: 10px;
color: var(--fontColor);
}
.timeline-item-time::before {
position: absolute;
top: 5px;
left: -37px;
width: 6px;
height: 6px;
border: 3px solid var(--blue);
border-radius: 50%;
background: var(--white);
content: '';
}
.timeline-item-content {
padding: 12px 15px;
margin: 10px 0 15px;
border-radius: 10px;
background: rgba(66, 139, 202, 0.2);
}
.process-delete {
margin-left: 10px;
cursor: pointer;
}
</style>

@ -0,0 +1,270 @@
<template>
<div class="tree-hole-container">
<ol class="tree-hole-list" v-if="!$common.isEmpty(treeHoleList)">
<li class="tree-hole-li"
v-for="(treeHole, index) in treeHoleList"
:key="index">
<div class="tree-hole-content"
:class="{ leftTreeHole: index % 2 === 0 && !$common.mobile(), rightTreeHole: index % 2 !== 0 || $common.mobile() }">
<el-avatar shape="square" class="avatar-img" :size="36"
:src="!$common.isEmpty($store.state.currentUser)?$store.state.currentUser.avatar:$store.state.webInfo.avatar"></el-avatar>
<div class="tree-hole-box"
:style="{background: $constant.tree_hole_color[index % $constant.tree_hole_color.length]}">
<div class="box-tag" v-if="index % 2 === 0 && !$common.mobile()"
:style="{'border-color': 'transparent transparent transparent '+$constant.tree_hole_color[index % $constant.tree_hole_color.length]}"></div>
<div class="box-tag" v-if="index % 2 !== 0 || $common.mobile()"
:style="{'border-color': 'transparent '+$constant.tree_hole_color[index % $constant.tree_hole_color.length]+' transparent transparent'}"></div>
<div class="my-content" v-html="treeHole.content"></div>
<div style="display: flex;justify-content: space-between">
<div>😃 {{treeHole.createTime}}</div>
<div @click="deleteTreeHole(treeHole.id)"
class="tree-hole-delete"
v-if="!$common.isEmpty($store.state.currentUser)">
<svg viewBox="0 0 1024 1024" width="18" height="18" style="vertical-align: -2px;">
<path
d="M921.1392 155.392h-270.592v-48.2816c0-22.7328-18.432-41.1648-41.1648-41.1648H426.3424a41.1648 41.1648 0 0 0-41.1648 41.1648v48.2816H110.6432c-14.1312 0-25.6 11.4688-25.6 25.6s11.4688 25.6 25.6 25.6h810.496c14.1312 0 25.6-11.4688 25.6-25.6s-11.4688-25.6-25.6-25.6zM170.8032 260.0448v592.8448c0 50.8928 41.2672 92.16 92.16 92.16h500.6848c50.8928 0 92.16-41.2672 92.16-92.16V260.0448H170.8032z m249.1392 462.7968c0 14.1312-11.4688 25.6-25.6 25.6s-25.6-11.4688-25.6-25.6V443.0848c0-14.1312 11.4688-25.6 25.6-25.6s25.6 11.4688 25.6 25.6v279.7568z m243.1488 0c0 14.1312-11.4688 25.6-25.6 25.6s-25.6-11.4688-25.6-25.6V443.0848c0-14.1312 11.4688-25.6 25.6-25.6s25.6 11.4688 25.6 25.6v279.7568z"
fill="#FF623E"></path>
</svg>
</div>
</div>
</div>
</div>
</li>
</ol>
<div class="tree-hole-go">
<i class="fa fa-paper-plane" @click="launch()"></i>
</div>
</div>
</template>
<script>
export default {
props: {
treeHoleList: {
type: Array
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {
launch() {
this.$emit("launch");
},
deleteTreeHole(id) {
this.$emit("deleteTreeHole", id);
}
}
}
</script>
<style scoped>
.tree-hole-container {
padding: 20px;
margin: 0 auto;
}
.tree-hole-list {
padding: 100px 0 20px;
margin: 0;
position: relative;
list-style: none;
}
.tree-hole-list:before {
content: '';
width: 4px;
border-radius: 50%;
position: absolute;
top: 0;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: var(--themeBackground);
}
.tree-hole-list:after {
content: '';
width: 12px;
height: 12px;
border: 4px solid var(--maxLightRed);
border-radius: 50%;
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
background-color: var(--white);
animation: weiYanShadowFlashing 1.5s linear infinite;
}
.tree-hole-li {
margin: 5px auto;
}
.tree-hole-content {
position: relative;
width: 50%;
}
.leftTreeHole {
text-align: right;
}
.rightTreeHole {
margin-left: 50%;
}
.tree-hole-content:before {
content: '';
width: 12px;
height: 12px;
border: 4px solid var(--blue);
border-radius: 50%;
position: absolute;
top: 10px;
background-color: var(--white);
}
.leftTreeHole:before {
right: 0;
transform: translateX(10px);
}
.rightTreeHole:before {
left: 0;
transform: translateX(-10px);
}
.avatar-img {
position: absolute;
top: 0;
transition: all 0.3s ease-in-out;
}
.leftTreeHole .avatar-img {
right: 25px;
}
.rightTreeHole .avatar-img {
left: 25px;
}
.tree-hole-box {
font-size: 16px;
padding: 10px;
width: 360px;
border-radius: 5px;
position: relative;
letter-spacing: 0.1em;
font-weight: 400;
transition: all 0.3s ease-in-out;
color: var(--black);
text-align: left;
display: inline-block;
}
.leftTreeHole .tree-hole-box {
margin-right: 90px;
}
.rightTreeHole .tree-hole-box {
margin-left: 90px;
}
.tree-hole-box:hover, .avatar-img:hover {
transform: translateY(-5px);
box-shadow: 0 0 16px 3px var(--miniMask);
}
.box-tag {
content: '';
position: absolute;
border-style: solid;
}
.leftTreeHole .box-tag {
right: -10px;
border-width: 15px 0 5px 10px;
}
.rightTreeHole .box-tag {
left: -10px;
border-width: 15px 10px 5px 0;
}
.my-content {
margin: 0 10px 10px;
line-height: 30px;
}
.tree-hole-box > div:last-child {
color: var(--greyFont);
padding: 10px 10px 0;
border-top: 1px dashed var(--white);
font-size: 14px;
}
.tree-hole-go {
color: var(--blue);
font-weight: 700;
font-size: 25px;
margin: 20px auto;
text-align: center;
}
.tree-hole-go i {
cursor: pointer;
}
.tree-hole-go i:hover {
animation: scale 1s linear infinite;
}
.tree-hole-delete {
font-size: 14px;
cursor: pointer;
}
@media screen and (max-width: 1000px) {
.tree-hole-box {
width: auto;
}
}
@media screen and (max-width: 600px) {
.tree-hole-content {
margin-bottom: 50px;
}
.tree-hole-list:after {
left: 0;
}
.tree-hole-list:before {
left: 0;
}
.rightTreeHole {
margin-left: unset;
}
.tree-hole-content {
width: 100%;
}
}
</style>

@ -0,0 +1,115 @@
<template>
<div class="poem-container myCenter my-animation-hideToShow"
v-if="!$common.isEmpty(guShi.origin) || !$common.isEmpty(hitokoto.hitokoto)">
<!-- 背景图片 -->
<el-image class="my-el-image poem-image"
style="position: absolute;margin-top: -50px"
v-once
:src="$constant.two_poem_image[Math.floor(Math.random() * $constant.two_poem_image.length)]"
fit="cover">
<div slot="error" class="image-slot"></div>
</el-image>
<div class="poem-wrap">
<div><span>{{isHitokoto?hitokoto.from:guShi.origin}}</span></div>
<p class="poem">{{isHitokoto?hitokoto.hitokoto:guShi.content}}</p>
<p class="info" v-if="!isHitokoto || (isHitokoto && !$common.isEmpty(hitokoto.from_who))">
{{isHitokoto?hitokoto.from_who:guShi.author}}
</p>
</div>
</div>
</template>
<script>
export default {
props: {
isHitokoto: {
type: Boolean,
default: true
}
},
data() {
return {
guShi: {
"content": "...",
"origin": "...",
"author": "...",
"category": "..."
},
hitokoto: {
"hitokoto": "...",
"from": "...",
"from_who": "..."
}
};
},
created() {
if (this.isHitokoto) {
this.getHitokoto();
} else {
this.getGuShi();
}
},
methods: {
getGuShi() {
let that = this;
let xhr = new XMLHttpRequest();
xhr.open('get', this.$constant.jinrishici);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
that.guShi = JSON.parse(xhr.responseText);
}
};
xhr.send();
},
getHitokoto() {
let that = this;
let xhr = new XMLHttpRequest();
xhr.open('get', this.$constant.hitokoto);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
that.hitokoto = JSON.parse(xhr.responseText);
}
}
xhr.send();
}
}
};
</script>
<style scoped>
.poem-container {
padding: 90px 0 40px;
position: relative;
}
.poem-wrap {
border-radius: 10px;
z-index: 10;
text-align: center;
letter-spacing: 4px;
font-weight: 300;
width: 60%;
}
.poem-wrap div span {
padding: 5px 40px;
color: var(--white);
font-size: 1.8em;
border-radius: 5px;
}
.poem-wrap p {
width: 70%;
color: var(--white);
}
.poem-wrap p.poem {
margin: 40px auto;
font-size: 1.5em;
}
.poem-wrap p.info {
margin: 20px auto;
font-size: 1.1em;
}
</style>

@ -0,0 +1,158 @@
<template>
<div>
<el-upload
class="upload-demo"
ref="upload"
multiple
drag
:action="$constant.qiniuUrl"
:data="qiniuParam"
:on-change="handleChange"
:before-upload="beforeUpload"
:on-success="handleSuccess"
:on-error="handleError"
list-type="picture"
accept="image/*"
:limit="maxNumber"
:auto-upload="false">
<div class="el-upload__text">
<svg viewBox="0 0 1024 1024" width="40" height="40">
<path
d="M666.2656 629.4528l-113.7664-112.4864c-20.7872-20.5824-54.3232-20.5312-75.1104 0.1024l-113.3056 112.4864c-20.8896 20.736-21.0432 54.528-0.256 75.4688 20.736 20.8896 54.528 21.0432 75.4688 0.256l22.6304-22.4256v189.5936c0 29.44 23.9104 53.3504 53.3504 53.3504s53.3504-23.9104 53.3504-53.3504v-189.5424l22.6816 22.4256a53.1456 53.1456 0 0 0 37.5296 15.4112c13.7728 0 27.4944-5.2736 37.9392-15.8208 20.6336-20.9408 20.4288-54.7328-0.512-75.4688z"
fill="#FFE37B"></path>
<path
d="M820.992 469.504h-5.376c-3.072-163.328-136.3456-294.8096-300.4416-294.8096S217.856 306.1248 214.784 469.504H209.408c-100.7104 0-182.3744 81.664-182.3744 182.3744s81.664 182.3744 182.3744 182.3744h209.7664V761.856c-30.208 5.5808-62.464-3.3792-85.6576-26.7264-37.3248-37.5808-37.0688-98.5088 0.512-135.7824l113.3056-112.4864c37.2224-36.9664 97.8432-37.0176 135.168-0.1536l113.7664 112.4864c18.2272 18.0224 28.3648 42.0864 28.5184 67.7376 0.1536 25.6512-9.728 49.8176-27.7504 68.0448a95.40096 95.40096 0 0 1-68.3008 28.5184c-5.9392 0-11.776-0.512-17.5104-1.5872v72.3456h209.7664c100.7104 0 182.3744-81.664 182.3744-182.3744S921.7024 469.504 820.992 469.504z"
fill="#8C7BFD"></path>
</svg>
<div>拖拽上传 / 点击上传</div>
</div>
<div slot="tip" class="el-upload__tip">
一次最多上传{{maxNumber}}张图片且每张图片不超过{{maxSize}}M
</div>
</el-upload>
<div style="text-align: center;margin-top: 20px">
<el-button type="success" style="font-size: 12px" @click="submitUpload">
上传
</el-button>
</div>
</div>
</template>
<script>
export default {
props: {
isAdmin: {
type: Boolean,
default: false
},
prefix: {
type: String,
default: ""
},
maxSize: {
type: Number,
default: 5
},
maxNumber: {
type: Number,
default: 5
}
},
data() {
return {
qiniuParam: {
token: "",
key: ""
}
}
},
computed: {},
watch: {},
created() {
if ((!this.isAdmin && !this.$common.isEmpty(this.$store.state.currentUser)) || (this.isAdmin && !this.$common.isEmpty(this.$store.state.currentAdmin))) {
this.getUpToken();
}
},
mounted() {
},
methods: {
getUpToken() {
this.$http.get(this.$constant.baseURL + "/qiniu/getUpToken", {}, this.isAdmin)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.qiniuParam.token = res.data;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitUpload() {
this.$refs.upload.submit();
},
//
handleSuccess(response, file, fileList) {
this.qiniuParam.key = "";
let url = this.$constant.qiniuDownload + response.key;
this.$common.saveResource(this, this.prefix, url, this.isAdmin);
this.$emit("addPicture", url);
},
handleError(err, file, fileList) {
this.qiniuParam.key = "";
this.$message({
message: "上传出错!",
type: "warning"
});
},
// false Promise reject
beforeUpload(file) {
if (this.$common.isEmpty(this.qiniuParam.token)) {
this.$message({
message: "上传出错!",
type: "warning"
});
return false;
}
this.qiniuParam.key = this.prefix + "/" + (!this.$common.isEmpty(this.$store.state.currentUser.username) ? (this.$store.state.currentUser.username.replace(/[^a-zA-Z]/g, '') + this.$store.state.currentUser.id) : (this.$store.state.currentAdmin.username.replace(/[^a-zA-Z]/g, '') + this.$store.state.currentAdmin.id)) + new Date().getTime() + Math.floor(Math.random() * 1000);
},
//
handleChange(file, fileList) {
let flag = false;
// if (!/image\/\w+/.test(file.type)) {
// this.$message({
// message: "",
// type: "warning"
// });
// flag = true;
// }
if (file.size > this.maxSize * 1024 * 1024) {
this.$message({
message: "图片最大为" + this.maxSize + "M",
type: "warning"
});
flag = true;
}
if (flag) {
fileList.splice(fileList.size - 1, 1);
}
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,785 @@
<template>
<div class="wrapper">
<div class="zombie">
<div class="zombie__head">
<div class="zombie__brain"></div>
<div class="zombie__cheeks"></div>
<div class="zombie__chin"></div>
<div class="zombie__eyes">
<div class="eye left">
<div class="eyebrow"></div>
</div>
<div class="eye right">
<div class="eyebrow"></div>
</div>
</div>
<div class="zombie__nose"></div>
<div class="zombie__mouth">
<div class="tooth">
<div class="tooth__top"></div>
<div class="tooth__bottom"></div>
</div>
</div>
</div>
<div class="zombie__body">
<div class="zombie__chest">
<div class="zombie__arms">
<div class="arm left">
<div class="arm__bone"></div>
<div class="arm__sleeve"></div>
</div>
<div class="arm right">
<div class="arm__details">
<div class="arm__biceps"></div>
<div class="arm__forearm"></div>
<div class="hands">
<div class="fingers">
<div class="finger thumb"></div>
<div class="finger middle"></div>
<div class="finger index"></div>
<div class="finger ring"></div>
<div class="finger pinky"></div>
</div>
</div>
</div>
<div class="arm__sleeve"></div>
</div>
</div>
</div>
</div>
</div>
<div class="ground">
<div class="ground__hole"></div>
<div class="ground__rocks">
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
<div class="rock"></div>
</div>
<div class="tomb">
<div class="tomb__info">
<h2 class="headers">{{$store.state.webInfo.webName}}</h2>
<h4 class="headers">大爷进来玩啊~~~</h4>
<h5 class="headers">网页有点慢等一下就好啦~</h5>
</div>
</div>
<div class="brains-comic-box">
<h1 class="brains__text">loading...</h1>
</div>
</div>
</div>
</template>
<style scoped>
@import url("https://fonts.googleapis.com/css?family=Creepster|Rye");
html,
body {
height: 100vh;
}
body {
background: #2c3e50;
}
.zombie__cheeks::before,
.zombie__cheeks::after {
content: "";
border-radius: 50% 0 0 50%;
box-shadow: 4px 7px 6px 1px rgba(0, 0, 0, 0.09);
background: #1abc9c;
width: 50px;
height: 50px;
}
.zombie__nose::before,
.zombie__nose::after {
content: "";
width: 15px;
height: 15px;
border-radius: 50% 50% 10px 10px;
background: #07362c;
box-shadow: inset 0 8px 0 2px #148f77;
align-self: flex-end;
}
.tooth .tooth__top::before,
.tooth .tooth__bottom::before {
content: "";
background: #fff;
width: 10px;
height: 10px;
display: block;
border-radius: 2px;
margin: 5px 20px 0 0;
display: inline-block;
}
.zombie__arms .left .arm__sleeve,
.zombie__arms .right .arm__sleeve {
width: 50px;
height: 60px;
background: linear-gradient(to bottom, #593f35, #795548);
border-radius: 20px 20px 0 0;
}
.wrapper {
display: flex;
height: 100vh;
justify-content: center;
flex-direction: column;
align-items: center;
background: #20332f;
}
.zombie {
position: relative;
z-index: 1;
}
.zombie__head {
width: 150px;
height: 150px;
background: #1abc9c;
border-radius: 70% 70% 35% 35%;
display: flex;
justify-content: center;
position: relative;
z-index: 1;
animation: moveHead 5s ease-in-out infinite;
}
.zombie__head::before {
content: "";
width: 49px;
height: 22px;
border-radius: 50%;
box-shadow: 0 -2px 0 1px #1a252f;
transform: translateX(24px) rotateZ(-53deg);
position: absolute;
right: 40px;
}
.zombie__head::after {
content: "";
width: 29px;
height: 12px;
border-radius: 50%;
box-shadow: 0 -2px 0 1px #1a252f;
transform: translateX(38px) rotateZ(-13deg);
position: absolute;
top: 5px;
right: 50px;
}
.zombie__brain {
width: 30px;
height: 60px;
background: #2c3e50;
border-radius: 50%;
transform: rotateZ(55deg);
position: absolute;
top: -2px;
left: 30px;
overflow: hidden;
}
.zombie__brain::before {
content: "";
width: 30px;
height: 80px;
background: #e05887;
position: absolute;
border-radius: 50%;
left: 15px;
}
.zombie__brain::after {
content: "";
background: #e05887;
width: 15px;
height: 15px;
border-radius: 40%;
position: absolute;
top: 35px;
left: 5px;
box-shadow: -14px -8px 0 0px #e05887, -28px -10px 0 0px #e05887;
transform: rotateZ(80deg);
}
.zombie__cheeks {
width: inherit;
height: 50px;
display: flex;
justify-content: space-between;
align-self: center;
position: absolute;
left: 0;
top: 75px;
}
.zombie__cheeks::before {
margin-left: -12px;
}
.zombie__cheeks::after {
transform: rotateY(180deg);
margin-right: -12px;
}
.zombie__eyes {
width: inherit;
height: 50px;
display: flex;
justify-content: space-between;
align-self: center;
position: absolute;
left: 0;
top: 50px;
}
.zombie__eyes .eye {
background: #fff;
border-radius: 50%;
box-shadow: 0 5px 0px 1px rgba(0, 0, 0, 0.22), 0 13px 0px 0px rgba(0, 0, 0, 0.22);
width: 50px;
height: 50px;
position: relative;
}
.zombie__eyes .eye::before {
content: "";
width: 16.66667px;
height: 16.66667px;
background: #fff;
border-radius: 50%;
display: table;
margin: 20px auto;
box-shadow: inset 0 -5px 0 5px #2c3e50, 0 0 0 3px #ff9800;
}
.zombie__eyes .eye .eyebrow {
width: inherit;
height: 20px;
background: #1abc9c;
position: absolute;
border-radius: 10px;
box-shadow: 0 2px 0 1px #117964;
top: -15px;
animation: moveEyebrow 5s ease-in-out infinite;
}
.zombie__chin {
width: 100px;
height: 80px;
background: #1abc9c;
border-radius: 0 0 30% 30%;
align-self: flex-end;
position: absolute;
left: 26px;
top: 100px;
}
.zombie__nose {
width: 25px;
height: 80px;
background: linear-gradient(to top, #148f77, #1abc9c);
border-radius: 0 0 10px 10px;
display: flex;
justify-content: space-between;
position: absolute;
left: 63px;
top: 35px;
}
.zombie__nose::before {
margin-left: -8px;
}
.zombie__nose::after {
margin-right: -8px;
}
.zombie__mouth {
width: 75px;
background: #1a252f;
border-radius: 20%/10% 10% 50% 50%;
box-shadow: inset 0 6px 0 0px #e883a6, 0 0 0 4px #148f77;
align-self: flex-end;
position: absolute;
left: 38px;
bottom: -18px;
overflow: hidden;
animation: moveMouth 5s ease-in-out infinite;
}
.tooth {
width: inherit;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.tooth .tooth__top {
position: relative;
left: 10px;
}
.tooth .tooth__top::before {
box-shadow: 15px 0px 0 0 #fff, 30px 0px 0 0 #fff, 45px 0px 0 0 #fff;
}
.tooth .tooth__bottom {
position: relative;
right: -18px;
bottom: -6px;
}
.tooth .tooth__bottom::before {
box-shadow: 15px 0px 0 0 #fff, 30px 0px 0 0 #fff;
}
.zombie__chest {
width: 150px;
height: 100px;
background: linear-gradient(to bottom, #593f35 40%, #795548);
border-radius: 20px 20px 0 0;
display: flex;
justify-content: space-between;
flex-direction: column;
position: relative;
top: -10px;
}
.zombie__arms {
display: inline-flex;
width: 100%;
}
.zombie__arms .left {
position: relative;
animation: moveLeftArm 5s ease-in-out infinite;
}
.zombie__arms .left .arm__sleeve {
transform: translateX(-25px) rotateZ(80deg);
}
.zombie__arms .left .arm__bone {
width: 100px;
height: 20px;
background: #bfbfbf;
position: absolute;
left: -100px;
top: 25px;
transform: rotateZ(-10deg);
}
.zombie__arms .left .arm__bone::before {
content: "";
background: inherit;
width: 20px;
height: 20px;
position: absolute;
left: -15px;
top: -8px;
border-radius: 40%/50% 0 30% 40%;
transform: rotateZ(40deg);
}
.zombie__arms .left .arm__bone::after {
content: "";
background: inherit;
width: 20px;
height: 20px;
position: absolute;
left: -10px;
bottom: -6px;
border-radius: 40%/50% 0 30% 40%;
transform: rotateZ(40deg);
}
.zombie__arms .right {
position: relative;
}
.zombie__arms .right .arm__sleeve {
transform: translateX(79px) rotateZ(-63deg);
}
.zombie__arms .arm__biceps {
width: 100px;
height: 20px;
position: absolute;
background: #1abc9c;
left: 95px;
top: 40px;
transform: rotateZ(25deg);
}
.zombie__arms .arm__forearm {
width: 38px;
height: 45px;
position: absolute;
background: linear-gradient(to bottom, #148f77, #1abc9c);
left: 160px;
top: 55px;
border-radius: 40%/90% 90% 0 0;
transform: skewX(-10deg);
box-shadow: -1px 0px 5px 1px rgba(0, 0, 0, 0.18);
}
.hands {
background: #1abc9c;
width: 75px;
height: 30px;
border-radius: 30%/80% 40% 40% 40%;
position: absolute;
left: 135px;
top: 90px;
animation: moveHand 5s ease-in-out infinite;
}
.hands .finger {
width: 16px;
height: 32px;
display: inline-block;
background: #1abc9c;
border-radius: 50%/80% 40% 40% 40%;
position: absolute;
}
.hands .finger::before {
content: "";
background: #fff;
opacity: 0.6;
width: 8.88889px;
height: 8.88889px;
position: relative;
top: 18px;
left: 2px;
border-radius: 50% 50% 0 0;
box-shadow: 0 2px 2px 1px rgba(0, 0, 0, 0.44);
display: block;
}
.hands .finger.thumb {
transform: rotateZ(90deg);
left: -15px;
top: -8px;
}
.hands .finger.index {
transform: rotateZ(20deg);
top: 20px;
left: -6px;
}
.hands .finger.middle {
top: 25px;
left: 22px;
}
.hands .finger.ring {
transform: rotateZ(-10deg) scale(0.9);
top: 20px;
left: 50px;
}
.hands .finger.pinky {
transform: rotateZ(-50deg) scale(0.8);
top: 8px;
left: 68px;
}
.ground {
position: relative;
}
.ground__hole {
width: 225px;
height: 40px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.39);
box-shadow: 0 11px 34px 20px rgba(0, 0, 0, 0.25);
position: relative;
top: -42px;
}
.ground__rocks {
position: absolute;
top: 0;
z-index: 2;
}
.ground__rocks .rock {
background: #3e5871;
border-radius: 40%/80% 20% 70% 20%;
box-shadow: 3px 4px 0 5px #1a252f;
width: 40px;
height: 20px;
display: block;
position: absolute;
top: 0;
}
.ground__rocks:nth-child(2) {
left: -25px;
top: -25px;
transform: scale(1.2) rotateZ(-10deg);
z-index: -1;
}
.ground__rocks:nth-child(3) {
left: -3px;
top: -53px;
transform: scale(0.4);
}
.ground__rocks:nth-child(4) {
left: 30px;
top: -20px;
transform: scale(0.5);
}
.ground__rocks:nth-child(5) {
left: 55px;
top: -15px;
transform: scale(0.8);
}
.ground__rocks:nth-child(6) {
left: 55px;
top: -15px;
transform: scale(0.8);
}
.ground__rocks:nth-child(7) {
left: 95px;
top: -15px;
transform: scale(0.6) rotateY(180deg);
}
.ground__rocks:nth-child(8) {
left: 85px;
top: 20px;
transform: scale(0.4) rotateY(180deg);
}
.ground__rocks:nth-child(9) {
left: 165px;
top: 10px;
transform: scale(0.2);
}
.ground__rocks:nth-child(10) {
left: 125px;
top: -15px;
transform: scale(1.1) rotateY(180deg);
}
.ground__rocks:nth-child(11) {
left: 165px;
top: -12px;
transform: scale(0.8) rotateY(180deg) rotateZ(-20deg);
}
.ground__rocks:nth-child(12) {
left: 265px;
top: -90px;
transform: scale(0.7);
}
.ground__rocks:nth-child(13) {
left: 300px;
top: -90px;
transform: scale(1);
}
.ground__rocks:nth-child(14) {
left: 350px;
top: -90px;
transform: scale(0.5) rotateY(180deg);
}
.ground__rocks:nth-child(15) {
left: 390px;
top: -90px;
transform: scale(0.8) rotateY(180deg) rotateZ(-10deg);
}
.tomb {
width: 200px;
height: 200px;
background: #95a5a6;
border-radius: 50% 50% 0 0;
box-shadow: 18px 1px 0 0px #6d8082, 12px 26px 39px 7px rgba(0, 0, 0, 0.25);
position: absolute;
top: -280px;
left: 200px;
}
.tomb .tomb__info {
text-align: center;
margin: 20px;
color: #3e4a4a;
}
.tomb .tomb__info .headers {
font-weight: normal;
line-height: 1.3em;
margin: 15px 0;
}
.brains-comic-box {
font-size: 1.4em;
letter-spacing: 0.2em;
color: #e05887;
position: absolute;
top: -360px;
left: -200px;
transform: rotateZ(-10deg);
position: relative;
animation: moveBrainsBox 5s ease-in-out infinite;
}
.brains-comic-box .brains__text {
background: #fff;
border-radius: 40px;
padding: 15px 20px;
animation: moveBrainsText 5s ease-in-out infinite;
}
.brains-comic-box .brains__text::before {
width: 0;
height: 0;
content: "";
border-top: 1em solid #fff;
border-left: 0.5em solid transparent;
border-right: 0.5em solid transparent;
position: absolute;
bottom: -20px;
left: 160px;
transform: rotateZ(-30deg);
}
@keyframes moveLeftArm {
0%,
50%,
90%,
100% {
transform: rotateZ(22deg);
}
10%,
20%,
40% {
transform: rotateZ(0);
}
}
@keyframes moveHead {
0%,
50%,
90%,
100% {
transform: rotateZ(-10deg);
}
30% {
transform: translateX(6px) translateY(2px);
}
35% {
transform: translateX(-6px);
}
10%,
20%,
40% {
transform: rotateZ(0);
}
}
@keyframes moveMouth {
0%,
50%,
90%,
100% {
height: 20px;
transform: translateY(-10px);
}
10%,
20%,
40% {
height: 40px;
transform: translateY(0);
}
}
@keyframes moveEyebrow {
0%,
50%,
90%,
100% {
transform: translateY(8px);
}
10%,
20%,
40% {
transform: translateY(-10px);
}
}
@keyframes moveHand {
0%,
50%,
90%,
100% {
transform: translateY(0);
}
10%,
20%,
40% {
transform: translateY(-10px) rotateZ(15deg);
}
}
@keyframes moveBrainsText {
0%,
20%,
40%,
60%,
80%,
100% {
transform: translateX(20px);
}
10%,
30%,
50%,
70%,
90% {
transform: translateX(-20px);
}
}
@keyframes moveBrainsBox {
0%,
50%,
90%,
100% {
opacity: 0;
}
10%,
20%,
40% {
opacity: 1;
}
}
</style>

@ -0,0 +1,374 @@
<template>
<div>
<el-image style="animation: header-effect 2s"
class="background-image"
v-once
:src="$constant.friendBG"
fit="cover">
<div slot="error" class="image-slot background-image-error"></div>
</el-image>
<!-- 封面 -->
<div class="friend-head myCenter">
<h1 style="color: var(--white);z-index: 10;font-weight: 700;font-size: 45px">友人帐</h1>
</div>
<div class="friend-wrap">
<div class="friend-main">
<!-- 添加友链 -->
<div @click="clickLetter()" class="form-wrap">
<!-- 信封上面 -->
<img class="before-img" :src="$constant.friendLetterTop" style="width: 100%"/>
<!-- -->
<div class="envelope" style="animation: hideToShow 2s">
<div class="form-main">
<img :src="$constant.friendLetterMiddle" style="width: 100%"/>
<div>
<h3 style="text-align: center">有朋自远方来</h3>
<div>
<div class="myCenter form-friend">
<div class="user-title">
<div>名称</div>
<div>简介</div>
<div>封面</div>
<div>网址</div>
</div>
<div class="user-content">
<div>
<el-input v-model="friend.title"></el-input>
</div>
<div>
<el-input v-model="friend.introduction"></el-input>
</div>
<div>
<el-input v-model="friend.cover"></el-input>
</div>
<div>
<el-input v-model="friend.url"></el-input>
</div>
</div>
</div>
<div class="myCenter" style="margin-top: 20px">
<proButton :info="'提交'"
@click.native.stop="submitFriend()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
<div>
<img :src="$constant.friendLetterBiLi" style="width: 100%;margin: 5px auto"/>
</div>
<p style="font-size: 12px;text-align: center;color: #999">欢迎交换友链</p>
</div>
</div>
</div>
<img class="after-img" :src="$constant.friendLetterBottom" style="width: 100%"/>
</div>
<hr>
<h2>🥇友情链接</h2>
<card :resourcePathList="friendList" @clickResourcePath="clickFriend"></card>
</div>
</div>
<!-- 页脚 -->
<myFooter></myFooter>
</div>
</template>
<script>
const myFooter = () => import( "./common/myFooter");
const card = () => import( "./common/card");
const proButton = () => import( "./common/proButton");
export default {
components: {
myFooter,
card,
proButton
},
data() {
return {
pagination: {
current: 1,
size: 9999,
resourceType: "friendUrl"
},
friendList: [],
friend: {
title: "",
introduction: "",
cover: "",
url: ""
}
}
},
computed: {},
watch: {},
created() {
this.getFriends();
},
mounted() {
},
methods: {
clickLetter() {
if (document.body.clientWidth < 700) {
$(".form-wrap").css({"height": "1000px", "top": "-200px"});
} else {
$(".form-wrap").css({"height": "1150px", "top": "-200px"});
}
},
submitFriend() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
if (this.friend.title.trim() === "") {
this.$message({
message: "你还没写名称呢~",
type: "warning",
});
return;
}
if (this.friend.introduction.trim() === "") {
this.$message({
message: "你还没写简介呢~",
type: "warning",
});
return;
}
if (this.friend.cover.trim() === "") {
this.$message({
message: "你还没设置封面呢~",
type: "warning",
});
return;
}
if (this.friend.url.trim() === "") {
this.$message({
message: "你还没写网址呢~",
type: "warning",
});
return;
}
this.$http.post(this.$constant.baseURL + "/webInfo/saveFriend", this.friend)
.then((res) => {
$(".form-wrap").css({"height": "447px", "top": "0"});
this.$message({
type: 'success',
message: '提交成功,待管理员审核!'
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
clickFriend(path) {
window.open(path);
},
getFriends() {
this.$http.post(this.$constant.baseURL + "/webInfo/listResourcePath", this.pagination)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.friendList = res.data.records;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.friend-head {
height: 300px;
position: relative;
}
.friend-head::before {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .3);
content: '';
}
.friend-main {
max-width: 1200px;
margin: 40px auto;
border-radius: 10px;
padding: 40px;
background: rgba(255, 255, 255, .85);
}
.friend-main h2 {
font-size: 20px;
}
hr {
position: relative;
margin: 40px auto;
border: 2px dashed var(--lightGreen);
overflow: visible;
}
hr:before {
position: absolute;
top: -14px;
left: 5%;
color: var(--lightGreen);
content: '❄';
font-size: 30px;
line-height: 1;
transition: all 1s ease-in-out;
}
hr:hover:before {
left: calc(95% - 20px);
}
.form-wrap {
margin: 0 auto;
overflow: hidden;
width: 530px;
height: 447px;
position: relative;
top: 0;
transition: all 1s ease-in-out .3s;
z-index: 0;
cursor: pointer;
}
.before-img {
position: absolute;
bottom: 126px;
left: 0;
background-repeat: no-repeat;
width: 530px;
height: 317px;
z-index: -100;
}
.after-img {
position: absolute;
bottom: -2px;
left: 0;
background-repeat: no-repeat;
width: 530px;
height: 259px;
z-index: 100;
}
.friend-wrap {
padding: 0 20px;
color: var(--black);
}
.envelope {
position: relative;
margin: 0 auto;
transition: all 1s ease-in-out .3s;
padding: 200px 20px 20px;
}
.form-main {
background: var(--white);
margin: 0 auto;
border-radius: 10px;
overflow: hidden;
}
.user-title {
text-align: right;
user-select: none;
}
.user-content {
text-align: left;
}
.user-title div {
height: 55px;
line-height: 55px;
text-align: center;
}
.user-content > div {
height: 55px;
display: flex;
align-items: center;
}
.user-content >>> .el-input__inner {
border: none;
height: 35px;
background: var(--whiteMask);
}
.form-friend {
margin-top: 12px;
background-color: #eee;
border: #ddd 1px solid;
padding: 20px 0;
}
@media screen and (max-width: 700px) {
.form-wrap {
width: auto;
}
.before-img {
width: auto;
}
.after-img {
width: auto;
}
}
@media screen and (max-width: 500px) {
.friend-main {
padding: 40px 15px;
}
.friend-wrap {
padding: 0 10px
}
}
</style>

@ -0,0 +1,814 @@
<template>
<div>
<!-- el过渡动画 -->
<transition name="el-fade-in-linear">
<!-- 导航栏 -->
<div v-show="toolbar.visible"
@mouseenter="hoverEnter = true"
@mouseleave="hoverEnter = false"
:class="[{ enter: toolbar.enter }, { hoverEnter: hoverEnter && !toolbar.enter }]"
class="toolbar-content myBetween">
<!-- 网站名称 -->
<div class="toolbar-title">
<h2 @click="$router.push({path: '/'})">{{$store.state.webInfo.webName}}</h2>
</div>
<!-- 手机导航按钮 -->
<div v-if="$common.mobile() || mobile"
class="toolbar-mobile-menu"
@click="toolbarDrawer = !toolbarDrawer"
:class="{ enter: toolbar.enter }">
<i class="el-icon-s-operation"></i>
</div>
<!-- 导航列表 -->
<div v-else>
<ul class="scroll-menu">
<li @click="$router.push({path: '/'})">
<div class="my-menu">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path d="M221.4 152.6h141.8V396h-141.8V152.6z" fill="#FAD996"></path>
<path
d="M363.4 152.6c-9-16.6-138.2-14.2-142 0-3 11.4-23.6 287 15.8 182.4 10.4-27.4 22.6-47.6 37.2-78.6 10.6-22.6 22-42.4 32.6-54.4 16.6-18.6 18 9.6 33.6 22.6 41.6 34.4 31.8-55.6 22.8-72z"
fill="#F9F8F7"></path>
<path
d="M834.2 851c0 24.8-20.2 45-45 45H234.8c-24.8 0-45-20.2-45-45v-370h1.2l321.2-270 321.2 270h0.6l0.2 370z"
fill="#FAD996"></path>
<path d="M833.4 481l-321.2-270-1.8 1.6V896h278.8c24.8 0 45-20.2 45-45l-0.2-370h-0.6z" fill="#F7C872"
p-id="16219"></path>
<path
d="M62 548L432.6 166.2s81.2-90.6 171.8 0c79 79 343.6 400 343.6 400s-55.4 41-125.2 14.2c-37.8-14.4-118.2-68-133.4-150.8-11-60.2-45.8 29-60.8-38.2-9.4-42.2-67.2-96.6-67.2-96.6s-48.4-55.4-100.2 0c-13.8 14.8-11.4 134.6-44 128-26.4-5.2-20-105.6-27-81.2-9.6 33-25 61-54.4 47.2-33.2-15.6-42.4 79.6-64.8 112.8-17.2 25.4-23.8-45.8-40.4-29.2-21.2 21-2.4 94-39.4 108s-132.8-2-129.2-32.4z"
fill="#F9F8F7"></path>
<path
d="M512 126.2v144c28.8 1 49.4 24.6 49.4 24.6s57.8 54.4 67.2 96.6c15 67.2 49.8-22 60.8 38.2 15.2 82.8 95.6 136.4 133.4 150.8 69.8 26.8 125.2-14.2 125.2-14.2s-264.6-321-343.6-400c-33.2-33.2-65.2-42-92.4-40z"
fill="#EFEBE8"></path>
<path d="M405.2 495h99.8v99.8h-99.8v-99.8zM405.2 609.2h99.8v99.8h-99.8v-99.8z" fill="#FB8A5D"></path>
<path d="M519 495h99.8v99.8h-99.8v-99.8zM519 609.2h99.8v99.8h-99.8v-99.8z" fill="#EA6D4B"></path>
</svg>
<span>&nbsp;首页</span>
</div>
</li>
<li v-for="(menu, index) in $store.getters.navigationBar"
@click="$router.push({path: '/sort', query: {sortId: menu.id, labelId: menu.labels[0].id}})"
:key="index">
<div class="my-menu">
<svg viewBox="0 0 1024 1024" width="18" height="18" style="vertical-align: -3px;">
<path d="M0 0h1024v1024H0V0z" fill="#202425" opacity=".01"></path>
<path
d="M682.666667 341.333333a136.533333 136.533333 0 0 1 273.066666 0v546.133334a68.266667 68.266667 0 0 1-68.266666 68.266666h-204.8V341.333333z"
fill="#FFAA44"></path>
<path
d="M68.266667 819.2a136.533333 136.533333 0 0 0 136.533333 136.533333h682.666667a68.266667 68.266667 0 0 1-68.266667-68.266666V204.8a136.533333 136.533333 0 0 0-136.533333-136.533333H204.8a136.533333 136.533333 0 0 0-136.533333 136.533333v614.4z"
fill="#FF7744"></path>
<path
d="M187.733333 273.066667A51.2 51.2 0 0 1 238.933333 221.866667h68.266667a51.2 51.2 0 1 1 0 102.4H238.933333A51.2 51.2 0 0 1 187.733333 273.066667z m0 204.8A51.2 51.2 0 0 1 238.933333 426.666667h409.6a51.2 51.2 0 0 1 0 102.4H238.933333A51.2 51.2 0 0 1 187.733333 477.866667zM238.933333 631.466667a51.2 51.2 0 0 0 0 102.4h204.8a51.2 51.2 0 0 0 0-102.4H238.933333z"
fill="#FFFFFF"></path>
</svg>
<span>&nbsp;{{ menu.sortName }}</span>
</div>
</li>
<!-- 聊天室 -->
<li @click="goIm()">
<div class="my-menu">
<svg viewBox="0 0 1024 1024" width="18" height="18" style="vertical-align: -3px;">
<path
d="M544.54784 628.16768a173.7216 173.7216 0 0 1 0-245.1712l158.6432-159.104a172.50816 172.50816 0 0 1 244.46464 0 173.7216 173.7216 0 0 1 0 245.17632L788.992 628.16768a172.50816 172.50816 0 0 1-244.44416 0z m-325.49888 324.608a173.71648 173.71648 0 0 1 0-245.1712l158.6432-159.104a172.50816 172.50816 0 0 1 244.46464 0 173.71648 173.71648 0 0 1 0 245.1712l-158.63808 159.09376a172.51328 172.51328 0 0 1-244.46976 0z"
fill="#F4CA1C"></path>
<path
d="M415.6416 567.72096a36.58752 36.58752 0 0 1-25.99936-10.80832 215.58272 215.58272 0 0 1-63.52896-149.15072A203.80672 203.80672 0 0 1 385.536 259.072l163.1744-163.7376c80.70656-80.9728 213.86752-79.104 296.82688 4.13696a215.61856 215.61856 0 0 1 63.53408 149.15072 203.776 203.776 0 0 1-59.392 148.67968l-105.2928 101.83168a36.8384 36.8384 0 0 1-51.03616-53.13024l104.79104-101.376a130.12992 130.12992 0 0 0 37.376-94.78144 142.06976 142.06976 0 0 0-41.984-98.21184c-54.30272-54.48192-140.8-56.32-192.82944-4.13696L437.51936 311.26016a130.50368 130.50368 0 0 0-37.888 95.26272 142.08512 142.08512 0 0 0 41.984 98.21184 36.97664 36.97664 0 0 1 0 52.18304 36.58752 36.58752 0 0 1-25.97376 10.8032z m-169.30816 346.34752a214.74304 214.74304 0 0 1-152.20736-63.67232c-82.85184-83.13856-84.81792-216.48384-4.46976-297.472l104.96-110.80704a36.82816 36.82816 0 1 1 53.30432 50.83648l-105.91232 111.79008c-52.0192 52.1984-50.176 138.99264 4.1216 193.47456s140.8 56.32 192.82432 4.13184l163.18976-163.74784a130.47808 130.47808 0 0 0 37.888-95.232 142.09536 142.09536 0 0 0-41.984-98.21696 36.83328 36.83328 0 0 1 51.9936-52.18304 215.6288 215.6288 0 0 1 63.53408 149.15584 203.81184 203.81184 0 0 1-59.392 148.67968L390.95296 854.528a203.08992 203.08992 0 0 1-144.61952 59.54048z"
fill="#595BB3"></path>
</svg>
<span>&nbsp;社交</span>
</div>
</li>
<!-- 微言 -->
<!-- <li @click="$router.push({path: '/weiYan'})">-->
<!-- <div class="my-menu">-->
<!-- <svg viewBox="0 0 1024 1024" width="18" height="18" style="vertical-align: -3px;">-->
<!-- <path-->
<!-- d="M252.8 862.9h-73.4c-6.8 0-12.4-5.6-12.4-12.4V134.4c0-6.8 5.6-12.4 12.4-12.4h73.4l5.3 6.8v728.8l-5.3 5.3z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path d="M338.5 942l-42.9-18.1-42.8 18.1v-79.1l7.5-5.3h71.3l7 5.3-0.1 79.1z" fill="#EA800C"></path>-->
<!-- <path-->
<!-- d="M844.6 327.9h-40.7l-5.3-5.8v-93.3l5.3-7.2h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.9-5.6 12.4-12.4 12.4z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path-->
<!-- d="M844.6 540.5h-40.7l-5.3-7.3v-90.6l5.3-8.4h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.8-5.6 12.4-12.4 12.4z"-->
<!-- fill="#EA800C"></path>-->
<!-- <path-->
<!-- d="M844.6 753h-40.7l-5.3-6.7v-92.1l5.3-7.5h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.8-5.6 12.4-12.4 12.4z"-->
<!-- fill="#2F9B77"></path>-->
<!-- <path d="M791.8 862.9h-539V122h539.1c6.7 0 12 5.4 12 12v716.8c0 6.7-5.4 12.1-12.1 12.1z"-->
<!-- fill="#3DC38A"></path>-->
<!-- <path-->
<!-- d="M680.3 661.1H343.7c-14 0-25.5-11.5-25.5-25.5s11.5-25.5 25.5-25.5h336.6c14 0 25.5 11.5 25.5 25.5s-11.5 25.5-25.5 25.5zM680.3 779.8H343.7c-14 0-25.5-11.5-25.5-25.5s11.5-25.5 25.5-25.5h336.6c14 0 25.5 11.5 25.5 25.5s-11.5 25.5-25.5 25.5z"-->
<!-- fill="#2F9B77"></path>-->
<!-- <path-->
<!-- d="M594.8 511.1c-79.2 45.7-180.5 18.6-226.3-60.6S350 270 429.2 224.2s180.5-18.6 226.3 60.6 18.5 180.6-60.7 226.3z"-->
<!-- fill="#3DC38A"></path>-->
<!-- <path-->
<!-- d="M523.7 318.1c-1.2 0.3-3.5 0.9-4.5 1.7-1.2 1 0.7 2.3 0 2.9-1.2 1-2.1 2.7-4.7 2.6-5.5-0.3-13.9-7.5-19-10.2 8.1-8.3-4.7-9.6-9.7-9.1-6.5 0.5-17.7 0-23.5 3.2-4.1 2.3-9.5 11.7-12.8 15.5-4.6 5.2-9.1 9.8-12.1 16-10.9 23 5.9 49.4 32.2 46.3 7.3-0.9 14.9-5.5 21.4 0.6 4.8 4.5 2.3 8.7 3.5 13.9 1.1 4.5 6.1 7.3 7.8 11.4 3.3 7.9 1.2 12.9-1.1 20.2-3.1 9.6 4.9 21 8 30.2 1.6 4.7 6.1 17.7 10.7 19.8 7.1 3.2 18.1-6.4 22.4-11.6 3.3-4.1 2.2-8.2 4.4-12 2.4-4.1 5.4-5.3 7.1-10.6 1.8-5.7 3.7-7.1 7.5-11.3 6.2-6.7 5.2-10.6 2.7-18.6-5.1-16.5 13.5-24.2 21.8-36.3 8.7-12.6-8.2-8.4-14.8-12.8-6.8-4.4-9.8-12.9-13.1-19.9s-6-17.5-11.4-23.3c-4.2-4.3-16.9-6.4-22.8-8.6zM609.2 428.8c-2.6 8.9-5.3 17.8-7.9 26.7-1.8 6.2-8.4 26.6-17.5 13.6-3.5-5-0.6-11.4 1.3-16 2.4-5.8-0.9-8.7 0.9-14.1 2-6.2 10-6.4 13.8-10.8 2.7-3 4.3-7.9 6.2-11.5 1 4 2.1 8.1 3.2 12.1z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path-->
<!-- d="M655.4 284.9c-28.5-49.4-78.7-78.5-131.6-82.4l-21.6 27.2-46.4 16.3-12.5 30.2 19.2 26.9 2-5.7c3.4-9.5 12.4-15.8 22.5-15.8h31.7l36.4 12.8 12.5 12v7.6l17.4 33.4 5.1-1.9c11-4 20.9-10.4 29.2-18.7l-4.2-6.3c-1.4-2 0.1-4.7 2.5-4.7h10.2c3 0 5.8 1.3 7.7 3.6l8.3 9.7c0.8 0.9 1.4 2 1.8 3.1l9.1 25.2 4.4-4.4c2.7-2.7 4.1-6.5 4.2-10.4 0-3.1 1.4-6.1 3.7-8.2l3.4-3c0.8-0.8 1.8-1.4 2.8-1.8-3.6-15.3-9.5-30.4-17.8-44.7zM407.6 291.3l7.9-8.5c5.8-6.2 7.4-15.2 4.2-23-3.4-8.3-10.9-13.6-19.2-14.8-29.2 26.5-47.4 62.2-52.6 100 6.2 5.4 12.6 11.2 12.6 11.7-0.1 1 23.2-2.9 23.2-2.9l-12-17.5 17.2-12.3 18.7-32.7zM423.8 456.4c7.5-2.4 11.6-10.4 9.1-17.9l-2.1-6.6c-0.9-2.9-0.9-5.9 0-8.8 2.7-8.1-2.4-16.8-10.8-18.4l-16.8-3.3-30.6-23.2-25.3 8.2c2.5 21.9 9.4 43.7 21.2 64.1 10.9 18.8 24.9 34.7 41 47.4l7.5-39.3 6.8-2.2z"-->
<!-- fill="#2F9B77"></path>-->
<!-- </svg>-->
<!-- <span>&nbsp;微言</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- 留言 -->
<li @click="$router.push({path: '/message'})">
<div class="my-menu">
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M113.834667 291.84v449.194667a29.013333 29.013333 0 0 0 28.842666 29.013333h252.928v90.453333l160.597334-90.453333h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333h-665.6a29.013333 29.013333 0 0 0-29.696 29.013333z"
fill="#FFDEAD"></path>
<path
d="M809.130667 262.826667h-665.6a29.013333 29.013333 0 0 0-28.842667 29.013333v40.106667a29.013333 29.013333 0 0 1 28.842667-29.013334h665.6a29.013333 29.013333 0 0 1 29.013333 29.013334V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333z"
fill="#FFF3DB"></path>
<path
d="M556.202667 770.048h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V362.837333s-59.733333 392.533333-724.309333 314.709334v63.488a29.013333 29.013333 0 0 0 28.842666 29.013333h253.098667v90.453333z"
fill="#F2C182"></path>
<path
d="M619.008 632.32l101.888-35.157333-131.754667-76.117334 29.866667 111.274667zM891.904 148.992a61.44 61.44 0 0 0-84.138667 22.528l-19.968 34.133333 106.666667 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-22.528-84.138667z"
fill="#69BAF9"></path>
<path d="M775.338667 198.775467l131.669333 76.032-186.026667 322.218666-131.6864-76.032z"
fill="#F7FBFF"></path>
<path
d="M775.168 198.826667l-5.290667 9.216 59.221334 34.133333a34.133333 34.133333 0 0 1 12.458666 46.592l-139.946666 242.346667a34.133333 34.133333 0 0 1-46.762667 12.629333l-59.050667-34.133333-6.656 11.434666 88.746667 51.2L720.896 597.333333l186.026667-322.56z"
fill="#D8E3F0"></path>
<path
d="M616.448 622.592l2.56 9.728 101.888-35.157333-44.885333-25.941334-59.562667 51.370667zM891.904 148.992c-1.024 0-2.218667-0.853333-3.242667-1.536A61.610667 61.610667 0 0 1 887.466667 204.8l-19.968 34.133333-73.728-42.496-5.12 8.704 106.666666 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-23.381333-83.626667z"
fill="#599ED4"></path>
<path
d="M265.898667 417.621333H494.933333a17.066667 17.066667 0 1 0 0-34.133333H265.898667a17.066667 17.066667 0 1 0 0 34.133333zM265.898667 533.504H494.933333a17.066667 17.066667 0 0 0 0-34.133333H265.898667a17.066667 17.066667 0 0 0 0 34.133333z"
fill="#3D3D63"></path>
<path
d="M959.488 354.645333a99.84 99.84 0 0 0-23.722667-127.488 78.677333 78.677333 0 0 0-142.848-64.170666l-11.605333 20.138666a17.066667 17.066667 0 0 0-20.821333 7.168l-32.085334 55.466667H142.677333a46.250667 46.250667 0 0 0-45.909333 46.08v449.194667a46.08 46.08 0 0 0 45.909333 46.08h236.032v73.386666a17.066667 17.066667 0 0 0 8.362667 14.848 17.066667 17.066667 0 0 0 8.704 2.218667 17.066667 17.066667 0 0 0 8.362667-2.218667l156.672-88.234666h248.32a46.08 46.08 0 0 0 46.08-46.08V398.677333L921.6 283.306667a17.066667 17.066667 0 0 0-4.266667-21.504l1.877334-3.413334a65.365333 65.365333 0 0 1 10.410666 79.189334l-53.077333 91.989333a56.832 56.832 0 0 0 20.821333 77.653333 17.066667 17.066667 0 0 0 24.234667-6.314666 17.066667 17.066667 0 0 0-6.997333-23.04 23.04 23.04 0 0 1-8.362667-31.061334z m-138.410667 386.389334a11.946667 11.946667 0 0 1-11.946666 11.946666H556.202667a17.066667 17.066667 0 0 0-8.362667 2.218667l-134.997333 76.117333v-61.269333a17.066667 17.066667 0 0 0-17.066667-17.066667H142.677333a11.946667 11.946667 0 0 1-11.776-11.946666V291.84a11.946667 11.946667 0 0 1 11.776-11.946667h565.930667L574.464 512a17.066667 17.066667 0 0 0-1.706667 12.970667L597.333333 615.253333H265.898667a17.066667 17.066667 0 1 0 0 34.133334h352.938666a17.066667 17.066667 0 0 0 5.802667 0l102.4-35.328a17.066667 17.066667 0 0 0 9.216-7.509334l85.333333-147.968z m-204.8-184.661334l63.829334 36.864-49.322667 17.066667z m206.848-170.666666v1.365333l-108.373333 186.709333-102.4-59.050666L781.482667 221.866667l102.4 59.050666z m76.458667-161.28L887.466667 244.224l-76.970667-44.373333 11.264-19.797334a44.544 44.544 0 1 1 77.141333 44.544z"
fill="#3D3D63"></path>
</svg>
<span>&nbsp;留言</span>
</div>
</li>
<!-- 友人帐 -->
<li @click="$router.push({path: '/friend'})">
<div class="my-menu">
<span>💃&nbsp;友人帐</span>
</div>
</li>
<!-- 关于 -->
<li @click="$router.push({path: '/about'})">
<div class="my-menu">
<svg viewBox="0 0 1136 1024" width="22" height="22" style="vertical-align: -5px;">
<path
d="M255.015385 409.796923s-113.821538-16.344615-106.338462 80.147692c7.483077 96.295385 106.338462 78.769231 106.338462 78.769231s66.363077 252.652308 332.8 257.772308 346.584615-260.135385 346.584615-260.135385 106.338462 32.492308 116.381538-76.209231-111.458462-81.526154-111.458461-81.526153S888.123077 155.766154 587.815385 153.403077s-332.8 256.393846-332.8 256.393846z"
fill="#FFC0A9"></path>
<path
d="M595.101538 846.375385h-7.68c-145.526154-2.756923-233.550769-76.8-281.6-138.436923-37.021538-47.458462-56.516923-94.326154-64.984615-118.153847-19.101538 0.393846-49.821538-2.56-74.633846-21.858461-22.252308-17.132308-34.855385-42.929231-37.415385-76.603077-2.56-31.901538 6.104615-57.304615 25.403077-75.421539 25.206154-23.630769 62.227692-27.569231 84.48-27.175384 5.907692-25.206154 20.283077-72.467692 53.76-119.729231 44.504615-62.621538 131.544615-137.058462 295.384616-135.68 163.052308 1.378462 255.212308 74.830769 303.852307 136.270769 36.627692 46.276923 54.547692 92.16 62.227693 116.775385 23.236923-2.166154 62.424615-1.378462 89.403077 22.252308 21.267692 18.707692 30.523077 46.670769 27.175384 83.101538-3.544615 38.006154-17.92 65.772308-42.732308 82.510769-27.372308 18.313846-60.258462 17.723077-80.344615 14.966154-9.649231 25.009231-31.704615 73.255385-70.892308 121.501539-72.073846 88.812308-169.353846 135.68-281.403077 135.68zM269.784615 545.673846l4.726154 17.92c0.196923 0.590769 16.541538 61.046154 63.803077 120.910769 62.227692 78.966154 146.313846 119.926154 249.895385 121.895385 248.32 4.529231 326.104615-243.396923 326.892307-245.956923l5.71077-19.298462 19.298461 5.907693c0.393846 0 39.384615 11.421538 65.378462-6.104616 14.375385-9.649231 22.843077-27.569231 25.009231-52.775384 2.166154-22.843077-2.363077-39.384615-13.587693-49.23077-20.086154-17.723077-59.864615-13.587692-73.452307-10.633846l-19.889231 4.529231-4.135385-20.086154c-0.196923-0.590769-12.996923-60.652308-60.258461-119.729231-62.818462-78.375385-154.387692-118.744615-271.753847-119.72923-117.76-0.984615-205.784615 38.990769-262.498461 118.744615-42.338462 59.667692-50.215385 119.532308-50.215385 120.123077l-2.56 20.283077-20.086154-2.953846c-13.193846-1.772308-51.593846-2.56-70.892307 15.556923-10.043077 9.452308-14.375385 23.630769-12.8 43.126154 1.772308 22.252308 8.861538 38.006154 22.055384 48.04923 23.827692 18.510769 60.455385 12.603077 60.849231 12.603077l18.510769-3.150769z"
fill="#493B4E"></path>
<path
d="M481.069296 499.027638a35.050906 35.050906 0 1 0 3.652962-70.006569 35.050906 35.050906 0 1 0-3.652962 70.006569Z"
fill="#493B4E"></path>
<path
d="M704.993567 510.606399a35.050906 35.050906 0 1 0 3.652961-70.00657 35.050906 35.050906 0 1 0-3.652961 70.00657Z"
fill="#493B4E"></path>
<path
d="M537.6 597.464615s-5.710769 50.806154 48.836923 54.35077c54.547692 3.544615 54.547692-45.489231 54.547692-45.489231s37.021538-31.507692 50.412308 4.332308c13.390769 35.643077-40.172308 85.858462-95.113846 86.843076s-115.003077-41.550769-109.686154-97.476923c0-0.196923 19.495385-36.627692 51.003077-2.56z"
fill="#493B4E"></path>
<path
d="M634.092308 172.307692s-118.350769 14.966154-93.932308 70.301539c24.418462 55.335385 81.329231 61.44 81.329231 61.44s119.926154 18.116923 33.28-54.547693c0 0-23.04 7.68-41.747693 2.166154s-21.070769-49.033846 4.923077-52.972307 98.067692 13.587692 103.384616 49.624615 41.353846 68.923077-61.243077 112.049231c0 0-144.738462 10.043077-162.264616-112.836923 0 0-17.329231-22.449231 17.132308-73.058462 34.264615-50.806154 119.138462-2.166154 119.138462-2.166154z"
fill="#493B4E"></path>
</svg>
<span>&nbsp;关于</span>
</div>
</li>
<!-- 个人中心 -->
<li>
<el-dropdown placement="bottom">
<el-avatar class="user-avatar" :size="36"
style="margin-top: 12px"
:src="!$common.isEmpty($store.state.currentUser)?$store.state.currentUser.avatar:$store.state.webInfo.avatar">
</el-avatar>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="$router.push({path: '/user'})"
v-if="!$common.isEmpty($store.state.currentUser)">
<i class="fa fa-user-circle" aria-hidden="true"></i> <span>个人中心</span>
</el-dropdown-item>
<el-dropdown-item @click.native="logout()" v-if="!$common.isEmpty($store.state.currentUser)">
<i class="fa fa-sign-out" aria-hidden="true"></i> <span>退出</span>
</el-dropdown-item>
<el-dropdown-item @click.native="$router.push({path: '/user'})"
v-if="$common.isEmpty($store.state.currentUser)">
<i class="fa fa-sign-in" aria-hidden="true"></i> <span>登陆</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
</ul>
</div>
</div>
</transition>
<div id="main-container">
<router-view></router-view>
</div>
<!-- 回到顶部按钮 -->
<div href="#" class="cd-top" v-if="!$common.mobile()" @click="toTop()"></div>
<div class="toolButton" v-show="toolButton">
<div class="backTop" v-if="$common.mobile()" @click="toTop()">
<!-- 回到顶部按钮 -->
<svg viewBox="0 0 1024 1024" width="50" height="50">
<path
d="M696.741825 447.714002c2.717387-214.485615-173.757803-312.227566-187.33574-320.371729-10.857551 5.430775-190.050127 103.168727-187.33274 320.371729-35.297037 24.435488-73.306463 65.1623-67.875688 135.752376 5.430775 70.589076 76.018851 119.460051 103.168726 116.745664 27.152875-2.716387 19.004713-21.7221 19.004713-21.7221l8.148162-38.011425s40.721814 59.732525 51.583363 59.732525h146.609927c13.574938 0 51.585363-59.732525 51.585363-59.732525l8.147162 38.011425s-8.147162 19.005713 19.004713 21.7221c27.148876 2.714388 97.738951-46.156588 103.168727-116.745664s-32.57965-111.316888-67.876688-135.752376z m-187.33574-2.713388c-5.426776 0-70.589076-2.717387-78.733239-78.737238 2.713388-73.306463 73.306463-78.733239 78.733239-81.450626 5.430775 0 76.02385 8.144163 78.736238 81.450626-8.143163 76.019851-73.305463 78.737238-78.736238 78.737238z m0 0"
fill="#000000"></path>
<path
d="M423.602441 746.060699c6.47054-6.297579 12.823107-7.017417 21.629121-2.784372 34.520213 16.582259 70.232157 19.645568 107.031855 9.116944 8.118169-2.323476 15.974396-5.475765 23.598677-9.22392 13.712907-6.73648 26.003134 0.8878 26.080116 16.13936 0.109975 22.574907-0.024994 45.142816 0.080982 67.709725 0.031993 7.464316-2.277486 13.322995-9.44387 16.608254-7.277358 3.333248-13.765895 1.961558-19.526595-3.264264-3.653176-3.313253-7.063407-6.897444-10.634601-10.304675-6.563519-6.259588-6.676494-6.25259-10.625603 1.603638-8.437097 16.80121-16.821205 33.623415-25.257302 50.423625-2.489438 4.953882-5.706713 9.196925-11.411426 10.775569-8.355115 2.315478-15.772442-1.070758-20.272427-9.867774-8.774021-17.15313-17.269104-34.453228-25.918153-51.669344-3.750154-7.469315-3.9891-7.479313-10.141712-1.514658-3.715162 3.602187-7.31435 7.326347-11.142486 10.800563-5.571743 5.060858-11.934308 6.269586-18.936728 3.207277-6.82746-2.984327-9.869774-8.483086-9.892769-15.685462-0.070984-23.506697-0.041991-47.018393-0.020995-70.532089 0.007998-4.679944 1.46467-8.785018 4.803916-11.538397z"
fill="#000000"></path>
</svg>
</div>
<el-popover placement="left"
:close-delay="100"
trigger="click">
<div slot="reference">
<i class="fa fa-cog iconRotate" aria-hidden="true"></i>
</div>
<div class="my-setting">
<div>
<!-- 太阳按钮 -->
<i v-if="isDark" class="el-icon-sunny iconRotate" @click="changeColor()"></i>
<!-- 月亮按钮 -->
<i v-else class="fa fa-moon-o" aria-hidden="true" @click="changeColor()"></i>
</div>
<div>
<i class="fa fa-snowflake-o" aria-hidden="true" @click="changeMouseAnimation()"></i>
</div>
</div>
</el-popover>
</div>
<!-- 点击动画 -->
<canvas v-if="mouseAnimation" id="mousedown"
style="position:fixed;left:0;top:0;pointer-events:none;z-index: 1000">
</canvas>
<el-drawer :visible.sync="toolbarDrawer"
:show-close="false"
size="65%"
custom-class="toolbarDrawer"
title="欢迎光临"
direction="ltr">
<div>
<ul class="small-menu">
<li @click="smallMenu({path: '/'})">
<div>
<svg viewBox="0 0 1024 1024" width="22" height="22" style="vertical-align: -3px;">
<path d="M221.4 152.6h141.8V396h-141.8V152.6z" fill="#FAD996"></path>
<path
d="M363.4 152.6c-9-16.6-138.2-14.2-142 0-3 11.4-23.6 287 15.8 182.4 10.4-27.4 22.6-47.6 37.2-78.6 10.6-22.6 22-42.4 32.6-54.4 16.6-18.6 18 9.6 33.6 22.6 41.6 34.4 31.8-55.6 22.8-72z"
fill="#F9F8F7"></path>
<path
d="M834.2 851c0 24.8-20.2 45-45 45H234.8c-24.8 0-45-20.2-45-45v-370h1.2l321.2-270 321.2 270h0.6l0.2 370z"
fill="#FAD996"></path>
<path d="M833.4 481l-321.2-270-1.8 1.6V896h278.8c24.8 0 45-20.2 45-45l-0.2-370h-0.6z" fill="#F7C872"
p-id="16219"></path>
<path
d="M62 548L432.6 166.2s81.2-90.6 171.8 0c79 79 343.6 400 343.6 400s-55.4 41-125.2 14.2c-37.8-14.4-118.2-68-133.4-150.8-11-60.2-45.8 29-60.8-38.2-9.4-42.2-67.2-96.6-67.2-96.6s-48.4-55.4-100.2 0c-13.8 14.8-11.4 134.6-44 128-26.4-5.2-20-105.6-27-81.2-9.6 33-25 61-54.4 47.2-33.2-15.6-42.4 79.6-64.8 112.8-17.2 25.4-23.8-45.8-40.4-29.2-21.2 21-2.4 94-39.4 108s-132.8-2-129.2-32.4z"
fill="#F9F8F7"></path>
<path
d="M512 126.2v144c28.8 1 49.4 24.6 49.4 24.6s57.8 54.4 67.2 96.6c15 67.2 49.8-22 60.8 38.2 15.2 82.8 95.6 136.4 133.4 150.8 69.8 26.8 125.2-14.2 125.2-14.2s-264.6-321-343.6-400c-33.2-33.2-65.2-42-92.4-40z"
fill="#EFEBE8"></path>
<path d="M405.2 495h99.8v99.8h-99.8v-99.8zM405.2 609.2h99.8v99.8h-99.8v-99.8z" fill="#FB8A5D"></path>
<path d="M519 495h99.8v99.8h-99.8v-99.8zM519 609.2h99.8v99.8h-99.8v-99.8z" fill="#EA6D4B"></path>
</svg>
<span>&nbsp;首页</span>
</div>
</li>
<li v-for="(menu, index) in $store.getters.navigationBar"
@click="smallMenu({path: '/sort', query: {sortId: menu.id, labelId: menu.labels[0].id}})"
:key="index">
<div>
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path d="M0 0h1024v1024H0V0z" fill="#202425" opacity=".01"></path>
<path
d="M682.666667 341.333333a136.533333 136.533333 0 0 1 273.066666 0v546.133334a68.266667 68.266667 0 0 1-68.266666 68.266666h-204.8V341.333333z"
fill="#FFAA44"></path>
<path
d="M68.266667 819.2a136.533333 136.533333 0 0 0 136.533333 136.533333h682.666667a68.266667 68.266667 0 0 1-68.266667-68.266666V204.8a136.533333 136.533333 0 0 0-136.533333-136.533333H204.8a136.533333 136.533333 0 0 0-136.533333 136.533333v614.4z"
fill="#FF7744"></path>
<path
d="M187.733333 273.066667A51.2 51.2 0 0 1 238.933333 221.866667h68.266667a51.2 51.2 0 1 1 0 102.4H238.933333A51.2 51.2 0 0 1 187.733333 273.066667z m0 204.8A51.2 51.2 0 0 1 238.933333 426.666667h409.6a51.2 51.2 0 0 1 0 102.4H238.933333A51.2 51.2 0 0 1 187.733333 477.866667zM238.933333 631.466667a51.2 51.2 0 0 0 0 102.4h204.8a51.2 51.2 0 0 0 0-102.4H238.933333z"
fill="#FFFFFF"></path>
</svg>
<span>&nbsp;{{ menu.sortName }}</span>
</div>
</li>
<!-- 聊天室 -->
<li @click="goIm()">
<div>
<svg viewBox="0 0 1024 1024" width="20" height="20" style="vertical-align: -3px;">
<path
d="M544.54784 628.16768a173.7216 173.7216 0 0 1 0-245.1712l158.6432-159.104a172.50816 172.50816 0 0 1 244.46464 0 173.7216 173.7216 0 0 1 0 245.17632L788.992 628.16768a172.50816 172.50816 0 0 1-244.44416 0z m-325.49888 324.608a173.71648 173.71648 0 0 1 0-245.1712l158.6432-159.104a172.50816 172.50816 0 0 1 244.46464 0 173.71648 173.71648 0 0 1 0 245.1712l-158.63808 159.09376a172.51328 172.51328 0 0 1-244.46976 0z"
fill="#F4CA1C"></path>
<path
d="M415.6416 567.72096a36.58752 36.58752 0 0 1-25.99936-10.80832 215.58272 215.58272 0 0 1-63.52896-149.15072A203.80672 203.80672 0 0 1 385.536 259.072l163.1744-163.7376c80.70656-80.9728 213.86752-79.104 296.82688 4.13696a215.61856 215.61856 0 0 1 63.53408 149.15072 203.776 203.776 0 0 1-59.392 148.67968l-105.2928 101.83168a36.8384 36.8384 0 0 1-51.03616-53.13024l104.79104-101.376a130.12992 130.12992 0 0 0 37.376-94.78144 142.06976 142.06976 0 0 0-41.984-98.21184c-54.30272-54.48192-140.8-56.32-192.82944-4.13696L437.51936 311.26016a130.50368 130.50368 0 0 0-37.888 95.26272 142.08512 142.08512 0 0 0 41.984 98.21184 36.97664 36.97664 0 0 1 0 52.18304 36.58752 36.58752 0 0 1-25.97376 10.8032z m-169.30816 346.34752a214.74304 214.74304 0 0 1-152.20736-63.67232c-82.85184-83.13856-84.81792-216.48384-4.46976-297.472l104.96-110.80704a36.82816 36.82816 0 1 1 53.30432 50.83648l-105.91232 111.79008c-52.0192 52.1984-50.176 138.99264 4.1216 193.47456s140.8 56.32 192.82432 4.13184l163.18976-163.74784a130.47808 130.47808 0 0 0 37.888-95.232 142.09536 142.09536 0 0 0-41.984-98.21696 36.83328 36.83328 0 0 1 51.9936-52.18304 215.6288 215.6288 0 0 1 63.53408 149.15584 203.81184 203.81184 0 0 1-59.392 148.67968L390.95296 854.528a203.08992 203.08992 0 0 1-144.61952 59.54048z"
fill="#595BB3"></path>
</svg>
<span>&nbsp;社交</span>
</div>
</li>
<!-- 微言 -->
<!-- <li @click="smallMenu({path: '/weiYan'})">-->
<!-- <div>-->
<!-- <svg viewBox="0 0 1024 1024" width="24" height="24" style="vertical-align: -3px;">-->
<!-- <path-->
<!-- d="M252.8 862.9h-73.4c-6.8 0-12.4-5.6-12.4-12.4V134.4c0-6.8 5.6-12.4 12.4-12.4h73.4l5.3 6.8v728.8l-5.3 5.3z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path d="M338.5 942l-42.9-18.1-42.8 18.1v-79.1l7.5-5.3h71.3l7 5.3-0.1 79.1z" fill="#EA800C"></path>-->
<!-- <path-->
<!-- d="M844.6 327.9h-40.7l-5.3-5.8v-93.3l5.3-7.2h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.9-5.6 12.4-12.4 12.4z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path-->
<!-- d="M844.6 540.5h-40.7l-5.3-7.3v-90.6l5.3-8.4h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.8-5.6 12.4-12.4 12.4z"-->
<!-- fill="#EA800C"></path>-->
<!-- <path-->
<!-- d="M844.6 753h-40.7l-5.3-6.7v-92.1l5.3-7.5h40.7c6.8 0 12.4 5.6 12.4 12.4v81.5c0 6.8-5.6 12.4-12.4 12.4z"-->
<!-- fill="#2F9B77"></path>-->
<!-- <path d="M791.8 862.9h-539V122h539.1c6.7 0 12 5.4 12 12v716.8c0 6.7-5.4 12.1-12.1 12.1z"-->
<!-- fill="#3DC38A"></path>-->
<!-- <path-->
<!-- d="M680.3 661.1H343.7c-14 0-25.5-11.5-25.5-25.5s11.5-25.5 25.5-25.5h336.6c14 0 25.5 11.5 25.5 25.5s-11.5 25.5-25.5 25.5zM680.3 779.8H343.7c-14 0-25.5-11.5-25.5-25.5s11.5-25.5 25.5-25.5h336.6c14 0 25.5 11.5 25.5 25.5s-11.5 25.5-25.5 25.5z"-->
<!-- fill="#2F9B77"></path>-->
<!-- <path-->
<!-- d="M594.8 511.1c-79.2 45.7-180.5 18.6-226.3-60.6S350 270 429.2 224.2s180.5-18.6 226.3 60.6 18.5 180.6-60.7 226.3z"-->
<!-- fill="#3DC38A"></path>-->
<!-- <path-->
<!-- d="M523.7 318.1c-1.2 0.3-3.5 0.9-4.5 1.7-1.2 1 0.7 2.3 0 2.9-1.2 1-2.1 2.7-4.7 2.6-5.5-0.3-13.9-7.5-19-10.2 8.1-8.3-4.7-9.6-9.7-9.1-6.5 0.5-17.7 0-23.5 3.2-4.1 2.3-9.5 11.7-12.8 15.5-4.6 5.2-9.1 9.8-12.1 16-10.9 23 5.9 49.4 32.2 46.3 7.3-0.9 14.9-5.5 21.4 0.6 4.8 4.5 2.3 8.7 3.5 13.9 1.1 4.5 6.1 7.3 7.8 11.4 3.3 7.9 1.2 12.9-1.1 20.2-3.1 9.6 4.9 21 8 30.2 1.6 4.7 6.1 17.7 10.7 19.8 7.1 3.2 18.1-6.4 22.4-11.6 3.3-4.1 2.2-8.2 4.4-12 2.4-4.1 5.4-5.3 7.1-10.6 1.8-5.7 3.7-7.1 7.5-11.3 6.2-6.7 5.2-10.6 2.7-18.6-5.1-16.5 13.5-24.2 21.8-36.3 8.7-12.6-8.2-8.4-14.8-12.8-6.8-4.4-9.8-12.9-13.1-19.9s-6-17.5-11.4-23.3c-4.2-4.3-16.9-6.4-22.8-8.6zM609.2 428.8c-2.6 8.9-5.3 17.8-7.9 26.7-1.8 6.2-8.4 26.6-17.5 13.6-3.5-5-0.6-11.4 1.3-16 2.4-5.8-0.9-8.7 0.9-14.1 2-6.2 10-6.4 13.8-10.8 2.7-3 4.3-7.9 6.2-11.5 1 4 2.1 8.1 3.2 12.1z"-->
<!-- fill="#F2B843"></path>-->
<!-- <path-->
<!-- d="M655.4 284.9c-28.5-49.4-78.7-78.5-131.6-82.4l-21.6 27.2-46.4 16.3-12.5 30.2 19.2 26.9 2-5.7c3.4-9.5 12.4-15.8 22.5-15.8h31.7l36.4 12.8 12.5 12v7.6l17.4 33.4 5.1-1.9c11-4 20.9-10.4 29.2-18.7l-4.2-6.3c-1.4-2 0.1-4.7 2.5-4.7h10.2c3 0 5.8 1.3 7.7 3.6l8.3 9.7c0.8 0.9 1.4 2 1.8 3.1l9.1 25.2 4.4-4.4c2.7-2.7 4.1-6.5 4.2-10.4 0-3.1 1.4-6.1 3.7-8.2l3.4-3c0.8-0.8 1.8-1.4 2.8-1.8-3.6-15.3-9.5-30.4-17.8-44.7zM407.6 291.3l7.9-8.5c5.8-6.2 7.4-15.2 4.2-23-3.4-8.3-10.9-13.6-19.2-14.8-29.2 26.5-47.4 62.2-52.6 100 6.2 5.4 12.6 11.2 12.6 11.7-0.1 1 23.2-2.9 23.2-2.9l-12-17.5 17.2-12.3 18.7-32.7zM423.8 456.4c7.5-2.4 11.6-10.4 9.1-17.9l-2.1-6.6c-0.9-2.9-0.9-5.9 0-8.8 2.7-8.1-2.4-16.8-10.8-18.4l-16.8-3.3-30.6-23.2-25.3 8.2c2.5 21.9 9.4 43.7 21.2 64.1 10.9 18.8 24.9 34.7 41 47.4l7.5-39.3 6.8-2.2z"-->
<!-- fill="#2F9B77"></path>-->
<!-- </svg>-->
<!-- <span>&nbsp;微言</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- 留言 -->
<li @click="smallMenu({path: '/message'})">
<div>
<svg viewBox="0 0 1024 1024" width="24" height="24" style="vertical-align: -3px;">
<path
d="M113.834667 291.84v449.194667a29.013333 29.013333 0 0 0 28.842666 29.013333h252.928v90.453333l160.597334-90.453333h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333h-665.6a29.013333 29.013333 0 0 0-29.696 29.013333z"
fill="#FFDEAD"></path>
<path
d="M809.130667 262.826667h-665.6a29.013333 29.013333 0 0 0-28.842667 29.013333v40.106667a29.013333 29.013333 0 0 1 28.842667-29.013334h665.6a29.013333 29.013333 0 0 1 29.013333 29.013334V291.84a29.013333 29.013333 0 0 0-29.013333-29.013333z"
fill="#FFF3DB"></path>
<path
d="M556.202667 770.048h252.928a29.013333 29.013333 0 0 0 29.013333-29.013333V362.837333s-59.733333 392.533333-724.309333 314.709334v63.488a29.013333 29.013333 0 0 0 28.842666 29.013333h253.098667v90.453333z"
fill="#F2C182"></path>
<path
d="M619.008 632.32l101.888-35.157333-131.754667-76.117334 29.866667 111.274667zM891.904 148.992a61.44 61.44 0 0 0-84.138667 22.528l-19.968 34.133333 106.666667 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-22.528-84.138667z"
fill="#69BAF9"></path>
<path d="M775.338667 198.775467l131.669333 76.032-186.026667 322.218666-131.6864-76.032z"
fill="#F7FBFF"></path>
<path
d="M775.168 198.826667l-5.290667 9.216 59.221334 34.133333a34.133333 34.133333 0 0 1 12.458666 46.592l-139.946666 242.346667a34.133333 34.133333 0 0 1-46.762667 12.629333l-59.050667-34.133333-6.656 11.434666 88.746667 51.2L720.896 597.333333l186.026667-322.56z"
fill="#D8E3F0"></path>
<path
d="M616.448 622.592l2.56 9.728 101.888-35.157333-44.885333-25.941334-59.562667 51.370667zM891.904 148.992c-1.024 0-2.218667-0.853333-3.242667-1.536A61.610667 61.610667 0 0 1 887.466667 204.8l-19.968 34.133333-73.728-42.496-5.12 8.704 106.666666 61.610667 19.968-34.133333a61.781333 61.781333 0 0 0-23.381333-83.626667z"
fill="#599ED4"></path>
<path
d="M265.898667 417.621333H494.933333a17.066667 17.066667 0 1 0 0-34.133333H265.898667a17.066667 17.066667 0 1 0 0 34.133333zM265.898667 533.504H494.933333a17.066667 17.066667 0 0 0 0-34.133333H265.898667a17.066667 17.066667 0 0 0 0 34.133333z"
fill="#3D3D63"></path>
<path
d="M959.488 354.645333a99.84 99.84 0 0 0-23.722667-127.488 78.677333 78.677333 0 0 0-142.848-64.170666l-11.605333 20.138666a17.066667 17.066667 0 0 0-20.821333 7.168l-32.085334 55.466667H142.677333a46.250667 46.250667 0 0 0-45.909333 46.08v449.194667a46.08 46.08 0 0 0 45.909333 46.08h236.032v73.386666a17.066667 17.066667 0 0 0 8.362667 14.848 17.066667 17.066667 0 0 0 8.704 2.218667 17.066667 17.066667 0 0 0 8.362667-2.218667l156.672-88.234666h248.32a46.08 46.08 0 0 0 46.08-46.08V398.677333L921.6 283.306667a17.066667 17.066667 0 0 0-4.266667-21.504l1.877334-3.413334a65.365333 65.365333 0 0 1 10.410666 79.189334l-53.077333 91.989333a56.832 56.832 0 0 0 20.821333 77.653333 17.066667 17.066667 0 0 0 24.234667-6.314666 17.066667 17.066667 0 0 0-6.997333-23.04 23.04 23.04 0 0 1-8.362667-31.061334z m-138.410667 386.389334a11.946667 11.946667 0 0 1-11.946666 11.946666H556.202667a17.066667 17.066667 0 0 0-8.362667 2.218667l-134.997333 76.117333v-61.269333a17.066667 17.066667 0 0 0-17.066667-17.066667H142.677333a11.946667 11.946667 0 0 1-11.776-11.946666V291.84a11.946667 11.946667 0 0 1 11.776-11.946667h565.930667L574.464 512a17.066667 17.066667 0 0 0-1.706667 12.970667L597.333333 615.253333H265.898667a17.066667 17.066667 0 1 0 0 34.133334h352.938666a17.066667 17.066667 0 0 0 5.802667 0l102.4-35.328a17.066667 17.066667 0 0 0 9.216-7.509334l85.333333-147.968z m-204.8-184.661334l63.829334 36.864-49.322667 17.066667z m206.848-170.666666v1.365333l-108.373333 186.709333-102.4-59.050666L781.482667 221.866667l102.4 59.050666z m76.458667-161.28L887.466667 244.224l-76.970667-44.373333 11.264-19.797334a44.544 44.544 0 1 1 77.141333 44.544z"
fill="#3D3D63"></path>
</svg>
<span>&nbsp;留言</span>
</div>
</li>
<!-- 友人帐 -->
<li @click="smallMenu({path: '/friend'})">
<div>
<span>💃&nbsp;友人帐</span>
</div>
</li>
<!-- 关于 -->
<li @click="smallMenu({path: '/about'})">
<div>
<svg viewBox="0 0 1136 1024" width="26" height="26" style="margin-left: -5px;vertical-align: -5px;">
<path
d="M255.015385 409.796923s-113.821538-16.344615-106.338462 80.147692c7.483077 96.295385 106.338462 78.769231 106.338462 78.769231s66.363077 252.652308 332.8 257.772308 346.584615-260.135385 346.584615-260.135385 106.338462 32.492308 116.381538-76.209231-111.458462-81.526154-111.458461-81.526153S888.123077 155.766154 587.815385 153.403077s-332.8 256.393846-332.8 256.393846z"
fill="#FFC0A9"></path>
<path
d="M595.101538 846.375385h-7.68c-145.526154-2.756923-233.550769-76.8-281.6-138.436923-37.021538-47.458462-56.516923-94.326154-64.984615-118.153847-19.101538 0.393846-49.821538-2.56-74.633846-21.858461-22.252308-17.132308-34.855385-42.929231-37.415385-76.603077-2.56-31.901538 6.104615-57.304615 25.403077-75.421539 25.206154-23.630769 62.227692-27.569231 84.48-27.175384 5.907692-25.206154 20.283077-72.467692 53.76-119.729231 44.504615-62.621538 131.544615-137.058462 295.384616-135.68 163.052308 1.378462 255.212308 74.830769 303.852307 136.270769 36.627692 46.276923 54.547692 92.16 62.227693 116.775385 23.236923-2.166154 62.424615-1.378462 89.403077 22.252308 21.267692 18.707692 30.523077 46.670769 27.175384 83.101538-3.544615 38.006154-17.92 65.772308-42.732308 82.510769-27.372308 18.313846-60.258462 17.723077-80.344615 14.966154-9.649231 25.009231-31.704615 73.255385-70.892308 121.501539-72.073846 88.812308-169.353846 135.68-281.403077 135.68zM269.784615 545.673846l4.726154 17.92c0.196923 0.590769 16.541538 61.046154 63.803077 120.910769 62.227692 78.966154 146.313846 119.926154 249.895385 121.895385 248.32 4.529231 326.104615-243.396923 326.892307-245.956923l5.71077-19.298462 19.298461 5.907693c0.393846 0 39.384615 11.421538 65.378462-6.104616 14.375385-9.649231 22.843077-27.569231 25.009231-52.775384 2.166154-22.843077-2.363077-39.384615-13.587693-49.23077-20.086154-17.723077-59.864615-13.587692-73.452307-10.633846l-19.889231 4.529231-4.135385-20.086154c-0.196923-0.590769-12.996923-60.652308-60.258461-119.729231-62.818462-78.375385-154.387692-118.744615-271.753847-119.72923-117.76-0.984615-205.784615 38.990769-262.498461 118.744615-42.338462 59.667692-50.215385 119.532308-50.215385 120.123077l-2.56 20.283077-20.086154-2.953846c-13.193846-1.772308-51.593846-2.56-70.892307 15.556923-10.043077 9.452308-14.375385 23.630769-12.8 43.126154 1.772308 22.252308 8.861538 38.006154 22.055384 48.04923 23.827692 18.510769 60.455385 12.603077 60.849231 12.603077l18.510769-3.150769z"
fill="#493B4E"></path>
<path
d="M481.069296 499.027638a35.050906 35.050906 0 1 0 3.652962-70.006569 35.050906 35.050906 0 1 0-3.652962 70.006569Z"
fill="#493B4E"></path>
<path
d="M704.993567 510.606399a35.050906 35.050906 0 1 0 3.652961-70.00657 35.050906 35.050906 0 1 0-3.652961 70.00657Z"
fill="#493B4E"></path>
<path
d="M537.6 597.464615s-5.710769 50.806154 48.836923 54.35077c54.547692 3.544615 54.547692-45.489231 54.547692-45.489231s37.021538-31.507692 50.412308 4.332308c13.390769 35.643077-40.172308 85.858462-95.113846 86.843076s-115.003077-41.550769-109.686154-97.476923c0-0.196923 19.495385-36.627692 51.003077-2.56z"
fill="#493B4E"></path>
<path
d="M634.092308 172.307692s-118.350769 14.966154-93.932308 70.301539c24.418462 55.335385 81.329231 61.44 81.329231 61.44s119.926154 18.116923 33.28-54.547693c0 0-23.04 7.68-41.747693 2.166154s-21.070769-49.033846 4.923077-52.972307 98.067692 13.587692 103.384616 49.624615 41.353846 68.923077-61.243077 112.049231c0 0-144.738462 10.043077-162.264616-112.836923 0 0-17.329231-22.449231 17.132308-73.058462 34.264615-50.806154 119.138462-2.166154 119.138462-2.166154z"
fill="#493B4E"></path>
</svg>
<span>&nbsp;关于</span>
</div>
</li>
<template v-if="$common.isEmpty($store.state.currentUser)">
<li @click="smallMenu({path: '/user'})">
<div>
<i class="fa fa-sign-in" aria-hidden="true"></i>
<span>&nbsp;登录</span>
</div>
</li>
</template>
<template v-else>
<li @click="smallMenu({path: '/user'})">
<div>
<i class="fa fa-user-circle" aria-hidden="true"></i>
<span>&nbsp;个人中心</span>
</div>
</li>
<li @click="smallMenuLogout()">
<div>
<i class="fa fa-sign-out" aria-hidden="true"></i>
<span>&nbsp;退出</span>
</div>
</li>
</template>
</ul>
</div>
</el-drawer>
</div>
</template>
<script>
import mousedown from '../utils/mousedown';
export default {
data() {
return {
toolButton: false,
hoverEnter: false,
mouseAnimation: false,
isDark: false,
scrollTop: 0,
toolbarDrawer: false,
mobile: false
}
},
mounted() {
if (this.mouseAnimation) {
mousedown();
}
window.addEventListener("scroll", this.onScrollPage);
if (this.isDaylight()) {
this.isDark = true;
let root = document.querySelector(":root");
root.style.setProperty("--background", "#272727");
root.style.setProperty("--fontColor", "white");
root.style.setProperty("--borderColor", "#4F4F4F");
root.style.setProperty("--borderHoverColor", "black");
root.style.setProperty("--articleFontColor", "#E4E4E4");
root.style.setProperty("--articleGreyFontColor", "#D4D4D4");
root.style.setProperty("--commentContent", "#D4D4D4");
}
},
destroyed() {
window.removeEventListener("scroll", this.onScrollPage);
},
watch: {
scrollTop(scrollTop, oldScrollTop) {
//
let enter = scrollTop > window.innerHeight / 2;
const top = scrollTop - oldScrollTop < 0;
let isShow = scrollTop - window.innerHeight > 30;
this.toolButton = isShow;
if (isShow && !this.$common.mobile()) {
if (window.innerHeight > 950) {
$(".cd-top").css("top", "0");
} else {
$(".cd-top").css("top", window.innerHeight - 950 + "px");
}
} else if (!isShow && !this.$common.mobile()) {
$(".cd-top").css("top", "-900px");
}
//
let toolbarStatus = {
enter: enter,
visible: top,
};
this.$store.commit("changeToolbarStatus", toolbarStatus);
},
},
created() {
let toolbarStatus = {
enter: false,
visible: true,
};
this.$store.commit("changeToolbarStatus", toolbarStatus);
this.getWebInfo();
this.getSortInfo();
this.mobile = document.body.clientWidth < 920;
window.addEventListener('resize', () => {
let docWidth = document.body.clientWidth;
if (docWidth < 920) {
this.mobile = true;
} else {
this.mobile = false;
}
});
},
computed: {
toolbar() {
return this.$store.state.toolbar;
}
},
methods: {
smallMenu(data) {
this.$router.push(data)
this.toolbarDrawer = false;
},
smallMenuLogout() {
this.logout();
this.toolbarDrawer = false;
},
goIm() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
} else {
let userToken = this.$common.encrypt(localStorage.getItem("userToken"));
window.open(this.$constant.imBaseURL + "?userToken=" + userToken);
}
},
logout() {
this.$http.get(this.$constant.baseURL + "/user/logout")
.then((res) => {
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.$store.commit("loadCurrentUser", {});
localStorage.removeItem("userToken");
this.$router.push({path: '/'});
},
getWebInfo() {
this.$http.get(this.$constant.baseURL + "/webInfo/getWebInfo")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadWebInfo", res.data);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
getSortInfo() {
this.$http.get(this.$constant.baseURL + "/webInfo/getSortInfo")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadSortInfo", res.data);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
changeColor() {
this.isDark = !this.isDark;
let root = document.querySelector(":root");
if (this.isDark) {
root.style.setProperty("--background", "#272727");
root.style.setProperty("--fontColor", "white");
root.style.setProperty("--borderColor", "#4F4F4F");
root.style.setProperty("--borderHoverColor", "black");
root.style.setProperty("--articleFontColor", "#E4E4E4");
root.style.setProperty("--articleGreyFontColor", "#D4D4D4");
root.style.setProperty("--commentContent", "#D4D4D4");
} else {
root.style.setProperty("--background", "white");
root.style.setProperty("--fontColor", "black");
root.style.setProperty("--borderColor", "rgba(0, 0, 0, 0.5)");
root.style.setProperty("--borderHoverColor", "rgba(110, 110, 110, 0.4)");
root.style.setProperty("--articleFontColor", "#1F1F1F");
root.style.setProperty("--articleGreyFontColor", "#616161");
root.style.setProperty("--commentContent", "#F7F9FE");
}
},
toTop() {
window.scrollTo({
top: 0,
behavior: "smooth"
});
},
onScrollPage() {
this.scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
},
isDaylight() {
let currDate = new Date();
if (currDate.getHours() > 22 || currDate.getHours() < 7) {
return true;
} else {
return false;
}
},
changeMouseAnimation() {
this.mouseAnimation = !this.mouseAnimation;
if (this.mouseAnimation) {
this.$nextTick(() => {
mousedown();
});
}
}
}
}
</script>
<style scoped>
.toolbar-content {
width: 100%;
height: 60px;
color: var(--white);
/* 固定位置,不随滚动条滚动 */
position: fixed;
z-index: 100;
/* 禁止选中文字 */
user-select: none;
transition: all 0.3s ease-in-out;
}
.toolbar-content.enter {
background: var(--toolbarBackground);
color: var(--toolbarFont);
box-shadow: 0 1px 3px 0 rgba(0, 34, 77, 0.05);
}
.toolbar-content.hoverEnter {
background: var(--translucent);
box-shadow: 0 1px 3px 0 rgba(0, 34, 77, 0.05);
}
.toolbar-title {
margin-left: 30px;
cursor: pointer;
}
.toolbar-mobile-menu {
font-size: 30px;
margin-right: 15px;
cursor: pointer;
}
.scroll-menu {
margin: 0 25px 0 0;
display: flex;
justify-content: flex-end;
padding: 0;
}
.scroll-menu > li {
list-style: none;
margin: 0 12px;
font-size: 17px;
height: 60px;
line-height: 60px;
position: relative;
cursor: pointer;
}
.scroll-menu > li:hover .my-menu span {
color: var(--themeBackground);
}
.scroll-menu > li:hover .my-menu i {
color: var(--themeBackground);
animation: scale 1.5s ease-in-out infinite;
}
.scroll-menu > li .my-menu:after {
content: "";
display: block;
position: absolute;
bottom: 0;
height: 6px;
background-color: var(--themeBackground);
width: 100%;
max-width: 0;
transition: max-width 0.25s ease-in-out;
}
.scroll-menu > li:hover .my-menu:after {
max-width: 100%;
}
.el-dropdown {
font-size: unset;
color: unset;
}
.el-popper[x-placement^=bottom] {
margin-top: -8px;
}
.el-dropdown-menu {
padding: 5px 0;
}
.el-dropdown-menu__item {
font-size: unset;
}
.el-dropdown-menu__item:hover {
background-color: var(--white);
color: var(--themeBackground);
}
.toolButton {
position: fixed;
right: 3vh;
bottom: 3vh;
animation: slide-bottom 0.5s ease-in-out both;
z-index: 100;
cursor: pointer;
font-size: 25px;
}
.my-setting {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
cursor: pointer;
font-size: 20px;
}
.my-setting i {
padding: 5px;
}
.my-setting i:hover {
color: var(--themeBackground);
}
.cd-top {
background: var(--toTop) no-repeat center;
position: fixed;
right: 5vh;
top: -900px;
z-index: 99;
width: 70px;
height: 900px;
background-size: contain;
transition: all 0.5s ease-in-out;
cursor: pointer;
}
.backTop {
transition: all 0.3s ease-in;
position: relative;
top: 0;
left: -13px;
}
.backTop:hover {
top: -10px;
}
@media screen and (max-width: 400px) {
.toolButton {
right: 0.5vh;
}
}
</style>

@ -0,0 +1,395 @@
<template>
<div>
<loader :loading="loading">
<!-- 加载页面 -->
<template slot="loader">
<div>
<zombie></zombie>
</div>
</template>
<!-- 内容页面 -->
<template slot="body">
<!-- 首页图片 -->
<el-image style="animation: header-effect 2s"
class="background-image"
v-once
:src="!$common.isEmpty($store.state.webInfo.backgroundImage)?$store.state.webInfo.backgroundImage:$constant.random_image+new Date()+Math.floor(Math.random()*10)"
fit="cover">
<div slot="error" class="image-slot background-image-error"></div>
</el-image>
<!-- 首页文字 -->
<div class="signature-wall myCenter my-animation-hideToShow">
<h1 class="playful">
<span v-for="(a, index) in $store.state.webInfo.webTitle" :key="index">{{a}}</span>
</h1>
<div class="printer" @click="getGuShi()">
<printer :printerInfo="printerInfo">
<template slot="paper" slot-scope="scope">
<h3>
{{ scope.content }}<span class="cursor">|</span>
</h3>
</template>
</printer>
</div>
<div id="bannerWave1"></div>
<div id="bannerWave2"></div>
<i class="el-icon-arrow-down" @click="navigation('.page-container-wrap')"></i>
</div>
<!-- 首页内容 -->
<div class="page-container-wrap">
<div class="page-container">
<div class="aside-content" v-if="showAside">
<myAside></myAside>
</div>
<div class="recent-posts">
<div class="announcement background-opacity">
<i class="fa fa-volume-up" aria-hidden="true"></i>
<div>
<div v-for="(notice, index) in $store.state.webInfo.notices" :key="index">
{{ notice }}
</div>
</div>
</div>
<articleList :articleList="articles"></articleList>
<div class="pagination-wrap">
<div @click="pageArticles()" class="pagination" v-if="pagination.total !== articles.length">
下一页
</div>
<div v-else style="user-select: none">
~~到底啦~~
</div>
</div>
</div>
</div>
</div>
<!-- 页脚 -->
<div style="background: var(--background)">
<myFooter></myFooter>
</div>
</template>
</loader>
</div>
</template>
<script>
const loader = () => import( "./common/loader");
const zombie = () => import( "./common/zombie");
const printer = () => import( "./common/printer");
const articleList = () => import( "./articleList");
const myFooter = () => import( "./common/myFooter");
const myAside = () => import( "./myAside");
export default {
components: {
loader,
zombie,
printer,
articleList,
myFooter,
myAside
},
data() {
return {
loading: false,
showAside: true,
printerInfo: "你看对面的青山多漂亮",
pagination: {
current: 1,
size: 10,
total: 0,
searchKey: ""
},
guShi: {
"content": "",
"origin": "",
"author": "",
"category": ""
},
articles: []
};
},
watch: {},
created() {
this.getGuShi();
this.getArticles();
},
mounted() {
},
methods: {
pageArticles() {
this.pagination.current = this.pagination.current + 1;
this.getArticles();
},
getArticles() {
this.$http.post(this.$constant.baseURL + "/article/listArticle", this.pagination)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.articles = this.articles.concat(res.data.records);
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
navigation(selector) {
let pageId = document.querySelector(selector);
window.scrollTo({
top: pageId.offsetTop,
behavior: "smooth"
});
},
getGuShi() {
let that = this;
let xhr = new XMLHttpRequest();
xhr.open('get', this.$constant.jinrishici);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
that.guShi = JSON.parse(xhr.responseText);
that.printerInfo = that.guShi.content;
}
};
xhr.send();
}
}
}
</script>
<style scoped>
.signature-wall {
/* 向下排列 */
display: flex;
flex-direction: column;
position: relative;
user-select: none;
height: 100vh;
overflow: hidden;
}
.playful {
color: var(--white);
font-size: 40px;
}
/*.playful span {*/
/* position: relative;*/
/* color: #5362f6;*/
/* text-shadow: 0.25px 0.25px #e485f8, 0.5px 0.5px #e485f8, 0.75px 0.75px #e485f8,*/
/* 1px 1px #e485f8, 1.25px 1.25px #e485f8, 1.5px 1.5px #e485f8, 1.75px 1.75px #e485f8,*/
/* 2px 2px #e485f8, 2.25px 2.25px #e485f8, 2.5px 2.5px #e485f8, 2.75px 2.75px #e485f8,*/
/* 3px 3px #e485f8, 3.25px 3.25px #e485f8, 3.5px 3.5px #e485f8, 3.75px 3.75px #e485f8,*/
/* 4px 4px #e485f8, 4.25px 4.25px #e485f8, 4.5px 4.5px #e485f8, 4.75px 4.75px #e485f8,*/
/* 5px 5px #e485f8, 5.25px 5.25px #e485f8, 5.5px 5.5px #e485f8, 5.75px 5.75px #e485f8,*/
/* 6px 6px #e485f8;*/
/* animation: scatter 1.75s infinite;*/
/* font-weight: normal;*/
/*}*/
/*.playful span:nth-child(2n) {*/
/* color: #ed625c;*/
/* text-shadow: 0.25px 0.25px #f2a063, 0.5px 0.5px #f2a063, 0.75px 0.75px #f2a063,*/
/* 1px 1px #f2a063, 1.25px 1.25px #f2a063, 1.5px 1.5px #f2a063, 1.75px 1.75px #f2a063,*/
/* 2px 2px #f2a063, 2.25px 2.25px #f2a063, 2.5px 2.5px #f2a063, 2.75px 2.75px #f2a063,*/
/* 3px 3px #f2a063, 3.25px 3.25px #f2a063, 3.5px 3.5px #f2a063, 3.75px 3.75px #f2a063,*/
/* 4px 4px #f2a063, 4.25px 4.25px #f2a063, 4.5px 4.5px #f2a063, 4.75px 4.75px #f2a063,*/
/* 5px 5px #f2a063, 5.25px 5.25px #f2a063, 5.5px 5.5px #f2a063, 5.75px 5.75px #f2a063,*/
/* 6px 6px #f2a063;*/
/* animation-delay: 0.3s;*/
/*}*/
/*.playful span:nth-child(3n) {*/
/* color: #ffd913;*/
/* text-shadow: 0.25px 0.25px #6ec0a9, 0.5px 0.5px #6ec0a9, 0.75px 0.75px #6ec0a9,*/
/* 1px 1px #6ec0a9, 1.25px 1.25px #6ec0a9, 1.5px 1.5px #6ec0a9, 1.75px 1.75px #6ec0a9,*/
/* 2px 2px #6ec0a9, 2.25px 2.25px #6ec0a9, 2.5px 2.5px #6ec0a9, 2.75px 2.75px #6ec0a9,*/
/* 3px 3px #6ec0a9, 3.25px 3.25px #6ec0a9, 3.5px 3.5px #6ec0a9, 3.75px 3.75px #6ec0a9,*/
/* 4px 4px #6ec0a9, 4.25px 4.25px #6ec0a9, 4.5px 4.5px #6ec0a9, 4.75px 4.75px #6ec0a9,*/
/* 5px 5px #6ec0a9, 5.25px 5.25px #6ec0a9, 5.5px 5.5px #6ec0a9, 5.75px 5.75px #6ec0a9,*/
/* 6px 6px #6ec0a9;*/
/* animation-delay: 0.15s;*/
/*}*/
/*.playful span:nth-child(5n) {*/
/* color: #555bff;*/
/* text-shadow: 0.25px 0.25px #e485f8, 0.5px 0.5px #e485f8, 0.75px 0.75px #e485f8,*/
/* 1px 1px #e485f8, 1.25px 1.25px #e485f8, 1.5px 1.5px #e485f8, 1.75px 1.75px #e485f8,*/
/* 2px 2px #e485f8, 2.25px 2.25px #e485f8, 2.5px 2.5px #e485f8, 2.75px 2.75px #e485f8,*/
/* 3px 3px #e485f8, 3.25px 3.25px #e485f8, 3.5px 3.5px #e485f8, 3.75px 3.75px #e485f8,*/
/* 4px 4px #e485f8, 4.25px 4.25px #e485f8, 4.5px 4.5px #e485f8, 4.75px 4.75px #e485f8,*/
/* 5px 5px #e485f8, 5.25px 5.25px #e485f8, 5.5px 5.5px #e485f8, 5.75px 5.75px #e485f8,*/
/* 6px 6px #e485f8;*/
/* animation-delay: 0.4s;*/
/*}*/
/*.playful span:nth-child(7n) {*/
/* color: #ff9c55;*/
/* text-shadow: 0.25px 0.25px #ff5555, 0.5px 0.5px #ff5555, 0.75px 0.75px #ff5555,*/
/* 1px 1px #ff5555, 1.25px 1.25px #ff5555, 1.5px 1.5px #ff5555, 1.75px 1.75px #ff5555,*/
/* 2px 2px #ff5555, 2.25px 2.25px #ff5555, 2.5px 2.5px #ff5555, 2.75px 2.75px #ff5555,*/
/* 3px 3px #ff5555, 3.25px 3.25px #ff5555, 3.5px 3.5px #ff5555, 3.75px 3.75px #ff5555,*/
/* 4px 4px #ff5555, 4.25px 4.25px #ff5555, 4.5px 4.5px #ff5555, 4.75px 4.75px #ff5555,*/
/* 5px 5px #ff5555, 5.25px 5.25px #ff5555, 5.5px 5.5px #ff5555, 5.75px 5.75px #ff5555,*/
/* 6px 6px #ff5555;*/
/* animation-delay: 0.25s;*/
/*}*/
.printer {
cursor: pointer;
color: var(--white);
background: var(--translucent);
border-radius: 10px;
padding-left: 10px;
padding-right: 10px;
}
#bannerWave1 {
height: 84px;
background: var(--bannerWave1);
position: absolute;
width: 200%;
bottom: 0;
z-index: 10;
animation: gradientBG 120s linear infinite;
}
#bannerWave2 {
height: 100px;
background: var(--bannerWave2);
position: absolute;
width: 400%;
bottom: 0;
z-index: 5;
animation: gradientBG 120s linear infinite;
}
/* 光标 */
.cursor {
margin-left: 1px;
animation: hideToShow 0.7s infinite;
font-weight: 200;
}
.el-icon-arrow-down {
font-size: 40px;
font-weight: bold;
color: var(--white);
position: absolute;
bottom: 60px;
animation: my-shake 1.5s ease-out infinite;
z-index: 15;
cursor: pointer;
}
.page-container-wrap {
background: var(--background);
position: relative;
}
.page-container {
display: flex;
justify-content: center;
width: 90%;
padding: 0 20px 40px 20px;
margin: 0 auto;
flex-direction: row;
}
.recent-posts {
width: 70%;
}
.announcement {
padding: 22px;
border: 1px dashed var(--lightGray);
color: var(--greyFont);
border-radius: 10px;
display: flex;
max-width: 780px;
margin: 40px auto 40px;
}
.announcement i {
color: var(--themeBackground);
font-size: 22px;
margin: auto 0;
animation: scale 0.8s ease-in-out infinite;
}
.announcement div div {
margin-left: 20px;
line-height: 30px;
}
.aside-content {
width: calc(30% - 40px);
user-select: none;
margin-top: 40px;
margin-right: 40px;
max-width: 300px;
float: right;
}
.pagination-wrap {
display: flex;
justify-content: center;
margin-top: 40px;
}
.pagination {
padding: 13px 15px;
border: 1px solid var(--lightGray);
border-radius: 3rem;
color: var(--greyFont);
width: 100px;
user-select: none;
cursor: pointer;
text-align: center;
}
.pagination:hover {
border: 1px solid var(--themeBackground);
color: var(--themeBackground);
box-shadow: 0 0 5px var(--themeBackground);
}
@media screen and (max-width: 1100px) {
.recent-posts {
width: 100%;
}
.page-container {
width: 100%;
}
}
@media screen and (max-width: 1000px) {
.page-container {
/* 文章栏与侧标栏垂直排列 */
flex-direction: column;
}
.aside-content {
width: 100%;
max-width: unset;
float: unset;
margin: 40px auto 0;
}
}
@media screen and (max-width: 768px) {
h1 {
font-size: 35px;
}
}
</style>

@ -0,0 +1,629 @@
<template>
<div class="letter-wrap">
<div id="jsi-cherry-container" style="z-index: -99;">
<canvas width="646" height="754" position="absolute" top="0"></canvas>
</div>
<section class="container" id="contact">
<form class="flip">
<div class="front">
<h2>To&nbsp;&nbsp;Ming</h2>
<a id="flip2back" href="#">Flip</a>
</div>
<div id="content" class="back">
<div id="letter">
<div class="container">
<div class="flip">
<div class="front"></div>
<div class="back">
<p class="letter">Ming<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;夜にはいつも寒いよねでも手を繋いでいると暖かくなるよ<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;どんなに寒い夜も君と二人でいればちっとも寒くない<br><br>
<p style="float:right; display:block; width:80px;">Hao</p><span class="typed-cursor"
style="animation-iteration-count: infinite;">|</span>
<a id="close" href="#">Close</a>
</div>
</div>
</div>
</div>
<div id="top">
<a id="flip" href="#contact">Flip</a>
</div>
<div id="lid" class="container">
<div class="flip">
<div class="front">
<a id="open" href="#content"><span style="background-position: 0px -150px;"></span></a>
</div>
<div class="back"></div>
</div>
</div>
</div>
</form>
</section>
<div id="footer">
<audio id="music2" preload="auto" loop="" src=""></audio>
<a id="music_btn2" href="javascript:playPause();" style="opacity: 1;"></a>
</div>
</div>
</template>
<script>
export default {
data() {
return {};
},
created() {
},
methods: {}
}
</script>
<style scoped>
.letter-wrap {
font-family: Satisfy, serif;
}
#jsi-cherry-container {
position: absolute;
top: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: transparent;
overflow: hidden;
opacity: 0.618;
z-index: 99;
}
#footer {
/*width: 100%; */
position: fixed;
/*bottom: 100px;*/
top: 10px;
right: 10px;
}
#music_btn2 {
position: relative;
margin: 0 auto;
display: block;
width: 32px;
height: 32px;
background: url(https://haiyong.site/demo/eluvletter/images/play.png) no-repeat;
cursor: pointer;
opacity: 0.2;
}
body {
opacity: 0;
}
span {
display: block;
width: 150px;
height: 150px;
background: url(https://haiyong.site/demo/eluvletter/images/stitch.png) no-repeat;
background-position: 0 0;
}
.typed-cursor {
opacity: 0;
-webkit-animation: blink 0.7s infinite;
-moz-animation: blink 0.7s infinite;
animation: blink 0.7s infinite;
}
@keyframes blink {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes blink {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@-moz-keyframes blink {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
100% {
opacity: 0;
}
}
/* reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}
html {
line-height: 1;
content-zooming: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
display: block;
}
/* body */
body {
font-family: Satisfy, serif;
color: #837362;
background: #fbf8f7;
}
h2 {
font-size: 1.5em;
line-height: 1.6;
float: left;
font-family: Satisfy, serif;
}
/* links */
a {
color: #9b4849;
text-decoration: none;
display: block;
}
a:hover {
color: #783839;
}
#open {
width: 150px;
text-align: center;
margin-top: 50px;
margin-left: 200px;
}
#flip {
margin: 160px 20px 0 0;
float: right;
}
#flip2back {
margin-top: 150px;
float: right;
}
#close {
position: absolute;
bottom: 10px;
right: 10px;
}
/*****************************/
section.container {
position: relative;
width: 600px;
height: 300px;
margin: 280px auto 0;
perspective: 1000px;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
}
section.container > form.flip {
width: 100%;
height: 100%;
position: absolute;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-webkit-transition: -webkit-transform 0.7s 0s;
-moz-transition: -moz-transform 0.7s 0s;
-webkit-transform-origin: center center;
-moz-transform-origin: center center;
}
section.container > form.flip > .front, section.container > form.flip > .back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
}
section.container > form.flip > .back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
background: #837362;
box-shadow: inset 0 10px 30px -10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}
section.container:target > form.flip {
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
transform: rotateY(0deg);
}
.no-csstransforms3d section.container:target > form.flip > .back {
display: none;
}
.container#lid {
position: relative;
width: 100%;
height: 50%;
-webkit-perspective: 800px;
-moz-perspective: 800px;
perspective: 800px;
z-index: 2;
transition: z-index 0s 1s;
-moz-transition: z-index 0s 1s;
-webkit-transition: z-index 0s 1s;
}
.no-csstransforms3d .container#lid {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
#content:target .container#lid {
z-index: -1;
transition: z-index 0s .5s;
-moz-transition: z-index 0s .5s;
-webkit-transition: z-index 0s .5s;
}
.no-csstransforms3d #content:target .container#lid {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.no-csstransforms3d .container#lid .back {
display: none;
}
.no-csstransforms3d #content:target .container#lid .back {
display: block;
top: -150px;
}
#lid .flip {
width: 100%;
height: 100%;
}
#lid .flip {
position: absolute;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: -webkit-transform 0.5s 1s;
-moz-transition: -moz-transform 0.5s 1s;
transition: -moz-transform 0.5s 1s;
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
transform-origin: left top;
}
#lid .flip > .front, #lid .flip > .back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
}
#lid .flip > .back {
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
}
#content:target #lid .flip {
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transition-delay: 0s;
-moz-transition-delay: 0s;
transition-delay: 0s;
}
#letter .flip > div, #lid .flip > div, section.container > form.flip > div {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#lid .flip .front, section.container > form.flip .front {
background: beige url("https://haiyong.site/demo/eluvletter/images/bg.png");
border: 1px #eae1d5 solid;
box-shadow: inset 0 0 10px 1px rgba(255, 255, 255, 0.6), 0 2px 3px -2px rgba(0, 0, 0, 0.6);
padding: 20px 30px;
color: #837362;
text-shadow: 0 1px 0 #fff, 0 1px 0 #fff;
}
section.container > form.flip > .front {
font-size: 1.25em;
background: beige url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: url("https://haiyong.site/demo/eluvletter/images/bg.png") no-repeat 450px 20px, url("https://haiyong.site/demo/eluvletter/images/bg.png");
padding: 120px 20px 20px 40%;
border: 1px #eae1d5 solid;
}
#lid .flip .front {
font-size: 1.25em;
border-radius: 0 0 40px 40px;
}
#lid .flip .back {
background: #837362;
border-radius: 40px 40px 0 0;
border: 35px solid rgba(255, 255, 255, 0.1);
border-bottom: none;
box-shadow: inset 0 10px 30px 10px rgba(0, 0, 0, 0.1);
}
#top {
text-align: right;
background: beige url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(163, 140, 130, 0.17) 100%), url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(163, 140, 130, 0.17))), url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(163, 140, 130, 0.17) 100%), url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: -o-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(163, 140, 130, 0.17) 100%), url("https://haiyong.site/demo/eluvletter/images/bg.png");
background: -ms-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(163, 140, 130, 0.17) 100%), url("https://haiyong.site/demo/eluvletter/images/bg.png");
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 65%;
position: absolute;
left: 0;
bottom: 0;
z-index: 1;
border: 1px #eae1d5 solid;
box-shadow: inset 0 0 10px 1px rgba(255, 255, 255, 0.6), 0 -2px 4px -3px rgba(0, 0, 0, 0.75), 0 2px 3px -2px rgba(0, 0, 0, 0.6);
}
#letter {
background: #fafafa;
width: 90%;
height: 95%;
position: absolute;
left: 5%;
top: 5%;
z-index: 0;
-webkit-transition: .5s .5s;
-moz-transition: .5s .5s;
-o-transition: 0s 0s;
transition: 0s 0s;
}
#content:target #letter {
top: -40%;
-o-transition: .5s .5s;
transition: .5s .5s;
}
#letter .container {
position: absolute;
width: 100%;
/*height: 50%;*/
-webkit-perspective: 800px;
-moz-perspective: 800px;
perspective: 800px;
top: 0;
left: 0;
-webkit-transition: 0s 0s;
-moz-transition: 0s 0s;
transition: 0s 0s;
z-index: 1;
}
#letter .flip {
width: 100%;
height: 100%;
}
#letter .flip {
position: absolute;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: -webkit-transform 0.5s 0s;
-moz-transition: -moz-transform 0.5s 0s;
transition: -moz-transform 0.5s 0s;
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
transform-origin: left top;
}
#letter .flip > .front, #letter .flip > .back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
}
#letter .flip > .back {
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
}
#content:target #letter .flip {
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transition-delay: 1s;
-moz-transition-delay: 1s;
transition-delay: 1s;
}
#content:target #letter .container {
z-index: -1;
-webkit-transition: z-index 0s 1.5s;
-moz-transition: z-index 0s 1.5s;
transition: z-index 0s 1.5s;
}
#letter .flip .front {
background: #fafafa;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2);
}
.no-csstransforms3d #content:target #letter .flip .front {
display: none;
}
#letter .flip .back {
background: #fafafa;
background: -webkit-linear-gradient(top, #fafafa 90%, #f7f7f7 100%);
background: -moz-linear-gradient(top, #fafafa 80%, #f7f7f7 100%);
padding: 40px 40px 0;
font-size: 18px;
line-height: 1.4;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
box-shadow: 0 -5px 8px -4px rgba(0, 0, 0, 0.15);
}
.no-csstransforms3d #content:target #letter .flip .back {
top: -140px;
}
input[type="text"] {
background: transparent;
border: none;
border-bottom: 1px dotted #837362;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
width: 50%;
-webkit-appearance: none;
}
input[type="text"]:focus {
outline: none;
border-bottom: 1px solid #837362;
-webkit-appearance: none;
}
textarea {
margin: 10px auto 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 90%;
height: 160px;
padding: 10px;
display: block;
background: transparent;
background: rgba(255, 255, 255, 0.07);
border: 1px dashed #c8bfb6;
}
textarea:focus {
outline: none;
background-color: rgba(255, 255, 255, 0.12);
border-color: rgba(255, 255, 255, 0.46);
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
}
input[type="submit"] {
cursor: pointer;
display: block;
margin: 10px auto;
-webkit-appearance: none;
font-size: .9em;
background: #9b4849;
padding: 5px 20px;
border-radius: 3px;
border: 1px solid #9b4849;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
color: #fff;
-webkit-transition: background .5s;
}
input[type="submit"]:hover {
background: #783839;
}
/*-------ie8-----------*/
.container.target > form.flip > .back, #content.target #letter .flip .front {
display: none;
}
#content.target .container#lid {
z-index: -1;
}
#content.target .container#lid .back {
display: block;
top: -150px;
}
#content.target #letter {
top: -40%;
}
#content.target #letter .flip .back {
top: -140px;
}
</style>

@ -0,0 +1,182 @@
<template>
<div>
<div>
<el-image style="animation: header-effect 2s"
class="background-image"
v-once
:src="$constant.random_image+new Date()+Math.floor(Math.random()*10)"
fit="cover">
<div slot="error" class="image-slot background-image-error"></div>
</el-image>
<!-- 输入框 -->
<div class="message-in" style="text-align: center">
<h2 class="message-title">树洞</h2>
<div>
<input class="message-input"
type="text"
style="outline: none;width: 70%"
placeholder="留下点什么啦~"
v-model="messageContent"
@click="show = true"
maxlength="150"/>
<button v-show="show"
style="margin-left: 12px;cursor: pointer;width: 20%"
@click="submitMessage"
class="message-input">发射
</button>
</div>
</div>
<!-- 弹幕 -->
<div class="barrage-container">
<vue-baberrage :barrageList="barrageList" :loop="true"></vue-baberrage>
</div>
</div>
<div class="comment-wrap">
<div class="comment-content">
<comment :source="$constant.source" :userId="$constant.userId"></comment>
</div>
<myFooter></myFooter>
</div>
</div>
</template>
<script>
const comment = () => import( "./comment/comment");
const myFooter = () => import( "./common/myFooter");
export default {
components: {
comment,
myFooter
},
data() {
return {
show: false,
messageContent: "",
// background: {"background": "url(" + this.$store.state.webInfo.backgroundImage + ") center center / cover no-repeat"},
barrageList: []
};
},
created() {
this.getTreeHole();
},
methods: {
getTreeHole() {
this.$http.get(this.$constant.baseURL + "/webInfo/listTreeHole")
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
res.data.forEach(m => {
this.barrageList.push({
id: m.id,
avatar: m.avatar,
msg: m.message,
time: Math.floor(Math.random() * 10 + 5)
});
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitMessage() {
if (this.messageContent.trim() === "") {
this.$message({
message: "你还没写呢~",
type: "warning",
});
return;
}
let treeHole = {
message: this.messageContent.trim()
};
if (!this.$common.isEmpty(this.$store.state.currentUser) && !this.$common.isEmpty(this.$store.state.currentUser.avatar)) {
treeHole.avatar = this.$store.state.currentUser.avatar;
}
this.$http.post(this.$constant.baseURL + "/webInfo/saveTreeHole", treeHole)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.barrageList.push({
id: res.data.id,
avatar: res.data.avatar,
msg: res.data.message,
time: Math.floor(Math.random() * 10 + 5)
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.messageContent = "";
this.show = false;
}
}
}
</script>
<style scoped>
.message-in {
position: absolute;
left: 50%;
top: 40%;
transform: translate(-50%, -50%);
color: var(--white);
animation: hideToShow 2.5s;
width: 360px;
z-index: 10;
}
.message-title {
user-select: none;
text-align: center;
}
.message-input {
border-radius: 1.2rem;
border: var(--white) 1px solid;
color: var(--white);
background: var(--transparent);
padding: 10px 10px;
}
.message-input::-webkit-input-placeholder {
color: var(--white);
}
.barrage-container {
position: absolute;
top: 50px;
left: 0;
right: 0;
bottom: 0;
height: calc(100% - 50px);
width: 100%;
user-select: none;
overflow: hidden;
}
.comment-wrap {
background: var(--background);
position: absolute;
top: 100vh;
width: 100%;
}
.comment-content {
max-width: 800px;
margin: 0 auto;
padding: 40px 20px;
}
</style>

@ -0,0 +1,253 @@
<template>
<div>
<!-- 网站信息 -->
<div class="card-content1 shadow-box background-opacity">
<el-avatar style="margin-top: 20px" class="user-avatar" :size="120" :src="webInfo.avatar"></el-avatar>
<div class="web-name">{{webInfo.webName}}</div>
<div class="web-info">
<div class="blog-info-box">
<span>文章</span>
<span class="blog-info-num">{{ $store.getters.articleTotal }}</span>
</div>
<div class="blog-info-box">
<span>分类</span>
<span class="blog-info-num">{{ sortInfo.length }}</span>
</div>
</div>
<a class="collection-btn" @click="showTip()">
<i class="el-icon-star-off" style="margin-right: 2px"></i>朋友圈
</a>
</div>
<!-- 分类 -->
<div class="shadow-box background-opacity wow"
style="padding: 25px 25px 5px;border-radius: 10px;animation: zoomIn 0.8s ease-in-out">
<div class="card-content2-title">
<i class="el-icon-folder-opened card-content2-icon"></i>
<span>分类</span>
</div>
<div v-for="(sort, index) in sortInfo"
:key="index"
class="post-sort"
@click="$router.push({path: '/sort', query: {sortId: sort.id}})">
<div>
<span v-for="(s, i) in sort.sortName.split('')" :key="i">{{ s }}</span>
</div>
</div>
</div>
<!-- 推荐文章 -->
<div v-if="!$common.isEmpty(recommendArticles)"
style="padding: 25px;border-radius: 10px;margin-top: 40px;animation: zoomIn 0.8s ease-in-out"
class="shadow-box background-opacity wow">
<div class="card-content2-title">
<i class="el-icon-reading card-content2-icon"></i>
<span>推荐文章</span>
</div>
<div v-for="(article, index) in recommendArticles"
:key="index"
@click="$router.push({path: '/article', query: {id: article.id}})">
<div class="aside-post-detail">
<div class="aside-post-image">
<el-image class="my-el-image" :src="article.articleCover" fit="cover">
<div slot="error" class="image-slot">
<div class="error-aside-image">
{{article.username}}
</div>
</div>
</el-image>
</div>
<div class="aside-post-title">
{{ article.articleTitle }}
</div>
</div>
<div class="aside-post-date">
<i class="el-icon-date" style="color: var(--greyFont)"></i>{{ article.createTime }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
pagination: {
current: 1,
size: 5,
recommendStatus: true
},
recommendArticles: []
}
},
computed: {
webInfo() {
return this.$store.state.webInfo;
},
sortInfo() {
return this.$store.state.sortInfo;
}
},
created() {
this.getRecommendArticles();
},
methods: {
getRecommendArticles() {
this.$http.post(this.$constant.baseURL + "/article/listArticle", this.pagination)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.recommendArticles = res.data.records;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
showTip() {
this.$router.push({path: '/weiYan'});
}
}
}
</script>
<style scoped>
.card-content1 {
background: linear-gradient(-45deg, #e8d8b9, #eccec5, #a3e9eb, #bdbdf0, #eec1ea);
background-size: 400% 400%;
animation: gradientBG 10s ease infinite;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40px;
border-radius: 10px;
position: relative;
/*color: var(--white);*/
overflow: hidden;
}
.card-content1 :not(:first-child) {
z-index: 10;
}
.web-name {
font-size: 30px;
font-weight: bold;
margin: 20px 0;
}
.web-info {
width: 80%;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.blog-info-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.blog-info-num {
margin-top: 12px;
}
.collection-btn {
position: relative;
margin-top: 12px;
background: var(--lightGreen);
cursor: pointer;
width: 65%;
height: 35px;
border-radius: 1rem;
text-align: center;
line-height: 35px;
color: var(--white);
overflow: hidden;
z-index: 1;
margin-bottom: 25px;
}
.collection-btn::before {
background: var(--gradualRed);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: "";
transform: scaleX(0);
transform-origin: 0;
transition: transform 0.5s ease-out;
transition-timing-function: cubic-bezier(0.45, 1.64, 0.47, 0.66);
border-radius: 1rem;
z-index: -1;
}
.collection-btn:hover::before {
transform: scaleX(1);
}
.card-content2-title {
font-size: 18px;
margin-bottom: 20px;
}
.card-content2-icon {
color: var(--red);
margin-right: 5px;
animation: scale 1s ease-in-out infinite;
}
.aside-post-detail {
display: flex;
cursor: pointer;
}
.aside-post-image {
width: 40%;
border-radius: 0.2rem;
margin-right: 8px;
overflow: hidden;
}
.error-aside-image {
background: var(--themeBackground);
color: var(--white);
padding: 10px;
text-align: center;
width: 100%;
height: 100%;
}
.aside-post-title {
width: 60%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.aside-post-date {
margin-top: 8px;
margin-bottom: 20px;
color: var(--greyFont);
font-size: 12px;
}
.post-sort {
border-radius: 1rem;
margin-bottom: 15px;
line-height: 30px;
transition: all 0.3s;
}
.post-sort:hover {
background: var(--themeBackground);
padding: 2px 15px;
cursor: pointer;
color: var(--white);
}
</style>

@ -0,0 +1,204 @@
<template>
<div>
<!-- 两句诗 -->
<div class="my-animation-slide-top">
<twoPoem></twoPoem>
</div>
<div style="background: var(--background);padding-top: 40px;" class="my-animation-slide-bottom">
<!-- 标签 -->
<div class="sort-warp shadow-box" v-if="!$common.isEmpty(sort) && !$common.isEmpty(sort.labels)">
<div v-for="(label, index) in sort.labels" :key="index"
:class="{isActive: !$common.isEmpty(labelId) && parseInt(labelId) === label.id}"
@click="listArticle(label)">
<proTag :info="label.labelName+' '+label.countOfLabel"
:color="$constant.before_color_list[Math.floor(Math.random() * 6)]"
style="margin: 12px">
</proTag>
</div>
</div>
<!-- 文章 -->
<div class="article-wrap">
<articleList :articleList="articles"></articleList>
<div class="pagination-wrap">
<div @click="pageArticles()" class="pagination" v-if="pagination.total !== articles.length">
下一页
</div>
<div v-else style="user-select: none">
~~到底啦~~
</div>
</div>
</div>
<!-- 页脚 -->
<myFooter></myFooter>
</div>
</div>
</template>
<script>
const twoPoem = () => import( "./common/twoPoem");
const proTag = () => import( "./common/proTag");
const articleList = () => import( "./articleList");
const myFooter = () => import( "./common/myFooter");
export default {
components: {
twoPoem,
proTag,
articleList,
myFooter
},
data() {
return {
sortId: this.$route.query.sortId,
labelId: this.$route.query.labelId,
sort: null,
pagination: {
current: 1,
size: 10,
total: 0,
searchKey: "",
sortId: this.$route.query.sortId,
labelId: this.$route.query.labelId
},
articles: []
}
},
computed: {},
watch: {
$route() {
this.pagination = {
current: 1,
size: 10,
total: 0,
searchKey: "",
sortId: this.$route.query.sortId,
labelId: this.$route.query.labelId
};
this.articles.splice(0, this.articles.length);
this.sortId = this.$route.query.sortId;
this.labelId = this.$route.query.labelId;
this.getSort();
this.getArticles();
}
},
created() {
this.getSort();
this.getArticles();
},
mounted() {
},
methods: {
pageArticles() {
this.pagination.current = this.pagination.current + 1;
this.getArticles();
},
getSort() {
let sortInfo = this.$store.state.sortInfo;
if (!this.$common.isEmpty(sortInfo)) {
let sortArray = sortInfo.filter(f => {
return f.id === parseInt(this.sortId);
});
if (!this.$common.isEmpty(sortArray)) {
this.sort = sortArray[0];
}
}
},
listArticle(label) {
this.labelId = label.id;
this.pagination = {
current: 1,
size: 10,
total: 0,
searchKey: "",
sortId: this.$route.query.sortId,
labelId: label.id
};
this.articles.splice(0, this.articles.length);
this.$nextTick(() => {
this.getArticles();
});
},
getArticles() {
this.$http.post(this.$constant.baseURL + "/article/listArticle", this.pagination)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.articles = this.articles.concat(res.data.records);
this.pagination.total = res.data.total;
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
.sort-warp {
width: 70%;
max-width: 780px;
margin: 0 auto;
padding: 20px;
border-radius: 10px;
display: flex;
flex-wrap: wrap;
}
.article-wrap {
width: 70%;
margin: 40px auto;
min-height: 600px;
}
.isActive {
animation: scale 1.5s ease-in-out infinite;
}
.pagination-wrap {
display: flex;
justify-content: center;
margin-top: 40px;
}
.pagination {
padding: 13px 15px;
border: 1px solid var(--lightGray);
border-radius: 3rem;
color: var(--greyFont);
width: 100px;
user-select: none;
cursor: pointer;
text-align: center;
}
.pagination:hover {
border: 1px solid var(--themeBackground);
color: var(--themeBackground);
box-shadow: 0 0 5px var(--themeBackground);
}
@media screen and (max-width: 900px) {
.sort-warp {
width: 90%;
}
.article-wrap {
width: 90%;
}
}
</style>

@ -0,0 +1,817 @@
<template>
<div>
<!-- 登陆和注册 -->
<div v-if="$common.isEmpty(currentUser)"
class="myCenter in-up-container my-animation-hideToShow">
<!-- 背景图片 -->
<el-image class="my-el-image"
style="position: absolute"
v-once
:src="$constant.two_poem_image[Math.floor(Math.random() * $constant.two_poem_image.length)]"
fit="cover">
<div slot="error" class="image-slot"></div>
</el-image>
<div class="in-up" id="loginAndRegist">
<div class="form-container sign-up-container">
<div class="myCenter">
<h1>注册</h1>
<input v-model="username" type="text" placeholder="用户名">
<input v-model="password" type="password" placeholder="密码">
<button @click="regist()"></button>
</div>
</div>
<div class="form-container sign-in-container">
<div class="myCenter">
<h1>登录</h1>
<input v-model="account" type="text" placeholder="用户名/邮箱/手机号">
<input v-model="password" type="password" placeholder="密码">
<a href="#" @click="changeDialog('找回密码')"></a>
<button @click="login()"></button>
</div>
</div>
<div class="overlay-container">
<div class="overlay">
<div class="overlay-panel myCenter overlay-left">
<h1>已有帐号</h1>
<p>请登录🚀</p>
<button class="ghost" @click="signIn()"></button>
</div>
<div class="overlay-panel myCenter overlay-right">
<h1>没有帐号</h1>
<p>立即注册吧😃</p>
<button class="ghost" @click="signUp()"></button>
</div>
</div>
</div>
</div>
</div>
<!-- 用户信息 -->
<div v-else class="user-container myCenter my-animation-hideToShow">
<!-- 背景图片 -->
<el-image class="my-el-image"
style="position: absolute"
v-once
:src="$constant.two_poem_image[Math.floor(Math.random() * $constant.two_poem_image.length)]"
fit="cover">
<div slot="error" class="image-slot"></div>
</el-image>
<div class="shadow-box-mini user-info" style="display: flex">
<div class="user-left">
<div>
<el-avatar class="user-avatar" @click.native="changeDialog('修改头像')" :size="60"
:src="currentUser.avatar"></el-avatar>
</div>
<div class="myCenter" style="margin-top: 12px">
<div class="user-title">
<div>用户名</div>
<div>手机号</div>
<div>邮箱</div>
<div>性别</div>
<div>简介</div>
</div>
<div class="user-content">
<div>
<el-input v-model="currentUser.username"></el-input>
</div>
<div>
<div v-if="!$common.isEmpty(currentUser.phoneNumber)">
{{ currentUser.phoneNumber }} <span class="changeInfo" @click="changeDialog('修改手机号')"></span>
</div>
<div v-else><span class="changeInfo" @click="changeDialog('绑定手机号')"></span></div>
</div>
<div>
<div v-if="!$common.isEmpty(currentUser.email)">
{{ currentUser.email }} <span class="changeInfo" @click="changeDialog('修改邮箱')"></span>
</div>
<div v-else><span class="changeInfo" @click="changeDialog('绑定邮箱')"></span></div>
</div>
<div>
<el-radio-group v-model="currentUser.gender">
<el-radio :label="0" style="margin-right: 10px">薛定谔的猫</el-radio>
<el-radio :label="1" style="margin-right: 10px"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</div>
<div>
<el-input v-model="currentUser.introduction"
maxlength="60"
type="textarea"
show-word-limit></el-input>
</div>
</div>
</div>
<div style="margin-top: 20px">
<proButton :info="'提交'"
@click.native="submitUserInfo()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
<div class="user-right">
</div>
</div>
</div>
<el-dialog :title="dialogTitle"
:visible.sync="showDialog"
width="30%"
:before-close="clearDialog"
:append-to-body="true"
center>
<div class="myCenter" style="flex-direction: column">
<div>
<div v-if="dialogTitle === '修改手机号' || dialogTitle === '绑定手机号'">
<div style="margin-bottom: 5px">手机号</div>
<el-input v-model="phoneNumber"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">验证码</div>
<el-input v-model="code"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">密码</div>
<el-input v-model="password"></el-input>
</div>
<div v-else-if="dialogTitle === '' || dialogTitle === ''">
<div style="margin-bottom: 5px">邮箱</div>
<el-input v-model="email"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">验证码</div>
<el-input v-model="code"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">密码</div>
<el-input v-model="password"></el-input>
</div>
<div v-else-if="dialogTitle === ''">
<uploadPicture :prefix="'userAvatar'" @addPicture="addPicture" :maxSize="1"
:maxNumber="1"></uploadPicture>
</div>
<div v-else-if="dialogTitle === ''">
<div class="myCenter" style="margin-bottom: 12px">
<el-radio-group v-model="passwordFlag">
<el-radio :label="1" style="margin-right: 10px">手机号</el-radio>
<el-radio :label="2">邮箱</el-radio>
</el-radio-group>
</div>
<div v-if="passwordFlag === 1">
<div style="margin-bottom: 5px">手机号</div>
<el-input v-model="phoneNumber"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">验证码</div>
<el-input v-model="code"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">新密码</div>
<el-input v-model="password"></el-input>
</div>
<div v-else-if="passwordFlag === 2">
<div style="margin-bottom: 5px">邮箱</div>
<el-input v-model="email"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">验证码</div>
<el-input v-model="code"></el-input>
<div style="margin-top: 10px;margin-bottom: 5px">新密码</div>
<el-input v-model="password"></el-input>
</div>
</div>
</div>
<div style="display: flex;margin-top: 30px" v-show="dialogTitle !== '修改头像'">
<proButton :info="codeString"
v-show="dialogTitle === '修改手机号' || dialogTitle === '绑定手机号' || dialogTitle === '修改邮箱' || dialogTitle === '绑定邮箱' || dialogTitle === '找回密码'"
@click.native="getCode()"
:before="$constant.before_color_1"
:after="$constant.after_color_1"
style="margin-right: 20px">
</proButton>
<proButton :info="'提交'"
@click.native="submitDialog()"
:before="$constant.before_color_2"
:after="$constant.after_color_2">
</proButton>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
const proButton = () => import( "./common/proButton");
const uploadPicture = () => import( "./common/uploadPicture");
export default {
components: {
proButton,
uploadPicture
},
data() {
return {
currentUser: this.$store.state.currentUser,
username: "",
account: "",
password: "",
phoneNumber: "",
email: "",
avatar: "",
showDialog: false,
code: "",
dialogTitle: "",
codeString: "验证码",
passwordFlag: null,
intervalCode: null
}
},
computed: {},
created() {
},
methods: {
addPicture(res) {
this.avatar = res;
this.submitDialog()
},
signUp() {
document.querySelector("#loginAndRegist").classList.add('right-panel-active');
},
signIn() {
document.querySelector("#loginAndRegist").classList.remove('right-panel-active');
},
login() {
if (this.$common.isEmpty(this.account) || this.$common.isEmpty(this.password)) {
this.$message({
message: "请输入账号或密码!",
type: "error"
});
return;
}
let user = {
account: this.account.trim(),
password: this.$common.encrypt(this.password.trim())
};
this.$http.post(this.$constant.baseURL + "/user/login", user, false, false)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadCurrentUser", res.data);
localStorage.setItem("userToken", res.data.accessToken);
this.account = "";
this.password = "";
this.$router.push({path: '/'});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
regist() {
if (this.$common.isEmpty(this.username) || this.$common.isEmpty(this.password)) {
this.$message({
message: "请输入用户名或密码!",
type: "error"
});
return;
}
if (this.username.indexOf(" ") !== -1 || this.password.indexOf(" ") !== -1) {
this.$message({
message: "用户名或密码不能包含空格!",
type: "error"
});
return;
}
let user = {
username: this.username.trim(),
password: this.$common.encrypt(this.password.trim())
};
this.$http.post(this.$constant.baseURL + "/user/regist", user)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadCurrentUser", res.data);
localStorage.setItem("userToken", res.data.accessToken);
this.username = "";
this.password = "";
this.$router.push({path: '/'});
let userToken = this.$common.encrypt(localStorage.getItem("userToken"));
window.open(this.$constant.imBaseURL + "?userToken=" + userToken);
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
},
submitUserInfo() {
if (!this.checkParameters()) {
return;
}
let user = {
username: this.currentUser.username,
gender: this.currentUser.gender
};
if (!this.$common.isEmpty(this.currentUser.introduction)) {
user.introduction = this.currentUser.introduction.trim();
}
this.$confirm('确认保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.post(this.$constant.baseURL + "/user/updateUserInfo", user)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadCurrentUser", res.data);
this.currentUser = this.$store.state.currentUser;
this.$message({
message: "修改成功!",
type: "success"
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消保存!'
});
});
},
checkParams(params) {
if (this.dialogTitle === "修改手机号" || this.dialogTitle === "绑定手机号" || (this.dialogTitle === "找回密码" && this.passwordFlag === 1)) {
params.flag = 1;
if (this.$common.isEmpty(this.phoneNumber)) {
this.$message({
message: "请输入手机号!",
type: "error"
});
return false;
}
if (!(/^1[345789]\d{9}$/.test(this.phoneNumber))) {
this.$message({
message: "手机号格式有误!",
type: "error"
});
return false;
}
params.place = this.phoneNumber;
return true;
} else if (this.dialogTitle === "修改邮箱" || this.dialogTitle === "绑定邮箱" || (this.dialogTitle === "找回密码" && this.passwordFlag === 2)) {
params.flag = 2;
if (this.$common.isEmpty(this.email)) {
this.$message({
message: "请输入邮箱!",
type: "error"
});
return false;
}
if (!(/^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/.test(this.email))) {
this.$message({
message: "邮箱格式有误!",
type: "error"
});
return false;
}
params.place = this.email;
return true;
}
return false;
},
checkParameters() {
if (this.$common.isEmpty(this.currentUser.username)) {
this.$message({
message: "请输入用户名!",
type: "error"
});
return false;
}
if (this.currentUser.username.indexOf(" ") !== -1) {
this.$message({
message: "用户名不能包含空格!",
type: "error"
});
return false;
}
return true;
},
changeDialog(value) {
if (value === "修改头像") {
if (this.$common.isEmpty(this.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
}
this.dialogTitle = value;
this.showDialog = true;
},
submitDialog() {
if (this.dialogTitle === "修改头像") {
if (this.$common.isEmpty(this.avatar)) {
this.$message({
message: "请上传头像!",
type: "error"
});
} else {
let user = {
avatar: this.avatar.trim()
};
this.$http.post(this.$constant.baseURL + "/user/updateUserInfo", user)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadCurrentUser", res.data);
this.currentUser = this.$store.state.currentUser;
this.clearDialog();
this.$message({
message: "修改成功!",
type: "success"
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
} else if (this.dialogTitle === "修改手机号" || this.dialogTitle === "绑定手机号" || this.dialogTitle === "修改邮箱" || this.dialogTitle === "绑定邮箱") {
this.updateSecretInfo();
} else if (this.dialogTitle === "找回密码") {
if (this.passwordFlag !== 1 && this.passwordFlag !== 2) {
this.$message({
message: "请选择找回方式!",
type: "error"
});
} else {
this.updateSecretInfo();
}
}
},
updateSecretInfo() {
if (this.$common.isEmpty(this.code)) {
this.$message({
message: "请输入验证码!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.password)) {
this.$message({
message: "请输入密码!",
type: "error"
});
return;
}
let params = {
code: this.code.trim(),
password: this.$common.encrypt(this.password.trim())
};
if (!this.checkParams(params)) {
return;
}
if (this.dialogTitle === "找回密码") {
this.$http.post(this.$constant.baseURL + "/user/updateForForgetPassword", params, false, false)
.then((res) => {
this.clearDialog();
this.$message({
message: "修改成功,请重新登陆!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
} else {
this.$http.post(this.$constant.baseURL + "/user/updateSecretInfo", params, false, false)
.then((res) => {
if (!this.$common.isEmpty(res.data)) {
this.$store.commit("loadCurrentUser", res.data);
this.currentUser = this.$store.state.currentUser;
this.clearDialog();
this.$message({
message: "修改成功!",
type: "success"
});
}
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
},
getCode() {
if (this.codeString === "验证码") {
//
let params = {};
if (!this.checkParams(params)) {
return;
}
let url;
if (this.dialogTitle === "找回密码") {
url = "/user/getCodeForForgetPassword";
} else {
url = "/user/getCodeForBind";
}
this.$http.get(this.$constant.baseURL + url, params)
.then((res) => {
this.$message({
message: "验证码已发送,请注意查收!",
type: "success"
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.codeString = "30";
this.intervalCode = setInterval(() => {
if (this.codeString === "0") {
clearInterval(this.intervalCode)
this.codeString = "验证码";
} else {
this.codeString = (parseInt(this.codeString) - 1) + "";
}
}, 1000);
} else {
this.$message({
message: "请稍后再试!",
type: "warning"
});
}
},
clearDialog() {
this.password = "";
this.phoneNumber = "";
this.email = "";
this.avatar = "";
this.showDialog = false;
this.code = "";
this.dialogTitle = "";
this.passwordFlag = null;
}
}
}
</script>
<style scoped>
.in-up-container {
height: 100vh;
position: relative;
}
.in-up {
opacity: 0.9;
border-radius: 10px;
box-shadow: 0 15px 30px var(--miniMask), 0 10px 10px var(--miniMask);
position: relative;
overflow: hidden;
width: 750px;
max-width: 100%;
min-height: 450px;
}
.in-up p {
font-size: 14px;
letter-spacing: 1px;
margin: 20px 0 30px 0;
}
.in-up a {
color: var(--black);
font-size: 14px;
text-decoration: none;
margin: 15px 0;
}
.form-container {
position: absolute;
height: 100%;
transition: all 0.5s ease-in-out;
}
.sign-in-container {
left: 0;
width: 50%;
}
.sign-up-container {
left: 0;
width: 50%;
opacity: 0;
}
.form-container div {
background: var(--white);
flex-direction: column;
padding: 0 50px;
height: 100%;
}
.form-container input {
background: var(--maxLightGray);
border-radius: 2px;
border: none;
padding: 12px 15px;
margin: 10px 0;
width: 100%;
outline: none;
}
.in-up button {
border-radius: 2rem;
border: none;
background: var(--lightRed);
color: var(--white);
font-size: 16px;
font-weight: bold;
padding: 12px 45px;
letter-spacing: 2px;
cursor: pointer;
}
.in-up button:hover {
animation: scale 0.8s ease-in-out;
}
.in-up button.ghost {
background: transparent;
border: 1px solid var(--white);
}
.sign-up-container button {
margin-top: 20px;
}
.overlay-container {
position: absolute;
left: 50%;
width: 50%;
height: 100%;
overflow: hidden;
transition: all 0.5s ease-in-out;
}
.overlay {
background: var(--gradualRed);
color: var(--white);
position: relative;
left: -100%;
height: 100%;
width: 200%;
}
.overlay-panel {
position: absolute;
top: 0;
flex-direction: column;
height: 100%;
width: 50%;
transition: all 0.5s ease-in-out;
}
.overlay-right {
right: 0;
transform: translateY(0);
}
.overlay-left {
transform: translateY(-20%);
}
.in-up.right-panel-active .sign-in-container {
transform: translateY(100%);
}
.in-up.right-panel-active .overlay-container {
transform: translateX(-100%);
}
.in-up.right-panel-active .sign-up-container {
transform: translateX(100%);
opacity: 1;
}
.in-up.right-panel-active .overlay {
transform: translateX(50%);
}
.in-up.right-panel-active .overlay-left {
transform: translateY(0);
}
.in-up.right-panel-active .overlay-right {
transform: translateY(20%);
}
.user-container {
width: 100vw;
height: 100vh;
position: relative;
}
.user-info {
width: 80%;
z-index: 10;
margin-top: 70px;
height: calc(100vh - 90px);
margin-bottom: 20px;
border-radius: 10px;
overflow: hidden;
}
.user-left {
width: 50%;
background: var(--maxMaxWhiteMask);
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 20px;
}
.user-right {
width: 50%;
background: var(--maxWhiteMask);
padding: 20px;
}
.user-title {
text-align: right;
user-select: none;
}
.user-content {
text-align: left;
}
.user-title div {
height: 55px;
line-height: 55px;
text-align: center;
}
.user-content > div {
height: 55px;
display: flex;
align-items: center;
}
.user-content >>> .el-input__inner, .user-content >>> .el-textarea__inner {
border: none;
background: var(--whiteMask);
}
.user-content >>> .el-input__count {
background: var(--transparent);
user-select: none;
}
.changeInfo {
color: var(--white);
font-size: 0.75rem;
cursor: pointer;
background: var(--themeBackground);
padding: 3px;
border-radius: 0.2rem;
user-select: none;
}
@media screen and (max-width: 920px) {
.user-info {
width: 90%;
}
.user-left {
width: 100%;
}
.user-right {
display: none;
}
}
</style>

@ -0,0 +1,213 @@
<template>
<div>
<!-- 两句诗 -->
<div class="my-animation-slide-top">
<twoPoem :isHitokoto="false"></twoPoem>
</div>
<div style="background: var(--background);animation: hideToShow 2.5s">
<div>
<treeHole :treeHoleList="treeHoleList" @launch="launch" @deleteTreeHole="deleteTreeHole"></treeHole>
<proPage :current="pagination.current"
:size="pagination.size"
:total="pagination.total"
:buttonSize="3"
:color="$constant.pageColor"
@toPage="toPage">
</proPage>
</div>
<!-- 页脚 -->
<myFooter :showFooter="showFooter"></myFooter>
</div>
<el-dialog title="微言"
:visible.sync="weiYanDialogVisible"
width="40%"
:before-close="handleClose"
:append-to-body="true"
destroy-on-close
center>
<div>
<div class="myCenter" style="padding-bottom: 20px">
<el-radio-group v-model="isPublic">
<el-radio-button :label="true">公开</el-radio-button>
<el-radio-button :label="false">私密</el-radio-button>
</el-radio-group>
</div>
<commentBox :disableGraffiti="true"
@submitComment="submitWeiYan">
</commentBox>
</div>
</el-dialog>
</div>
</template>
<script>
const twoPoem = () => import( "./common/twoPoem");
const myFooter = () => import( "./common/myFooter");
const treeHole = () => import( "./common/treeHole");
const proPage = () => import( "./common/proPage");
const commentBox = () => import( "./comment/commentBox");
export default {
components: {
twoPoem,
myFooter,
treeHole,
proPage,
commentBox
},
data() {
return {
treeHoleList: [],
pagination: {
current: 1,
size: 10,
total: 0
},
weiYanDialogVisible: false,
isPublic: true,
showFooter: false
}
},
computed: {},
watch: {},
created() {
this.getWeiYan();
},
mounted() {
},
methods: {
toPage(page) {
this.pagination.current = page;
window.scrollTo({
top: 240,
behavior: "smooth"
});
this.getWeiYan();
},
launch() {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
this.weiYanDialogVisible = true;
},
handleClose() {
this.weiYanDialogVisible = false;
},
submitWeiYan(content) {
let weiYan = {
content: content,
isPublic: this.isPublic
};
this.$http.post(this.$constant.baseURL + "/weiYan/saveWeiYan", weiYan)
.then((res) => {
this.getWeiYan();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
this.handleClose();
},
deleteTreeHole(id) {
if (this.$common.isEmpty(this.$store.state.currentUser)) {
this.$message({
message: "请先登录!",
type: "error"
});
return;
}
if (this.$common.isEmpty(this.$store.state.currentUser.email)) {
this.$message({
message: "请先绑定邮箱!",
type: "error"
});
return;
}
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
center: true
}).then(() => {
this.$http.get(this.$constant.baseURL + "/weiYan/deleteWeiYan", {id: id})
.then((res) => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.pagination.current = 1;
this.getWeiYan();
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}).catch(() => {
this.$message({
type: 'success',
message: '已取消删除!'
});
});
},
getWeiYan() {
this.$http.post(this.$constant.baseURL + "/weiYan/listWeiYan", this.pagination)
.then((res) => {
this.showFooter = false;
if (!this.$common.isEmpty(res.data)) {
res.data.records.forEach(c => {
c.content = c.content.replace(/\n{2,}/g, '<div style="height: 12px"></div>');
c.content = c.content.replace(/\n/g, '<br/>');
c.content = this.$common.faceReg(c.content);
c.content = this.$common.pictureReg(c.content);
});
this.treeHoleList = res.data.records;
this.pagination.total = res.data.total;
}
this.$nextTick(() => {
this.showFooter = true;
});
})
.catch((error) => {
this.$message({
message: error.message,
type: "error"
});
});
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,42 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import http from './utils/request'
import common from './utils/common'
import constant from './utils/constant'
import mavonEditor from 'mavon-editor'
//引入js
//import './utils/live2d'
import './utils/title'
//引入css
import './assets/css/animation.css'
import './assets/css/index.css'
import './assets/css/tocbot.css'
import './assets/css/color.css'
import './assets/css/markdown-highlight.css'
import './assets/css/font-awesome.min.css'
import 'mavon-editor/dist/css/index.css'
//点击涟漪效果
import Ripple from 'vue-ripple-directive'
import {vueBaberrage} from 'vue-baberrage'
Ripple.color = 'var(--rippleColor)'
Vue.directive("ripple", Ripple)
Vue.use(ElementUI)
Vue.use(vueBaberrage)
Vue.use(mavonEditor)
Vue.prototype.$http = http
Vue.prototype.$common = common
Vue.prototype.$constant = constant
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

@ -0,0 +1,130 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
}
Vue.use(VueRouter)
const routes = [
{
path: '/',
component: () => import('../components/home'),
children: [{
path: "/",
name: "index",
component: () => import('../components/index')
}, {
path: "/sort",
name: "sort",
component: () => import('../components/sort')
}, {
path: "/article",
name: "article",
component: () => import('../components/article')
}, {
path: "/weiYan",
name: "weiYan",
component: () => import('../components/weiYan')
}, {
path: "/message",
name: "message",
component: () => import('../components/message')
}, {
path: "/friend",
name: "friend",
component: () => import('../components/friend')
}, {
path: "/about",
name: "about",
component: () => import('../components/about')
}, {
path: "/user",
name: "user",
component: () => import('../components/user')
}, {
path: "/letter",
name: "letter",
component: () => import('../components/letter')
}]
},
{
path: '/admin',
redirect: '/main',
meta: {requiresAuth: true},
component: () => import('../components/admin/admin'),
children: [{
path: '/main',
name: 'main',
component: () => import('../components/admin/main')
}, {
path: '/webEdit',
name: 'webEdit',
component: () => import('../components/admin/webEdit')
}, {
path: '/userList',
name: 'userList',
component: () => import('../components/admin/userList')
}, {
path: '/postList',
name: 'postList',
component: () => import('../components/admin/postList')
}, {
path: '/postEdit',
name: 'postEdit',
component: () => import('../components/admin/postEdit')
}, {
path: '/sortList',
name: 'sortList',
component: () => import('../components/admin/sortList')
}, {
path: '/commentList',
name: 'commentList',
component: () => import('../components/admin/commentList')
}, {
path: '/treeHoleList',
name: 'treeHoleList',
component: () => import('../components/admin/treeHoleList')
}, {
path: '/resourceList',
name: 'resourceList',
component: () => import('../components/admin/resourceList')
}, {
path: '/resourcePathList',
name: 'resourcePathList',
component: () => import('../components/admin/resourcePathList')
}]
},
{
path: '/verify',
name: 'verify',
component: () => import('../components/admin/verify')
}
]
const router = new VueRouter({
mode: "history",
routes: routes,
scrollBehavior(to, from, savedPosition) {
return {x: 0, y: 0}
}
})
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!Boolean(localStorage.getItem("adminToken"))) {
next({
path: '/verify',
query: {redirect: to.fullPath}
});
} else {
next();
}
} else {
next();
}
})
export default router

@ -0,0 +1,81 @@
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)
export default new Vuex.Store({
state: {
toolbar: {
visible: false,
enter: true
},
sortInfo: [],
currentUser: {},
currentAdmin: {},
webInfo: {
webName: "",
webTitle: [],
notices: [],
footer: "",
backgroundImage: "",
avatar: ""
}
},
getters: {
articleTotal: state => {
if (state.sortInfo !== null && state.sortInfo.length !== 0) {
if (state.sortInfo.length === 1) {
return state.sortInfo[0].countOfSort;
} else {
return state.sortInfo.reduce((prev, curr) => {
if (typeof prev === "number") {
return prev + curr.countOfSort;
} else {
return prev.countOfSort + curr.countOfSort;
}
});
}
} else {
return 0;
}
},
navigationBar: state => {
if (state.sortInfo !== null && state.sortInfo.length !== 0) {
return state.sortInfo.filter(f => {
return f.sortType === 0;
}).sort((s1, s2) => {
return s1.priority - s2.priority;
})
} else {
return [];
}
}
},
mutations: {
changeToolbarStatus(state, toolbarState) {
state.toolbar = toolbarState;
},
loadSortInfo(state, sortInfo) {
state.sortInfo = sortInfo;
},
loadCurrentUser(state, user) {
state.currentUser = user;
},
loadCurrentAdmin(state, user) {
state.currentAdmin = user;
},
loadWebInfo(state, webInfo) {
webInfo.webTitle = webInfo.webTitle.split('');
webInfo.notices = JSON.parse(webInfo.notices);
state.webInfo = webInfo;
}
},
actions: {},
modules: {},
plugins: [
createPersistedState({
storage: window.localStorage
})
]
})

@ -0,0 +1,157 @@
import constant from "./constant";
import CryptoJS from 'crypto-js';
export default {
mobile() {
let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
return flag && flag.length && flag.length > 0;
},
/**
* 判断是否为空
*/
isEmpty(value) {
if (typeof value === "undefined" || value === null || (typeof value === "string" && value.trim() === "") || (Array.prototype.isPrototypeOf(value) && value.length === 0) || (Object.prototype.isPrototypeOf(value) && Object.keys(value).length === 0)) {
return true;
} else {
return false;
}
},
/**
* 加密
*/
encrypt(plaintText) {
let options = {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
};
let key = CryptoJS.enc.Utf8.parse(constant.cryptojs_key);
let encryptedData = CryptoJS.AES.encrypt(plaintText, key, options);
return encryptedData.toString().replace(/\//g, "_").replace(/\+/g, "-");
},
/**
* 解密
*/
decrypt(encryptedBase64Str) {
let val = encryptedBase64Str.replace(/\-/g, '+').replace(/_/g, '/');
let options = {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
};
let key = CryptoJS.enc.Utf8.parse(constant.cryptojs_key);
let decryptedData = CryptoJS.AES.decrypt(val, key, options);
return CryptoJS.enc.Utf8.stringify(decryptedData);
},
/**
* 表情包转换
*/
faceReg(content) {
content = content.replace(/\[[^\[^\]]+\]/g, (word) => {
let index = constant.emojiList.indexOf(word.replace("[", "").replace("]", ""));
if (index > -1) {
let url = "https://pzh-blog-photo.oss-cn-shenzhen.aliyuncs.com/emoji/q" + (index + 1) + ".gif";
return '<img style="vertical-align: middle;width: 32px;height: 32px" src="' + url + '" title="' + word + '"/>';
} else {
return word;
}
});
return content;
},
/**
* 图片转换
*/
pictureReg(content) {
content = content.replace(/\<[^\<^\>]+\>/g, (word) => {
let index = word.indexOf(",");
if (index > -1) {
let arr = word.replace("<", "").replace(">", "").split(",");
return '<img style="border-radius: 5px;width: 100%;max-width: 250px;display: block" src="' + arr[1] + '" title="' + arr[0] + '"/>';
} else {
return word;
}
});
return content;
},
/**
* 字符串转换为时间戳
*/
getDateTimeStamp(dateStr) {
return Date.parse(dateStr.replace(/-/gi, "/"));
},
getDateDiff(dateStr) {
let publishTime = isNaN(Date.parse(dateStr.replace(/-/gi, "/")) / 1000) ? Date.parse(dateStr) / 1000 : Date.parse(dateStr.replace(/-/gi, "/")) / 1000;
let d_seconds,
d_minutes,
d_hours,
d_days,
timeNow = Math.floor(new Date().getTime() / 1000),
d,
date = new Date(publishTime * 1000),
Y = date.getFullYear(),
M = date.getMonth() + 1,
D = date.getDate(),
H = date.getHours(),
m = date.getMinutes(),
s = date.getSeconds();
//小于10的在前面补0
if (M < 10) {
M = '0' + M;
}
if (D < 10) {
D = '0' + D;
}
if (H < 10) {
H = '0' + H;
}
if (m < 10) {
m = '0' + m;
}
if (s < 10) {
s = '0' + s;
}
d = timeNow - publishTime;
d_days = Math.floor(d / 86400);
d_hours = Math.floor(d / 3600);
d_minutes = Math.floor(d / 60);
d_seconds = Math.floor(d);
if (d_days > 0 && d_days < 3) {
return d_days + '天前';
} else if (d_days <= 0 && d_hours > 0) {
return d_hours + '小时前';
} else if (d_hours <= 0 && d_minutes > 0) {
return d_minutes + '分钟前';
} else if (d_seconds < 60) {
if (d_seconds <= 0) {
return '刚刚发表';
} else {
return d_seconds + '秒前';
}
} else if (d_days >= 3) {
return Y + '-' + M + '-' + D + ' ' + H + ':' + m;
}
},
/**
* 保存资源
*/
saveResource(that, type, path, isAdmin = false) {
let resource = {
type: type,
path: path
};
that.$http.post(that.$constant.baseURL + "/resource/saveResource", resource, isAdmin)
.catch((error) => {
that.$message({
message: error.message,
type: "error"
});
});
}
}

@ -0,0 +1,46 @@
export default {
baseURL: "http://localhost:8081",
imBaseURL: "http://localhost:81",
webURL: "http://localhost",
// baseURL: "https://poetize.cn/api",
// imBaseURL: "https://poetize.cn/im",
// webURL: "https://poetize.cn",
live2d_path: "https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/",
cdnPath: "https://cdn.jsdelivr.net/gh/fghrsh/live2d_api/",
waifuPath: "/webInfo/getWaifuJson",
hitokoto: "https://v1.hitokoto.cn",
tocbot: "https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.11.1/tocbot.min.js",
jinrishici: "https://v1.jinrishici.com/all.json",
random_image: "https://api.lixingyong.com/api/images?home=home&type=url&itype=album&id=p62&t=5&",
//前后端定义的密钥AES使用16位
cryptojs_key: "$$$$密码加密传输",
qiniuUrl: "https://upload.qiniup.com",
qiniuDownload: "$$$$七牛云下载地址",
friendBG: "$$$$图片地址",
friendLetterTop: "$$$$图片地址",
friendLetterBottom: "$$$$图片地址",
friendLetterBiLi: "$$$$图片地址",
friendLetterMiddle: "$$$$图片地址",
before_color_list: ["$$$$随机颜色"],
tree_hole_color: ["$$$$随机颜色"],
two_poem_image: ["$$$$图片地址"],
before_color_1: "black",
after_color_1: "linear-gradient(45deg, #f43f3b, #ec008c)",
before_color_2: "rgb(131, 123, 199)",
after_color_2: "linear-gradient(45deg, #f43f3b, #ec008c)",
pageColor: "#ee7752",
commentPageColor: "#23d5ab",
userId: 1,
source: 0,
emojiList: ['衰', '鄙视', '再见', '捂嘴', '皱眉', '奋斗', '白眼', '可怜', '皱眉', '鼓掌', '烦恼', '吐舌', '挖鼻', '委屈', '滑稽', '啊这', '生气', '害羞', '晕', '好色', '流泪', '吐血', '微笑', '酷', '坏笑', '吓', '大兵', '哭笑', '困', '呲牙']
}

@ -0,0 +1,69 @@
var aparted = false;
$("#open").click(function () {
if (!aparted) {
var typed = new Typed('.letter', {
strings: ["^1000Dear&nbsp;&nbsp;Ming",
"M^200ing<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;夜には^300いつも^200寒いよね、^600でも、^600手を^200繋いでいると、^600暖か^200くなるよ<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;どんなに^300寒い夜も、^600君と^300二人でいれば、^600ちっとも^300寒くない<br><br><p style='float:right; display:block; width:80px;'>^1000H^200ao</p>"],
typeSpeed: 100,
backSpeed: 50
});
$('#open').find("span").eq(0).css('background-position', "0 -150px");
aparted = true;
var music = document.getElementById('music2');
if (music.paused) {
music.play();
$('#music_btn2').css("opacity", "1");
}
}
});
function playPause() {
var music = document.getElementById('music2');
var music_btn = $('#music_btn2');
if (music.paused) {
music.play();
music_btn.css("opacity", "1");
} else {
music.pause();
music_btn.css("opacity", "0.2");
}
}
window.onload = function () {
var currentUrl = window.location.href;
var firstIndex = currentUrl.indexOf("#");
if (firstIndex <= 0) window.location.href = currentUrl + "#contact";
$('#music2').attr('src', bgmsrc);
document.addEventListener('touchstart', function (event) {
if (event.touches.length > 1) event.preventDefault();
});
var lastTouchEnd = 0;
document.addEventListener('touchend', function (event) {
var now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) event.preventDefault();
lastTouchEnd = now;
}, false);
document.addEventListener('gesturestart', function (event) {
event.preventDefault();
});
$('body').css('opacity', '1');
$('#jsi-cherry-container').css('z-index', '-99');
}

@ -0,0 +1,323 @@
/*
* Live2D Widget
* https://github.com/stevenjoezhang/live2d-widget
*/
import constant from "./constant";
// 注意live2d_path 参数应使用绝对路径
const live2d_path = constant.live2d_path;
// 加载 waifu.css live2d.min.js
if (screen.width > 768) {
Promise.all([
loadExternalResource(live2d_path + "waifu.css", "css"),
loadExternalResource(live2d_path + "live2d.min.js", "js")
]).then(() => {
initWidget({
waifuPath: constant.baseURL + constant.waifuPath,
cdnPath: constant.cdnPath
});
});
}
// 封装异步加载资源的方法
function loadExternalResource(url, type) {
return new Promise((resolve, reject) => {
let tag;
if (type === "css") {
tag = document.createElement("link");
tag.rel = "stylesheet";
tag.href = url;
} else if (type === "js") {
tag = document.createElement("script");
tag.src = url;
}
if (tag) {
tag.onload = () => resolve(url);
tag.onerror = () => reject(url);
document.head.appendChild(tag);
}
});
}
function initWidget(config) {
document.body.insertAdjacentHTML("beforeend", `<div id="waifu-toggle">
<span>看板娘</span>
</div>`);
const toggle = document.getElementById("waifu-toggle");
toggle.addEventListener("click", () => {
toggle.classList.remove("waifu-toggle-active");
if (toggle.getAttribute("first-time")) {
loadWidget(config);
toggle.removeAttribute("first-time");
} else {
localStorage.removeItem("waifu-display");
document.getElementById("waifu").style.display = "";
setTimeout(() => {
document.getElementById("waifu").style.bottom = 0;
}, 0);
}
});
if (localStorage.getItem("waifu-display") && Date.now() - localStorage.getItem("waifu-display") <= 86400000) {
toggle.setAttribute("first-time", true);
setTimeout(() => {
toggle.classList.add("waifu-toggle-active");
}, 0);
} else {
loadWidget(config);
}
}
function loadWidget(config) {
// 配置路径
let {waifuPath, cdnPath} = config;
if (!cdnPath.endsWith("/")) cdnPath += "/";
let modelList, idx = 0;
// 插入html
localStorage.removeItem("waifu-display");
localStorage.removeItem("waifu-text");
document.body.insertAdjacentHTML("beforeend", `<div id="waifu">
<div id="waifu-tips"></div>
<canvas id="live2d" width="800" height="800"></canvas>
<!-- 工具 -->
<div id="waifu-tool">
<span class="fa fa-lg fa-comment"></span>
<span class="fa fa-lg fa-street-view"></span>
<span class="fa fa-lg fa-mouse-pointer"></span>
<span class="fa fa-lg fa-times"></span>
</div>
</div>`);
setTimeout(() => {
document.getElementById("waifu").style.bottom = 0;
}, 0);
// 检测用户活动状态,并在空闲时显示消息
let userAction = false,
userActionTimer,
messageTimer,
messageArray = ["好久不见,日子过得好快呢……", "大坏蛋!你都多久没理人家了呀,嘤嘤嘤~", "嗨~快来逗我玩吧!", "拿小拳拳锤你胸口!", "记得把小家加入 Adblock 白名单哦!"];
window.addEventListener("mousemove", () => userAction = true);
window.addEventListener("keydown", () => userAction = true);
setInterval(() => {
if (userAction) {
userAction = false;
clearInterval(userActionTimer);
userActionTimer = null;
} else if (!userActionTimer) {
userActionTimer = setInterval(() => {
showMessage(randomSelection(messageArray), 6000, 9);
}, 20000);
}
}, 1000);
// 监听器
(function registerEventListener() {
document.querySelector("#waifu-tool .fa-comment").addEventListener("click", showHitokoto);
document.querySelector("#waifu-tool .fa-street-view").addEventListener("click", loadRandModel);
document.querySelector("#waifu-tool .fa-mouse-pointer").addEventListener("click", changeMouseAnimation);
document.querySelector("#waifu-tool .fa-times").addEventListener("click", () => {
localStorage.setItem("waifu-display", Date.now());
showMessage("愿你有一天能与重要的人重逢。", 2000, 11);
document.getElementById("waifu").style.bottom = "-500px";
setTimeout(() => {
document.getElementById("waifu").style.display = "none";
document.getElementById("waifu-toggle").classList.add("waifu-toggle-active");
}, 3000);
});
const devtools = () => {
};
console.log("%c", devtools);
devtools.toString = () => {
showMessage("哈哈,你打开了控制台,是想要看看我的小秘密吗?", 6000, 9);
};
window.addEventListener("copy", () => {
showMessage("你都复制了些什么呀,转载要记得加上出处哦!", 6000, 9);
});
window.addEventListener("visibilitychange", () => {
if (!document.hidden) showMessage("哇,你终于回来了~", 6000, 9);
});
localStorage.setItem("showMouseAnimation", "1");
document.querySelector("body").addEventListener("click", mouseAnimation);
})();
// 欢迎页
(function welcomeMessage() {
let text;
if (location.pathname === "/") { // 如果是主页
const now = new Date().getHours();
if (now > 5 && now <= 7) text = "早上好!一日之计在于晨,美好的一天就要开始了。";
else if (now > 7 && now <= 11) text = "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!";
else if (now > 11 && now <= 13) text = "中午了,工作了一个上午,现在是午餐时间!";
else if (now > 13 && now <= 17) text = "午后很容易犯困呢,今天的运动目标完成了吗?";
else if (now > 17 && now <= 19) text = "傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~";
else if (now > 19 && now <= 21) text = "晚上好,今天过得怎么样?";
else if (now > 21 && now <= 23) text = ["已经这么晚了呀,早点休息吧,晚安~", "深夜时要爱护眼睛呀!"];
else text = "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?";
} else if (document.referrer !== "") {
const referrer = new URL(document.referrer),
domain = referrer.hostname.split(".")[1];
if (location.hostname === referrer.hostname) text = `欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
else if (domain === "baidu") text = `Hello来自 百度搜索 的朋友<br>你是搜索 <span>${referrer.search.split("&wd=")[1].split("&")[0]}</span> 找到的我吗?`;
else if (domain === "so") text = `Hello来自 360搜索 的朋友<br>你是搜索 <span>${referrer.search.split("&q=")[1].split("&")[0]}</span> 找到的我吗?`;
else if (domain === "google") text = `Hello来自 谷歌搜索 的朋友<br>欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
else text = `Hello来自 <span>${referrer.hostname}</span> 的朋友`;
} else {
text = `欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
}
showMessage(text, 7000, 8);
})();
// 初始化模型
(function initModel() {
let modelId = localStorage.getItem("modelId");
if (modelId === null) {
// 首次访问加载 指定模型 的 指定材质
modelId = 5; // 模型 ID
}
loadModel(modelId);
fetch(waifuPath)
.then(response => response.json())
.then(result => {
window.addEventListener("mouseover", event => {
for (let {selector, text} of result.mouseover) {
if (!event.target.matches(selector)) continue;
text = randomSelection(text);
text = text.replace("{text}", event.target.innerText);
showMessage(text, 4000, 8);
return;
}
});
window.addEventListener("click", event => {
for (let {selector, text} of result.click) {
if (!event.target.matches(selector)) continue;
text = randomSelection(text);
text = text.replace("{text}", event.target.innerText);
showMessage(text, 4000, 8);
return;
}
});
result.seasons.forEach(({date, text}) => {
const now = new Date(),
after = date.split("-")[0],
before = date.split("-")[1] || after;
if ((after.split("/")[0] <= now.getMonth() + 1 && now.getMonth() + 1 <= before.split("/")[0]) && (after.split("/")[1] <= now.getDate() && now.getDate() <= before.split("/")[1])) {
text = randomSelection(text);
text = text.replace("{year}", now.getFullYear());
messageArray.push(text);
}
});
});
})();
// 模型集合
async function loadModelList() {
const response = await fetch(`${cdnPath}model_list.json`);
modelList = await response.json();
}
// 载入模型
async function loadModel(modelId, message) {
localStorage.setItem("modelId", modelId);
showMessage(message, 4000, 10);
if (!modelList) await loadModelList();
// const target = randomSelection(modelList.models[modelId]);
const target = "HyperdimensionNeptunia/blanc_swimwear";
loadlive2d("live2d", `${cdnPath}model/${target}/index.json`);
}
// 换肤
async function loadRandModel() {
const modelId = localStorage.getItem("modelId");
if (!modelList) await loadModelList();
const target = randomSelection(modelList.models[modelId]);
loadlive2d("live2d", `${cdnPath}model/${target}/index.json`);
showMessage("我的新衣服好看嘛?", 4000, 10);
}
// 换人
async function loadOtherModel() {
let modelId = localStorage.getItem("modelId");
if (!modelList) await loadModelList();
const index = (++modelId >= modelList.models.length) ? 0 : modelId;
loadModel(index, modelList.messages[index]);
}
// 转换鼠标动画
function changeMouseAnimation() {
if (localStorage.getItem("showMouseAnimation") === "0") {
localStorage.setItem("showMouseAnimation", "1");
document.querySelector("body").addEventListener("click", mouseAnimation);
showMessage("哈哈,要牢记社会主义核心价值观哦!", 6000, 9);
} else {
localStorage.setItem("showMouseAnimation", "0");
document.querySelector("body").removeEventListener("click", mouseAnimation);
showMessage("今天你爱国了吗?", 6000, 9);
}
}
// 鼠标动画
function mouseAnimation(e) {
let list = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
let span = $("<span>").text(list[idx]);
idx = (idx + 1) % list.length;
let x = e.pageX, y = e.pageY;
span.css({
"z-index": 1000,
"top": y - 20,
"left": x,
"position": "absolute",
"pointer-events": "none",
"font-weight": "bold",
"color": "#ff6651"
});
$("body").append(span);
span.animate({"top": y - 180, "opacity": 0}, 1500, function () {
span.remove();
});
}
// 随机选择
function randomSelection(obj) {
return Array.isArray(obj) ? obj[Math.floor(Math.random() * obj.length)] : obj;
}
// 随机词
function showHitokoto() {
// 增加 hitokoto.cn 的 API
fetch(constant.hitokoto)
.then(response => response.json())
.then(result => {
const text = `这句一言来自 <span>「${result.from}」</span>,是 <span>${result.creator}</span> 在 hitokoto.cn 投稿的。`;
showMessage(result.hitokoto, 6000, 9);
setTimeout(() => {
showMessage(text, 4000, 9);
}, 6000);
});
}
// 显示消息
function showMessage(text, timeout, priority) {
if (!text || (localStorage.getItem("waifu-text") && localStorage.getItem("waifu-text") > priority)) return;
if (messageTimer) {
clearTimeout(messageTimer);
messageTimer = null;
}
text = randomSelection(text);
localStorage.setItem("waifu-text", priority);
const tips = document.getElementById("waifu-tips");
tips.innerHTML = text;
tips.classList.add("waifu-tips-active");
messageTimer = setTimeout(() => {
localStorage.removeItem("waifu-text");
tips.classList.remove("waifu-tips-active");
}, timeout);
}
}

@ -0,0 +1,133 @@
export default function () {
// 动画效果
var canvasEl = document.querySelector("#mousedown");
if (canvasEl) {
var ctx = canvasEl.getContext("2d", {willReadFrequently: true})
, numberOfParticules = 30
, pointerX = 0
, pointerY = 0
, tap = "mousedown"
, colors = ["#FF1461", "#18FF92", "#5A87FF", "#FBF38C"]
, setCanvasSize = debounce(function () {
canvasEl.width = 2 * window.innerWidth,
canvasEl.height = 2 * window.innerHeight,
canvasEl.style.width = window.innerWidth + "px",
canvasEl.style.height = window.innerHeight + "px",
canvasEl.getContext("2d", {willReadFrequently: true}).scale(2, 2)
}, 500)
, render = anime({
duration: 1 / 0,
update: function () {
ctx.clearRect(0, 0, canvasEl.width, canvasEl.height)
}
});
document.addEventListener(tap, function (e) {
"sidebar" !== e.target.id && "toggle-sidebar" !== e.target.id && "A" !== e.target.nodeName && "IMG" !== e.target.nodeName && (render.play(),
updateCoords(e),
animateParticules(pointerX, pointerY))
}, !1),
setCanvasSize(),
window.addEventListener("resize", setCanvasSize, !1)
}
function updateCoords(e) {
pointerX = (e.clientX || e.touches[0].clientX) - canvasEl.getBoundingClientRect().left,
pointerY = e.clientY || e.touches[0].clientY - canvasEl.getBoundingClientRect().top
}
function setParticuleDirection(e) {
var t = anime.random(0, 360) * Math.PI / 180
, a = anime.random(50, 180)
, n = [-1, 1][anime.random(0, 1)] * a;
return {
x: e.x + n * Math.cos(t),
y: e.y + n * Math.sin(t)
}
}
function createParticule(e, t) {
var a = {};
return a.x = e,
a.y = t,
a.color = colors[anime.random(0, colors.length - 1)],
a.radius = anime.random(16, 32),
a.endPos = setParticuleDirection(a),
a.draw = function () {
ctx.beginPath(),
ctx.arc(a.x, a.y, a.radius, 0, 2 * Math.PI, !0),
ctx.fillStyle = a.color,
ctx.fill()
}
,
a
}
function createCircle(e, t) {
var a = {};
return a.x = e,
a.y = t,
a.color = "#F00",
a.radius = .1,
a.alpha = .5,
a.lineWidth = 6,
a.draw = function () {
ctx.globalAlpha = a.alpha,
ctx.beginPath(),
ctx.arc(a.x, a.y, a.radius, 0, 2 * Math.PI, !0),
ctx.lineWidth = a.lineWidth,
ctx.strokeStyle = a.color,
ctx.stroke(),
ctx.globalAlpha = 1
}
,
a
}
function renderParticule(e) {
for (var t = 0; t < e.animatables.length; t++)
e.animatables[t].target.draw()
}
function animateParticules(e, t) {
for (var a = createCircle(e, t), n = [], i = 0; i < numberOfParticules; i++)
n.push(createParticule(e, t));
anime.timeline().add({
targets: n,
x: function (e) {
return e.endPos.x
},
y: function (e) {
return e.endPos.y
},
radius: .1,
duration: anime.random(1200, 1800),
easing: "easeOutExpo",
update: renderParticule
}).add({
targets: a,
radius: anime.random(80, 160),
lineWidth: 0,
alpha: {
value: 0,
easing: "linear",
duration: anime.random(600, 800)
},
duration: anime.random(1200, 1800),
easing: "easeOutExpo",
update: renderParticule,
offset: 0
})
}
function debounce(fn, delay) {
var timer
return function () {
var context = this
var args = arguments
clearTimeout(timer)
timer = setTimeout(function () {
fn.apply(context, args)
}, delay)
}
}
}

@ -0,0 +1,129 @@
import axios from "axios";
import constant from "./constant";
//处理url参数
import qs from "qs";
import store from "../store";
axios.defaults.baseURL = constant.baseURL;
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
if (response.data !== null && response.data.hasOwnProperty("code") && response.data.code !== 200) {
if (response.data.code === 300) {
store.commit("loadCurrentUser", {});
localStorage.removeItem("userToken");
store.commit("loadCurrentAdmin", {});
localStorage.removeItem("adminToken");
window.location.href = constant.webURL + "/user";
}
return Promise.reject(new Error(response.data.message));
} else {
return response;
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
// 当data为URLSearchParams对象时设置为application/x-www-form-urlencoded;charset=utf-8
// 当data为普通对象时会被设置为application/json;charset=utf-8
export default {
post(url, params = {}, isAdmin = false, json = true) {
let config;
if (isAdmin) {
config = {
headers: {"Authorization": localStorage.getItem("adminToken")}
};
} else {
config = {
headers: {"Authorization": localStorage.getItem("userToken")}
};
}
return new Promise((resolve, reject) => {
axios
.post(url, json ? params : qs.stringify(params), config)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err);
});
});
},
get(url, params = {}, isAdmin = false) {
let headers;
if (isAdmin) {
headers = {"Authorization": localStorage.getItem("adminToken")};
} else {
headers = {"Authorization": localStorage.getItem("userToken")};
}
return new Promise((resolve, reject) => {
axios.get(url, {
params: params,
headers: headers
}).then(res => {
resolve(res.data);
}).catch(err => {
reject(err)
})
});
},
upload(url, param, isAdmin = false) {
let config;
if (isAdmin) {
config = {
headers: {"Authorization": localStorage.getItem("adminToken"), "Content-Type": "multipart/form-data"}
};
} else {
config = {
headers: {"Authorization": localStorage.getItem("userToken"), "Content-Type": "multipart/form-data"}
};
}
return new Promise((resolve, reject) => {
axios
.post(url, param, config)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err);
});
});
},
uploadQiniu(url, param) {
let config = {
headers: {"Content-Type": "multipart/form-data"},
timeout: 60000
};
return new Promise((resolve, reject) => {
axios
.post(url, param, config)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err);
});
});
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,6 @@
let titleTime, OriginTitile = document.title;
document.addEventListener("visibilitychange", (function () {
document.hidden ? (document.title = "w(゚Д゚)w 不要走!再看看嘛!", clearTimeout(titleTime)) : (document.title = "♪(^∇^*)欢迎肥来!", titleTime = setTimeout((function () {
document.title = OriginTitile
}), 2e3))
}));

@ -0,0 +1,710 @@
// <canvas class="illo" style="max-width: 250px;max-height: 250px;touch-action: none"></canvas>
// Made with Zdog
var BokehShape = Zdog.Shape.subclass({
bokehSize: 5,
bokehLimit: 64
});
BokehShape.prototype.updateBokeh = function () {
// bokeh 0 -> 1
this.bokeh = Math.abs(this.sortValue) / this.bokehLimit;
this.bokeh = Math.max(0, Math.min(1, this.bokeh));
return this.bokeh;
};
BokehShape.prototype.getLineWidth = function () {
return this.stroke + this.bokehSize * this.bokeh * this.bokeh;
};
BokehShape.prototype.getBokehAlpha = function () {
var alpha = 1 - this.bokeh;
alpha *= alpha;
return alpha * 0.8 + 0.2;
};
BokehShape.prototype.renderCanvasDot = function (ctx) {
this.updateBokeh();
ctx.globalAlpha = this.getBokehAlpha(); // set opacity
Zdog.Shape.prototype.renderCanvasDot.apply(this, arguments);
ctx.globalAlpha = 1; // reset
};
BokehShape.prototype.renderPath = function (ctx, renderer) {
this.updateBokeh();
// set opacity
if (renderer.isCanvas) {
ctx.globalAlpha = this.getBokehAlpha();
}
Zdog.Shape.prototype.renderPath.apply(this, arguments);
// reset opacity
if (renderer.isCanvas) {
ctx.globalAlpha = 1;
}
};
var TAU = Zdog.TAU;
function makeMadeline(isGood, colors, options) {
var rotor = new Zdog.Anchor(options);
var body = new Zdog.Group({
addTo: rotor,
rotate: {x: -TAU / 8},
translate: {z: -48},
updateSort: true
});
var head = new Zdog.Anchor({
addTo: body,
translate: {y: -11, z: -2},
rotate: {x: TAU / 8}
});
// face
var face = new Zdog.Ellipse({
diameter: 6,
addTo: head,
translate: {z: 4},
stroke: 8,
color: colors.skin
});
var eyeGroup = new Zdog.Group({
addTo: face,
translate: {z: face.stroke / 2 - 0.5}
});
// eyes
[-1, 1].forEach(function (xSide) {
// cheek blush
if (isGood) {
new Zdog.Ellipse({
width: 2,
height: 1.3,
addTo: eyeGroup,
translate: {x: 4.5 * xSide, y: 3, z: -1},
rotate: {y: -TAU / 16 * xSide},
stroke: 1,
color: '#FA8',
fill: true
});
}
var eyeX = 3.5 * xSide;
// eye
new Zdog.Ellipse({
width: 0.75,
height: 1.5,
addTo: eyeGroup,
color: colors.eye,
translate: {x: eyeX},
stroke: 2,
fill: true
});
// eye brow
new Zdog.Ellipse({
addTo: eyeGroup,
height: 3,
width: 1.2,
quarters: 2,
translate: {x: eyeX, y: -3},
rotate: {z: -TAU / 4 + 0.15 * xSide * (isGood ? 1 : -1)},
color: colors.hair,
stroke: 1,
fill: false,
closed: true
});
});
// hair ball
new Zdog.Shape({
path: [
{x: -1},
{x: 1},
{z: -4}],
addTo: head,
translate: {y: -4, z: -1},
stroke: 18,
color: colors.hair
});
var bang = new Zdog.Shape({
path: [
{},
{
arc: [
{z: 4, y: 4},
{z: 0, y: 8}]
}],
addTo: head,
translate: {x: 2, y: -7.5, z: 6},
rotate: {x: 0.5, z: -0.5},
stroke: 4,
color: colors.hair,
closed: false
});
bang.copy({
translate: {x: 5, y: -6, z: 5},
rotate: {x: -0.3, z: -0.5}
});
bang.copy({
translate: {x: 5, y: -6, z: 3},
rotate: {y: -0.7, z: -1}
});
// left side
bang.copy({
translate: {x: -2, y: -7.5, z: 6},
rotate: {x: 0, z: TAU / 16 * 6}
});
bang.copy({
translate: {x: -5, y: -6, z: 5},
rotate: {x: 0, z: TAU / 4}
});
bang.copy({
translate: {x: -5, y: -6, z: 3},
rotate: {y: 0.7, z: 1}
});
// hair cover
new Zdog.Shape({
path: [
{x: -3},
{x: 3}],
addTo: head,
stroke: 7,
translate: {y: -8, z: 5},
color: colors.hair
});
// trail locks
var trailLock = new Zdog.Shape({
path: [
{y: -4, z: 0},
{
bezier: [
{y: -10, z: -14},
{y: 0, z: -16},
{y: 0, z: -26}]
}],
addTo: head,
translate: {z: -4, y: 0},
stroke: 10,
color: colors.hair,
closed: false
});
trailLock.copy({
translate: {x: -3, z: -4},
rotate: {z: -TAU / 8},
stroke: 8
});
trailLock.copy({
translate: {x: 3, z: -4},
rotate: {z: TAU / 8},
stroke: 8
});
trailLock.copy({
translate: {y: 2},
// rotate: { z: TAU/2 },
scale: {y: 0.5},
stroke: 8
});
// ----- torso ----- //
// 2nd rib
var torsoRib = new Zdog.Ellipse({
width: 12,
height: 10,
addTo: body,
rotate: {x: -TAU / 4},
translate: {y: -1},
stroke: 6,
color: colors.parkaLight,
fill: true
});
// neck rib
torsoRib.copy({
width: 6,
height: 6,
translate: {y: -5}
});
// 3rd rib
torsoRib.copy({
translate: {y: 3}
});
// 4th rib
torsoRib.copy({
translate: {y: 7},
color: colors.parkaDark
});
// waist
new Zdog.Ellipse({
width: 10,
height: 8,
addTo: body,
rotate: {x: -TAU / 4},
translate: {y: 11},
stroke: 4,
color: colors.tight,
fill: true
});
// arms
[-1, 1].forEach(function (xSide) {
var isLeft = xSide == 1;
// shoulder ball
new Zdog.Shape({
addTo: body,
stroke: 6,
translate: {x: 6 * xSide, y: -5, z: -1},
color: colors.parkaLight
});
var shoulderJoint = new Zdog.Anchor({
addTo: body,
translate: {x: 9 * xSide, y: -3, z: -2},
rotate: isLeft ? {x: TAU / 8 * 3, z: -TAU / 32} : {z: TAU / 16 * 2, x: -TAU / 16 * 2}
});
// top shoulder rib
var armRib = new Zdog.Ellipse({
diameter: 2,
rotate: {x: -TAU / 4},
addTo: shoulderJoint,
translate: {x: 0 * xSide},
stroke: 6,
color: colors.parkaLight,
fill: true
});
armRib.copy({
translate: {y: 4}
});
var elbowJoint = new Zdog.Anchor({
addTo: shoulderJoint,
translate: {y: 8},
rotate: isLeft ? {} : {z: TAU / 8}
});
armRib.copy({
addTo: elbowJoint,
translate: {x: 0, y: 0}
});
armRib.copy({
addTo: elbowJoint,
translate: {y: 4},
color: colors.parkaDark
});
// hand
new Zdog.Shape({
addTo: elbowJoint,
translate: {y: 9, z: -1},
stroke: 8,
color: colors.skin
});
// ----- legs ----- //
var knee = {y: 7};
var thigh = new Zdog.Shape({
path: [{y: 0}, knee],
addTo: body,
translate: {x: 4 * xSide, y: 13},
rotate: isLeft ? {} : {x: TAU / 16 * 3, z: TAU / 16},
stroke: 8,
color: colors.tight
});
var shin = new Zdog.Shape({
path: [{y: 0}, {y: 8}],
addTo: thigh,
stroke: 6,
translate: knee,
rotate: isLeft ? {} : {x: -TAU / 16 * 5},
color: colors.tight
});
});
// butt
new Zdog.Shape({
path: [
{x: -3},
{x: 3}],
visible: false,
addTo: body,
translate: {y: 11, z: -2},
stroke: 8,
color: colors.tight
});
}
window.makeBird = function (options) {
var spin = options.spin || 0;
var arrow = new Zdog.Anchor({
addTo: options.addTo,
scale: 2 / 3,
rotate: {z: spin}
});
var bird = new Zdog.Group({
addTo: arrow,
translate: {x: 87},
rotate: {x: -spin}
});
// bird body
new Zdog.Shape({
path: [
{x: -3, y: 0},
{
arc: [
{x: -2, y: 1.5},
{x: 0, y: 1.5}]
},
{
arc: [
{x: 2, y: 1.5},
{x: 2, y: 0}]
}],
addTo: bird,
translate: {x: 0.5},
stroke: 3,
color: options.color,
fill: true
});
// bird head
new Zdog.Shape({
translate: {x: 4, y: -1},
addTo: bird,
stroke: 4,
color: options.color
});
// beak
new Zdog.Shape({
path: [
{x: 0, y: -1},
{x: 3, y: 0},
{x: 0, y: 1}],
addTo: bird,
translate: {x: 5, y: -1},
stroke: 1,
color: options.color,
fill: true
});
// tail feather
new Zdog.Shape({
path: [
{x: -3, z: -2},
{x: 0, z: 0},
{x: -3, z: 2}],
addTo: bird,
translate: {x: -4, y: 0},
stroke: 2,
color: options.color,
fill: true
});
var wing = new Zdog.Shape({
path: [
{x: 3, y: 0},
{x: -1, y: -9},
{
arc: [
{x: -5, y: -4},
{x: -3, y: 0}]
}],
addTo: bird,
translate: {z: -1.5},
rotate: {x: TAU / 8},
stroke: 1,
color: options.color,
fill: true
});
wing.copy({
translate: {z: 1.5},
scale: {z: -1},
rotate: {x: -TAU / 8}
});
};
// -------------------------- demo -------------------------- //
var illoElem = document.querySelector('.illo');
var w = 160;
var h = 160;
var minWindowSize = Math.min(window.innerWidth, window.innerHeight);
var zoom = Math.min(5, Math.floor(minWindowSize / w));
illoElem.setAttribute('width', w * zoom);
illoElem.setAttribute('height', h * zoom);
var isSpinning = true;
var TAU = Zdog.TAU;
var illo = new Zdog.Illustration({
element: illoElem,
zoom: zoom,
rotate: {y: -TAU / 4},
dragRotate: true,
onDragStart: function () {
isSpinning = false;
}
});
var madColor = {
skin: '#FD9',
hair: '#D53',
parkaLight: '#67F',
parkaDark: '#35D',
tight: '#742',
eye: '#333'
};
var badColor = {
skin: '#EBC',
hair: '#D4B',
parkaLight: '#85A',
parkaDark: '#527',
tight: '#412',
eye: '#D02'
};
var glow = 'hsla(60, 100%, 80%, 0.3)';
var featherGold = '#FE5';
// -- illustration shapes --- //
makeMadeline(true, madColor, {
addTo: illo
});
makeMadeline(false, badColor, {
addTo: illo,
rotate: {y: TAU / 2}
});
// ----- feather ----- //
var feather = new Zdog.Group({
addTo: illo,
rotate: {y: -TAU / 4}
});
(function () {
var featherPartCount = 8;
var radius = 12;
var angleX = TAU / featherPartCount / 2;
var sector = TAU * radius / 2 / featherPartCount;
for (var i = 0; i < featherPartCount; i++) {
var curve = Math.cos(i / featherPartCount * TAU * 3 / 4 + TAU * 1 / 4);
var x = 4 - curve * 2;
var y0 = sector / 2;
// var y2 = -sector/2;
var isLast = i == featherPartCount - 1;
var y3 = isLast ? sector * -1 : -y0;
var z1 = -radius + 2 + curve * -1.5;
var z2 = isLast ? -radius : -radius;
var barb = new Zdog.Shape({
path: [
{x: 0, y: y0, z: -radius},
{x: x, y: -sector / 2, z: z1},
{x: x, y: -sector * 3 / 4, z: z1},
{x: 0, y: y3, z: z2}],
addTo: feather,
rotate: {x: angleX * -i + TAU / 8},
stroke: 1,
color: featherGold,
fill: true
});
barb.copy({
scale: {x: -1}
});
}
// rachis
var rachis = new Zdog.Ellipse({
addTo: feather,
diameter: radius * 2,
quarters: 2,
rotate: {y: -TAU / 4},
stroke: 2,
color: featherGold
});
rachis.copy({
stroke: 8,
color: glow,
rotate: {y: -TAU / 4, x: -0.5}
});
})();
// ----- rods ----- //
(function () {
var rodCount = 14;
for (var i = 0; i < rodCount; i++) {
var zRotor = new Zdog.Anchor({
addTo: illo,
rotate: {z: TAU / rodCount * i}
});
var y0 = 32;
var y1 = y0 + 2 + Math.random() * 24;
new BokehShape({
path: [
{y: y0},
{y: y1}],
addTo: zRotor,
rotate: {x: (Math.random() * 2 - 1) * TAU / 8},
color: madColor.skin,
stroke: 1,
bokehSize: 6,
bokehLimit: 70
});
}
})();
// dots
(function () {
var dotCount = 64;
for (var i = 0; i < dotCount; i++) {
var yRotor = new Zdog.Anchor({
addTo: illo,
rotate: {y: TAU / dotCount * i}
});
new BokehShape({
path: [
{z: 40 * (1 - Math.random() * Math.random()) + 32}],
addTo: yRotor,
rotate: {x: (Math.random() * 2 - 1) * TAU * 3 / 16},
color: badColor.skin,
stroke: 1 + Math.random(),
bokehSize: 6,
bokehLimit: 74
});
}
})();
// ----- birds ----- //
var birdRotor = new Zdog.Anchor({
addTo: illo,
rotate: {y: TAU * -1 / 8}
});
makeBird({
addTo: birdRotor,
color: madColor.parkaLight,
spin: TAU / 2
});
makeBird({
addTo: birdRotor,
color: featherGold,
spin: -TAU * 3 / 8
});
makeBird({
addTo: birdRotor,
color: 'white',
spin: -TAU / 4
});
makeBird({
addTo: birdRotor,
color: madColor.hair,
spin: -TAU / 8
});
makeBird({
addTo: birdRotor,
color: madColor.parkaDark,
spin: TAU / 8
});
// -- animate --- //
var isSpinning = true;
var rotateSpeed = -TAU / 60;
var xClock = 0;
var then = new Date() - 1 / 60;
function animate() {
update();
illo.renderGraph();
requestAnimationFrame(animate);
}
animate();
// -- update -- //
function update() {
var now = new Date();
var delta = now - then;
// auto rotate
if (isSpinning) {
var theta = rotateSpeed / 60 * delta * -1;
illo.rotate.y += theta;
xClock += theta / 4;
illo.rotate.x = Math.sin(xClock) * TAU / 12;
}
illo.updateGraph();
then = now;
}
//# sourceURL=pen.js

File diff suppressed because it is too large Load Diff

@ -0,0 +1,5 @@
module.exports = {
devServer: {
port: 80
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Loading…
Cancel
Save