Compare commits

...

No commits in common. 'main' and 'e980cdc90535c7a2a9207525d4a2287e93ce9fb3' have entirely different histories.

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

@ -1,4 +1,4 @@
# chathome
# love
## Project setup
```
@ -15,7 +15,10 @@ npm run serve
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
# LOVEGET

@ -1,14 +0,0 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
# 数据库连接字符串
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:mypassword12@127.0.0.1:3306/lianai"
# 创建数据库引擎
engine = create_engine(SQLALCHEMY_DATABASE_URL)
# 创建会话本地类
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
# 声明基类
Base = declarative_base()

@ -1,70 +0,0 @@
from fastapi import FastAPI, Depends, HTTPException, Request
from database import engine, SessionLocal
from models import User
from sqlalchemy.orm import Session
import uvicorn
from models import User
app = FastAPI()
# 创建所有表
User.metadata.create_all(bind=engine)
# 依赖注入:获取数据库会话
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
@app.post("/login")
async def login(request: Request, db: Session = Depends(get_db)):
user_data =await request.json()
print(user_data)
user=db.query(User).filter(User.username==user_data['username']).first()
if user:
if user.password==user_data['password']:
return {"code":200,"msg":"登录成功"}
else:
return {"code":400,"msg":"密码错误"}
return {"code":501,"msg":"账号不存在"}
@app.post("/register")
async def register(request: Request, db: Session = Depends(get_db)):
user_data =await request.json()
users=db.query(User).filter(User.username==user_data['username']).first()
if users:
return {"code":501,"msg":"账号已存在"}
else:
new_user=User(username=user_data['username'],password=user_data['password'])
db.add(new_user)
db.commit()
db.refresh(new_user)
print(new_user)
return {"code":200,"msg":"注册成功"}
from fastapi.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
if __name__ == '__main__':
# 运行fastapi程序
uvicorn.run(app="main:app", host="127.0.0.1", port=8000, reload=True)

@ -1,11 +0,0 @@
from sqlalchemy import Column, Integer, String
from database import Base
class User(Base):
__tablename__ = "users"
username = Column(String(30),index=True,primary_key=True)
password = Column(String(100), index=True,nullable=False)

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>666</title>
<style type="text/css">
.div1{
width: 500px;
height: 300px;
overflow-y: scroll;
margin: auto;
border: 1px solid red;
}
.div2{
width: 200px;
height: 50px;
border: 1px solid red;
}
</style>
</head>
<body>
<div class="div1">
666
</div>
<button type="button" id="btn">添加</button>
<script type="text/javascript">
var div1 = document.querySelector('.div1');
var btn = document.querySelector('#btn');
btn.addEventListener('click',function(){
console.log('66')
var k = div1.innerHTML;
div1.innerHTML = k+"<br/>66";
div1.scrollTop = div1.scrollHeight;
})
</script>
</body>
</html>

19103
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,25 +1,43 @@
{
"name": "chathome",
"name": "love",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.3.1",
"core-js": "^3.8.3",
"element-ui": "^2.15.12",
"mockjs": "^1.1.0",
"sass": "^1.56.2",
"sass-loader": "^13.2.0",
"vue": "^2.6.14",
"vue-router": "^3.6.5"
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"babel-plugin-component": "^1.1.1",
"vue-template-compiler": "^2.6.14"
}
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

@ -1,28 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -1,40 +1,31 @@
<template>
<div id="app">
<Home></Home>
<MyComponent />
</div>
</template>
<script>
import Home from './view/home.vue'
import MyComponent from './components/MyComponent.vue';
export default {
name: 'App',
components: {
Home
MyComponent
}
}
};
</script>
<style lang="scss">
@import url(./assets/font/iconfont.css);
.iconfont {
font-family: "iconfont" !important;
font-style: normal;
font-size: 25px;
vertical-align: middle;
color: rgb(117,120,137);
transition: .3s;
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
padding: 0;
margin: 0;
}
#app {
width: 100vw;
height: 100vh;
background-color: rgb(255, 255, 255);
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

@ -1,41 +0,0 @@
<template>
<div id="app">
<Home></Home>
</div>
</template>
<script>
import Home from './view/home.vue'
export default {
name: 'App',
components: {
Home,
}
}
</script>
<style lang="scss">
@import url(./assets/font/iconfont.css);
.iconfont {
font-family: "iconfont" !important;
font-style: normal;
font-size: 25px;
vertical-align: middle;
color: rgb(117,120,137);
transition: .3s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
padding: 0;
margin: 0;
}
#app {
width: 100vw;
height: 100vh;
background-color: rgb(255, 255, 255);
}
</style>

@ -1,21 +0,0 @@
import base from './index'
let axios = base.axios
let baseUrl = base.baseUrl
// 获取好友
export const getFriend = params => {
return axios({
method: 'post',
baseURL: `${baseUrl}/friend/friendList`,
data: params
}).then(res => res.data)
}
// 获取聊天信息
export const getChatMsg = params => {
return axios({
method: 'post',
baseURL: `${baseUrl}/friend/chatMsg`,
data: params
}).then(res => res.data)
}

@ -1,36 +0,0 @@
import axios from 'axios'
//全局参数,自定义参数可在发送请求时设置
axios.defaults.timeout = 300000000 //超时时间ms
axios.defaults.withCredentials = true
// 请求时的拦截
//回调里面不能获取错误信息
axios.interceptors.request.use(
function (config) {
return config;
},
function (error) {
// 当请求异常时做一些处理
console.log('请求异常:' + JSON.stringify(error));
return Promise.reject(error);
}
);
axios.interceptors.response.use(function (response) {
// Do something with response data
return response
}, function (error) {
// Do something with response error
console.log('响应出错:' + error)
return Promise.reject(error)
})
const base = {
axios: axios,
baseUrl: 'http://localhost:8080'
}
export default base

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

@ -1,539 +0,0 @@
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path stroke viewBox IE
normalize.css */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

@ -1,395 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>iconfont Demo</title>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
<style>
.main .logo {
margin-top: 0;
height: auto;
}
.main .logo a {
display: flex;
align-items: center;
}
.main .logo .sub-title {
margin-left: 0.5em;
font-size: 22px;
color: #fff;
background: linear-gradient(-45deg, #3967FF, #B500FE);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
</head>
<body>
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
<li class="dib active"><span>Unicode</span></li>
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=3829178" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe646;</span>
<div class="name">snapchat</div>
<div class="code-name">&amp;#xe646;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62e;</span>
<div class="name">文件</div>
<div class="code-name">&amp;#xe62e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe96c;</span>
<div class="name">24gf-telephone</div>
<div class="code-name">&amp;#xe96c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe610;</span>
<div class="name">图片</div>
<div class="code-name">&amp;#xe610;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe600;</span>
<div class="name">视频</div>
<div class="code-name">&amp;#xe600;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe601;</span>
<div class="name"></div>
<div class="code-name">&amp;#xe601;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe8b8;</span>
<div class="name">205设置</div>
<div class="code-name">&amp;#xe8b8;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe607;</span>
<div class="name">message</div>
<div class="code-name">&amp;#xe607;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe61b;</span>
<div class="name">闪电</div>
<div class="code-name">&amp;#xe61b;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
<hr>
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
<ul>
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
<li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
</ul>
<blockquote>
<p>注意:新版 iconfont 支持两种方式引用多色图标SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
</blockquote>
<p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1675406501520') format('woff2'),
url('iconfont.woff?t=1675406501520') format('woff'),
url('iconfont.ttf?t=1675406501520') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css"
>.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre>
<code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-snapchat"></span>
<div class="name">
snapchat
</div>
<div class="code-name">.icon-snapchat
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-wenjian"></span>
<div class="name">
文件
</div>
<div class="code-name">.icon-wenjian
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-gf-telephone"></span>
<div class="name">
24gf-telephone
</div>
<div class="code-name">.icon-gf-telephone
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-tupian"></span>
<div class="name">
图片
</div>
<div class="code-name">.icon-tupian
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shipin"></span>
<div class="name">
视频
</div>
<div class="code-name">.icon-shipin
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shu"></span>
<div class="name">
</div>
<div class="code-name">.icon-shu
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shezhi"></span>
<div class="name">
205设置
</div>
<div class="code-name">.icon-shezhi
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-xinxi"></span>
<div class="name">
message
</div>
<div class="code-name">.icon-xinxi
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shandian"></span>
<div class="name">
闪电
</div>
<div class="code-name">.icon-shandian
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
<hr>
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
<p>与 Unicode 使用方式相比,具有如下特点:</p>
<ul>
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"
iconfont" 是你项目下的 font-family。可以通过编辑项目查看默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-snapchat"></use>
</svg>
<div class="name">snapchat</div>
<div class="code-name">#icon-snapchat</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-wenjian"></use>
</svg>
<div class="name">文件</div>
<div class="code-name">#icon-wenjian</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-gf-telephone"></use>
</svg>
<div class="name">24gf-telephone</div>
<div class="code-name">#icon-gf-telephone</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-tupian"></use>
</svg>
<div class="name">图片</div>
<div class="code-name">#icon-tupian</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shipin"></use>
</svg>
<div class="name">视频</div>
<div class="code-name">#icon-shipin</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shu"></use>
</svg>
<div class="name"></div>
<div class="code-name">#icon-shu</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shezhi"></use>
</svg>
<div class="name">205设置</div>
<div class="code-name">#icon-shezhi</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xinxi"></use>
</svg>
<div class="name">message</div>
<div class="code-name">#icon-xinxi</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shandian"></use>
</svg>
<div class="name">闪电</div>
<div class="code-name">#icon-shandian</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>
<hr>
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
<ul>
<li>支持多色图标了,不再受单色限制。</li>
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt;
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
&lt;/style&gt;
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt;
</code></pre>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.tab-container .content:first').show()
$('#tabs li').click(function (e) {
var tabContent = $('.tab-container .content')
var index = $(this).index()
if ($(this).hasClass('active')) {
return
} else {
$('#tabs li').removeClass('active')
$(this).addClass('active')
tabContent.hide().eq(index).fadeIn()
}
})
})
</script>
</body>
</html>

@ -1,51 +0,0 @@
@font-face {
font-family: "iconfont"; /* Project id 3829178 */
src: url('iconfont.woff2?t=1675406501520') format('woff2'),
url('iconfont.woff?t=1675406501520') format('woff'),
url('iconfont.ttf?t=1675406501520') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-snapchat:before {
content: "\e646";
}
.icon-wenjian:before {
content: "\e62e";
}
.icon-gf-telephone:before {
content: "\e96c";
}
.icon-tupian:before {
content: "\e610";
}
.icon-shipin:before {
content: "\e600";
}
.icon-shu:before {
content: "\e601";
}
.icon-shezhi:before {
content: "\e8b8";
}
.icon-xinxi:before {
content: "\e607";
}
.icon-shandian:before {
content: "\e61b";
}

File diff suppressed because one or more lines are too long

@ -1,72 +0,0 @@
{
"id": "3829178",
"name": "chat",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "1080596",
"name": "snapchat",
"font_class": "snapchat",
"unicode": "e646",
"unicode_decimal": 58950
},
{
"icon_id": "6714382",
"name": "文件",
"font_class": "wenjian",
"unicode": "e62e",
"unicode_decimal": 58926
},
{
"icon_id": "7568886",
"name": "24gf-telephone",
"font_class": "gf-telephone",
"unicode": "e96c",
"unicode_decimal": 59756
},
{
"icon_id": "12382329",
"name": "图片",
"font_class": "tupian",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "1283",
"name": "视频",
"font_class": "shipin",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "1412",
"name": "树",
"font_class": "shu",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "1727422",
"name": "205设置",
"font_class": "shezhi",
"unicode": "e8b8",
"unicode_decimal": 59576
},
{
"icon_id": "5744743",
"name": "message",
"font_class": "xinxi",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "15391349",
"name": "闪电",
"font_class": "shandian",
"unicode": "e61b",
"unicode_decimal": 58907
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 KiB

@ -1,160 +0,0 @@
<template>
<div class="emoji-content">
<div class="emoji">
<div class="emoji-wrapper">
<ul class="emoji-list">
<li
class="emoji-item"
v-for="(item, index) in emojiList"
:key="index"
@click="sendEmoji(item)"
>
<img :src="item" alt="" />
</li>
</ul>
</div>
</div>
<div class="mask" @click="closeEmoji"></div>
</div>
</template>
<script>
export default {
data() {
return {
emojiList: [
require("@/assets/img/emoji/slightly-smiling-face.png"),
require("@/assets/img/emoji/smiling-face.png"),
require("@/assets/img/emoji/smiling-face-with-heart-eyes.png"),
require("@/assets/img/emoji/smiling-face-with-sunglasses.png"),
require("@/assets/img/emoji/thinking-face.png"),
require("@/assets/img/emoji/tired-face.png"),
require("@/assets/img/emoji/money-mouth-face.png"),
require("@/assets/img/emoji/loudly-crying-face.png"),
require("@/assets/img/emoji/pouting-face.png"),
require("@/assets/img/emoji/face-screaming-in-fear.png"),
require("@/assets/img/emoji/face-vomiting.png"),
require("@/assets/img/emoji/face-without-mouth.png"),
require("@/assets/img/emoji/face-with-tongue.png"),
require("@/assets/img/emoji/clown-face.png"),
require("@/assets/img/emoji/new-moon-face.png"),
require("@/assets/img/emoji/ghost.png"),
require("@/assets/img/emoji/jack-o-lantern.png"),
require("@/assets/img/emoji/money-bag.png"),
require("@/assets/img/emoji/pile-of-poo.png"),
require("@/assets/img/emoji/shamrock.png"),
require("@/assets/img/emoji/hibiscus.png"),
require("@/assets/img/emoji/lips.png"),
require("@/assets/img/emoji/sparkles.png"),
require("@/assets/img/emoji/star.png"),
require("@/assets/img/emoji/two-hearts.png"),
require("@/assets/img/emoji/rainbow.png"),
require("@/assets/img/emoji/thought-balloon.png"),
],
};
},
methods: {
sendEmoji(item) {
this.$emit("sendEmoji", item);
},
closeEmoji() {
this.$emit("closeEmoji");
}
},
};
</script>
<style lang="scss" scoped>
.emoji-content {
.emoji {
width: 400px;
height: 200px;
background-color: white;
position: absolute;
top: -220px;
left: 12px;
border-radius: 10px;
transition: 0.3s;
z-index: 3;
&::after {
content: "";
display: block;
width: 0;
height: 0;
border-top: 10px solid whitesmoke;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
position: absolute;
bottom: -8px;
left: 15px;
z-index: 100;
}
.emoji-wrapper {
background-color: whitesmoke;
width: 100%;
height: 100%;
overflow-y: scroll;
padding: 10px;
box-sizing: border-box;
position: relative;
border-radius: 5px;
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 0; /* Safari,Chrome 隐藏滚动条 */
height: 0; /* Safari,Chrome 隐藏滚动条 */
display: none; /* 移动端、pad 上SafariChrome隐藏滚动条 */
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
box-shadow: inset 0 0 5px rgba(97, 184, 179, 0.1);
background: white;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(87, 175, 187, 0.1);
border-radius: 10px;
background: white;
}
.emoji-list {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
margin-left: 10px;
.emoji-item {
list-style: none;
width: 50px;
height: 50px;
border-radius: 10px;
margin: 5px;
position: relative;
cursor: pointer;
&:hover {
background-color: rgba(128, 128, 128, 0.158);
}
img {
width: 35px;
height: 35px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
}
}
.mask {
width: 100%;
height: 100%;
position: fixed;
background: transparent;
left: 0;
top: 0;
z-index: 1;
}
}
</style>

@ -1,81 +0,0 @@
<template>
<div class="file-card">
<img src="@/assets/img/fileImg/unknowfile.png" alt="" v-if="fileType == 0"/>
<img src="@/assets/img/fileImg/word.png" alt="" v-else-if="fileType == 1"/>
<img src="@/assets/img/fileImg/excel.png" alt="" v-else-if="fileType == 2"/>
<img src="@/assets/img/fileImg/ppt.png" alt="" v-else-if="fileType == 3"/>
<img src="@/assets/img/fileImg/pdf.png" alt="" v-else-if="fileType == 4"/>
<img src="@/assets/img/fileImg/zpi.png" alt="" v-else-if="fileType == 5"/>
<img src="@/assets/img/fileImg/txt.png" alt="" v-else/>
<div class="word">
<span
>{{file.name || '未知'}}</span
>
<span>154kb</span>
</div>
</div>
</template>
<script>
export default {
// props: ["fileType", "file"],
props: {
fileType: Number,
file: File,
default() {
return {};
},
},
watch: {
file() {
console.log(this.file);
},
},
mounted() {
console.log(this.file);
console.log(this.fileType);
}
};
</script>
<style lang="scss" scoped>
.file-card {
width: 250px;
height: 100px;
background-color: rgb(255, 255, 255);
border-radius: 20px;
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
box-sizing: border-box;
cursor: pointer;
&:hover {
background-color: rgb(8, 250, 226);
}
img {
width: 60px;
height: 60px;
}
.word {
width: 60%;
margin-left: 10px;
overflow: hidden;
span {
width: 90%;
display: inline-block;
color: #090000;
}
span:first-child {
font-size: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
span:last-child {
font-size: 12px;
color: rgb(10, 0, 0);
}
}
}
</style>

@ -1,47 +0,0 @@
<template>
<div class="head-portrait">
<img :src="imgUrl" alt="">
</div>
</template>
<script>
export default {
props: {
imgUrl:{ default:require('@/assets/img/head_portrait.jpg')}
}
}
</script>
<style lang="scss" scoped>
.head-portrait {
width: 50px;
height: 50px;
border-radius: 50%;
// border: 2px solid rgb(137,140,151);
border: 2px solid rgb(12, 12, 12);
position:relative;
&::before {
content: '';
width: 15px;
height: 15px;
z-index: 1;
display: block;
border-radius: 50%;
background-color: rgb(144,225,80);
position: absolute;
right: 0;
}
img {
width: 45px;
height: 45px;
border-radius: 50%;
// padding: 2px;
box-sizing: border-box;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
vertical-align: middle;
}
}
</style>

@ -0,0 +1,58 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

@ -0,0 +1,42 @@
<template>
<div>
<form @submit.prevent="login">
<input placeholder="用户名" v-model="formData.username" required />
<input v-model="formData.password" type="password" placeholder="密码" />
<button type="submit">登录</button>
</form>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
formData:{
username: '',
password: ''
}
};
},
methods: {
async login() {
const response = await axios.post('http://127.0.0.1:8000/register', this.formData);
console.log(response.data); //
if(response.data.code === 200){
alert("登录成功")
}else if (response.data.code === 400){
alert("密码错误")
}else{
alert("用户不存在")
}
//
}
}
};
</script>

@ -1,128 +0,0 @@
<template>
<div class="nav">
<div class="nav-menu-wrapper">
<ul class="menu-list">
<li
v-for="(item, index) in menuList"
:key="index"
:class="{ activeNav: index == current }"
@click="changeMenu(index)"
>
<div class="block"></div>
<span class="iconfont" :class="item"></span>
</li>
</ul>
</div>
<div class="own-pic">
<HeadPortrait :imgUrl="imgUrl"></HeadPortrait>
</div>
</div>
</template>
<script>
import HeadPortrait from "./HeadPortrait.vue";
export default {
components: {
HeadPortrait,
},
data() {
return {
menuList: [
"icon-xinxi",
"icon-shipin",
"icon-shu",
"icon-shandian",
"icon-shezhi",
],
current: 0,
imgUrl: require('@/assets/img/head_portrait.jpg')
};
},
methods: {
changeMenu(index) {
switch (index) {
case 0:
this.$router.push({
name: "ChatHome",
}, () => {});
break;
case 1:
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
break;
case 2:
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
break;
case 3:
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
break;
case 4:
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
break;
default:
this.$router.push({
name: "ChatHome",
});
}
this.current = index;
},
},
};
</script>
<style lang="scss" scoped>
.nav {
width: 100%;
height: 90vh;
position: relative;
border-radius: 20px 0 0 20px;
.nav-menu-wrapper {
position: absolute;
top: 40%;
transform: translate(0, -50%);
.menu-list {
margin-left: 10px;
li {
margin: 40px 0 0 30px;
list-style: none;
cursor: pointer;
position: relative;
.block {
background-color: rgb(29, 144, 245);
position: absolute;
left: -40px;
width: 6px;
height: 25px;
transition: 0.5s;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
opacity: 0;
}
&:hover {
span {
color: rgb(29, 144, 245);
}
.block {
opacity: 1;
}
}
}
}
}
.own-pic {
position: absolute;
bottom: 10%;
margin-left: 25px;
}
}
.activeNav {
span {
color: rgb(29, 144, 245);
}
.block {
opacity: 1 !important;
}
}
</style>

@ -1,56 +0,0 @@
<template>
<nav class="navbar">
<ul class="nav-links">
<li><router-link to="/ChatHome">首页</router-link></li>
<li><router-link to="/ReCommend">匹配推荐</router-link></li>
<li><router-link to="/LinVite1n">个人资料</router-link></li>
<li><router-link to="#">设置</router-link></li>
</ul>
</nav>
</template>
<script>
export default {
}
</script>
<style scoped>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.navbar {
width: 100%;
background-color: #0073e6;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
font-family: 'Open Sans', sans-serif;
}
.nav-links {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-around;
align-items: center;
height: 50px;
}
.nav-links li {
font-weight: 600;
}
.nav-links li a {
text-decoration: none;
color: white;
font-size: 25px;
transition: color 0.3s;
padding: 0 15px;
}
.nav-links li a:hover {
color: #d0e7ff;
}
</style>

@ -1,109 +0,0 @@
<template>
<div class="person-card" :class="{ activeCard: personInfo.id == current }">
<div class="info">
<HeadPortrait :imgUrl="personInfo.headImg"></HeadPortrait>
<div class="info-detail">
<div class="name">{{ personInfo.name }}</div>
<!-- <div class="detail">{{ personInfo.detail }}</div> -->
</div>
</div>
</div>
</template>
<script>
import HeadPortrait from "./HeadPortrait.vue";
export default {
props: {
personInfo: {
default: {
},
},
pcCurrent: {
default: ''
}
},
components: {
HeadPortrait,
},
data() {
return {
current: '',
}
},
watch: {
pcCurrent: function() {
this.isActive()
}
},
methods: {
isActive() {
this.current = this.pcCurrent
}
}
};
</script>
<style lang="scss" scoped>
.person-card {
width: 280px;
height: 80px;
border-radius: 0px;
background-color: white;
position: relative;
cursor: pointer;
.info {
position: absolute;
left: 50%;
top: 50%;
width: 90%;
transform: translate(-50%, -50%);
overflow: hidden;
display: flex;
.info-detail {
margin-top: 5px;
margin-left: 20px;
.name {
color: #070707;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-bottom: 5px;
}
.detail {
color: #3f5f8f;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 12px;
}
}
}
&:hover {
background-color: #1d90f5;
transition: 0.3s;
// box-shadow: 0px 0px 10px 0px rgba(0, 136, 255);
// box-shadow: 0 5px 20px rgba(251, 152, 11, .5);
.info {
.info-detail {
.detail {
color: #fff;
}
}
}
}
}
.activeCard {
background-color: #1d90f5;
transition: 0.3s;
// box-shadow: 3px 2px 10px 0px rgba(0, 136, 255);
.info {
.info-detail {
.detail {
color: #fff;
}
}
}
}
</style>

@ -1,16 +1,4 @@
import Vue from 'vue'
import { createApp } from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import VueRouter from 'vue-router'
import 'element-ui/lib/theme-chalk/index.css';
import router from './router/index'
import "./mock/index.js"
Vue.use(VueRouter)
Vue.config.productionTip = false
Vue.use(ElementUI);
new Vue({
router,
render: h => h(App),
}).$mount('#app')
createApp(App).mount('#app')

@ -1,228 +0,0 @@
const Mock = require("mockjs");
Mock.mock(/friend\/friendList/, 'post', () => { //三个参数。第一个路径第二个请求方式post/get第三个回调返回值
return friendList
})
Mock.mock(/friend\/chatMsg/, 'post', (config) => { //三个参数。第一个路径第二个请求方式post/get第三个回调返回值
let params = JSON.parse(config.body)
if (params.frinedId == "1002")
return chatMsg1002
if (params.frinedId == "1003")
return chatMsg1003
if (params.frinedId == "1004")
return chatMsg1004
})
let friendList = Mock.mock(
[
{
img: "",
name: "大毛",
detail: "我是大毛",
lastMsg: "to do",
id: "1002",
headImg: require("@/assets/img/head_portrait1.jpg"),
},
{
img: "",
name: "小毛",
detail: "我是小毛",
lastMsg: "dada dw ertgthy j uy",
id: "1003",
headImg: require("@/assets/img/head_portrait2.jpg"),
},
{
img: "",
name: "小王",
detail: "我是小王",
lastMsg: "大萨达萨达所大大萨达",
id: "1004",
headImg: require("@/assets/img/head_portrait3.jpg"),
},
{
img: "",
name: "小红",
detail: "我是喜欢音乐的有趣灵魂",
lastMsg: "to do",
id: "1005",
headImg: require("@/assets/img/head_portrait1.jpg"),
},
]
)
let chatMsg1002 = Mock.mock(
[
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: " 在吗?",
chatType: 0, //信息类型0文字1图片
uid: "1001", //uid
},
{
headImg: require("@/assets/img/head_portrait1.jpg"),
name: "大毛",
time: "0912 AM",
msg: " 怎么了?",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "问你个问题",
chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait1.jpg"),
name: "大毛",
time: "0912 AM",
msg: "别问",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1001",
},
]
)
let chatMsg1003 = Mock.mock(
[
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "在干嘛呢",
chatType: 0, //信息类型0文字1图片
uid: "1001", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛",
time: "0912 AM",
msg: "吃饭",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "吃的什么饭",
chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛",
time: "0912 AM",
msg: "蛋炒饭",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "加蛋了吗?",
chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛",
time: "0912 AM",
msg: "你说呢",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1002", //uid
},
]
)
let chatMsg1004 = Mock.mock(
[
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: " sadasdawdas sadsad sad sad as despite ofhaving so much to do",
chatType: 0, //信息类型0文字1图片
uid: "1001", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait3.jpg"),
name: "小王",
time: "0912 AM",
msg: " 21312大萨达萨达",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "111212",
chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001",
},
{
headImg: require("@/assets/img/head_portrait3.jpg"),
name: "小王",
time: "0912 AM",
msg: "大萨达萨达所大大萨达",
chatType: 0, //信息类型0文字1图片
uid: "1002", //uid
},
]
)

@ -0,0 +1,5 @@
{
"dependencies": {
"axios": "^1.7.7"
}
}

@ -1,57 +0,0 @@
import VueRouter from 'vue-router'
import ChatHome from '../view/pages/chatHome/index.vue'
import Video from '../view/pages/video.vue'
import Lingting from '../view/pages/lingting.vue'
import Setting from '../view/pages/setting.vue'
import LinVite1n from '../view/pages/LnVite1n.vue'
import ReCommend from '../view/pages/ReCommend.vue'
import LoginPage from '@/view/LoginPage.vue'
export default new VueRouter({
mode: 'hash',
routes: [
{
path:'/',
name: 'Login',
component:LoginPage
},
{
path: "/home",
name: "Home",
redirect: '/ChatHome'
},
{
path: "/ChatHome",
name: "ChatHome",
component: ChatHome,
},
{
path: "/LinVite1n",
name: "LinVite1n",
component: LinVite1n
},
{
path: "/Recommend",
name: "Recommend",
component: ReCommend
},
{
path: "/Video",
name: "Video",
component: Video
},
{
path: "/Lingting",
name: "Lingting",
component: Lingting
},
{
path: "/Setting",
name: "Setting",
component: Setting
},
]
})

@ -1,88 +0,0 @@
//防抖
export function debounce(fn) {
console.log(1)
let t = null //只会执行一次
debugger
return function (){
if(t){
clearTimeout(t)
}
t = setTimeout(()=>{
console.log(temp); //可以获取
// console.log(arguments[0]) //undefined
fn.apply(this,arguments)
//在这个回调函数里面的argument是这个回调函数的参数因为没有参数所以undefined可以通过外面的函数赋值来进行访问
//也可以改变成箭头函数,箭头函数的this是指向定义函数的那一层的所以访问到的arguments是上一层函数的arguments
},1000)
}
}
//节流
export function throttle(fn, delay = 200) {
let timer = null
console.log(fn);
debugger
return function () {
if(timer) return
timer = setTimeout(() => {
debugger
fn.apply(this,arguments)
timer = null
})
}
}
//下拉动画
export function animation(obj, target, fn1) {
// console.log(fn1);
// fn是一个回调函数在定时器结束的时候添加
// 每次开定时器之前先清除掉定时器
clearInterval(obj.timer);
obj.timer = setInterval(function () {
// 步长计算公式 越来越小
// 步长取整
var step = (target - obj.scrollTop) / 10;
step = step > 0 ? Math.ceil(step) : Math.floor(step);
if (obj.scrollTop >= target) {
clearInterval(obj.timer);
// 如果fn1存在调用fn
if (fn1) {
fn1();
}
} else {
// 每30毫秒就将新的值给obj.left
obj.scrollTop = obj.scrollTop + step;
}
}, 10);
}
//判断文件类型
export function judgeFileType(file) {
if (file == null||file == ""){
alert("请选择要上传的图片!");
return false;
}
if (file.lastIndexOf('.')==-1){ //如果不存在"."
alert("路径不正确!");
return false;
}
var AllImgExt=".jpg|.jpeg|.gif|.bmp|.png|";
var extName = file.substring(file.lastIndexOf(".")).toLowerCase();//(把路径中的所有字母全部转换为小写)
if(AllImgExt.indexOf(extName+"|")==-1)
{
ErrMsg="该文件类型不允许上传。请上传 "+AllImgExt+" 类型的文件,当前文件类型为"+extName;
alert(ErrMsg);
return false;
}
}
//文件类型
export function fileType() {
return {
'application/msword': 'word',
'application/pdf': 'pdf',
'application/vnd.ms-powerpoint': 'ppt',
'application/vnd.ms-excel': 'excel',
'aplication/zip': 'zpi',
}
}

@ -1,23 +0,0 @@
<template>
<div class="hello">
<h1>mian首页</h1>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
div {
background-color: aqua;
padding: 0;
margin: 0;
}
</style>

@ -1,169 +0,0 @@
<template>
<div class="app-background">
<div class="login-container">
<div class="login-box">
<h1>欢迎登录</h1>
<form @submit.prevent="login">
<div class="input-group">
<label for="username">用户名:</label>
<input type="text" v-model="formData.username" id="username" required />
</div>
<div class="input-group">
<label for="password">密码:</label>
<input type="password" v-model="formData.password" id="password" required />
</div>
<button type="submit">登录</button>
</form>
<button @click="register" class="register-button">注册账号</button>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
formData:{
username: '',
password: ''
}
};
},
methods: {
async login() {
const response = await axios.post('http://127.0.0.1:8000/login', this.formData);
console.log(response.data); //
if(response.data.code === 200){
alert("登录成功")
this.$router.push('/home').then(() => {
location.reload();//
}).catch(() => {});
}else if (response.data.code === 400){
alert("密码错误")
}else{
alert("用户不存在")
}
}
}
};
</script>
<style scoped>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden; /* 防止滚动条 */
}
.app-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url("../assets/R.jpg") no-repeat center center;
background-size: cover;
z-index: 1;
}
.login-container {
text-align: center;
max-width: 600px; /* 宽度 */
margin: 0 0 0 auto;
background: rgba(255, 255, 255, 0.9);
background-color: hwb(207 71% 7% / 0.959);
border-radius: 50px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 200px; /* 内边距 */
box-sizing: border-box;
left: 150px;
z-index: 2; /* 确保登录框在背景图之上 */
position: relative;
left: -30px;
max-height: 700px;
top:16px;
}
.login-box h1 {
font-size: 3em;
margin-bottom: 20px;
color: #0b70b4c1;
position: relative;
bottom: 50px;
}
.input-group {
margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.input-group label {
display: block;
margin-bottom: 10px;
color: #333;
}
.input-group input {
width: 180%;
padding: 15px;
margin-top: 5px;
border: 1px solid #ddd;
border-radius: 5px;
box-sizing: border-box;
font-size: 1.2em;
margin: auto;
position: relative;
left: -80px;
}
button {
width: 180%;
padding: 15px;
background-color: #538edb;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
font-size: 1.2em;
position: relative;
left: -80px;
}
.register-button {
margin-top: 10px; /* 按钮与登录按钮之间的间距 */
padding: 5px; /* 内边距 */
background-color: transparent; /* */
color: rgb(27, 150, 227);
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
font-size: 0.8em; /* 字体大小 */
width: 50%; /* 调整按钮宽度 */
align-self: center; /* 居中对齐按钮 */
position: relative;
left: 150px
}
button:hover {
background-color: #e55b54;
}
</style>

@ -1,34 +0,0 @@
<template>
<div class="home">
<el-container height="100%">
<el-main style="padding: 0;">
<Navi></Navi>
<router-view></router-view>
</el-main>
</el-container>
</div>
</template>
<script>
import Navi from "@/components/Navi.vue";
export default {
components: {
Navi,
},
};
</script>
<style lang="scss" scoped>
//
.home {
width: 100vw;
height: 100vh;
background-color:rgb(255, 255, 255);
border-radius: 15px;
position: absolute;
margin-left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
</style>

@ -1,220 +0,0 @@
<template>
<div class="user-info-page">
<div class="user-info-container">
<!-- 左侧用户基本信息 -->
<div class="user-basic-info">
<div class="user-details">
<img :src="userInfo.avatarUrl" alt="用户头像" />
<p class="nickname">{{ userInfo.nickname }}</p> <!-- 使用 nickname -->
<p class="information">性别{{ userInfo.gender }}</p>
<p class="information">年龄{{ userInfo.age }}</p>
<p class="information">居住地{{ userInfo.residence }}</p>
</div>
</div>
<!-- 右侧交友要求和基本资料 -->
<div class="user-other-info">
<div class="dating-requirements">
<h2>详细信息</h2>
</div>
<div class="basic-profile">
<div class="i1">
<p class="i11">昵称</p>
<p class="i12">{{userInfo.nickname }}</p>
</div>
<div class="i2">
<p class="i11">当前状态</p>
<p class="i12">{{ userInfo.currentStatus }}</p>
</div>
<div class="i1">
<p class="i11">我在寻找</p>
<p class="i12">{{ userInfo.lookingFor }}</p>
</div>
<div class="i2">
<p class="i11">性别</p>
<p class="i12">{{ userInfo.gender }}</p>
</div>
<div class="i1">
<p class="i11">年龄</p>
<p class="i12">{{ userInfo.age }}</p>
</div>
<div class="i2">
<p class="i11">身高</p>
<p class="i12">{{ userInfo.height }}</p>
</div>
<div class="i1">
<p class="i11">体重</p>
<p class="i12">{{ userInfo.weight }}</p>
</div>
<div class="i2">
<p class="i11">居住在</p>
<p class="i12">{{ userInfo.residence }}</p>
</div>
<div class="i1">
<p class="i11">学历</p>
<p class="i12">{{ userInfo.education }}</p>
</div>
<div class="i2">
<p class="i11">毕业院校</p>
<p class="i12">{{ userInfo.graduateSchool }}</p>
</div>
<div class="i1">
<p class="i11">行业</p>
<p class="i12">{{ userInfo.industry }}</p>
</div>
<div class="i2">
<p class="i11">工作单位</p>
<p class="i12">{{ userInfo.workUnit }}</p>
</div>
<div class="i1">
<p class="i11">目前职位</p>
<p class="i12">{{ userInfo.currentPosition }}</p>
</div>
<div class="i2">
<p class="i11">月收入</p>
<p class="i12">{{ userInfo.monthlyIncome }}</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
userInfo: {
avatarUrl: "https://picture.gptkong.com/20241115/20437780c5227d4025ac097d3c32517fc7.jpg", // URL
nickname: "abc",
gender: "男",
age: "20岁",
residence: "福建福州",
currentStatus: "未婚",
lookingFor: "恋人",
height: "173cm",
weight: "60kg",
education: "本科",
graduateSchool: "福州大学",
industry: "互联网/IT",
workUnit: "xxx",
currentPosition: "普通职员",
monthlyIncome: "4000-6000元",
},
datingLocation: "",
datingAgeMin: "",
datingAgeMax: "",
};
},
methods: {
saveInfo() {
alert("信息已保存(暂未与后端交互,仅为示例提示)");
},
},
};
</script>
<style scoped>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #aeabab;
}
.user-info-page {
margin-top: 0;
}
.user-info-container {
display: flex; /* 使用 Flexbox 布局 */
width: 100%; /* 让容器宽度填满网页 */
min-height: calc(100vh - 60px); /* 对应导航栏高度调整内容区 height */
}
.user-basic-info {
display: flex;
flex-direction: column;
align-items: center;
width: 15%;
background-color: whitesmoke; /* 设置背景色 */
border-right: 1px solid gray;
height: 93.2vh;
}
.information {
font-size: 18px;
margin-top: 20px;
display: flex;
flex-direction: column;
text-align: center;
background-color: whitesmoke;
}
.user-other-info {
width: 85%;
background-color: whitesmoke; /* 设置背景色 */
}
img {
margin-top: 30px;
width: 145px; /* 调整头像宽度为160px */
height: 145px; /* 调整头像高度为160px */
border-radius: 50%; /* 圆形头像 */
border: 1px solid #000102; /* 头像边框 */
}
.nickname {
text-align: center;
margin-top: 10px;
font-size: 40px; /* 增大昵称字体 */
color: #000000; /* 设置昵称的颜色 */
}
.basic-profile {
font-size: 16px; /* 可选择适当减小字体 */
}
.dating-requirements {
display: flex;
justify-content: center;
align-items: center;
height: 50px;
text-align: center;
border-bottom: 1px solid gray;
}
.i1,.i2 {
display: flex;
flex-direction: row;
height: 45.6px;
border-bottom: 1px solid gray;
}
.i1 {
background-color: rgba(255, 255, 255, 0.43);
}
.i2 {
background-color: rgba(15, 238, 238, 0.051);
}
.i11 {
display: flex;
align-items: center;
justify-content: center;
width: 100px;
border-right: 0.5px solid gray;
}
.i12 {
margin-left: 10px;
display: flex;
align-items: center;
width: 621px;
}
</style>

@ -1,277 +0,0 @@
<template>
<div id="app">
<!-- 搜索框和关键词示例 -->
<div class="search-container">
<input type="text" v-model="searchQuery" placeholder="没有心仪的?尝试搜索一下吧">
</div>
<div class="keyword-suggestions">
<button @click="applyKeyword('杭州市')"></button>
<button @click="applyKeyword('跳舞')"></button>
<button @click="applyKeyword('健身')"></button>
<button @click="applyKeyword('美术')"></button>
<button @click="applyKeyword('文艺')"></button>
</div>
<!-- 刷新按钮 -->
<div class="refresh-button" @click="refreshUsers" style=" margin-right: -500px">
🔄刷新一下
</div>
<!-- 推荐用户列表 -->
<div class="match-list">
<div class="match-card" v-for="user in filteredUsers" :key="user.name">
<img :src="user.avatar" alt="user-avatar">
<div class="match-info">
<h3>{{ user.name }} ({{ user.age }})</h3>
<p>{{ user.city }}</p>
<p>{{ user.description }}</p>
<p>{{ user.hobby }}</p>
</div>
<div class="match-buttons">
<a class="match-button" href="">了解详细信息</a>
<router-link to="/home" class="chat-button">开始聊天</router-link>
</div>
</div>
</div>
</div>
</template>
<script>
import Navi from "../../components/Navi.vue";
export default{
data() {
return {
searchQuery: '', //
users: [ //
{ name: "小红", age: 22, hobby: "追剧,跳舞", city: "杭州市", description: "我是喜欢音乐的有趣灵魂", avatar: require('@/assets/1.jpg') },
{ name: "李娜", age: 23, hobby: "唱歌,跳舞", city: "北京市", description: "我喜欢旅行和美食", avatar: require('@/assets/2.jpg') },
{ name: "李华", age: 24, hobby: "吃饭,健身", city: "上海市", description: "热爱健身和阅读", avatar: require('@/assets/3.jpg') },
{ name: "赵丽", age: 25, hobby: "美术,旅行", city: "广州市", description: "美术爱好者,喜欢安静", avatar: require('@/assets/4.jpg') },
{ name: "孙甜", age: 26, hobby: "登山,篮球", city: "成都市", description: "科技迷,热衷编程", avatar: require('@/assets/5.jpg') },
{ name: "王梅", age: 27, hobby: "跑步,跳舞", city: "重庆市", description: "热爱户外运动", avatar: require('@/assets/6.jpg') },
{ name: "李蔷", age: 28, hobby: "唱歌,钢琴", city: "天津市", description: "文艺青年,诗词爱好者", avatar: require('@/assets/logo.png') }
]
};
},
components: {
Navi,
},
computed: {
//
filteredUsers() {
const query = this.searchQuery.toLowerCase(); //
return this.users.filter(user => {
//
return (
user.name.toLowerCase().includes(query) ||
user.city.toLowerCase().includes(query) ||
user.description.toLowerCase().includes(query) ||
user.hobby.toLowerCase().includes(query)
);
});
}
},
methods: {
//
applyKeyword(keyword) {
this.searchQuery = keyword;
},
// 4
refreshUsers() {
this.users = this.users.sort(() => Math.random() - 0.5); //
}
}
};
</script>
<style scoped>
body {
font-family: Arial, sans-serif;
background-color: #87ceeb;
color: #333;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.navbar {
width: 100%;
background-color: #0073e6;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
margin-bottom: 10px;
font-family: "Open Sans", sans-serif;
position: fixed; /* 设置为固定定位 */
top: 0; /* 置顶 */
left: 0; /* 对齐到左边 */
right: 0; /* 对齐到右边 */
z-index: 1000; /* 确保在其他元素之上 */
}
.nav-links {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-around;
align-items: center;
height: 50px;
}
.nav-links li {
font-weight: 600;
}
.nav-links li router-link {
text-decoration: none;
color: white;
font-size: 25px;
transition: color 0.3s;
padding: 0 15px;
}
.nav-links li router-link:hover {
color: #d0e7ff;
}
#app {
display: flex;
background: #fff;
border-radius: 8px;
overflow: hidden;
flex-direction: column;
align-items: center;
height: 200vh;
max-height: 675px;
overflow-y: auto;
}
.search-container {
width: 100%;
max-width: 600px;
margin-top: 50px;
margin-bottom: 15px;
position: relative;
}
.search-container input[type="text"] {
width: 100%;
padding: 12px;
font-size: 16px;
border: 1px solid #0073e6;
border-radius: 25px;
box-sizing: border-box;
outline: none;
padding-left: 40px;
}
.search-container::before {
content: "🔍";
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 16px;
color: #0073e6;
}
.keyword-suggestions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 10px;
}
.keyword-suggestions button {
padding: 5px 12px;
background-color: transparent;
color: #0073e6;
border: 1px solid #0073e6;
border-radius: 20px;
font-size: 14px;
cursor: pointer;
transition: background-color 0.3s;
}
.keyword-suggestions button:hover {
background-color: #d0e7ff;
}
.match-list {
width: 100%;
max-width: 600px;
margin-top: 20px;
}
/* 刷新按钮 */
.refresh-button {
display: flex;
align-items: center;
cursor: pointer;
color: #0073e6;
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.match-card {
display: flex;
align-items: center;
padding: 15px;
border-radius: 8px;
background-color: #d0e7ff;
margin-bottom: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.match-card img {
width: 60px;
height: 60px;
border-radius: 50%;
margin-right: 15px;
}
.match-info {
flex: 1;
}
.match-info h3 {
margin: 0;
font-size: 18px;
color: #333;
}
.match-buttons {
display: flex;
flex-direction: column;
gap: 20px;
width: 30%;
}
.match-button,
.chat-button {
padding: 8px 12px;
background-color: #0073e6;
color: white;
font-size: 14px;
font-weight: bold;
border: none;
border-radius: 4px;
cursor: pointer;
text-align: center;
}
.chat-button {
background-color: #ff6600;
}
.match-buttons a {
text-decoration: none;
}
</style>

@ -1,545 +0,0 @@
<template>
<div class="chat-window">
<div class="top">
<div class="head-pic">
<HeadPortrait :imgUrl="frinedInfo.headImg"></HeadPortrait>
</div>
<div class="info-detail">
<div class="name">{{ frinedInfo.name }}</div>
</div>
<div class="other-fun">
<label for="docFile">
<span class="iconfont icon-wenjian"></span>
</label>
<label for="imgFile">
<span class="iconfont icon-tupian"></span>
</label>
<input
type="file"
name=""
id="imgFile"
@change="sendImg"
accept="image/*"
/>
<input
type="file"
name=""
id="docFile"
@change="sendFile"
accept="application/*,text/*"
/>
<!-- accept="application/*" -->
</div>
</div>
<div class="botoom">
<div class="chat-content" ref="chatContent">
<div class="chat-wrapper" v-for="item in chatList" :key="item.id">
<div class="chat-friend" v-if="item.uid !== '1001'">
<div class="info-time">
<img :src="item.headImg" alt="" />
<span>{{ item.name }}</span>
</div>
<div class="chat-text" v-if="item.chatType == 0">
{{ item.msg }}
</div>
<div class="chat-img" v-if="item.chatType == 1">
<img
:src="item.msg"
alt="表情"
v-if="item.extend.imgType == 1"
style="width: 100px; height: 100px"
/>
<el-image :src="item.msg" :preview-src-list="srcImgList" v-else>
</el-image>
</div>
<div class="chat-img" v-if="item.chatType == 2">
<div class="word-file">
<FileCard
:fileType="item.extend.fileType"
:file="item.msg"
></FileCard>
</div>
</div>
</div>
<div class="chat-me" v-else>
<div class="info-time">
<span>{{ item.name }}</span>
<img :src="item.headImg" alt="" />
</div>
<div class="chat-text" v-if="item.chatType == 0">
{{ item.msg }}
</div>
<div class="chat-img" v-if="item.chatType == 1">
<img
:src="item.msg"
alt="表情"
v-if="item.extend.imgType == 1"
style="width: 100px; height: 100px"
/>
<el-image
style="max-width: 300px; border-radius: 10px"
:src="item.msg"
:preview-src-list="srcImgList"
v-else
>
</el-image>
</div>
<div class="chat-img" v-if="item.chatType == 2">
<div class="word-file">
<FileCard
:fileType="item.extend.fileType"
:file="item.msg"
></FileCard>
</div>
</div>
</div>
</div>
</div>
<div class="chatInputs">
<div class="emoji boxinput" @click="clickEmoji">
<img src="@/assets/img/emoji/smiling-face.png" alt="" />
</div>
<div class="emoji-content">
<Emoji
v-show="showEmoji"
@sendEmoji="sendEmoji"
@closeEmoji="clickEmoji"
></Emoji>
</div>
<input class="inputs" v-model="inputMsg" @keyup.enter="sendText" />
<div class="send boxinput" @click="sendText">
<!-- <img src="@/assets/img/emoji/rocket.png" alt="" /> -->
<div class="text">发送</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { animation } from "@/util/util";
import { getChatMsg } from "@/api/getData";
import HeadPortrait from "@/components/HeadPortrait";
import Emoji from "@/components/Emoji";
import FileCard from "@/components/FileCard.vue";
export default {
components: {
HeadPortrait,
Emoji,
FileCard,
},
props: {
frinedInfo: Object,
default() {
return {};
},
},
watch: {
frinedInfo() {
this.getFriendChatMsg();
},
},
data() {
return {
chatList: [],
inputMsg: "",
showEmoji: false,
friendInfo: {},
srcImgList: [],
};
},
mounted() {
this.getFriendChatMsg();
},
methods: {
//
getFriendChatMsg() {
let params = {
frinedId: this.frinedInfo.id,
};
getChatMsg(params).then((res) => {
this.chatList = res;
this.chatList.forEach((item) => {
if (item.chatType == 2 && item.extend.imgType == 2) {
this.srcImgList.push(item.msg);
}
});
});
},
//
sendMsg(msgList) {
this.chatList.push(msgList);
this.scrollBottom();
},
//
scrollBottom() {
this.$nextTick(() => {
const scrollDom = this.$refs.chatContent;
animation(scrollDom, scrollDom.scrollHeight - scrollDom.offsetHeight);
});
},
//
clickEmoji() {
this.showEmoji = !this.showEmoji;
},
//
sendText() {
if (this.inputMsg) {
let chatMsg = {
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: this.inputMsg,
chatType: 0, //01
uid: "1001", //uid
};
this.sendMsg(chatMsg);
this.$emit('personCardSort', this.frinedInfo.id)
this.inputMsg = "";
} else {
this.$message({
message: "消息不能为空哦~",
type: "warning",
});
}
},
//
sendEmoji(msg) {
let chatMsg = {
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: msg,
chatType: 1, //01
extend: {
imgType: 1, //(12)
},
uid: "1001",
};
this.sendMsg(chatMsg);
this.clickEmoji();
},
//
sendImg(e) {
let _this = this;
console.log(e.target.files);
let chatMsg = {
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "",
chatType: 1, //01, 2
extend: {
imgType: 2, //(12)
},
uid: "1001",
};
let files = e.target.files[0]; //
if (!e || !window.FileReader) return; // FileReader
let reader = new FileReader();
reader.readAsDataURL(files); //
reader.onloadend = function() {
chatMsg.msg = this.result; //
_this.srcImgList.push(chatMsg.msg);
};
this.sendMsg(chatMsg);
e.target.files = null;
},
//
sendFile(e) {
let chatMsg = {
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "",
chatType: 2, //01, 2
extend: {
fileType: "", //(1word2excel3ppt4pdf5zpi, 6txt)
},
uid: "1001",
};
let files = e.target.files[0]; //
chatMsg.msg = files;
console.log(files);
if (files) {
switch (files.type) {
case "application/msword":
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
chatMsg.extend.fileType = 1;
break;
case "application/vnd.ms-excel":
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
chatMsg.extend.fileType = 2;
break;
case "application/vnd.ms-powerpoint":
case "application/vnd.openxmlformats-officedocument.presentationml.presentation":
chatMsg.extend.fileType = 3;
break;
case "application/pdf":
chatMsg.extend.fileType = 4;
break;
case "application/zip":
case "application/x-zip-compressed":
chatMsg.extend.fileType = 5;
break;
case "text/plain":
chatMsg.extend.fileType = 6;
break;
default:
chatMsg.extend.fileType = 0;
}
this.sendMsg(chatMsg);
e.target.files = null;
}
},
//
telephone() {
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
},
//
video() {
this.$message("该功能还没有开发哦,敬请期待一下吧~🥳");
},
},
};
</script>
<!-- 左上角色的信息样式 -->
<style lang="scss" scoped>
.chat-window {
width: 100%;
height: 100%;
margin-left: 0px;
position: relative;
.top {
display: flex;
align-items: center;
width: 100%;
border-bottom: 0.5px solid rgba(128, 128, 128, 0.436);
height: 73px;
&::after {
content: "";
display: block;
clear: both;
}
.head-pic {
float: left;
margin-left: 15px;
}
.info-detail {
width:60px;
float: left;
margin-left: 5px;
text-align: center;
.name {
font-size: 20px;
font-weight: 600;
color: #070707;
}
.detail {
color: #46658b;
font-size: 12px;
margin-top: 2px;
}
}
.other-fun {
float: right;
margin-left: 940px;
span {
margin-left: 30px;
margin-right: 30px;
cursor: pointer;
}
// .icon-tupian {
// }
input {
display: none;
}
}
}
.botoom {
width: 100%;
height: 80vh;
background-color: rgb(255, 255, 255);
border-radius: 20px;
box-sizing: border-box;
position: relative;
.chat-content {
width: 100%;
height: 90%;
overflow-y: scroll;
padding: 20px;
box-sizing: border-box;
&::-webkit-scrollbar {
width: 0; /* Safari,Chrome 隐藏滚动条 */
height: 0; /* Safari,Chrome 隐藏滚动条 */
display: none; /* 移动端、pad 上SafariChrome隐藏滚动条 */
}
.chat-wrapper {
position: relative;
word-break: break-all;
.chat-friend {
width: 100%;
float: left;
margin-bottom: 20px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
.chat-text {
max-width: 90%;
padding: 20px;
border-radius: 20px 20px 20px 20px;
background-color: whitesmoke;
color: #0c0c0c;
}
.chat-img {
img {
width: 100px;
height: 100px;
}
}
.info-time {
margin: 10px 0;
color: #090909;
font-size: 14px;
img {
width: 30px;
height: 30px;
border-radius: 50%;
vertical-align: middle;
margin-right: 10px;
}
span:last-child {
color: rgb(10, 10, 10);
margin-left: 10px;
vertical-align: middle;
}
}
}
.chat-me {
width: 100%;
float: right;
margin-bottom: 20px;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: flex-end;
.chat-text {
float: right;
max-width: 90%;
padding: 20px;
border-radius: 20px 20px 20px 20px;
background-color: rgb(10, 154, 238);
color: #070707;
}
.chat-img {
img {
max-width: 300px;
max-height: 200px;
border-radius: 10px;
}
}
.info-time {
margin: 10px 0;
color: #050505;
font-size: 14px;
display: flex;
justify-content: flex-end;
img {
width: 30px;
height: 30px;
border-radius: 50%;
vertical-align: middle;
margin-left: 10px;
}
span {
line-height: 30px;
}
span:first-child {
color: rgb(7, 7, 7);
margin-right: 10px;
vertical-align: middle;
}
}
}
}
}
.chatInputs {
width: 100%;
position: absolute;
display: flex;
margin-top: 22px;
.boxinput {
width: 50px;
height: 50px;
background-color: rgb(255, 255, 255);
border-radius: 15px;
border: 1px solid rgb(80, 85, 103);
position: relative;
cursor: pointer;
img {
width: 30px;
height: 30px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
.emoji {
transition: 0.3s;
margin-left: 10px;
border: none;
&:hover {
background-color: rgba(128, 128, 128, 0.299);
}
}
.inputs {
width: 1030px;
height: 50px;
background-color: rgb(255, 255, 255);
border-radius: 10px;
border: 2px solid rgb(15, 15, 15);
padding: 10px;
box-sizing: border-box;
transition: 0.2s;
font-size: 20px;
color: #0f0f0f;
font-weight: 100;
margin-top: 0px;
margin-left: 20px;
margin-right: 20px;
&:focus {
outline: none;
}
}
.send {
display: flex;
width: 100px;
background-color: rgb(255, 255, 255);
border: 0;
transition: 0.3s;
text-align: center;
align-items: center;
justify-content: center;
box-shadow: 0px 0px 5px 0px rgb(125, 124, 124);
&:hover {
box-shadow: 0px 0px 10px 0px rgba(0, 136, 255);
}
}
}
}
}
</style>

@ -1,182 +0,0 @@
<template>
<div class="chatHome">
<div class="chatLeft">
<div class="online-person">
<div class="osearch">
<input
class="search"
type="text"
v-model="searchQuery"
placeholder="搜索"
@input="handleSearch"
/>
</div>
<div class="person-cards-wrapper">
<div
class="personList"
v-for="personInfo in filteredItems"
:key="personInfo.id"
@click="clickPerson(personInfo)"
>
<PersonCard
:personInfo="personInfo"
:pcCurrent="pcCurrent"
></PersonCard>
</div>
</div>
</div>
</div>
<div class="chatRight">
<!-- <router-view></router-view> -->
<div v-if="showChatWindow">
<ChatWindow
:frinedInfo="chatWindowInfo"
@personCardSort="personCardSort"
></ChatWindow>
</div>
<div class="showIcon" v-else>
<span class="iconfont icon-snapchat"></span>
<!-- <img src="@/assets/img/snapchat.png" alt="" /> -->
</div>
</div>
<!-- <el-col :span="4"><div class="grid-content bg-purple"></div></el-col> -->
</div>
</template>
<script>
import PersonCard from "@/components/PersonCard.vue";
import ChatWindow from "./chatwindow.vue";
import Navi from "../../../components/Navi.vue";
import { getFriend } from "@/api/getData";
export default {
name: "App",
components: {
PersonCard,
ChatWindow,
Navi,
},
data() {
return {
filteredItems: [],
searchQuery: '',
pcCurrent: "",
personList: [],
showChatWindow: false,
chatWindowInfo: {},
};
},
mounted() {
getFriend().then((res) => {
console.log(res);
this.personList = res;
this.filteredItems = res;
});
},
methods: {
handleSearch() {
const query = this.searchQuery.toLowerCase();
this.filteredItems = this.personList.filter(item =>
item.name.toLowerCase().includes(query)
);
console.log(this.filteredItems);
},
clickPerson(info) {
this.showChatWindow = true;
this.chatWindowInfo = info;
this.personInfo = info;
this.pcCurrent = info.id;
},
personCardSort(id) {
if (id !== this.personList[0].id) {
console.log(id);
let nowPersonInfo;
for (let i = 0; i < this.personList.length; i++) {
if (this.personList[i].id == id) {
nowPersonInfo = this.personList[i];
this.personList.splice(i, 1);
break;
}
}
this.personList.unshift(nowPersonInfo);
}
},
},
};
</script>
<style lang="scss" scoped>
.chatHome {
display: flex;
.chatLeft {
width: 280px;
height: 93.2vh;
border-right: 0.5px solid rgba(128, 128, 128, 0.436);
.title {
width: 200px;
height: 50px;
border: #090909;
color: #090909;
padding-left: 10px;
.h1 {
display: flex;
justify-content: center;
}
}
.online-person {
display: flex;
flex-direction: column;
align-items: center;
.osearch {
height: 73px;
width: 100%;
display: flex;
margin-top: 0%;
justify-content: center;
align-items: center;
border-bottom: 0.5px solid rgba(128, 128, 128, 0.436);
.search {
background-color: rgba(128, 128, 128, 0.119);
font-size: 20px;
border: 1px solid gray;
border-radius: 3px;
width: 80%;
height: 30px;
text-align: center;
}
}
.onlin-text {
padding-left: 10px;
color: rgb(6, 6, 6);
}
.person-cards-wrapper {
padding-left: 0px;
height: 65vh;
overflow: hidden;
overflow-y: scroll;
box-sizing: border-box;
&::-webkit-scrollbar {
width: 0; /* Safari,Chrome 隐藏滚动条 */
height: 0; /* Safari,Chrome 隐藏滚动条 */
display: none; /* 移动端、pad 上SafariChrome隐藏滚动条 */
}
}
}
}
.chatRight {
flex: 1;
.showIcon {
position: absolute;
top: calc(50% - 150px); /*垂直居中 */
left: calc(50% - 50px); /*水平居中 */
.icon-snapchat {
width: 300px;
height: 300px;
font-size: 300px;
// color: rgb(28, 30, 44);
}
}
}
}
</style>

@ -1,13 +0,0 @@
<template>
</template>
<script>
export default {
}
</script>
<style>
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save