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
396d4d9a
提交
396d4d9a
authored
4月 15, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
e9945275
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
140 行增加
和
35 行删除
+140
-35
api.ts
src/modules/course/api.ts
+3
-3
ChapterItem.vue
src/modules/course/components/ChapterItem.vue
+1
-2
api.ts
src/modules/home/api.ts
+7
-2
Banner.vue
src/modules/home/components/Banner.vue
+3
-18
LearningMapCourse.vue
src/modules/home/components/LearningMapCourse.vue
+2
-1
LearningMapVideo.vue
src/modules/home/components/LearningMapVideo.vue
+38
-4
Menu.vue
src/modules/home/components/Menu.vue
+1
-1
Questions.vue
src/modules/home/components/Questions.vue
+1
-1
types.ts
src/modules/home/types.ts
+1
-0
api.ts
src/modules/qa/api.ts
+20
-0
index.ts
src/modules/qa/index.ts
+4
-1
Publish.vue
src/modules/qa/views/Publish.vue
+57
-0
types.ts
src/types.ts
+2
-2
没有找到文件。
src/modules/course/api.ts
浏览文件 @
396d4d9a
import
httpRequest
from
'@/utils/axios'
import
httpRequest
from
'@/utils/axios'
// 获取课程列表
// 获取课程列表
export
function
getCourseList
(
params
:
{
page_size
:
number
;
page
:
number
})
{
export
function
getCourseList
(
params
?:
{
page_size
?:
number
;
page
?
:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/course-list'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v1/learning/course-list'
,
{
params
})
}
}
...
@@ -20,7 +20,7 @@ export function createCourseRecord(data: {
...
@@ -20,7 +20,7 @@ export function createCourseRecord(data: {
chapter_id
:
string
chapter_id
:
string
course_id
:
string
course_id
:
string
content
:
string
content
:
string
titl
e
?:
string
pictur
e
?:
string
file
?:
string
file
?:
string
})
{
})
{
return
httpRequest
.
post
(
'/api/psp/v1/learning/upload'
,
data
)
return
httpRequest
.
post
(
'/api/psp/v1/learning/upload'
,
data
)
...
@@ -32,6 +32,6 @@ export function createCourseComment(data: { entity_id: string; to_comment_id?: s
...
@@ -32,6 +32,6 @@ export function createCourseComment(data: { entity_id: string; to_comment_id?: s
}
}
// 获取打卡记录评论
// 获取打卡记录评论
export
function
getRecordComment
(
params
:
{
id
:
string
;
page_size
?:
number
;
page
:
number
})
{
export
function
getRecordComment
(
params
:
{
id
:
string
;
page_size
?:
number
;
page
?
:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/record-comments'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v1/learning/record-comments'
,
{
params
})
}
}
src/modules/course/components/ChapterItem.vue
浏览文件 @
396d4d9a
...
@@ -82,8 +82,7 @@ useInfiniteScroll(
...
@@ -82,8 +82,7 @@ useInfiniteScroll(
line-height
:
0
.28rem
;
line-height
:
0
.28rem
;
}
}
.chapter-view
{
.chapter-view
{
margin-bottom
:
0
.56rem
;
padding
:
0
.36rem
0
;
padding
:
0
.16rem
0
;
font-size
:
0
.24rem
;
font-size
:
0
.24rem
;
color
:
#033974
;
color
:
#033974
;
line-height
:
0
.36rem
;
line-height
:
0
.36rem
;
...
...
src/modules/home/api.ts
浏览文件 @
396d4d9a
...
@@ -5,12 +5,17 @@ export function getHomeData() {
...
@@ -5,12 +5,17 @@ export function getHomeData() {
return
httpRequest
.
get
(
'/api/psp/v1/index/index'
)
return
httpRequest
.
get
(
'/api/psp/v1/index/index'
)
}
}
// 获取导学视频列表
// 获取导学视频列表
export
function
getVideoList
(
params
?:
{
page_size
:
number
;
page
:
number
})
{
export
function
getVideoList
(
params
?:
{
page_size
?:
number
;
page
?
:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/video-list'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v1/learning/video-list'
,
{
params
})
}
}
// 获取导学视频详情
export
function
getVideoView
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/video-view'
,
{
params
})
}
// 获取课程列表
// 获取课程列表
export
function
getCourseList
(
params
?:
{
page_size
:
number
;
page
:
number
})
{
export
function
getCourseList
(
params
?:
{
page_size
?:
number
;
page
?
:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/course-list'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v1/learning/course-list'
,
{
params
})
}
}
...
...
src/modules/home/components/Banner.vue
浏览文件 @
396d4d9a
...
@@ -3,31 +3,16 @@ import { Swiper, SwiperSlide } from 'swiper/vue'
...
@@ -3,31 +3,16 @@ import { Swiper, SwiperSlide } from 'swiper/vue'
import
{
Pagination
}
from
'swiper'
import
{
Pagination
}
from
'swiper'
import
'swiper/css'
import
'swiper/css'
import
'swiper/css/pagination'
import
'swiper/css/pagination'
import
type
{
IBanner
}
from
'../types'
const
list
:
Array
<
{
defineProps
<
{
list
:
IBanner
[]
}
>
()
url
:
string
imageUrl
:
string
}
>
=
[
{
url
:
'/'
,
imageUrl
:
'https://webapp-pub.ezijing.com/project/prp-h5/banner.png'
},
{
url
:
'/'
,
imageUrl
:
'https://webapp-pub.ezijing.com/project/prp-h5/banner.png'
},
{
url
:
'/'
,
imageUrl
:
'https://webapp-pub.ezijing.com/project/prp-h5/banner.png'
}
]
</
script
>
</
script
>
<
template
>
<
template
>
<nav
class=
"home-banner"
>
<nav
class=
"home-banner"
>
<Swiper
pagination
:modules=
"[Pagination]"
>
<Swiper
pagination
:modules=
"[Pagination]"
>
<SwiperSlide
v-for=
"(item, index) in list"
:key=
"index"
>
<SwiperSlide
v-for=
"(item, index) in list"
:key=
"index"
>
<img
:src=
"item.
imageUrl
"
/>
<img
:src=
"item.
cover_page
"
/>
</SwiperSlide>
</SwiperSlide>
</Swiper>
</Swiper>
</nav>
</nav>
...
...
src/modules/home/components/LearningMapCourse.vue
浏览文件 @
396d4d9a
...
@@ -8,7 +8,7 @@ import { getCourseList } from '../api'
...
@@ -8,7 +8,7 @@ import { getCourseList } from '../api'
// 学习进度
// 学习进度
const
dataset
=
ref
<
{
total
:
number
;
list
:
ICourseItem
[]
}
>
({
total
:
0
,
list
:
[]
})
const
dataset
=
ref
<
{
total
:
number
;
list
:
ICourseItem
[]
}
>
({
total
:
0
,
list
:
[]
})
const
fetchCourseList
=
()
=>
{
const
fetchCourseList
=
()
=>
{
getCourseList
().
then
(
res
=>
{
getCourseList
(
{
page_size
:
100
}
).
then
(
res
=>
{
dataset
.
value
=
res
.
data
dataset
.
value
=
res
.
data
})
})
}
}
...
@@ -72,6 +72,7 @@ onMounted(() => {
...
@@ -72,6 +72,7 @@ onMounted(() => {
flex
:
1
;
flex
:
1
;
margin-left
:
0
.26rem
;
margin-left
:
0
.26rem
;
line-height
:
0
.33rem
;
line-height
:
0
.33rem
;
overflow
:
hidden
;
h5
{
h5
{
font-size
:
0
.24rem
;
font-size
:
0
.24rem
;
font-weight
:
500
;
font-weight
:
500
;
...
...
src/modules/home/components/LearningMapVideo.vue
浏览文件 @
396d4d9a
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
}
from
'vue'
import
{
ref
,
computed
,
onMounted
}
from
'vue'
import
{
Swiper
,
SwiperSlide
}
from
'swiper/vue'
import
{
Swiper
,
SwiperSlide
}
from
'swiper/vue'
import
'swiper/css'
import
'swiper/css'
import
type
{
IVideoItem
}
from
'../types'
import
type
{
IVideoItem
}
from
'../types'
import
{
getVideoList
}
from
'../api'
import
{
getVideoList
,
getVideoView
}
from
'../api'
// 课程导学
// 课程导学
const
dataset
=
ref
<
{
total
:
number
;
list
:
IVideoItem
[]
}
>
({
total
:
0
,
list
:
[]
})
const
dataset
=
ref
<
{
total
:
number
;
list
:
IVideoItem
[]
}
>
({
total
:
0
,
list
:
[]
})
const
fetchVideoList
=
()
=>
{
const
fetchVideoList
=
()
=>
{
getVideoList
().
then
(
res
=>
{
getVideoList
(
{
page_size
:
100
}
).
then
(
res
=>
{
dataset
.
value
=
res
.
data
dataset
.
value
=
res
.
data
})
})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
fetchVideoList
()
fetchVideoList
()
})
})
// 查看详情
const
dialogVisible
=
ref
<
boolean
>
(
false
)
const
videoInfo
=
ref
<
IVideoItem
>
()
const
videoUrl
=
computed
(()
=>
{
if
(
videoInfo
.
value
)
{
// 优先取mp4
const
[
first
=
{}]
=
videoInfo
.
value
.
play_info
.
filter
(
item
=>
item
.
Format
===
'mp4'
)
return
first
.
PlayURL
}
return
''
})
const
fetchVideoView
=
(
id
:
string
)
=>
{
getVideoView
({
id
}).
then
(
res
=>
{
videoInfo
.
value
=
res
.
data
})
}
const
onClick
=
(
data
:
IVideoItem
)
=>
{
fetchVideoView
(
data
.
id
)
dialogVisible
.
value
=
true
}
</
script
>
</
script
>
<
template
>
<
template
>
<swiper
slides-per-view=
"auto"
:space-between=
"10"
>
<swiper
slides-per-view=
"auto"
:space-between=
"10"
>
<swiper-slide
v-for=
"(item, index) in dataset.list"
:key=
"index"
class=
"video-item"
>
<swiper-slide
v-for=
"(item, index) in dataset.list"
:key=
"index"
class=
"video-item"
@
click=
"onClick(item)"
>
<img
:src=
"item.cover_page"
/>
<img
:src=
"item.cover_page"
/>
<h5>
{{
item
.
course_name
}}
</h5>
<h5>
{{
item
.
course_name
}}
</h5>
<p>
{{
item
.
pv
}}
播放
</p>
<p>
{{
item
.
pv
}}
播放
</p>
</swiper-slide>
</swiper-slide>
</swiper>
</swiper>
<van-popup
v-model:show=
"dialogVisible"
round
>
<div
class=
"video-wrap"
v-if=
"dialogVisible"
>
<video
controls
autoplay
:src=
"videoUrl"
></video>
</div>
</van-popup>
</
template
>
</
template
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
@@ -54,4 +80,12 @@ onMounted(() => {
...
@@ -54,4 +80,12 @@ onMounted(() => {
color
:
#999999
;
color
:
#999999
;
}
}
}
}
.video-wrap
{
width
:
80vw
;
margin
:
0
.2rem
;
video
{
width
:
100%
;
max-height
:
80vh
;
}
}
</
style
>
</
style
>
src/modules/home/components/Menu.vue
浏览文件 @
396d4d9a
...
@@ -18,7 +18,7 @@ const menus: Array<{
...
@@ -18,7 +18,7 @@ const menus: Array<{
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_2.png'
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_2.png'
},
},
{
{
path
:
'
/
query'
,
path
:
'
#
query'
,
name
:
'权益查看'
,
name
:
'权益查看'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_3.png'
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_3.png'
},
},
...
...
src/modules/home/components/Questions.vue
浏览文件 @
396d4d9a
...
@@ -31,7 +31,7 @@ const onSubmitComment = (data: any, action: string) => {
...
@@ -31,7 +31,7 @@ const onSubmitComment = (data: any, action: string) => {
<
template
>
<
template
>
<AppCard
title=
"陪伴问答"
id=
"qa"
>
<AppCard
title=
"陪伴问答"
id=
"qa"
>
<template
#
header-aside
>
<template
#
header-aside
>
<div
class=
"button"
>
发表问答
</div>
<div
class=
"button"
>
<router-link
to=
"/qa/publish"
>
发表问答
</router-link>
</div>
</
template
>
</
template
>
<PublishItem
v-for=
"item in data.list"
:data=
"item"
:key=
"item.id"
@
submitComment=
"onSubmitComment"
></PublishItem>
<PublishItem
v-for=
"item in data.list"
:data=
"item"
:key=
"item.id"
@
submitComment=
"onSubmitComment"
></PublishItem>
</AppCard>
</AppCard>
...
...
src/modules/home/types.ts
浏览文件 @
396d4d9a
...
@@ -12,6 +12,7 @@ export interface IBanner {
...
@@ -12,6 +12,7 @@ export interface IBanner {
id
:
string
id
:
string
title
:
string
title
:
string
pv
:
string
pv
:
string
cover_page
:
string
}
}
export
interface
IDocItem
{
export
interface
IDocItem
{
...
...
src/modules/qa/api.ts
0 → 100644
浏览文件 @
396d4d9a
import
httpRequest
from
'@/utils/axios'
// 获取问答列表
export
function
getQuestionList
(
params
?:
{
page_size
?:
number
;
page
?:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/question/list'
,
{
params
})
}
// 获取问答详情
export
function
getQuestionView
(
params
:
{
id
:
string
;
page_size
?:
number
;
page
?:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/question/view'
,
{
params
})
}
// 发布问答
export
function
createQuestion
(
data
:
{
title
:
string
;
desc
:
string
;
picture
?:
string
;
file
?:
string
})
{
return
httpRequest
.
post
(
'/api/psp/v1/question/create-question'
,
data
)
}
// 发布问答评论
export
function
createQuestionComment
(
data
:
{
question_id
:
string
;
to_comment_id
?:
string
;
content
:
string
})
{
return
httpRequest
.
post
(
'/api/psp/v1/question/create-comment'
,
data
)
}
src/modules/qa/index.ts
浏览文件 @
396d4d9a
...
@@ -5,6 +5,9 @@ export const routes: Array<RouteRecordRaw> = [
...
@@ -5,6 +5,9 @@ export const routes: Array<RouteRecordRaw> = [
{
{
path
:
'/qa'
,
path
:
'/qa'
,
component
:
AppLayout
,
component
:
AppLayout
,
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
{
path
:
'publish'
,
component
:
()
=>
import
(
'./views/Publish.vue'
)
}
]
}
}
]
]
src/modules/qa/views/Publish.vue
0 → 100644
浏览文件 @
396d4d9a
<
script
setup
lang=
"ts"
>
import
{
reactive
}
from
'vue'
import
{
useRouter
}
from
'vue-router'
import
{
createQuestion
}
from
'../api'
import
UploadImageList
from
'@/components/UploadImageList.vue'
import
{
Toast
}
from
'vant'
const
router
=
useRouter
()
const
form
=
reactive
({
title
:
''
,
desc
:
''
,
picture
:
[]
})
function
onSubmit
()
{
const
params
=
Object
.
assign
({},
form
,
{
picture
:
JSON
.
stringify
(
form
.
picture
)
})
createQuestion
(
params
).
then
(()
=>
{
Toast
.
success
(
'发布成功'
)
router
.
push
({
path
:
'/#qa'
})
})
}
</
script
>
<
template
>
<AppContainer
title=
"发布问题"
backgroundColor=
"#fff"
headerAlign=
"center"
>
<van-form
@
submit=
"onSubmit"
>
<van-field
v-model=
"form.title"
placeholder=
"请输入问题标题"
:rules=
"[
{ required: true, message: '请输入问题标题' }]"
/>
<van-field
v-model=
"form.desc"
type=
"textarea"
placeholder=
"请输入问题内容"
:autosize=
"
{ minHeight: 200 }"
:rules="[{ required: true, message: '请输入问题内容' }]"
/>
<van-field>
<template
#
input
>
<UploadImageList
v-model=
"form.picture"
></UploadImageList>
</
template
>
</van-field>
<van-button
block
round
native-type=
"submit"
class=
"my-button"
>
发布
</van-button>
</van-form>
</AppContainer>
</template>
<
style
lang=
"scss"
scoped
>
:deep
(
.van-cell
)
{
padding-left
:
0
;
padding-right
:
0
;
&
:
:
after
{
left
:
0
;
right
:
0
;
}
}
.my-button
{
margin
:
1rem
0
;
}
</
style
>
src/types.ts
浏览文件 @
396d4d9a
...
@@ -7,7 +7,7 @@ export interface IVideoItem {
...
@@ -7,7 +7,7 @@ export interface IVideoItem {
course_name
:
string
course_name
:
string
aliyun_video_id
:
string
aliyun_video_id
:
string
pv
:
string
pv
:
string
play_info
:
object
play_info
:
any
[]
}
}
// 课程
// 课程
...
@@ -30,7 +30,7 @@ export interface ICourseItem {
...
@@ -30,7 +30,7 @@ export interface ICourseItem {
export
interface
ICourseChapters
{
export
interface
ICourseChapters
{
big_total
:
string
big_total
:
string
small_total
:
string
small_total
:
string
list
:
[]
list
:
any
[]
}
}
// 课程老师
// 课程老师
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论