Compare commits
No commits in common. 'main' and 'master' have entirely different histories.
@ -0,0 +1,14 @@
|
||||
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()
|
||||
@ -0,0 +1,247 @@
|
||||
from faker import Faker
|
||||
from sqlalchemy.orm import Session
|
||||
from database import SessionLocal, Base, engine
|
||||
from models import User
|
||||
|
||||
# 初始化 Faker 并指定中文语言
|
||||
fake = Faker('zh_CN')
|
||||
|
||||
# 创建会话
|
||||
session: Session = SessionLocal()
|
||||
|
||||
# 定义爱好列表
|
||||
hobbies = [
|
||||
"阅读", "旅行", "摄影", "音乐", "电影", "运动", "绘画", "编程", "烹饪", "园艺",
|
||||
"徒步", "瑜伽", "舞蹈", "健身", "游泳", "跑步", "骑行", "攀岩", "滑雪", "冲浪",
|
||||
"钓鱼", "高尔夫", "网球", "篮球", "足球", "乒乓球", "羽毛球", "台球", "棋类", "象棋",
|
||||
"围棋", "桥牌", "扑克", "桌游", "魔术", "魔术表演", "魔术制作", "手工艺", "编织", "刺绣",
|
||||
"陶艺", "木工", "园艺设计", "园艺维护", "宠物护理", "宠物训练", "宠物摄影", "宠物美容",
|
||||
"汽车修理", "汽车驾驶", "摩托车驾驶", "赛车", "飞行", "潜水", "跳伞", "攀冰", "攀岩",
|
||||
"皮划艇", "独木舟", "帆船", "帆板", "冲浪", "滑水", "滑雪", "雪板", "滑翔伞", "热气球",
|
||||
"徒步旅行", "背包旅行", "露营", "野餐", "烧烤", "音乐会", "戏剧", "歌剧", "芭蕾舞", "舞蹈",
|
||||
"戏剧表演", "歌唱", "乐器演奏", "吉他", "钢琴", "小提琴", "长笛", "萨克斯", "鼓", "打击乐",
|
||||
"写作", "小说创作", "诗歌创作", "散文创作", "剧本创作", "博客写作", "新闻写作", "翻译",
|
||||
"播客制作", "视频制作", "电影制作", "摄影", "航拍", "剪辑", "后期制作", "游戏开发",
|
||||
"软件开发", "编程", "数据分析", "机器学习", "人工智能", "网络安全", "区块链", "云计算",
|
||||
"虚拟现实", "增强现实", "机器人技术", "自动化", "电子工程", "机械工程", "生物工程",
|
||||
]
|
||||
|
||||
university = [
|
||||
"北京大学",
|
||||
"清华大学",
|
||||
"浙江大学",
|
||||
"上海交通大学",
|
||||
"复旦大学",
|
||||
"南京大学",
|
||||
"中国科学技术大学",
|
||||
"哈尔滨工业大学",
|
||||
"天津大学",
|
||||
"华中科技大学",
|
||||
"中山大学",
|
||||
"华南理工大学",
|
||||
"武汉大学",
|
||||
"四川大学",
|
||||
"西安交通大学",
|
||||
"东南大学",
|
||||
"同济大学",
|
||||
"北京航空航天大学",
|
||||
"北京理工大学",
|
||||
"西北工业大学",
|
||||
"中国人民大学",
|
||||
"北京师范大学",
|
||||
"南开大学",
|
||||
"厦门大学",
|
||||
"山东大学",
|
||||
"吉林大学",
|
||||
"湖南大学",
|
||||
"重庆大学",
|
||||
"大连理工大学",
|
||||
"电子科技大学",
|
||||
"兰州大学",
|
||||
"东北大学",
|
||||
"中国农业大学",
|
||||
"国防科技大学",
|
||||
"中南大学",
|
||||
"中国海洋大学",
|
||||
"中央民族大学",
|
||||
"华东师范大学",
|
||||
"北京工业大学",
|
||||
"北京化工大学",
|
||||
"北京邮电大学",
|
||||
"北京林业大学",
|
||||
"北京中医药大学",
|
||||
"北京外国语大学",
|
||||
"对外经济贸易大学",
|
||||
"中国政法大学",
|
||||
"中央财经大学",
|
||||
"中国传媒大学",
|
||||
"中央音乐学院",
|
||||
"中央美术学院",
|
||||
"北京体育大学",
|
||||
"华北电力大学",
|
||||
"北京科技大学",
|
||||
"北京交通大学",
|
||||
"中国地质大学",
|
||||
"中国矿业大学",
|
||||
"中国石油大学",
|
||||
"北京语言大学",
|
||||
"北京信息科技大学",
|
||||
"首都医科大学",
|
||||
"首都师范大学",
|
||||
"首都经济贸易大学",
|
||||
"外交学院",
|
||||
"国际关系学院",
|
||||
"北京电影学院",
|
||||
"中国戏曲学院",
|
||||
"中央戏剧学院",
|
||||
"中国科学院大学",
|
||||
"中国社会科学院大学",
|
||||
"中国人民公安大学",
|
||||
"中国刑事警察学院",
|
||||
"中国消防救援学院",
|
||||
"中央司法警官学院",
|
||||
"南京航空航天大学",
|
||||
"南京理工大学",
|
||||
"河海大学",
|
||||
"南京农业大学",
|
||||
"南京师范大学",
|
||||
"苏州大学",
|
||||
"江南大学",
|
||||
"南京信息工程大学",
|
||||
"南京邮电大学",
|
||||
"南京林业大学",
|
||||
"南京中医药大学",
|
||||
"南京医科大学",
|
||||
"南京艺术学院",
|
||||
"南京体育学院",
|
||||
"南京审计大学",
|
||||
"江苏大学",
|
||||
"扬州大学",
|
||||
"江苏师范大学",
|
||||
"常州大学",
|
||||
"南通大学",
|
||||
"苏州科技大学",
|
||||
"徐州医科大学",
|
||||
"江苏科技大学",
|
||||
"南京晓庄学院",
|
||||
"金陵科技学院",
|
||||
"南京工程学院",
|
||||
"南京特殊教育师范学院",
|
||||
"苏州科技大学",
|
||||
"江苏理工学院",
|
||||
"淮阴工学院",
|
||||
"盐城工学院",
|
||||
"江苏海洋大学",
|
||||
"江苏师范大学",
|
||||
"徐州工程学院",
|
||||
"宿迁学院",
|
||||
"无锡太湖学院",
|
||||
"常州工学院",
|
||||
"南京森林警察学院",
|
||||
"江苏警官学院",
|
||||
"江苏第二师范学院",
|
||||
"江苏卫生健康职业学院",
|
||||
"江苏经贸职业技术学院",
|
||||
"南京工业职业技术大学",
|
||||
"南京铁道职业技术学院",
|
||||
"江苏食品药品职业技术学院",
|
||||
"江苏农林职业技术学院",
|
||||
"江苏建筑职业技术学院",
|
||||
"江苏城市职业学院",
|
||||
"江苏信息职业技术学院",
|
||||
"江苏航运职业技术学院",
|
||||
"江苏旅游职业学院",
|
||||
"江苏护理职业学院",
|
||||
"江苏财经职业技术学院",
|
||||
"江苏安全技术职业学院",
|
||||
"江苏商贸职业学院",
|
||||
"江苏工程职业技术学院",
|
||||
"江苏农牧科技职业学院",
|
||||
"江苏医药职业学院",
|
||||
"江苏电子信息职业学院",
|
||||
"江苏海事职业技术学院",
|
||||
"江苏航空职业技术学院",
|
||||
"江苏交通职业技术学院",
|
||||
"江苏联合职业技术学院",
|
||||
"江苏开放大学",
|
||||
"江苏广播电视大学",
|
||||
"江苏远程教育中心",
|
||||
'福州大学',
|
||||
]
|
||||
|
||||
middle_school = [
|
||||
"第一中学",
|
||||
"第二中学",
|
||||
"第三中学",
|
||||
"实验中学",
|
||||
"育才中学",
|
||||
"光明中学",
|
||||
"希望中学",
|
||||
"胜利中学",
|
||||
"友谊中学",
|
||||
"和平中学"
|
||||
]
|
||||
img_url=[
|
||||
"img/thought-balloon.f04a98df.png",
|
||||
"img/ghost.e931ffda.png",
|
||||
"img/rainbow.f269a036.png",
|
||||
"",
|
||||
]
|
||||
|
||||
|
||||
|
||||
# 生成大量模拟数据
|
||||
def generate_fake_users(num_users):
|
||||
fake_users = []
|
||||
existing_usernames = set(user.username for user in session.query(User.username).all())
|
||||
|
||||
while len(fake_users) < num_users:
|
||||
location = fake.city() # 生成市级地址
|
||||
education = fake.random_element(elements=('初中', '高中', '本科', '研究生', '博士')) # 生成学历
|
||||
|
||||
if education in ['初中', '高中']:
|
||||
# 从 middle_school 中随机选择一个中学,并结合 location
|
||||
middle_school_name = fake.random_element(elements=middle_school)
|
||||
graduation_school = f"{location}{middle_school_name}"
|
||||
else:
|
||||
# 从 university 中随机选择一个大学
|
||||
graduation_school = fake.random_element(elements=university)
|
||||
|
||||
user = User(
|
||||
username=fake.unique.user_name(), # 生成唯一用户名
|
||||
password=fake.password(length=10), # 生成密码
|
||||
head_img=fake.random_element(elements=img_url), # 生成头像链接
|
||||
sex=fake.random_element(elements=('女', '男')), # 生成性别
|
||||
age=fake.random_int(min=18, max=40), # 生成年龄
|
||||
height=f"{fake.random_int(min=150, max=200)} cm", # 生成身高并添加 cm 后缀
|
||||
weight=f"{fake.random_int(min=40, max=150)} kg", # 生成体重并添加 kg 后缀
|
||||
hobby=fake.random_element(elements=hobbies), # 从预定义列表中随机选择爱好
|
||||
tips=fake.sentence(nb_words=10), # 生成个人签名
|
||||
location=location, # 使用生成的市级地址
|
||||
education=education, # 使用生成的学历
|
||||
graduation_school=graduation_school, # 根据学历生成的毕业院校
|
||||
work_place=fake.company(), # 生成工作单位
|
||||
job=fake.job()[:15], # 生成职位并限制长度
|
||||
monthly_income=str(fake.random_int(min=3000, max=30000)), # 生成月收入
|
||||
house=fake.random_element(elements=('没有', '贷款买房', '有房')), # 生成买房情况
|
||||
car=fake.random_element(elements=('没有', '有车')) # 生成买车情况
|
||||
)
|
||||
|
||||
if user.username not in existing_usernames:
|
||||
fake_users.append(user)
|
||||
existing_usernames.add(user.username)
|
||||
|
||||
return fake_users
|
||||
|
||||
# 插入模拟数据
|
||||
num_users_to_generate = 1000 # 生成 1000 个用户
|
||||
fake_users = generate_fake_users(num_users_to_generate)
|
||||
|
||||
# 批量插入数据
|
||||
session.bulk_save_objects(fake_users)
|
||||
session.commit()
|
||||
|
||||
print(f"成功插入 {num_users_to_generate} 个模拟用户")
|
||||
|
||||
# 关闭会话
|
||||
session.close()
|
||||
@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
@ -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,21 @@
|
||||
# chathome
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
# LOVEGET
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
<!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>
|
||||
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "chathome",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,28 @@
|
||||
<!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>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,40 @@
|
||||
<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>
|
||||
@ -0,0 +1,41 @@
|
||||
<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>
|
||||
@ -0,0 +1,61 @@
|
||||
import base from './index'
|
||||
let axios = base.axios
|
||||
let baseUrl = base.baseUrl
|
||||
//baseUrl = 'http://localhost:8080'
|
||||
|
||||
|
||||
//获取username
|
||||
const userstring=localStorage.getItem('user')
|
||||
const username = JSON.parse(userstring)
|
||||
// 获取好友
|
||||
export const getFriend = params => {
|
||||
const requestData = {
|
||||
...params,
|
||||
username: username
|
||||
};
|
||||
return axios({
|
||||
method: 'post',
|
||||
baseURL: `${baseUrl}/friend/friendList`,
|
||||
// /frend/friendList和mock文件夹中预设的接口一致
|
||||
data: requestData
|
||||
}).then(res => res.data)
|
||||
}
|
||||
|
||||
// 获取聊天信息
|
||||
export const getChatMsg = params => {
|
||||
const requestData = {
|
||||
...params,
|
||||
username: username
|
||||
};
|
||||
return axios({
|
||||
method: 'post',
|
||||
baseURL: `${baseUrl}/friend/chatMsg`,
|
||||
data: requestData
|
||||
}).then(res => res.data)
|
||||
}
|
||||
|
||||
//获取用户信息
|
||||
export const getuserInfo = params => {
|
||||
const requestData = {
|
||||
...params,
|
||||
username: username
|
||||
};
|
||||
return axios({
|
||||
method: 'post',
|
||||
baseURL: `${baseUrl}/user/userInfo`,
|
||||
data: requestData
|
||||
}).then(res => res.data)
|
||||
}
|
||||
// 更新聊天信息
|
||||
export function updateChatMsg(params) {
|
||||
const requestData = {
|
||||
...params,
|
||||
username: username
|
||||
};
|
||||
console.log(requestData)
|
||||
return axios({
|
||||
method: 'post',
|
||||
baseURL: `${baseUrl}/friend/updateChatMsg`,
|
||||
data: requestData
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
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:8000'
|
||||
}
|
||||
|
||||
export default base
|
||||
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,539 @@
|
||||
/* 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;
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
@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";
|
||||
}
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 812 KiB |
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,81 @@
|
||||
<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>
|
||||
@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div class="head-portrait">
|
||||
<img :src="imgUrl || defaultAvatar" alt="">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
imgUrl:{ default:require('@/assets/img/snapchat.png')},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultAvatar: require('@/assets/img/snapchat.png')
|
||||
};
|
||||
}
|
||||
}
|
||||
</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,128 @@
|
||||
<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>
|
||||
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<nav class="navbar">
|
||||
<ul class="nav-links">
|
||||
<li @click="setActiveItem('recommend')" :class="{ 'active': activeItem === 'recommend' }">
|
||||
<router-link to="/ReCommendtrue">推荐</router-link>
|
||||
</li>
|
||||
<li @click="setActiveItem('search')" :class="{ 'active': activeItem === 'search' }">
|
||||
<router-link to="/ReCommend">搜索</router-link>
|
||||
</li>
|
||||
<li @click="setActiveItem('chat')" :class="{ 'active': activeItem === 'chat' }">
|
||||
<router-link to="/ChatHome">聊天</router-link>
|
||||
</li>
|
||||
<li @click="setActiveItem('profile')" :class="{ 'active': activeItem === 'profile' }">
|
||||
<router-link to="/LinVite1n">个人资料</router-link>
|
||||
</li>
|
||||
<li class="logout-button" :style="backgroundStyle" @mouseenter="toggleDropdown(true)" @mouseleave="toggleDropdown(false)">
|
||||
<ul v-if="isDropdownOpen" class="dropdown-menu">
|
||||
<li @click.stop="handleOptionClick('option1')">修改账户</li>
|
||||
<li @click.stop="handleOptionClick('option2')">退出登录</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import base from '@/api/index';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeItem: null,
|
||||
backgroundImageUrl: '',
|
||||
defaultAvatarUrl: require('@/assets/img/snapchat.png'), // 默认头像路径
|
||||
isDropdownOpen: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
backgroundStyle() {
|
||||
return {
|
||||
backgroundImage: `url(${this.backgroundImageUrl || this.defaultAvatarUrl})`
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(to) {
|
||||
this.setActiveItemBasedOnRoute(to.path);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setActiveItemBasedOnRoute(this.$route.path);
|
||||
this.fetchBackgroundImageUrl();
|
||||
},
|
||||
methods: {
|
||||
setActiveItem(item) {
|
||||
this.activeItem = item;
|
||||
},
|
||||
setActiveItemBasedOnRoute(path) {
|
||||
if (path === '/ReCommendtrue') {
|
||||
this.activeItem = 'recommend';
|
||||
} else if (path === '/ReCommend') {
|
||||
this.activeItem = 'search';
|
||||
} else if (path === '/ChatHome') {
|
||||
this.activeItem = 'chat';
|
||||
} else if (path === '/LinVite1n') {
|
||||
this.activeItem = 'profile';
|
||||
}
|
||||
},
|
||||
async fetchBackgroundImageUrl() {
|
||||
try {
|
||||
const userString = localStorage.getItem('user');
|
||||
const username = JSON.parse(userString);
|
||||
const response = await base.axios({
|
||||
method: 'get',
|
||||
url: `${base.baseUrl}/get_headimg`,
|
||||
params: {
|
||||
username: username
|
||||
}
|
||||
});
|
||||
this.backgroundImageUrl = response.data;
|
||||
console.log(this.backgroundImageUrl);
|
||||
} catch (error) {
|
||||
console.error('获取用户头像失败:', error);
|
||||
}
|
||||
},
|
||||
toggleDropdown(isOpen) {
|
||||
this.isDropdownOpen = isOpen;
|
||||
},
|
||||
logout() {
|
||||
localStorage.removeItem('user');
|
||||
this.$router.push('/');
|
||||
},
|
||||
handleOptionClick(option) {
|
||||
console.log(`Clicked on ${option}`);
|
||||
// 在这里添加选项点击后的逻辑
|
||||
if (option === 'option2') {
|
||||
this.logout();
|
||||
}
|
||||
if (option === 'option1') {
|
||||
this.$router.push('/ChangePwd');
|
||||
}
|
||||
this.isDropdownOpen = false; // 关闭下拉菜单
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.active {
|
||||
background-color: rgb(0, 0, 255); /* 你可以根据需要更改颜色 */
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
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;
|
||||
height: 100%; /* 确保 li 占据整个导航栏的高度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer; /* 添加鼠标指针样式 */
|
||||
}
|
||||
|
||||
.nav-links li a {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
font-size: 25px;
|
||||
transition: color 0.3s;
|
||||
width: 360px;
|
||||
height: 100%; /* 确保 a 占据整个 li 的高度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-links li a:hover {
|
||||
color: #d0e7ff;
|
||||
}
|
||||
|
||||
.nav-links li.active {
|
||||
background-color: rgb(0, 0, 255); /* 确保整个 li 的背景颜色在激活状态下改变 */
|
||||
}
|
||||
|
||||
.nav-links li.active a {
|
||||
color: white; /* 确保文字颜色在激活状态下不变 */
|
||||
}
|
||||
|
||||
.logout-button {
|
||||
margin-left: 20px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border: none;
|
||||
cursor: pointer; /* 添加鼠标指针样式 */
|
||||
position: relative; /* 设置为相对定位 */
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: absolute;
|
||||
top: 100%; /* 从父元素底部开始 */
|
||||
left: -15px;
|
||||
background-color: #1d84eb;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||
list-style-type: none;
|
||||
font-size: 14.6px;
|
||||
color: white;
|
||||
width: 160%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.dropdown-menu li {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,109 @@
|
||||
<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>
|
||||
@ -0,0 +1,22 @@
|
||||
import Vue 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"
|
||||
import api from './api/index.js'; // 导入配置好的 axios 实例
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
// 将 axios 挂载到 Vue 原型上,这样所有 Vue 实例都可以访问
|
||||
Vue.prototype.$axios = api.axios;
|
||||
|
||||
Vue.use(VueRouter)
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(ElementUI);
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
@ -0,0 +1,82 @@
|
||||
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'
|
||||
import zhuce from '@/view/zhuce.vue'
|
||||
import ChangePwd from '@/view/ChangePwd.vue'
|
||||
import ImFormation from '@/view/pages/ImFormation.vue'
|
||||
import ReCommendtrue from '@/view/pages/ReCommendtrue.vue'
|
||||
|
||||
export default new VueRouter({
|
||||
mode: 'hash',
|
||||
routes: [
|
||||
|
||||
{
|
||||
path:'/',
|
||||
name: 'Login',
|
||||
component:LoginPage
|
||||
},
|
||||
|
||||
{
|
||||
path: "/home",
|
||||
name: "Home",
|
||||
redirect: '/ChatHome'
|
||||
},
|
||||
{
|
||||
path: "/Recommendtrue",
|
||||
name: "Recommendtrue",
|
||||
component: ReCommendtrue
|
||||
},
|
||||
{
|
||||
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
|
||||
},
|
||||
{
|
||||
path: "/zhuce",
|
||||
name: "zhuce",
|
||||
component: zhuce
|
||||
},
|
||||
{
|
||||
path:'/ChangePwd',
|
||||
name:'ChangePwd',
|
||||
component:ChangePwd
|
||||
},
|
||||
{
|
||||
path:'/InFormation',
|
||||
name:'InFormation',
|
||||
component:ImFormation
|
||||
|
||||
},
|
||||
]
|
||||
})
|
||||