-
9.editorconfig
-
1.gitattributes
-
30.gitignore
-
7.vscode/extensions.json
-
35README.md
-
33eslint.config.js
-
13index.html
-
8jsconfig.json
-
4470package-lock.json
-
29package.json
-
BINpublic/favicon.ico
-
90src/App.vue
-
11src/api/homeApi.js
-
9src/api/indexApi.js
-
BINsrc/assets/background.png
-
0src/assets/base.css
-
BINsrc/assets/channel-avatar.png
-
BINsrc/assets/cover1.png
-
BINsrc/assets/cover2.png
-
BINsrc/assets/cover3.png
-
BINsrc/assets/cover4.png
-
10src/assets/main.css
-
BINsrc/assets/十年上.png
-
BINsrc/assets/十年下.png
-
BINsrc/assets/发财线.png
-
BINsrc/assets/解套.png
-
87src/components/TheFrame.vue
-
7src/components/icons/IconCommunity.vue
-
7src/components/icons/IconDocumentation.vue
-
7src/components/icons/IconEcosystem.vue
-
7src/components/icons/IconSupport.vue
-
19src/components/icons/IconTooling.vue
-
23src/main.js
-
BINsrc/pic/1.jpg
-
BINsrc/pic/2.jpg
-
BINsrc/pic/A.png
-
BINsrc/pic/bofang.png
-
BINsrc/pic/bogu.png
-
BINsrc/pic/dianzan.png
-
BINsrc/pic/images/1.png
-
BINsrc/pic/images/2.png
-
BINsrc/pic/images/3.png
-
BINsrc/pic/images/4.png
-
BINsrc/pic/images/5.png
-
BINsrc/pic/images/6.png
-
BINsrc/pic/images/7.png
-
BINsrc/pic/images/8.png
-
BINsrc/pic/images/link.jpg
-
BINsrc/pic/jihuigu.png
-
BINsrc/pic/jinrongzhan.png
-
BINsrc/pic/like.png
-
BINsrc/pic/link.jpg
-
BINsrc/pic/logo.jpg
-
BINsrc/pic/meiyuanbaquan.png
-
BINsrc/pic/money.png
-
BINsrc/pic/pic02.png
-
BINsrc/pic/pinglun.png
-
BINsrc/pic/qiangshi.png
-
BINsrc/pic/shengkuang.png
-
BINsrc/pic/touzi.png
-
BINsrc/pic/wengehua.png
-
BINsrc/pic/youxueban.png
-
36src/router/index.js
-
12src/stores/counter.js
-
153src/views/BookView.vue
-
249src/views/ChannelView.vue
-
404src/views/ClubView.vue
-
373src/views/HomeView.vue
-
289src/views/LiveView.vue
-
18vite.config.js
@ -0,0 +1,9 @@ |
|||||
|
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}] |
||||
|
charset = utf-8 |
||||
|
indent_size = 2 |
||||
|
indent_style = space |
||||
|
insert_final_newline = true |
||||
|
trim_trailing_whitespace = true |
||||
|
|
||||
|
end_of_line = lf |
||||
|
max_line_length = 100 |
@ -0,0 +1 @@ |
|||||
|
* text=auto eol=lf |
@ -0,0 +1,30 @@ |
|||||
|
# Logs |
||||
|
logs |
||||
|
*.log |
||||
|
npm-debug.log* |
||||
|
yarn-debug.log* |
||||
|
yarn-error.log* |
||||
|
pnpm-debug.log* |
||||
|
lerna-debug.log* |
||||
|
|
||||
|
node_modules |
||||
|
.DS_Store |
||||
|
dist |
||||
|
dist-ssr |
||||
|
coverage |
||||
|
*.local |
||||
|
|
||||
|
/cypress/videos/ |
||||
|
/cypress/screenshots/ |
||||
|
|
||||
|
# Editor directories and files |
||||
|
.vscode/* |
||||
|
!.vscode/extensions.json |
||||
|
.idea |
||||
|
*.suo |
||||
|
*.ntvs* |
||||
|
*.njsproj |
||||
|
*.sln |
||||
|
*.sw? |
||||
|
|
||||
|
*.tsbuildinfo |
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"recommendations": [ |
||||
|
"Vue.volar", |
||||
|
"dbaeumer.vscode-eslint", |
||||
|
"EditorConfig.EditorConfig" |
||||
|
] |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
# myproject |
||||
|
|
||||
|
This template should help get you started developing with Vue 3 in Vite. |
||||
|
|
||||
|
## Recommended IDE Setup |
||||
|
|
||||
|
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). |
||||
|
|
||||
|
## Customize configuration |
||||
|
|
||||
|
See [Vite Configuration Reference](https://vite.dev/config/). |
||||
|
|
||||
|
## Project Setup |
||||
|
|
||||
|
```sh |
||||
|
npm install |
||||
|
``` |
||||
|
|
||||
|
### Compile and Hot-Reload for Development |
||||
|
|
||||
|
```sh |
||||
|
npm run dev |
||||
|
``` |
||||
|
|
||||
|
### Compile and Minify for Production |
||||
|
|
||||
|
```sh |
||||
|
npm run build |
||||
|
``` |
||||
|
|
||||
|
### Lint with [ESLint](https://eslint.org/) |
||||
|
|
||||
|
```sh |
||||
|
npm run lint |
||||
|
``` |
@ -0,0 +1,33 @@ |
|||||
|
import { defineConfig, globalIgnores } from 'eslint/config' |
||||
|
import globals from 'globals' |
||||
|
import js from '@eslint/js' |
||||
|
import pluginVue from 'eslint-plugin-vue' |
||||
|
|
||||
|
export default defineConfig([ |
||||
|
{ |
||||
|
name: 'app/files-to-lint', |
||||
|
files: ['**/*.{js,mjs,jsx,vue}'], |
||||
|
}, |
||||
|
|
||||
|
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), |
||||
|
|
||||
|
{ |
||||
|
languageOptions: { |
||||
|
globals: { |
||||
|
...globals.browser, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
js.configs.recommended, |
||||
|
...pluginVue.configs['flat/essential'], |
||||
|
|
||||
|
|
||||
|
{ |
||||
|
"rules": { |
||||
|
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], |
||||
|
"no-undef": "off" |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
]) |
@ -0,0 +1,13 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang=""> |
||||
|
<head> |
||||
|
<meta charset="UTF-8"> |
||||
|
<link rel="icon" href="/favicon.ico"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
|
<title>Vite App</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="app"></div> |
||||
|
<script type="module" src="/src/main.js"></script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"compilerOptions": { |
||||
|
"paths": { |
||||
|
"@/*": ["./src/*"] |
||||
|
} |
||||
|
}, |
||||
|
"exclude": ["node_modules", "dist"] |
||||
|
} |
4470
package-lock.json
File diff suppressed because it is too large
View File
@ -0,0 +1,29 @@ |
|||||
|
{ |
||||
|
"name": "myproject", |
||||
|
"version": "0.0.0", |
||||
|
"private": true, |
||||
|
"type": "module", |
||||
|
"scripts": { |
||||
|
"dev": "vite", |
||||
|
"build": "vite build", |
||||
|
"preview": "vite preview", |
||||
|
"lint": "eslint . --fix" |
||||
|
}, |
||||
|
"dependencies": { |
||||
|
"@element-plus/icons-vue": "^2.3.1", |
||||
|
"axios": "^1.8.4", |
||||
|
"element-plus": "^2.9.7", |
||||
|
"pinia": "^3.0.1", |
||||
|
"vue": "^3.5.13", |
||||
|
"vue-router": "^4.5.0" |
||||
|
}, |
||||
|
"devDependencies": { |
||||
|
"@eslint/js": "^9.22.0", |
||||
|
"@vitejs/plugin-vue": "^5.2.3", |
||||
|
"eslint": "^9.22.0", |
||||
|
"eslint-plugin-vue": "~10.0.0", |
||||
|
"globals": "^16.0.0", |
||||
|
"vite": "^6.2.4", |
||||
|
"vite-plugin-vue-devtools": "^7.7.2" |
||||
|
} |
||||
|
} |
@ -0,0 +1,90 @@ |
|||||
|
<template> |
||||
|
<!-- <el-container class="full-height"> |
||||
|
<el-header class="header">Header</el-header> |
||||
|
<el-container> |
||||
|
<el-aside class="aside"> |
||||
|
<div class="aside-content"> |
||||
|
<RouterLink to="/"><div class="aside-item">主页</div></RouterLink> |
||||
|
<RouterLink to="clubView"><div class="aside-item">博股俱乐部</div></RouterLink> |
||||
|
<RouterLink to="channelView"><div class="aside-item">频道</div></RouterLink> |
||||
|
<RouterLink to="liveView"><div class="aside-item">直播广场</div></RouterLink> |
||||
|
<RouterLink to="bookView"><div class="aside-item">电子书</div></RouterLink> |
||||
|
<RouterLink to="channelView1"><div class="aside-item">频道1</div></RouterLink> |
||||
|
</div> |
||||
|
</el-aside> |
||||
|
|
||||
|
<el-main class="main"> |
||||
|
<RouterView /> |
||||
|
</el-main> |
||||
|
|
||||
|
</el-container> |
||||
|
</el-container> --> |
||||
|
<RouterView></RouterView> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
// import { ElContainer, ElHeader, ElAside, ElMain} from 'element-plus'; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
/* .full-height { |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.header { |
||||
|
background-color: #e6f2ff; |
||||
|
text-align: center; |
||||
|
line-height: 60px; |
||||
|
font-size: 18px; |
||||
|
height: 60px !important; |
||||
|
} |
||||
|
|
||||
|
.aside { |
||||
|
width: 200px; |
||||
|
background-color: #f0f0f0; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.aside-content { |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
margin-top: 15px; |
||||
|
} |
||||
|
|
||||
|
.aside-item { |
||||
|
padding: 15px; |
||||
|
margin: 5px 0; |
||||
|
background-color: #e0e0e0; |
||||
|
border-radius: 4px; |
||||
|
cursor: pointer; |
||||
|
transition: background-color 0.3s; |
||||
|
text-align: center; |
||||
|
font-size: 14px; |
||||
|
color: #333; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
.aside-item:hover { |
||||
|
background-color: #d0d0d0; |
||||
|
} |
||||
|
|
||||
|
.aside-item.active { |
||||
|
background-color: #409eff; |
||||
|
color: white; |
||||
|
} |
||||
|
|
||||
|
.main { |
||||
|
background-color: #f5f5f5; |
||||
|
padding: 20px; |
||||
|
text-align: center; |
||||
|
line-height: 40px; |
||||
|
} |
||||
|
|
||||
|
html, body { |
||||
|
height: 100%; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
} */ |
||||
|
</style> |
@ -0,0 +1,11 @@ |
|||||
|
|
||||
|
import service from "./indexApi"; |
||||
|
const homeApi = { |
||||
|
selectHome(queryType){ |
||||
|
//查询首页的数据
|
||||
|
return service.post('/api/show/getShowList', {queryType: queryType}); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
export default homeApi; |
@ -0,0 +1,9 @@ |
|||||
|
import axios from "axios"; |
||||
|
|
||||
|
//后端基于8000端口
|
||||
|
const service = axios.create({ |
||||
|
baseURL: "http://192.168.8.235:8000", |
||||
|
responseType: "json", |
||||
|
}); |
||||
|
|
||||
|
export default service; |
After Width: 1200 | Height: 800 | Size: 2.1 MiB |
After Width: 223 | Height: 220 | Size: 97 KiB |
After Width: 162 | Height: 111 | Size: 40 KiB |
After Width: 160 | Height: 113 | Size: 39 KiB |
After Width: 165 | Height: 105 | Size: 36 KiB |
After Width: 166 | Height: 107 | Size: 29 KiB |
@ -0,0 +1,10 @@ |
|||||
|
@import './base.css'; |
||||
|
|
||||
|
* { |
||||
|
margin: 0px; |
||||
|
padding: 0px; |
||||
|
} |
||||
|
|
||||
|
html, body, #app, .common-layout, .el-container, ul { |
||||
|
height: 100%; |
||||
|
} |
After Width: 86 | Height: 111 | Size: 17 KiB |
After Width: 85 | Height: 116 | Size: 17 KiB |
After Width: 82 | Height: 112 | Size: 16 KiB |
After Width: 84 | Height: 114 | Size: 17 KiB |
@ -0,0 +1,87 @@ |
|||||
|
<template> |
||||
|
<el-container class="full-height"> |
||||
|
<el-header class="header">Header</el-header> |
||||
|
<el-container> |
||||
|
<el-aside class="aside"> |
||||
|
<div class="aside-content"> |
||||
|
<div class="aside-item" @click="$router.push('/')">主页</div> |
||||
|
<div class="aside-item" @click="$router.push('/clubView')">博股俱乐部</div> |
||||
|
<div class="aside-item" @click="$router.push('/channelView')">频道</div> |
||||
|
<div class="aside-item" @click="$router.push('/bookView')">电子书</div> |
||||
|
<div class="aside-item" @click="$router.push('/liveView')">直播广场</div> |
||||
|
</div> |
||||
|
</el-aside> |
||||
|
<el-main class="main"> |
||||
|
<RouterView /> |
||||
|
</el-main> |
||||
|
</el-container> |
||||
|
</el-container> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import { ElContainer, ElHeader, ElAside, ElMain } from 'element-plus'; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.full-height { |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.header { |
||||
|
background-color: #e6f2ff; |
||||
|
text-align: center; |
||||
|
line-height: 60px; |
||||
|
font-size: 18px; |
||||
|
height: 60px !important; |
||||
|
} |
||||
|
|
||||
|
.aside { |
||||
|
width: 200px; |
||||
|
background-color: #f0f0f0; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.aside-content { |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
margin-top: 15px; |
||||
|
} |
||||
|
|
||||
|
.aside-item { |
||||
|
padding: 15px; |
||||
|
margin: 5px 0; |
||||
|
background-color: #e0e0e0; |
||||
|
border-radius: 4px; |
||||
|
cursor: pointer; |
||||
|
transition: background-color 0.3s; |
||||
|
text-align: center; |
||||
|
font-size: 14px; |
||||
|
color: #333; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
.aside-item:hover { |
||||
|
background-color: #d0d0d0; |
||||
|
} |
||||
|
|
||||
|
.aside-item.active { |
||||
|
background-color: #409eff; |
||||
|
color: white; |
||||
|
} |
||||
|
|
||||
|
.main { |
||||
|
background-color: #f5f5f5; |
||||
|
padding: 20px; |
||||
|
text-align: center; |
||||
|
line-height: 40px; |
||||
|
} |
||||
|
|
||||
|
html, |
||||
|
body { |
||||
|
height: 100%; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,7 @@ |
|||||
|
<template> |
||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"> |
||||
|
<path |
||||
|
d="M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z" |
||||
|
/> |
||||
|
</svg> |
||||
|
</template> |
@ -0,0 +1,7 @@ |
|||||
|
<template> |
||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" fill="currentColor"> |
||||
|
<path |
||||
|
d="M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z" |
||||
|
/> |
||||
|
</svg> |
||||
|
</template> |
@ -0,0 +1,7 @@ |
|||||
|
<template> |
||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" fill="currentColor"> |
||||
|
<path |
||||
|
d="M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z" |
||||
|
/> |
||||
|
</svg> |
||||
|
</template> |
@ -0,0 +1,7 @@ |
|||||
|
<template> |
||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"> |
||||
|
<path |
||||
|
d="M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z" |
||||
|
/> |
||||
|
</svg> |
||||
|
</template> |
@ -0,0 +1,19 @@ |
|||||
|
<!-- This icon is from <https://github.com/Templarian/MaterialDesign>, distributed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) license--> |
||||
|
<template> |
||||
|
<svg |
||||
|
xmlns="http://www.w3.org/2000/svg" |
||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" |
||||
|
aria-hidden="true" |
||||
|
role="img" |
||||
|
class="iconify iconify--mdi" |
||||
|
width="24" |
||||
|
height="24" |
||||
|
preserveAspectRatio="xMidYMid meet" |
||||
|
viewBox="0 0 24 24" |
||||
|
> |
||||
|
<path |
||||
|
d="M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z" |
||||
|
fill="currentColor" |
||||
|
></path> |
||||
|
</svg> |
||||
|
</template> |
@ -0,0 +1,23 @@ |
|||||
|
import './assets/main.css' |
||||
|
|
||||
|
import { createApp } from 'vue' |
||||
|
import { createPinia } from 'pinia' |
||||
|
|
||||
|
import App from './App.vue' |
||||
|
import router from './router' |
||||
|
|
||||
|
import ElementPlus from 'element-plus' |
||||
|
import 'element-plus/dist/index.css' |
||||
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
||||
|
|
||||
|
const app = createApp(App) |
||||
|
//图标
|
||||
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
||||
|
app.component(key, component) |
||||
|
} |
||||
|
|
||||
|
app.use(createPinia()) |
||||
|
app.use(router) |
||||
|
|
||||
|
app.use(ElementPlus) |
||||
|
app.mount('#app') |
After Width: 467 | Height: 234 | Size: 296 KiB |
After Width: 578 | Height: 311 | Size: 192 KiB |
After Width: 159 | Height: 101 | Size: 38 KiB |
After Width: 200 | Height: 200 | Size: 8.5 KiB |
After Width: 114 | Height: 27 | Size: 2.1 KiB |
After Width: 200 | Height: 200 | Size: 8.0 KiB |
After Width: 455 | Height: 255 | Size: 242 KiB |
After Width: 474 | Height: 258 | Size: 228 KiB |
After Width: 476 | Height: 259 | Size: 312 KiB |
After Width: 487 | Height: 279 | Size: 324 KiB |
After Width: 450 | Height: 217 | Size: 250 KiB |
After Width: 541 | Height: 321 | Size: 319 KiB |
After Width: 509 | Height: 315 | Size: 290 KiB |
After Width: 510 | Height: 320 | Size: 231 KiB |
After Width: 89 | Height: 88 | Size: 18 KiB |
After Width: 150 | Height: 101 | Size: 37 KiB |
After Width: 157 | Height: 99 | Size: 40 KiB |
After Width: 200 | Height: 200 | Size: 7.2 KiB |
After Width: 89 | Height: 88 | Size: 18 KiB |
After Width: 76 | Height: 75 | Size: 11 KiB |
After Width: 159 | Height: 105 | Size: 39 KiB |
After Width: 156 | Height: 99 | Size: 38 KiB |
After Width: 308 | Height: 180 | Size: 18 KiB |
After Width: 200 | Height: 200 | Size: 10 KiB |
After Width: 159 | Height: 101 | Size: 34 KiB |
After Width: 157 | Height: 103 | Size: 43 KiB |
After Width: 152 | Height: 101 | Size: 19 KiB |
After Width: 156 | Height: 93 | Size: 36 KiB |
After Width: 160 | Height: 102 | Size: 43 KiB |
@ -0,0 +1,36 @@ |
|||||
|
import { createRouter, createWebHistory } from 'vue-router' |
||||
|
import ClubView from '@/views/ClubView.vue' |
||||
|
import LiveView from '@/views/LiveView.vue' |
||||
|
import BookView from '@/views/BookView.vue' |
||||
|
import TheFrame from '@/components/TheFrame.vue' |
||||
|
import ChannelView from '../views/ChannelView.vue' |
||||
|
import HomeView from '@/views/HomeView.vue' |
||||
|
|
||||
|
const router = createRouter({ |
||||
|
history: createWebHistory(import.meta.env.BASE_URL), |
||||
|
routes: [ |
||||
|
// {
|
||||
|
// path: '/',
|
||||
|
// name: 'home',
|
||||
|
// component:HomeView
|
||||
|
// },
|
||||
|
{ |
||||
|
path: '/theFrame', |
||||
|
name: 'theFrame', |
||||
|
component: TheFrame, |
||||
|
children:[{ |
||||
|
path: '/clubView',component: ClubView |
||||
|
},{ |
||||
|
path: '/liveView',component: LiveView, |
||||
|
},{ |
||||
|
path: '/bookView',component: BookView, |
||||
|
},{ |
||||
|
path: '/channelView',component: ChannelView |
||||
|
},{ |
||||
|
path: '/',component: HomeView |
||||
|
}] |
||||
|
}, |
||||
|
], |
||||
|
}) |
||||
|
|
||||
|
export default router |
@ -0,0 +1,12 @@ |
|||||
|
import { ref, computed } from 'vue' |
||||
|
import { defineStore } from 'pinia' |
||||
|
|
||||
|
export const useCounterStore = defineStore('counter', () => { |
||||
|
const count = ref(0) |
||||
|
const doubleCount = computed(() => count.value * 2) |
||||
|
function increment() { |
||||
|
count.value++ |
||||
|
} |
||||
|
|
||||
|
return { count, doubleCount, increment } |
||||
|
}) |
@ -0,0 +1,153 @@ |
|||||
|
<template> |
||||
|
<div class="book-list"> |
||||
|
<div v-for="book in books" :key="book.title" class="book-item"> |
||||
|
<img :src="book.cover" :alt="book.title"> |
||||
|
<div class="book-info"> |
||||
|
<h3>{{ book.title }}</h3> |
||||
|
<p>{{ book.description }}</p> |
||||
|
<p>阅读次数:{{ book.reads }}次</p> |
||||
|
</div> |
||||
|
<button @click="handleReadBook(book.title)">立即阅读</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<!-- <script> |
||||
|
import { ref } from 'vue'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'Book', |
||||
|
setup() { |
||||
|
const books = ref([ |
||||
|
{ |
||||
|
title: "发财线秘籍", |
||||
|
description: "发财线经济(阅读时间截止为2024年6月30日)", |
||||
|
reads: 2490, |
||||
|
cover: "./src/assets/发财线.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "解套宝典", |
||||
|
description: "解套宝典(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1057, |
||||
|
cover: "src/assets/解套.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "十年200倍——上册", |
||||
|
description: "十年200倍——上册(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1073, |
||||
|
cover: "src/assets/十年上.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "十年200倍——下册", |
||||
|
description: "十年200倍——下册(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1018, |
||||
|
cover: "src/assets/十年下.png" |
||||
|
} |
||||
|
]); |
||||
|
|
||||
|
const handleReadBook = (title) => { |
||||
|
alert(`您点击了《${title}》`); |
||||
|
}; |
||||
|
|
||||
|
return { |
||||
|
books, |
||||
|
handleReadBook |
||||
|
}; |
||||
|
} |
||||
|
}; |
||||
|
</script> --> |
||||
|
<script setup> |
||||
|
import { ref } from 'vue'; |
||||
|
|
||||
|
const books = ref([ |
||||
|
{ |
||||
|
title: "发财线秘籍", |
||||
|
description: "发财线经济(阅读时间截止为2024年6月30日)", |
||||
|
reads: 2490, |
||||
|
cover: "src/assets/发财线.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "解套宝典", |
||||
|
description: "解套宝典(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1057, |
||||
|
cover: "src/assets/解套.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "十年200倍——上册", |
||||
|
description: "十年200倍——上册(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1073, |
||||
|
cover: "src/assets/十年上.png" |
||||
|
}, |
||||
|
{ |
||||
|
title: "十年200倍——下册", |
||||
|
description: "十年200倍——下册(阅读截止时间为2024年12月31日)", |
||||
|
reads: 1018, |
||||
|
cover: "src/assets/十年下.png" |
||||
|
} |
||||
|
]); |
||||
|
|
||||
|
const handleReadBook = (title) => { |
||||
|
alert(`您点击了《${title}》`); |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
body { |
||||
|
font-family: Arial, sans-serif; |
||||
|
background-color: #f4f4f4; |
||||
|
margin: 0; |
||||
|
padding: 20px; |
||||
|
} |
||||
|
|
||||
|
.book-list { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 20px; |
||||
|
} |
||||
|
|
||||
|
.book-item { |
||||
|
background-color: white; |
||||
|
border: 1px solid #ddd; |
||||
|
border-radius: 5px; |
||||
|
padding: 15px; |
||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.book-item img { |
||||
|
width: 100px; |
||||
|
height: 150px; |
||||
|
margin-right: 20px; |
||||
|
} |
||||
|
|
||||
|
.book-info { |
||||
|
flex-grow: 1; |
||||
|
} |
||||
|
|
||||
|
.book-info h3 { |
||||
|
margin: 0 0 10px 0; |
||||
|
font-size: 18px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.book-info p { |
||||
|
margin: 5px 0; |
||||
|
color: #555; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
button { |
||||
|
background-color: #ff6f61; |
||||
|
color: white; |
||||
|
border: none; |
||||
|
padding: 10px 20px; |
||||
|
border-radius: 5px; |
||||
|
cursor: pointer; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
button:hover { |
||||
|
background-color: #ff5252; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,249 @@ |
|||||
|
<template> |
||||
|
<el-container class="full-height"> |
||||
|
|
||||
|
<el-header class="channel-header"> |
||||
|
<div class="header-left"> |
||||
|
<img :src="channelLogo" class="adaptive-avatar" /> |
||||
|
<div class="channel-info"> |
||||
|
<h1>{{ channelName }}</h1> |
||||
|
<p>{{ subscribers }}已订阅</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<el-button class="subscribe-button" :class="{ disabled: isSubscribed }" @click="toggleSubscribe"> |
||||
|
{{ isSubscribed ? '已订阅' : '订阅' }} |
||||
|
</el-button> |
||||
|
</el-header> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!-- 频道内容容器 --> |
||||
|
<el-main class="channel-content"> |
||||
|
<div v-for="item in contentItems" :key="item.title" class="content-card"> |
||||
|
<div class="content-item"> |
||||
|
<img :src="item.cover" class="content-cover" @click="showLoading(item.link)" /> |
||||
|
<div class="content-details"> |
||||
|
<h2>{{ item.title }}</h2> |
||||
|
<div class="content-meta"> |
||||
|
<img :src="channelLogo" class="adaptive-avatar2" /> |
||||
|
<span class="channel-name">{{ channelName }}</span> |
||||
|
<span class="content-comments">{{ item.comments }}评论</span> |
||||
|
<span class="content-date">{{ item.date }}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-main> |
||||
|
</el-container> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import { ref } from 'vue'; |
||||
|
// import { ElContainer, ElHeader, ElMain, ElButton} from 'element-plus'; |
||||
|
|
||||
|
|
||||
|
const channelLogo = 'src/assets/channel-avatar.png'; |
||||
|
const channelName = ref('量价时空四维预测术'); |
||||
|
const subscribers = ref(5341); |
||||
|
const isSubscribed = ref(false); |
||||
|
const contentItems = ref([ |
||||
|
{ |
||||
|
title: '2/7~7/17 精彩直播课程安排,弘粉同城会全面启程!', |
||||
|
cover: 'src/assets/cover1.png', |
||||
|
link: '#', |
||||
|
comments: 0, |
||||
|
date: '07-01 17:27' |
||||
|
}, |
||||
|
{ |
||||
|
title: '大国博弈下的深度交易策略', |
||||
|
cover: 'src/assets/cover2.png', |
||||
|
link: '#', |
||||
|
comments: 1, |
||||
|
date: '05-28 15:35' |
||||
|
}, |
||||
|
{ |
||||
|
title: '弘历软件云版重磅迎来升级三部曲', |
||||
|
cover: 'src/assets/cover3.png', |
||||
|
link: '#', |
||||
|
comments: 28, |
||||
|
date: '05-28 09:58' |
||||
|
}, |
||||
|
{ |
||||
|
title: '给弘历老师的一封信', |
||||
|
cover: 'src/assets/cover4.png', |
||||
|
link: '#', |
||||
|
comments: 0, |
||||
|
date: '05-26 18:18' |
||||
|
} |
||||
|
]); |
||||
|
|
||||
|
const toggleSubscribe = () => { |
||||
|
isSubscribed.value = !isSubscribed.value; |
||||
|
}; |
||||
|
|
||||
|
const showLoading = () => { |
||||
|
alert('正在跳转到相对应内容...'); |
||||
|
// 这里可以添加跳转逻辑,例如: |
||||
|
// window.location.href = link; |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<style scoped> |
||||
|
.full-height { |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.channel-header { |
||||
|
background: url('src/assets/background.png') no-repeat center center fixed; |
||||
|
background-size: cover; |
||||
|
color: white; |
||||
|
padding: 30px 60px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
position: relative; |
||||
|
min-height: 160px; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.header-left { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 30%; |
||||
|
z-index: 1; |
||||
|
} |
||||
|
|
||||
|
.channel-info { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
height: 100px; |
||||
|
margin-left: 10px; |
||||
|
flex: 1; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
|
||||
|
.channel-info h1 { |
||||
|
white-space: nowrap; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
font-size: 24px; |
||||
|
padding-left: 0%; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.channel-info p { |
||||
|
margin: 5px 0 0 0; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.subscribe-button { |
||||
|
background-color: #666; |
||||
|
color: white; |
||||
|
border: none; |
||||
|
padding: 10px 20px; |
||||
|
border-radius: 5px; |
||||
|
cursor: pointer; |
||||
|
transition: background-color 0.3s; |
||||
|
} |
||||
|
|
||||
|
.subscribe-button.disabled { |
||||
|
background-color: #ccc; |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
|
||||
|
.channel-content { |
||||
|
padding: 20px; |
||||
|
} |
||||
|
|
||||
|
.content-card { |
||||
|
margin-bottom: 15px; |
||||
|
background-color: white; |
||||
|
border-radius: 5px; |
||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
||||
|
padding: 15px; |
||||
|
} |
||||
|
|
||||
|
.content-item { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
height: 120px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.content-cover { |
||||
|
width: 200px; |
||||
|
height: 120px; |
||||
|
margin-right: 20px; |
||||
|
cursor: pointer; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
|
||||
|
.content-details { |
||||
|
flex-grow: 1; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.content-details h2 { |
||||
|
margin: 0 0 10px 0; |
||||
|
font-size: 18px; |
||||
|
color: black; |
||||
|
text-decoration: none; |
||||
|
transition: color 0.3s; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.content-meta { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
margin-top: 10px; |
||||
|
padding-left: 10px; |
||||
|
} |
||||
|
|
||||
|
.channel-name { |
||||
|
margin-right: 10px; |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.content-comments { |
||||
|
margin-right: 10px; |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.adaptive-avatar { |
||||
|
width: 100px; |
||||
|
height: 100%; |
||||
|
display: inline; |
||||
|
} |
||||
|
|
||||
|
.adaptive-avatar2 { |
||||
|
width: 20px; |
||||
|
/* 头像宽度占父容器宽度的20% */ |
||||
|
height: 10%; |
||||
|
/* 头像高度占父容器高度的20% */ |
||||
|
} |
||||
|
|
||||
|
.content-date { |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.content-item:hover h2 { |
||||
|
color: #007BFF; |
||||
|
} |
||||
|
|
||||
|
/* 增加响应式处理 */ |
||||
|
@media (max-width: 768px) { |
||||
|
.channel-header { |
||||
|
padding: 20px; |
||||
|
flex-direction: column; |
||||
|
align-items: flex-start; |
||||
|
} |
||||
|
|
||||
|
.subscribe-button { |
||||
|
margin-top: 15px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,404 @@ |
|||||
|
<template> |
||||
|
<div class="container"> |
||||
|
<!-- 顶部介绍部分 --> |
||||
|
<div class="header"> |
||||
|
<div class="header-top"> |
||||
|
<div class="logo"> |
||||
|
<img src="../pic/logo.jpg" alt="Logo" /> |
||||
|
</div> |
||||
|
<button class="more-button" @click="showMore">查看更多</button> |
||||
|
</div> |
||||
|
<div class="header-content"> |
||||
|
<p> |
||||
|
博股国际投资论坛(Bogul International Investment Forum)立足中国,面向全球。聚集了国际政要、投资大师、经济学家和高端投资人士。该论坛旨在为一小部分高端投资人士提供深度学习,解读国际经济形势,并研判经济发展机遇。博股会员是博股国际投资论坛的终身会员,我们注重知识体系的深度,与大师为伍,强调价值投资,并利用大波段进行盈利。 |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 专题部分 --> |
||||
|
<div class="topic"> |
||||
|
<div class="topic-header"> |
||||
|
<h2 class="topic-title">专题</h2> |
||||
|
<button class="more-button" @click="showMoreTopics">查看更多</button> |
||||
|
</div> |
||||
|
<h3 class="topic-subtitle" style="text-align: left;">前言股市投资分享之左侧交易</h3> |
||||
|
|
||||
|
<!-- 视频列表 --> |
||||
|
<div class="video-list"> |
||||
|
<div class="video-card" v-for="(video, index) in videos" :key="index"> |
||||
|
<div class="video-thumbnail" @click="incrementViews(index)"> |
||||
|
<img :src="video.thumbnail" alt="Video Thumbnail" /> |
||||
|
<div class="play-button"> |
||||
|
<span class="play-icon">▶</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="video-info"> |
||||
|
<div class="video-title"> |
||||
|
<span class="gold-icon">🏆</span> |
||||
|
{{ video.title }} |
||||
|
</div> |
||||
|
<div class="video-meta"> |
||||
|
<span class="author">博股俱乐部</span> |
||||
|
<div class="video-stats"> |
||||
|
<div class="stat-item"> |
||||
|
<img src="../pic/link.jpg" alt="HomilyLink" class="homily-icon" /> |
||||
|
<span class="homily-text">HomilyLink</span> |
||||
|
</div> |
||||
|
<div class="stat-item"> |
||||
|
<span class="date">{{ video.date }}</span> |
||||
|
</div> |
||||
|
<div class="stat-item"> |
||||
|
<img src="../pic/bofang.png" alt="Views" class="views-icon" /> |
||||
|
<span class="views">{{ video.views }}</span> |
||||
|
</div> |
||||
|
<div class="stat-item"> |
||||
|
<img src="../pic/bofang.png" alt="Comments" class="comments-icon" @click.stop="toggleComments(index)" /> |
||||
|
<span class="comments">{{ video.comments }}</span> |
||||
|
</div> |
||||
|
<div class="stat-item"> |
||||
|
<img src="../pic/dianzan.png" alt="Likes" class="likes-icon" @click.stop="toggleLikes(index)" /> |
||||
|
<span class="likes">{{ video.likes }}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 弹出框 --> |
||||
|
<div v-if="showModal" class="modal"> |
||||
|
<div class="modal-content"> |
||||
|
<span class="close-button" @click="closeModal">×</span> |
||||
|
<h3>{{ modalTitle }}</h3> |
||||
|
<p>{{ modalContent }}</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import { ref, onMounted } from 'vue'; |
||||
|
|
||||
|
const videos = ref([ |
||||
|
{ |
||||
|
thumbnail: 'src/pic/1.jpg', |
||||
|
title: '第一节《影形结构同现》', |
||||
|
date: '05-26 11:42', |
||||
|
views: 643, |
||||
|
comments: 5, |
||||
|
likes: 3, |
||||
|
isLiked: false, |
||||
|
isCommented: false |
||||
|
}, |
||||
|
{ |
||||
|
thumbnail: 'src/pic/2.jpg', |
||||
|
title: '第二节《强势结构形态》', |
||||
|
date: '01-11 09:55', |
||||
|
views: 498, |
||||
|
comments: 10, |
||||
|
likes: 12, |
||||
|
isLiked: false, |
||||
|
isCommented: false |
||||
|
}, |
||||
|
]); |
||||
|
|
||||
|
// 弹出框相关 |
||||
|
const showModal = ref(false); |
||||
|
const modalTitle = ref(''); |
||||
|
const modalContent = ref(''); |
||||
|
|
||||
|
// 增加播放量 |
||||
|
const incrementViews = (index) => { |
||||
|
videos.value[index].views += 1; |
||||
|
saveToLocalStorage(); |
||||
|
}; |
||||
|
|
||||
|
// 切换评论状态 |
||||
|
const toggleComments = (index) => { |
||||
|
if (videos.value[index].isCommented) { |
||||
|
videos.value[index].comments -= 1; |
||||
|
videos.value[index].isCommented = false; |
||||
|
} else { |
||||
|
videos.value[index].comments += 1; |
||||
|
videos.value[index].isCommented = true; |
||||
|
} |
||||
|
saveToLocalStorage(); |
||||
|
}; |
||||
|
|
||||
|
// 切换点赞状态 |
||||
|
const toggleLikes = (index) => { |
||||
|
if (videos.value[index].isLiked) { |
||||
|
videos.value[index].likes -= 1; |
||||
|
videos.value[index].isLiked = false; |
||||
|
} else { |
||||
|
videos.value[index].likes += 1; |
||||
|
videos.value[index].isLiked = true; |
||||
|
} |
||||
|
saveToLocalStorage(); |
||||
|
}; |
||||
|
|
||||
|
// 查看更多的动态效果 |
||||
|
const showMore = () => { |
||||
|
modalTitle.value = '查看更多内容'; |
||||
|
modalContent.value = '正在加载更多内容...'; |
||||
|
showModal.value = true; |
||||
|
}; |
||||
|
|
||||
|
// 查看更多专题的动态效果 |
||||
|
const showMoreTopics = () => { |
||||
|
modalTitle.value = '查看更多专题'; |
||||
|
modalContent.value = '正在加载更多专题...'; |
||||
|
showModal.value = true; |
||||
|
}; |
||||
|
|
||||
|
// 关闭弹出框 |
||||
|
const closeModal = () => { |
||||
|
showModal.value = false; |
||||
|
}; |
||||
|
|
||||
|
// 保存到本地存储 |
||||
|
const saveToLocalStorage = () => { |
||||
|
localStorage.setItem('videos', JSON.stringify(videos.value)); |
||||
|
}; |
||||
|
|
||||
|
// 从本地存储加载 |
||||
|
const loadFromLocalStorage = () => { |
||||
|
const savedVideos = localStorage.getItem('videos'); |
||||
|
if (savedVideos) { |
||||
|
videos.value = JSON.parse(savedVideos); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
// 清除本地存储(调试用) |
||||
|
localStorage.removeItem('videos'); |
||||
|
// 初始化加载 |
||||
|
onMounted(() => { |
||||
|
loadFromLocalStorage(); |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
.header-content p { |
||||
|
font-size: 20px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
.container { |
||||
|
max-width: 1600px; |
||||
|
margin: 0 auto; |
||||
|
padding: 20px; |
||||
|
font-family: 'Arial', sans-serif; |
||||
|
} |
||||
|
|
||||
|
/* 顶部介绍部分样式 */ |
||||
|
.header { |
||||
|
background-color: #f9c784; |
||||
|
padding: 20px; |
||||
|
border-radius: 10px; |
||||
|
margin-bottom: 30px; |
||||
|
} |
||||
|
|
||||
|
.header-top { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
margin-bottom: 15px; |
||||
|
} |
||||
|
|
||||
|
.logo { |
||||
|
margin-right: 20px; |
||||
|
} |
||||
|
|
||||
|
.logo img { |
||||
|
width: 80px; |
||||
|
height: 80px; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
|
||||
|
.header-content { |
||||
|
font-size: 14px; |
||||
|
line-height: 1.6; |
||||
|
color: #333; |
||||
|
} |
||||
|
|
||||
|
.more-button { |
||||
|
background-color: rgba(249, 199, 132, 0.7); |
||||
|
border: none; |
||||
|
padding: 8px 15px; |
||||
|
border-radius: 5px; |
||||
|
cursor: pointer; |
||||
|
font-size: 14px; |
||||
|
color: #333; |
||||
|
transition: background-color 0.3s; |
||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); |
||||
|
} |
||||
|
|
||||
|
.more-button:hover { |
||||
|
background-color: rgba(249, 199, 132, 1); |
||||
|
} |
||||
|
|
||||
|
/* 专题部分样式 */ |
||||
|
.topic { |
||||
|
background: linear-gradient(to right, #fff, #fff9e6); |
||||
|
padding: 20px; |
||||
|
border-radius: 10px; |
||||
|
margin-bottom: 30px; |
||||
|
} |
||||
|
|
||||
|
.topic-header { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
margin-bottom: 10px; |
||||
|
} |
||||
|
|
||||
|
.topic-title { |
||||
|
font-size: 24px; |
||||
|
color: #0066cc; |
||||
|
} |
||||
|
|
||||
|
.topic-subtitle { |
||||
|
font-size: 18px; |
||||
|
font-weight: normal; |
||||
|
margin-bottom: 20px; |
||||
|
color: #333; |
||||
|
} |
||||
|
|
||||
|
/* 视频列表样式 */ |
||||
|
.video-list { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 20px; |
||||
|
} |
||||
|
|
||||
|
.video-card { |
||||
|
display: flex; |
||||
|
background-color: white; |
||||
|
border-radius: 5px; |
||||
|
overflow: hidden; |
||||
|
cursor: pointer; |
||||
|
transition: transform 0.3s ease; |
||||
|
width: 100%; |
||||
|
padding: 5px; |
||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.video-card:hover { |
||||
|
transform: translateY(-5px); |
||||
|
} |
||||
|
|
||||
|
.video-thumbnail { |
||||
|
position: relative; |
||||
|
width: 240px; |
||||
|
height: 120px; |
||||
|
} |
||||
|
|
||||
|
.video-thumbnail img { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
|
||||
|
.play-button { |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
transform: translate(-50%, -50%); |
||||
|
background-color: rgba(0, 0, 0, 0.5); |
||||
|
color: white; |
||||
|
width: 50px; |
||||
|
height: 50px; |
||||
|
border-radius: 50%; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
font-size: 20px; |
||||
|
} |
||||
|
|
||||
|
.video-info { |
||||
|
flex: 1; |
||||
|
padding: 15px; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.video-title { |
||||
|
font-size: 18px; |
||||
|
margin-bottom: 10px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.gold-icon { |
||||
|
color: #ffc107; |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
|
||||
|
.video-meta { |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.author { |
||||
|
color: #ff6b6b; |
||||
|
margin-bottom: 5px; |
||||
|
margin-right: 90%; |
||||
|
} |
||||
|
|
||||
|
.video-stats { |
||||
|
display: flex; |
||||
|
gap: 15px; |
||||
|
margin-top: 10px; |
||||
|
font-size: 12px; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.homily-icon, .date-icon, .views-icon, .comments-icon, .likes-icon { |
||||
|
width: 16px; |
||||
|
height: 16px; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.stat-item { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
margin-right: 15px; |
||||
|
} |
||||
|
|
||||
|
.homily-text { |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
|
||||
|
/* 弹出框样式 */ |
||||
|
.modal { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background-color: rgba(0, 0, 0, 0.5); |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
z-index: 1000; |
||||
|
} |
||||
|
|
||||
|
.modal-content { |
||||
|
background-color: white; |
||||
|
padding: 20px; |
||||
|
border-radius: 10px; |
||||
|
max-width: 500px; |
||||
|
width: 80%; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.close-button { |
||||
|
position: absolute; |
||||
|
top: 10px; |
||||
|
right: 10px; |
||||
|
font-size: 24px; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,373 @@ |
|||||
|
<template> |
||||
|
<div class="container"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="17" :xs="24"> |
||||
|
<div class="section-title">推荐</div> |
||||
|
<el-row :gutter="20" class="recommend-videos" style="margin-right: -25px;"> |
||||
|
<el-col :span="24" v-for="video in video" :key="video.id"> |
||||
|
<el-card class="video-card" @click="incrementViews(scope.row.id)"> |
||||
|
<div class="video-content"> |
||||
|
<img :src="video.cover" alt="视频缩略图" class="video-thumbnail" /> |
||||
|
<div class="video-info"> |
||||
|
<div class="video-title1">{{ video.title }}</div> |
||||
|
<div style="text-align: left;"><img src="../pic/bogu.png" v-if="video.clubId == '1'" /><img v-else /></div> |
||||
|
<div class="video-meta1"> |
||||
|
<img class="icon" :src="video.publisherAvatar" /> |
||||
|
<span> {{ video.publisherName }} {{ video.publishTime }}</span> |
||||
|
<div class="video-stats"> |
||||
|
<el-icon> |
||||
|
<View /> |
||||
|
</el-icon> |
||||
|
<el-button type="text">{{ video.videoDuration }}</el-button> |
||||
|
<el-icon> |
||||
|
<ChatDotSquare /> |
||||
|
</el-icon> |
||||
|
<el-button type="text">{{ video.likeCount }}</el-button> |
||||
|
<img src="../pic/like.png" class="like"> |
||||
|
<el-button type="text">{{ video.commentCount }}</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-col> |
||||
|
<el-col :span="7" :xs="24"> |
||||
|
<div class="section-title">精选视频</div> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="24" v-for="video in featuredVideos" :key="video.id"> |
||||
|
<el-card class="video-card"> |
||||
|
<div class="video-content"> |
||||
|
<img :src="video.cover" alt="视频缩略图" class="video-thumbnail" /> |
||||
|
<div class="video-info"> |
||||
|
<div class="video-title2">{{ video.title }}</div> |
||||
|
<div class="video-meta2"> |
||||
|
<div class="video-stats"> |
||||
|
<el-icon class="my-icon"> |
||||
|
<View /> |
||||
|
</el-icon> |
||||
|
<el-button type="text">{{ video.viewCount }}</el-button> |
||||
|
<el-button type="text">{{ video.publishTime }}</el-button> |
||||
|
<!-- <el-button type="text">{{ video.comments }}</el-button> --> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup> |
||||
|
import 'element-plus/dist/index.css'; |
||||
|
import homeApi from '@/api/homeApi'; |
||||
|
import { ref } from 'vue'; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
// 初始化所有的推荐视频 |
||||
|
const video = ref([]); |
||||
|
|
||||
|
// 定义方法,获取推荐视频 |
||||
|
function getAllRecommendedVideos(queryType) { |
||||
|
homeApi.selectHome(queryType) |
||||
|
.then(resp =>{ |
||||
|
if(resp.data){ |
||||
|
video.value = resp.data.list; |
||||
|
console.log(video.value); |
||||
|
}else{ |
||||
|
console.log('获取推荐视频失败'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//精选视频 |
||||
|
const featuredVideos = ref([]); |
||||
|
|
||||
|
// 定义方法,获取精选视频 |
||||
|
function getAllFeaturedVideos(queryType) { |
||||
|
homeApi.selectHome(queryType) |
||||
|
.then(resp =>{ |
||||
|
if(resp.data){ |
||||
|
featuredVideos.value = resp.data.list; |
||||
|
console.log(featuredVideos.value); |
||||
|
}else{ |
||||
|
console.log('获取精选视频失败'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
// 页面加载时调用 |
||||
|
getAllRecommendedVideos(1); |
||||
|
getAllFeaturedVideos(2); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
// const recommendedVideos = ref([ |
||||
|
// { |
||||
|
// id: 1, |
||||
|
// thumbnail: 'src/pic/money.png', |
||||
|
// title: '【机构财富密码破局之道5】MCD六彩神龙之吉龙抬头(普通话)', |
||||
|
// author: '小金', |
||||
|
// time: '23小时前', |
||||
|
// views: 15, |
||||
|
// likes: 0, |
||||
|
// comments: 1, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 2, |
||||
|
// thumbnail: 'src/pic/touzi.png', |
||||
|
// title: '投资的真谛(永远的价值投资)一陆健大师(13.7.24)', |
||||
|
// author: 'STW', |
||||
|
// time: '07-16 17:47', |
||||
|
// views: 5, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 3, |
||||
|
// thumbnail: 'src/pic/qiangshi.png', |
||||
|
// title: '第二节《强势结构形态》', |
||||
|
// author: '博股俱乐部', |
||||
|
// time: '01-24 09:55', |
||||
|
// views: 498, |
||||
|
// likes: 0, |
||||
|
// comments: 12, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 4, |
||||
|
// thumbnail: 'src/pic/jihuigu.png', |
||||
|
// title: '价值投资之机会谷一Josie老师(11.7.24)', |
||||
|
// author: 'STW', |
||||
|
// time: '07-16 17:37', |
||||
|
// views: 6, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 5, |
||||
|
// thumbnail: 'src/pic/A.png', |
||||
|
// title: 'A股释放积极信号!一大批上市公司发布回购、业绩预增等公告', |
||||
|
// author: '宋建军', |
||||
|
// time: '07-16 16:22', |
||||
|
// views: 3, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// ]); |
||||
|
|
||||
|
// 精选视频 |
||||
|
// const featuredVideos = ref([ |
||||
|
// { |
||||
|
// id: 1, |
||||
|
// thumbnail: 'src/pic/wengehua.png', |
||||
|
// title: '温哥华弘粉之约-北美同城会陪你共话投资', |
||||
|
// author: 'CANADA', |
||||
|
// time: '07-08 19:47', |
||||
|
// views: 523, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 2, |
||||
|
// thumbnail: 'src/pic/shengkuang.png', |
||||
|
// title: '盛况!香港弘粉同城会圆满成功!', |
||||
|
// author: '精彩回顾', |
||||
|
// time: '07-08 19:47', |
||||
|
// views: 307, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 3, |
||||
|
// thumbnail: 'src/pic/jinrongzhan.png', |
||||
|
// title: '金融战事再升级-欧盟对中国电动车征税的真相', |
||||
|
// author: '精彩回顾', |
||||
|
// time: '06-27 17:30', |
||||
|
// views: 144, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 4, |
||||
|
// thumbnail: 'src/pic/youxueban.png', |
||||
|
// title: '弘粉游学班:赏美景、品美食、学投资!', |
||||
|
// author: '精彩回顾', |
||||
|
// time: '06-29 19:11', |
||||
|
// views: 658, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// { |
||||
|
// id: 5, |
||||
|
// thumbnail: 'src/pic/meiyuanbaquan.png', |
||||
|
// title: '美元霸权地位动摇!"石油美元"时代...', |
||||
|
// author: '精彩回顾', |
||||
|
// time: '06-18 14:00', |
||||
|
// views: 538, |
||||
|
// likes: 0, |
||||
|
// comments: 0, |
||||
|
// }, |
||||
|
// ]); |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.video-card:hover{ |
||||
|
transform: scale(1.01); |
||||
|
} |
||||
|
|
||||
|
.my-icon{ |
||||
|
right: 3px; |
||||
|
} |
||||
|
.like { |
||||
|
height: 14px; |
||||
|
width: 14px; |
||||
|
transform: translate(10px, 9px); |
||||
|
} |
||||
|
|
||||
|
.el-icon { |
||||
|
vertical-align: middle; |
||||
|
position: relative; |
||||
|
transform: translate(10px, 10px); |
||||
|
} |
||||
|
|
||||
|
span { |
||||
|
display: inline-block; |
||||
|
vertical-align: middle; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.icon { |
||||
|
vertical-align: middle; |
||||
|
height: 16px; |
||||
|
} |
||||
|
|
||||
|
.container { |
||||
|
padding: 20px; |
||||
|
} |
||||
|
|
||||
|
.section-title { |
||||
|
font-size: 28px; |
||||
|
font-weight: bold; |
||||
|
margin-bottom: 10px; |
||||
|
text-align: left; |
||||
|
color: black; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.video-content { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.video-thumbnail { |
||||
|
width: 150px; |
||||
|
height: 100px; |
||||
|
border-radius: 4px; |
||||
|
margin-right: 20px; |
||||
|
} |
||||
|
|
||||
|
.video-info { |
||||
|
flex: 1; |
||||
|
height: 100px; |
||||
|
/* padding-top: 30px; */ |
||||
|
} |
||||
|
|
||||
|
.video-title1 { |
||||
|
font-size: 20px; |
||||
|
font-weight: bold; |
||||
|
margin-bottom: 10px; |
||||
|
text-align: left; |
||||
|
line-height: normal; |
||||
|
} |
||||
|
|
||||
|
.video-title2 { |
||||
|
font-size: 18px; |
||||
|
font-weight: 540; |
||||
|
margin-bottom: 10px; |
||||
|
text-align: left; |
||||
|
line-height: normal; |
||||
|
} |
||||
|
|
||||
|
.video-meta1 { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
/* padding-top: 20px; */ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.video-meta2 { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
font-size: 14px; |
||||
|
color: #666; |
||||
|
padding-top: 40px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.video-stats { |
||||
|
display: flex; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.video-stats .el-button { |
||||
|
margin-left: 10px; |
||||
|
} |
||||
|
|
||||
|
/* 响应式样式调整 */ |
||||
|
@media (max-width: 768px) { |
||||
|
.el-col { |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.video-thumbnail { |
||||
|
width: 100px; |
||||
|
height: 67px; |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
|
||||
|
.video-title { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.video-meta { |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
|
||||
|
.video-stats .el-button { |
||||
|
margin-left: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@media (max-width: 480px) { |
||||
|
.video-thumbnail { |
||||
|
width: 80px; |
||||
|
height: 53px; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.video-title { |
||||
|
font-size: 14px; |
||||
|
} |
||||
|
|
||||
|
.video-meta { |
||||
|
font-size: 10px; |
||||
|
} |
||||
|
|
||||
|
.video-stats .el-button { |
||||
|
margin-left: 3px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,289 @@ |
|||||
|
<template> |
||||
|
<div class="container"> |
||||
|
<div class="course-grid"> |
||||
|
<div v-for="course in courses" :key="course.id" class="course-card"> |
||||
|
<div class="course-image"> |
||||
|
<img :src="course.image" alt="课程图片"> |
||||
|
<div class="live-badge">即将开播</div> |
||||
|
<div class="live-time">{{ course.time }}</div> |
||||
|
</div> |
||||
|
<div class="course-info"> |
||||
|
<div class="course-title">{{ course.title }}</div> |
||||
|
<div class="course-footer"> |
||||
|
<div class="course-tag"> |
||||
|
<img :src="course.avatar" alt="讲师头像"> |
||||
|
<!-- <img src="../pic/images/1.png" alt="讲师头像"> --> |
||||
|
{{ course.teacher }} |
||||
|
</div> |
||||
|
<button class="book-btn" :class="{ active: course.booked }" @click="toggleBook(course.id)">预约</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { ref } from 'vue'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'LiveCourses', |
||||
|
setup() { |
||||
|
const courses = ref([ |
||||
|
{ |
||||
|
id: 1, |
||||
|
title: '猎庄之顶级波段我公司不...', |
||||
|
teacher: '猎庄之顶级波段', |
||||
|
time: '明天09:55开播', |
||||
|
image: 'src/pic/images/1.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 2, |
||||
|
title: '如何提前把握大盘和个股...', |
||||
|
teacher: '多空识庄短线寻...', |
||||
|
time: '明天10:00开播', |
||||
|
image: 'src/pic/images/2.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 3, |
||||
|
title: '【粤语】AI铁皮训练-Tom...', |
||||
|
teacher: '【粤语】AI铁皮...', |
||||
|
time: '明天11:30开播', |
||||
|
image: 'src/pic/images/3.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 4, |
||||
|
title: '构建有效的价值投资体系...', |
||||
|
teacher: '构建有效的价值...', |
||||
|
time: '明天20:30开播', |
||||
|
image: 'src/pic/images/4.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 5, |
||||
|
title: '猎庄之顶级波段我公司不...', |
||||
|
teacher: '猎庄之顶级波段', |
||||
|
time: '明天09:55开播', |
||||
|
image: 'src/pic/images/5.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 6, |
||||
|
title: '如何提前把握大盘和个股...', |
||||
|
teacher: '多空识庄短线寻...', |
||||
|
time: '明天10:00开播', |
||||
|
image: 'src/pic/images/6.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 7, |
||||
|
title: '【粤语】AI铁皮训练-Tom...', |
||||
|
teacher: '【粤语】AI铁皮...', |
||||
|
time: '明天11:30开播', |
||||
|
image: 'src/pic/images/7.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
}, |
||||
|
{ |
||||
|
id: 8, |
||||
|
title: '构建有效的价值投资体系...', |
||||
|
teacher: '构建有效的价值...', |
||||
|
time: '明天20:30开播', |
||||
|
image: 'src/pic/images/8.png', |
||||
|
avatar: 'src/pic/images/link.jpg', |
||||
|
booked: false |
||||
|
} |
||||
|
]); |
||||
|
|
||||
|
const toggleBook = async (id) => { |
||||
|
const courseIndex = courses.value.findIndex(course => course.id === id); |
||||
|
if (courseIndex !== -1) { |
||||
|
const course = courses.value[courseIndex]; |
||||
|
try { |
||||
|
if (!course.booked) { |
||||
|
// 预约课程 - POST 请求 |
||||
|
const response = await fetch(`https://your-backend-api.com/bookings/${id}`, { |
||||
|
method: 'POST', |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json', |
||||
|
}, |
||||
|
body: JSON.stringify({ |
||||
|
courseId: id |
||||
|
}) |
||||
|
}); |
||||
|
|
||||
|
if (!response.ok) { |
||||
|
throw new Error('预约失败'); |
||||
|
} |
||||
|
|
||||
|
// 更新本地状态 |
||||
|
course.booked = true; |
||||
|
alert(`您已成功预约课程:${course.title}`); |
||||
|
} else { |
||||
|
// 取消预约 - DELETE 请求 |
||||
|
const response = await fetch(`https://your-backend-api.com/bookings/${id}`, { |
||||
|
method: 'DELETE', |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json', |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
if (!response.ok) { |
||||
|
throw new Error('取消预约失败'); |
||||
|
} |
||||
|
|
||||
|
// 更新本地状态 |
||||
|
course.booked = false; |
||||
|
alert(`您已取消预约课程:${course.title}`); |
||||
|
} |
||||
|
} catch (error) { |
||||
|
console.error('预约请求失败:', error); |
||||
|
alert('预约请求失败,请稍后再试'); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
return { |
||||
|
courses, |
||||
|
toggleBook |
||||
|
}; |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.container { |
||||
|
max-width: 1200px; |
||||
|
margin: 0 auto; |
||||
|
padding: 20px; |
||||
|
} |
||||
|
|
||||
|
.course-grid { |
||||
|
display: grid; |
||||
|
grid-template-columns: repeat(4, 1fr); |
||||
|
gap: 15px; |
||||
|
} |
||||
|
|
||||
|
.course-card { |
||||
|
background-color: #fff; |
||||
|
border-radius: 8px; |
||||
|
overflow: hidden; |
||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
||||
|
transition: transform 0.3s, box-shadow 0.3s; |
||||
|
min-width: 250px; |
||||
|
height: 230px; |
||||
|
} |
||||
|
|
||||
|
.course-card:hover { |
||||
|
transform: translateY(-5px); |
||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); |
||||
|
} |
||||
|
|
||||
|
.course-image { |
||||
|
position: relative; |
||||
|
height: 150px; |
||||
|
background-color: #333; |
||||
|
overflow: hidden; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
|
||||
|
.course-image img { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
|
||||
|
.live-badge { |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
transform: translate(-50%, -50%); |
||||
|
background-color: rgba(0, 0, 0, 0.6); |
||||
|
color: #fff; |
||||
|
padding: 8px 16px; |
||||
|
border-radius: 4px; |
||||
|
font-size: 16px; |
||||
|
font-weight: bold; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
|
||||
|
.live-time { |
||||
|
position: absolute; |
||||
|
top: calc(50% + 30px); |
||||
|
left: 50%; |
||||
|
transform: translateX(-50%); |
||||
|
background-color: rgba(0, 0, 0, 0.6); |
||||
|
color: #fff; |
||||
|
padding: 3px 8px; |
||||
|
border-radius: 4px; |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
|
||||
|
.course-info { |
||||
|
padding: 5px; /* 减少内边距 */ |
||||
|
} |
||||
|
|
||||
|
.course-title { |
||||
|
font-size: 14px; |
||||
|
font-weight: bold; |
||||
|
margin-bottom: 5px; /* 减少底部边距 */ |
||||
|
white-space: nowrap; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
height: 28px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
.course-footer { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
margin-top: 5px; /* 减少顶部边距 */ |
||||
|
} |
||||
|
|
||||
|
.course-tag { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
font-size: 12px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.course-tag img { |
||||
|
width: 16px; |
||||
|
height: 16px; |
||||
|
border-radius: 50%; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.book-btn { |
||||
|
background-color: #ff6b00; |
||||
|
color: white; |
||||
|
border: none; |
||||
|
border-radius: 20px; |
||||
|
padding: 4px 15px; |
||||
|
font-size: 12px; |
||||
|
cursor: pointer; |
||||
|
transition: background-color 0.3s, transform 0.2s; /* 添加动态效果 */ |
||||
|
} |
||||
|
|
||||
|
.book-btn:hover { |
||||
|
background-color: #ff8c33; |
||||
|
transform: scale(1.05); /* 悬停时放大按钮 */ |
||||
|
} |
||||
|
|
||||
|
.book-btn.active { |
||||
|
background-color: #ff8c33; |
||||
|
transform: scale(1.05); /* 预约成功后保持放大效果 */ |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,18 @@ |
|||||
|
import { fileURLToPath, URL } from 'node:url' |
||||
|
|
||||
|
import { defineConfig } from 'vite' |
||||
|
import vue from '@vitejs/plugin-vue' |
||||
|
import vueDevTools from 'vite-plugin-vue-devtools' |
||||
|
|
||||
|
// https://vite.dev/config/
|
||||
|
export default defineConfig({ |
||||
|
plugins: [ |
||||
|
vue(), |
||||
|
vueDevTools(), |
||||
|
], |
||||
|
resolve: { |
||||
|
alias: { |
||||
|
'@': fileURLToPath(new URL('./src', import.meta.url)) |
||||
|
}, |
||||
|
}, |
||||
|
}) |