diff --git a/demo_module/public/images/v1.mp4 b/demo_module/public/images/v1.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..f92526c0c6fc4a5e1a09b3351c3188c95df365c0 Binary files /dev/null and b/demo_module/public/images/v1.mp4 differ diff --git a/demo_module/src/Login/Ren.jsx b/demo_module/src/Login/Ren.jsx index a5594ebb6a4cfc63fa194a8dbb0040cdc951cf32..99d8e1b1931e7d54c5a3b43fb9eb17655e12efa7 100644 --- a/demo_module/src/Login/Ren.jsx +++ b/demo_module/src/Login/Ren.jsx @@ -27,8 +27,8 @@ export default function Ren() { let data = await axios.post('http://localhost:3000/faceLogin', { b64: img }) if (data.data.code === 200) { Toast('登录成功') - localStorage.setItem('accessToken',data.data.accessToken) - localStorage.setItem('refreshToken',data.data.refreshToken) + localStorage.setItem('accessToken', data.data.accessToken) + localStorage.setItem('refreshToken', data.data.refreshToken) navigate('/homepage') } else { Toast(data.data.msg) @@ -37,7 +37,7 @@ export default function Ren() { // 导航头回退 let headgo = () => { - navigate('/yzm') + navigate('/mm') } return (
@@ -53,7 +53,7 @@ export default function Ren() {
-
diff --git a/demo_module/src/router/index.jsx b/demo_module/src/router/index.jsx index 20f20cababc08b3f6aeb48c8ab061bce523a5867..144f2e900b86eec7ded1642cd8c8c2cf17795d91 100644 --- a/demo_module/src/router/index.jsx +++ b/demo_module/src/router/index.jsx @@ -10,7 +10,7 @@ const Ren = lazy(() => import("../Login/Ren")) const Wang = lazy(() => import("../Login/Wang")) const Yzm = lazy(() => import("../Login/Yzm")) const Zc = lazy(() => import("../Login/Zc")) -const Zf = lazy(() => import("../zf/Zhifudingdan")) + //唐帅磊和康峰容负责的 项目首页 @@ -94,6 +94,7 @@ const MyInterview = lazy(() => import("../view/Mine/MyInterview")) const MyMedal = lazy(() => import("../view/Mine/MyMedal")) //我的等级 const Mylev = lazy(() => import("../view/Mine/Mylev")) +const MyVideo = lazy(() => import("../view/Mine/MyVideo")) // 路由设置 @@ -108,7 +109,7 @@ const routes = [ { path: '/wang', element: }, { path: '/yzm', element: }, { path: '/zc', element: }, - { path: '/zf', element: }, + // 唐帅磊和康峰容负责的 首页路由 @@ -207,6 +208,7 @@ const routes = [ { path: '/mine/mymedal', element: < MyMedal /> }, //我的等级 { path: '/mine/mylev', element: < Mylev /> }, + { path: '/mine/myvideo', element: < MyVideo /> }, ] diff --git a/demo_module/src/view/Mine/MyCourse.jsx b/demo_module/src/view/Mine/MyCourse.jsx index 325deb9b385f7657629c14e8fbce8e87639fa04e..7d5776d6c99cc50644affc75f76a4d81df54c7ec 100644 --- a/demo_module/src/view/Mine/MyCourse.jsx +++ b/demo_module/src/view/Mine/MyCourse.jsx @@ -1,30 +1,43 @@ -import React, { Component } from 'react' -import { Link } from 'react-router-dom' -import { LeftOutline,RightOutline } from 'antd-mobile-icons' -import './List.css' +import React, { Component } from 'react'; +import { Link } from 'react-router-dom'; +import { LeftOutline } from 'antd-mobile-icons'; +import './List.css'; export default class MyCourse extends Component { + constructor(props) { + super(props); + this.state = { + currentVideo: '/images/v1.mp4', // 当前播放的视频 + }; + this.videoRefs = []; // 储存视频标签的引用 + } + + handlePlayVideo(video) { + this.setState({ currentVideo: video }); + } + render() { + + return ( -
- - 我的课程 -

-
-
-
-
- -
- +
+ + 我的课程 +

+
+
+
+
+ +
{/* 这里是课程列表 */} -
+
2020年【各省公务员】笔试全程班合集

- - + +
    @@ -32,32 +45,32 @@ export default class MyCourse extends Component {
  • 苏晴雨
- +
  • 陆泽飞
- +
  • 刘俊堂
- +
-
-

- -
+
+

+ +
2021年【河北省公务员】笔试全程班合集

- - + +
    @@ -65,14 +78,14 @@ export default class MyCourse extends Component {
  • 苏晴雨
- +
  • 陆泽飞
- +
  • @@ -82,15 +95,15 @@ export default class MyCourse extends Component {
-
-

- -
+
+

+ +
2022年【山东省公务员】笔试全程班合集

- - + +
    @@ -98,14 +111,14 @@ export default class MyCourse extends Component {
  • 苏晴雨
- +
  • 陆泽飞
- +
  • @@ -115,15 +128,15 @@ export default class MyCourse extends Component {
-
-

- -
+
+

+ +
2023年【河南省公务员】笔试全程班合集

- - + +
    @@ -131,14 +144,14 @@ export default class MyCourse extends Component {
  • 苏晴雨
- +
  • 陆泽飞
- +
  • @@ -148,11 +161,11 @@ export default class MyCourse extends Component {
-
-
-
- - ) +
+ + +
+ + ); } } - diff --git a/demo_module/src/view/Mine/MyVideo.jsx b/demo_module/src/view/Mine/MyVideo.jsx new file mode 100644 index 0000000000000000000000000000000000000000..0e503328a4f046300612f8dd4409143fd4cfbe2d --- /dev/null +++ b/demo_module/src/view/Mine/MyVideo.jsx @@ -0,0 +1,86 @@ +import React, { Component } from 'react'; +import { Link } from 'react-router-dom'; +import { LeftOutline } from 'antd-mobile-icons'; +import './List.css'; + +export default class MyVideo extends Component { + constructor(props) { + super(props); + this.state = { + currentVideo: '/images/v1.mp4', // 当前播放的视频 + comments: [ // 初始评论列表 + '这节课真好,收益良多!', + '老师讲解得非常清晰!', + '期待下一节课!', + '视频内容很丰富,感谢分享!', + ], + newComment: '', // 输入的新评论 + }; + } + + handlePlayVideo(video) { + this.setState({ currentVideo: video }); + } + + handleCommentChange = (event) => { + this.setState({ newComment: event.target.value }); + } + + handleAddComment = () => { + const { newComment, comments } = this.state; + if (newComment.trim()) { + this.setState({ + comments: [...comments, newComment], + newComment: '', // 清空输入框 + }); + } + } + + render() { + const { currentVideo, comments, newComment } = this.state; + + return ( + +
+ + 2020年【各省公务员】笔试全程班合集 +

+
+

+ + {/* 播放视频的部分 */} + {currentVideo && ( +
+ +
+ )} + + {/* 评论部分 */} +

+

观众评论


+
+ + +
+

    + {comments.map((comment, index) => ( + +
  • {comment}

  • +

    +
    + ))} +
+
+
+ ) + } +} diff --git a/demo_module/src/view/Mine/Settings.jsx b/demo_module/src/view/Mine/Settings.jsx index df89fc5940a785ead814fb19143dc959072d00b5..6240b4202f825ea06e1c79d8d91055f4306a7b7c 100644 --- a/demo_module/src/view/Mine/Settings.jsx +++ b/demo_module/src/view/Mine/Settings.jsx @@ -1,58 +1,65 @@ import React from 'react' -import { Link } from'react-router-dom' -import { LeftOutline,RightOutline } from 'antd-mobile-icons' +import { Link } from 'react-router-dom' +import { LeftOutline, RightOutline } from 'antd-mobile-icons' import "./List.css" import { Modal, Input, Form, Button } from 'antd'; - +import { useNavigate } from 'react-router-dom' export default function Settings() { + const navigate = useNavigate() + return ( - -
- - 设置 -

-
-
- 登录密码 - 已设置 -
-
- -
- 设置声音 - -
-
- -
- 版本信息 - V2.21 -
-
- -
- 用户协议 - -
-
- -
- 隐私协议 - -
-
- -
- 彻底注销账号 - -
-
+ +
+ + 设置 +

+
+
{ + navigate('/wang') + }} > + 登录密码 + 已设置 +
+
+ +
+ 设置声音 + +
+
+ +
+ 版本信息 + V2.21 +
+
+ +
+ 用户协议 + +
+
+ +
+ 隐私协议 + +
+
+ +
{ + navigate('/mm') + }}> + 彻底注销账号 +
+
+
- -
+ + ) } diff --git a/demo_server/db/index.js b/demo_server/db/index.js index 621a9bdb068b591e00eecb9ee2aa0f963ce84785..7125de119696b69d74bcfca786de6a4ac5d8176b 100644 --- a/demo_server/db/index.js +++ b/demo_server/db/index.js @@ -3,7 +3,7 @@ const mongoose = require('mongoose'); mongoose.connect('mongodb+srv://3079975645:YANG123123@zhangfu-database.5i5er.mongodb.net/XIANGMU-BASE').then(res => { console.log('OK'); }).catch(err => { - console.log('NO'); + console.log('NO! 网络未连接'); }) module.exports = mongoose; \ No newline at end of file