Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-psp-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-psp-show-h5
Commits
6731bd7b
提交
6731bd7b
authored
4月 19, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
b92bfc67
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
166 行增加
和
101 行删除
+166
-101
CourseItem.vue
src/components/CourseItem.vue
+0
-47
VideoItem.vue
src/components/VideoItem.vue
+0
-40
main.ts
src/main.ts
+0
-4
index.ts
src/modules/doc/index.ts
+10
-0
Index.vue
src/modules/doc/views/Index.vue
+4
-0
AdmissionGuide.vue
src/modules/home/components/AdmissionGuide.vue
+7
-2
LearningMap.vue
src/modules/home/components/LearningMap.vue
+11
-4
LearningMapCourse.vue
src/modules/home/components/LearningMapCourse.vue
+1
-1
LearningMapVideo.vue
src/modules/home/components/LearningMapVideo.vue
+1
-1
api.ts
src/modules/my/api.ts
+5
-0
index.ts
src/modules/my/index.ts
+4
-1
Course.vue
src/modules/my/views/Course.vue
+121
-0
Index.vue
src/modules/my/views/Index.vue
+1
-1
index.ts
src/router/index.ts
+1
-0
没有找到文件。
src/components/CourseItem.vue
deleted
100644 → 0
浏览文件 @
b92bfc67
<
script
setup
lang=
"ts"
>
import
type
{
ICourseItem
}
from
'@/types'
defineProps
<
{
data
:
ICourseItem
}
>
()
</
script
>
<
template
>
<div
class=
"course-item"
>
<img
:src=
"data.course_picture"
class=
"course-item-pic"
/>
<div
class=
"course-item-content"
>
<h5>
{{
data
.
course_name
}}
</h5>
<div>
<span>
{{
data
.
course_chapters
.
big_total
}}
章节
</span>
<span>
{{
data
.
course_chapters
.
small_total
}}
课时
</span>
</div>
<div>
<span>
{{
data
.
pv
}}
人看过
</span>
<span>
{{
data
.
records_total
}}
人评论
</span>
</div>
<p>
{{
data
.
status
}}
</p>
</div>
</div>
</
template
>
<
style
lang=
"scss"
>
.course-item
{
display
:
flex
;
padding
:
0
.22rem
;
background
:
#fff
;
border-radius
:
0
.2rem
;
}
.course-item-pic
{
width
:
1
.6rem
;
height
:
1
.9rem
;
border-radius
:
0
.1rem
;
overflow
:
hidden
;
object-fit
:
cover
;
}
.course-item-content
{
margin-left
:
0
.26rem
;
font-size
:
0
.24rem
;
line-height
:
0
.33rem
;
font-weight
:
500
;
color
:
#4e4e4e
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
</
style
>
src/components/VideoItem.vue
deleted
100644 → 0
浏览文件 @
b92bfc67
<
script
setup
lang=
"ts"
>
import
type
{
IVideoItem
}
from
'@/types'
defineProps
<
{
data
:
IVideoItem
}
>
()
</
script
>
<
template
>
<div
class=
"video-item"
>
<img
:src=
"data.cover_page"
/>
<h5>
{{
data
.
course_name
}}
</h5>
<p>
{{
data
.
pv
}}
播放
</p>
</div>
</
template
>
<
style
lang=
"scss"
>
.video-item
{
img
{
width
:
2rem
;
height
:
1
.9rem
;
border-radius
:
0
.1rem
;
overflow
:
hidden
;
object-fit
:
cover
;
}
h5
{
margin-top
:
0
.09rem
;
font-size
:
0
.24rem
;
font-weight
:
500
;
line-height
:
0
.33rem
;
color
:
#4e4e4e
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
p
{
margin-top
:
0
.04rem
;
font-size
:
0
.1rem
;
line-height
:
0
.28rem
;
color
:
#999999
;
}
}
</
style
>
src/main.ts
浏览文件 @
6731bd7b
...
@@ -10,7 +10,6 @@ import AppContainer from '@/components/base/AppContainer.vue'
...
@@ -10,7 +10,6 @@ import AppContainer from '@/components/base/AppContainer.vue'
import
Avatar
from
'@/components/Avatar.vue'
import
Avatar
from
'@/components/Avatar.vue'
import
modules
from
'./modules'
import
modules
from
'./modules'
import
{
useUserStore
}
from
'@/stores/user'
const
app
=
createApp
(
App
)
const
app
=
createApp
(
App
)
// 注册公共组件
// 注册公共组件
...
@@ -23,6 +22,3 @@ app.use(router)
...
@@ -23,6 +22,3 @@ app.use(router)
app
.
use
(
Vant
)
app
.
use
(
Vant
)
app
.
mount
(
'#app'
)
app
.
mount
(
'#app'
)
// 初始化用户信息,判断是否登录
useUserStore
().
getUser
()
src/modules/doc/index.ts
0 → 100644
浏览文件 @
6731bd7b
import
type
{
RouteRecordRaw
}
from
'vue-router'
import
AppLayout
from
'@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
path
:
'/message'
,
component
:
AppLayout
,
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
}
]
src/modules/doc/views/Index.vue
0 → 100644
浏览文件 @
6731bd7b
<
script
setup
lang=
"ts"
></
script
>
<
template
>
<div
class=
"home"
></div>
</
template
>
src/modules/home/components/AdmissionGuide.vue
浏览文件 @
6731bd7b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
Notify
}
from
'vant'
import
type
{
IDocItem
,
IVideoItem
}
from
'../types'
import
type
{
IDocItem
,
IVideoItem
}
from
'../types'
defineProps
<
{
docs
:
IDocItem
[];
videos
:
IVideoItem
[]
}
>
()
defineProps
<
{
docs
:
IDocItem
[];
videos
:
IVideoItem
[]
}
>
()
function
showTips
()
{
Notify
({
type
:
'primary'
,
message
:
'尚未开放'
})
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -22,12 +27,12 @@ defineProps<{ docs: IDocItem[]; videos: IVideoItem[] }>()
...
@@ -22,12 +27,12 @@ defineProps<{ docs: IDocItem[]; videos: IVideoItem[] }>()
<div
class=
"box box-test"
>
<div
class=
"box box-test"
>
<h2>
入学评测
</h2>
<h2>
入学评测
</h2>
<p
class=
"t1"
>
系统专业知识
</p>
<p
class=
"t1"
>
系统专业知识
</p>
<p
class=
"t2"
><a
href=
"https://www.ezijing.com"
target=
"_blank
"
>
去看看 >
</a></p>
<p
class=
"t2"
><a
@
click=
"showTips
"
>
去看看 >
</a></p>
</div>
</div>
<div
class=
"box box-notice"
>
<div
class=
"box box-notice"
>
<h2>
入学通知书
</h2>
<h2>
入学通知书
</h2>
<p
class=
"t1"
>
报名之后即可查询
</p>
<p
class=
"t1"
>
报名之后即可查询
</p>
<p
class=
"t2"
><a
href=
"https://www.ezijing.com"
target=
"_blank
"
>
去看看 >
</a></p>
<p
class=
"t2"
><a
@
click=
"showTips
"
>
去看看 >
</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/modules/home/components/LearningMap.vue
浏览文件 @
6731bd7b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
ref
}
from
'vue'
import
{
Notify
}
from
'vant'
import
type
{
IDocItem
}
from
'../types'
import
type
{
IDocItem
}
from
'../types'
import
LearningMapVideo
from
'./LearningMapVideo.vue'
import
LearningMapVideo
from
'./LearningMapVideo.vue'
import
LearningMapCourse
from
'./LearningMapCourse.vue'
import
LearningMapCourse
from
'./LearningMapCourse.vue'
defineProps
<
{
docs
:
IDocItem
[]
}
>
()
defineProps
<
{
docs
:
IDocItem
[]
}
>
()
const
active
=
ref
<
number
>
(
0
)
const
active
=
ref
<
number
>
(
0
)
</
script
>
function
showTips
()
{
Notify
({
type
:
'primary'
,
message
:
'尚未开放'
})
}
</
script
>
<
template
>
<
template
>
<AppCard
title=
"学习地图"
id=
"learning"
>
<AppCard
title=
"学习地图"
id=
"learning"
>
...
@@ -36,7 +41,7 @@ const active = ref<number>(0)
...
@@ -36,7 +41,7 @@ const active = ref<number>(0)
<div
class=
"learn-box learn-test"
>
<div
class=
"learn-box learn-test"
>
<h2>
查漏补缺 建立系统概念
</h2>
<h2>
查漏补缺 建立系统概念
</h2>
<p>
了解PRP学习前系统专业知识的情况
</p>
<p>
了解PRP学习前系统专业知识的情况
</p>
<a
class=
"button"
>
去测评
</a>
<a
class=
"button"
@
click=
"showTips"
>
去测评
</a>
</div>
</div>
</van-tab>
</van-tab>
<van-tab
title=
"课程导学"
>
<van-tab
title=
"课程导学"
>
...
@@ -51,12 +56,14 @@ const active = ref<number>(0)
...
@@ -51,12 +56,14 @@ const active = ref<number>(0)
</van-tab>
</van-tab>
</van-tabs>
</van-tabs>
<div
class=
"learn-banner"
>
<div
class=
"learn-banner"
>
<img
src=
"https://webapp-pub.ezijing.com/project/prp-h5/learning_map_banner.png"
/>
<router-link
to=
"/my/course"
>
<img
src=
"https://webapp-pub.ezijing.com/project/prp-h5/learning_map_banner.png"
/>
</router-link>
</div>
</div>
</AppCard>
</AppCard>
</template>
</template>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.learn-box
{
.learn-box
{
height
:
3
.1rem
;
height
:
3
.1rem
;
padding
:
0
.3rem
;
padding
:
0
.3rem
;
...
...
src/modules/home/components/LearningMapCourse.vue
浏览文件 @
6731bd7b
...
@@ -51,7 +51,7 @@ onMounted(() => {
...
@@ -51,7 +51,7 @@ onMounted(() => {
</swiper>
</swiper>
</
template
>
</
template
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.course-item
{
.course-item
{
width
:
4
.7rem
;
width
:
4
.7rem
;
padding
:
0
.22rem
;
padding
:
0
.22rem
;
...
...
src/modules/home/components/LearningMapVideo.vue
浏览文件 @
6731bd7b
...
@@ -53,7 +53,7 @@ const onClick = (data: IVideoItem) => {
...
@@ -53,7 +53,7 @@ const onClick = (data: IVideoItem) => {
</van-popup>
</van-popup>
</
template
>
</
template
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.video-item
{
.video-item
{
width
:
2rem
;
width
:
2rem
;
img
{
img
{
...
...
src/modules/my/api.ts
浏览文件 @
6731bd7b
...
@@ -4,3 +4,8 @@ import httpRequest from '@/utils/axios'
...
@@ -4,3 +4,8 @@ import httpRequest from '@/utils/axios'
export
function
getMyInfo
()
{
export
function
getMyInfo
()
{
return
httpRequest
.
get
(
'/api/psp/v1/my/info'
)
return
httpRequest
.
get
(
'/api/psp/v1/my/info'
)
}
}
// 获取课程列表
export
function
getCourseList
(
params
?:
{
page_size
?:
number
;
page
?:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/course-list'
,
{
params
})
}
src/modules/my/index.ts
浏览文件 @
6731bd7b
...
@@ -6,6 +6,9 @@ export const routes: Array<RouteRecordRaw> = [
...
@@ -6,6 +6,9 @@ export const routes: Array<RouteRecordRaw> = [
path
:
'/my'
,
path
:
'/my'
,
component
:
AppLayout
,
component
:
AppLayout
,
meta
:
{
requireLogin
:
true
},
meta
:
{
requireLogin
:
true
},
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
{
path
:
'course'
,
component
:
()
=>
import
(
'./views/Course.vue'
)
}
]
}
}
]
]
src/modules/my/views/Course.vue
0 → 100644
浏览文件 @
6731bd7b
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
}
from
'vue'
import
type
{
ICourseItem
}
from
'@/types'
import
{
getCourseList
}
from
'../api'
// 学习进度
const
dataset
=
ref
<
{
total
:
number
;
list
:
ICourseItem
[]
}
>
({
total
:
0
,
list
:
[]
})
const
fetchCourseList
=
()
=>
{
getCourseList
({
page_size
:
100
}).
then
(
res
=>
{
dataset
.
value
=
res
.
data
})
}
const
studyStatus
=
(
progress
:
number
)
=>
{
if
(
progress
===
100
)
{
return
'已完成'
}
else
if
(
progress
>
0
)
{
return
'已学习'
}
else
{
return
'未学习'
}
}
onMounted
(()
=>
{
fetchCourseList
()
})
</
script
>
<
template
>
<img
src=
"https://webapp-pub.ezijing.com/project/prp-h5/banner_my_course.png"
style=
"width: 100%"
/>
<p
class=
"tips"
>
如果你也是知识获得者,点击课程,晒出你的海报、说出你的感想,得到你的星星。
</p>
<div
v-for=
"(item, index) in dataset.list"
:key=
"index"
class=
"course-item"
>
<router-link
:to=
"
{ path: `/course/view/${item.id}` }" class="course-item-inner">
<img
:src=
"item.course_picture"
class=
"course-item-pic"
/>
<div
class=
"course-item-content"
>
<h5>
{{
item
.
course_name
}}
</h5>
<p
class=
"t1"
>
<span
v-for=
"(lecturer, index) in item.course_lectures"
:key=
"index"
>
{{
lecturer
.
lecturer_name
}}
</span>
</p>
<p
class=
"t2"
>
<span>
{{
item
.
course_chapters
.
big_total
}}
章节
</span>
<span>
{{
item
.
course_chapters
.
small_total
}}
课时
</span>
</p>
<p
class=
"t2"
>
<span>
{{
item
.
pv
}}
人看过
</span>
<span>
{{
item
.
records_total
}}
人评论
</span>
</p>
<p
class=
"t3"
>
{{
studyStatus
(
item
.
progress
)
}}
</p>
</div>
</router-link>
</div>
</
template
>
<
style
lang=
"scss"
scoped
>
.tips
{
padding
:
0
.1rem
0
0
.2rem
;
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#033974
;
line-height
:
0
.36rem
;
}
.course-item
{
padding
:
0
.22rem
;
background
:
#fff
;
border-radius
:
0
.2rem
;
margin-bottom
:
0
.3rem
;
}
.course-item-inner
{
display
:
flex
;
}
.course-item-pic
{
width
:
1
.6rem
;
height
:
1
.9rem
;
border-radius
:
0
.1rem
;
overflow
:
hidden
;
object-fit
:
cover
;
}
.course-item-content
{
flex
:
1
;
margin-left
:
0
.26rem
;
line-height
:
0
.33rem
;
overflow
:
hidden
;
h5
{
font-size
:
0
.24rem
;
font-weight
:
500
;
line-height
:
0
.33rem
;
color
:
#4e4e4e
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.t1
{
margin-top
:
0
.05rem
;
font-size
:
0
.24rem
;
font-weight
:
400
;
line-height
:
0
.33rem
;
color
:
#666
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.t2
{
margin-top
:
0
.05rem
;
font-size
:
0
.2rem
;
font-weight
:
400
;
color
:
#999
;
line-height
:
0
.28rem
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
span
+
span
{
margin-left
:
0
.2rem
;
}
}
.t3
{
margin-top
:
0
.23rem
;
font-size
:
0
.2rem
;
font-weight
:
400
;
color
:
#999
;
text-align
:
right
;
}
}
</
style
>
src/modules/my/views/Index.vue
浏览文件 @
6731bd7b
...
@@ -20,7 +20,7 @@ const menus: Array<{
...
@@ -20,7 +20,7 @@ const menus: Array<{
icon
:
string
icon
:
string
}
>
=
[
}
>
=
[
{
{
path
:
'/'
,
path
:
'/
my/course
'
,
name
:
'我的课程'
,
name
:
'我的课程'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/my_menu_1.png'
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/my_menu_1.png'
},
},
...
...
src/router/index.ts
浏览文件 @
6731bd7b
...
@@ -8,6 +8,7 @@ const router = createRouter({
...
@@ -8,6 +8,7 @@ const router = createRouter({
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
const
user
=
useUserStore
()
const
user
=
useUserStore
()
await
user
.
getUser
()
if
(
to
.
meta
.
requireLogin
&&
!
user
.
isLogin
)
{
if
(
to
.
meta
.
requireLogin
&&
!
user
.
isLogin
)
{
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论