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
08f3f29a
提交
08f3f29a
authored
4月 20, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
release 1.0
上级
97f0c27f
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
200 行增加
和
50 行删除
+200
-50
base.ts
src/api/base.ts
+1
-1
CourseItem.vue
src/components/CourseItem.vue
+1
-1
api.ts
src/modules/admission/api.ts
+6
-0
index.ts
src/modules/admission/index.ts
+2
-2
DocView.vue
src/modules/admission/views/DocView.vue
+58
-0
View.vue
src/modules/doc/views/View.vue
+0
-4
AdmissionGuide.vue
src/modules/home/components/AdmissionGuide.vue
+8
-1
LearningMap.vue
src/modules/home/components/LearningMap.vue
+20
-2
Menu.vue
src/modules/home/components/Menu.vue
+20
-20
Index.vue
src/modules/home/views/Index.vue
+6
-6
api.ts
src/modules/learn/api.ts
+5
-0
ChapterItem.vue
src/modules/learn/components/ChapterItem.vue
+0
-0
ChapterItemRecord.vue
src/modules/learn/components/ChapterItemRecord.vue
+0
-0
index.ts
src/modules/learn/index.ts
+4
-3
Course.vue
src/modules/learn/views/Course.vue
+0
-0
CourseView.vue
src/modules/learn/views/CourseView.vue
+0
-0
DocView.vue
src/modules/learn/views/DocView.vue
+58
-0
Publish.vue
src/modules/learn/views/Publish.vue
+1
-1
index.ts
src/router/index.ts
+7
-1
axios.ts
src/utils/axios.ts
+2
-2
vite.config.ts
vite.config.ts
+1
-6
没有找到文件。
src/api/base.ts
浏览文件 @
08f3f29a
...
...
@@ -30,5 +30,5 @@ export function uploadFile(data: object) {
// 获取导学视频详情
export
function
getVideoView
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/psp/v1/
learning
/video-view'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v1/
admission
/video-view'
,
{
params
})
}
src/components/CourseItem.vue
浏览文件 @
08f3f29a
...
...
@@ -14,7 +14,7 @@ const studyStatus = (progress: number) => {
</
script
>
<
template
>
<div
class=
"course-item"
>
<router-link
:to=
"
{ path: `/
course/view
/${data.id}` }" class="course-item-inner">
<router-link
:to=
"
{ path: `/
learn/course
/${data.id}` }" class="course-item-inner">
<img
:src=
"data.course_picture"
class=
"course-item-pic"
/>
<div
class=
"course-item-content"
>
<h5>
{{
data
.
course_name
}}
</h5>
...
...
src/modules/admission/api.ts
0 → 100644
浏览文件 @
08f3f29a
import
httpRequest
from
'@/utils/axios'
// 获取文档数据
export
function
getDocView
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/psp/v1/admission/doc-view'
,
{
params
})
}
src/modules/
doc
/index.ts
→
src/modules/
admission
/index.ts
浏览文件 @
08f3f29a
...
...
@@ -3,8 +3,8 @@ import AppLayout from '@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
path
:
'/
message
'
,
path
:
'/
admission
'
,
component
:
AppLayout
,
children
:
[{
path
:
'
'
,
component
:
()
=>
import
(
'./views/View.vue'
)
}]
children
:
[{
path
:
'
doc/:id'
,
component
:
()
=>
import
(
'./views/DocView.vue'
),
props
:
true
}]
}
]
src/modules/admission/views/DocView.vue
0 → 100644
浏览文件 @
08f3f29a
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
}
from
'vue'
import
{
getDocView
}
from
'../api'
const
props
=
defineProps
<
{
id
:
string
}
>
()
const
data
=
ref
()
function
fetchDocView
()
{
getDocView
({
id
:
props
.
id
}).
then
(
res
=>
{
data
.
value
=
res
.
data
})
}
onMounted
(()
=>
{
fetchDocView
()
})
</
script
>
<
template
>
<AppContainer
backgroundColor=
"#fff"
headerAlign=
"center"
v-if=
"data"
class=
"doc"
>
<div
class=
"doc-hd"
>
<h1>
{{
data
.
title
}}
</h1>
<p>
<span>
{{
data
.
created_time
}}
</span>
<span>
{{
data
.
pv
}}
观看
</span>
</p>
</div>
<div
class=
"doc-bd"
>
<article
v-html=
"data.desc"
></article>
</div>
</AppContainer>
</
template
>
<
style
lang=
"scss"
scoped
>
.doc-hd
{
h1
{
font-size
:
0
.32rem
;
font-weight
:
500
;
line-height
:
0
.45rem
;
color
:
#333333
;
}
p
{
margin-top
:
0
.15rem
;
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#b2b2b2
;
span
+
span
{
margin-left
:
0
.5rem
;
}
}
}
.doc-bd
{
padding
:
0
.5rem
0
;
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
0
.42rem
;
}
</
style
>
src/modules/doc/views/View.vue
deleted
100644 → 0
浏览文件 @
97f0c27f
<
script
setup
lang=
"ts"
></
script
>
<
template
>
<div
class=
"home"
></div>
</
template
>
src/modules/home/components/AdmissionGuide.vue
浏览文件 @
08f3f29a
<
script
setup
lang=
"ts"
>
import
{
useRouter
}
from
'vue-router'
import
{
Notify
}
from
'vant'
import
{
Swiper
,
SwiperSlide
}
from
'swiper/vue'
import
'swiper/css'
...
...
@@ -8,6 +9,11 @@ import type { IDocItem, IVideoItem } from '../types'
defineProps
<
{
docs
:
IDocItem
[];
videos
:
IVideoItem
[]
}
>
()
const
router
=
useRouter
()
function
handleViewDoc
(
data
:
IDocItem
)
{
router
.
push
(
'/admission/doc/'
+
data
.
id
)
}
function
showTips
()
{
Notify
({
type
:
'primary'
,
message
:
'尚未开放'
})
}
...
...
@@ -20,7 +26,7 @@ function showTips() {
<h2>
解释文档
</h2>
<div
class=
"box"
>
<ul>
<li
v-for=
"item in docs"
:key=
"item.id"
>
<li
v-for=
"item in docs"
:key=
"item.id"
@
click=
"handleViewDoc(item)"
>
<p>
{{
item
.
title
}}
</p>
<span>
{{
item
.
pv
}}
</span>
<van-icon
name=
"arrow"
/>
...
...
@@ -84,6 +90,7 @@ function showTips() {
align-items
:
center
;
font-size
:
0
.2rem
;
color
:
#adadad
;
cursor
:
pointer
;
}
p
{
flex
:
1
;
...
...
src/modules/home/components/LearningMap.vue
浏览文件 @
08f3f29a
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useRouter
}
from
'vue-router'
import
{
Notify
}
from
'vant'
import
type
{
IDocItem
}
from
'../types'
import
LearningMapVideo
from
'./LearningMapVideo.vue'
import
LearningMapCourse
from
'./LearningMapCourse.vue'
defineProps
<
{
docs
:
IDocItem
[]
}
>
()
const
router
=
useRouter
()
const
active
=
ref
<
number
>
(
0
)
function
handleViewDoc
(
data
:
IDocItem
)
{
router
.
push
(
'/learn/doc/'
+
data
.
id
)
}
function
showTips
()
{
Notify
({
type
:
'primary'
,
message
:
'尚未开放'
})
}
...
...
@@ -29,7 +37,7 @@ function showTips() {
<van-tab
title=
"解释文档"
>
<div
class=
"learn-box learn-docs"
>
<ul>
<li
v-for=
"item in docs"
:key=
"item.id"
>
<li
v-for=
"item in docs"
:key=
"item.id"
@
click=
"handleViewDoc(item)"
>
<p>
{{ item.title }}
</p>
<span>
{{ item.pv }}
</span>
<van-icon
name=
"arrow"
/>
...
...
@@ -80,13 +88,22 @@ function showTips() {
overflow
:
hidden
;
}
li
{
margin
:
0
.3rem
0
.14rem
0
;
position
:
relative
;
display
:
flex
;
align-items
:
center
;
font-size
:
0
.2rem
;
color
:
#adadad
;
cursor
:
pointer
;
&
:
:
before
{
content
:
''
;
width
:
0
.08rem
;
height
:
0
.08rem
;
background
:
#033974
;
border-radius
:
50%
;
}
}
p
{
margin-left
:
0
.1rem
;
flex
:
1
;
font-size
:
0
.24rem
;
color
:
#4e4e4e
;
...
...
@@ -95,6 +112,7 @@ function showTips() {
overflow
:
hidden
;
}
span
{
margin
:
0
0
.1rem
;
min-width
:
0
.44rem
;
font-size
:
0
.2rem
;
color
:
#c6c6c6
;
...
...
src/modules/home/components/Menu.vue
浏览文件 @
08f3f29a
...
...
@@ -16,27 +16,27 @@ const menus: Array<{
path
:
'#learning'
,
name
:
'学习地图'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_2.png'
},
{
path
:
'#query'
,
name
:
'权益查看'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_3.png'
},
{
path
:
'#team'
,
name
:
'荣誉总榜'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_4.png'
},
{
path
:
'#exam'
,
name
:
'考试攻略'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_6.png'
},
{
path
:
'#qa'
,
name
:
'陪伴问答'
,
icon
:
'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_5.png'
}
// {
// path: '#query',
// name: '权益查看',
// icon: 'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_3.png'
// },
// {
// path: '#team',
// name: '荣誉总榜',
// icon: 'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_4.png'
// },
// {
// path: '#exam',
// name: '考试攻略',
// icon: 'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_6.png'
// },
// {
// path: '#qa',
// name: '陪伴问答',
// icon: 'https://webapp-pub.ezijing.com/project/prp-h5/home_menu_5.png'
// }
]
</
script
>
...
...
src/modules/home/views/Index.vue
浏览文件 @
08f3f29a
...
...
@@ -6,9 +6,9 @@ import Banner from '../components/Banner.vue'
import
Menu
from
'../components/Menu.vue'
import
AdmissionGuide
from
'../components/AdmissionGuide.vue'
import
LearningMap
from
'../components/LearningMap.vue'
import
ExamStrategy
from
'../components/ExamStrategy.vue'
import
TeamRanking
from
'../components/TeamRanking.vue'
import
Questions
from
'../components/Questions.vue'
//
import ExamStrategy from '../components/ExamStrategy.vue'
//
import TeamRanking from '../components/TeamRanking.vue'
//
import Questions from '../components/Questions.vue'
const
data
=
ref
<
HomeInfo
>
({
banner
:
[],
...
...
@@ -37,9 +37,9 @@ onMounted(() => {
<LearningMap
:docs=
"data.learning_map_docs"
></LearningMap>
<!-- 权益查看 -->
<!-- 荣誉总榜 -->
<
TeamRanking></TeamRanking
>
<
!--
<TeamRanking></TeamRanking>
--
>
<!-- 考试攻略 -->
<
ExamStrategy></ExamStrategy
>
<
!--
<ExamStrategy></ExamStrategy>
--
>
<!-- 陪伴问答 -->
<
Questions
:data=
"data.questions"
></Questions
>
<
!--
<Questions
:data=
"data.questions"
></Questions>
--
>
</
template
>
src/modules/
course
/api.ts
→
src/modules/
learn
/api.ts
浏览文件 @
08f3f29a
...
...
@@ -35,3 +35,8 @@ export function createCourseComment(data: { entity_id: string; to_comment_id?: s
export
function
getRecordComment
(
params
:
{
id
:
string
;
page_size
?:
number
;
page
?:
number
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/record-comments'
,
{
params
})
}
// 获取文档数据
export
function
getDocView
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/psp/v1/learning/doc-view'
,
{
params
})
}
src/modules/
course
/components/ChapterItem.vue
→
src/modules/
learn
/components/ChapterItem.vue
浏览文件 @
08f3f29a
File moved
src/modules/
course
/components/ChapterItemRecord.vue
→
src/modules/
learn
/components/ChapterItemRecord.vue
浏览文件 @
08f3f29a
File moved
src/modules/
course
/index.ts
→
src/modules/
learn
/index.ts
浏览文件 @
08f3f29a
...
...
@@ -3,11 +3,12 @@ import AppLayout from '@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
path
:
'/
course
'
,
path
:
'/
learn
'
,
component
:
AppLayout
,
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
{
name
:
'courseView'
,
path
:
'view/:id'
,
component
:
()
=>
import
(
'./views/View.vue'
),
props
:
true
},
{
name
:
'learnCourse'
,
path
:
'course'
,
component
:
()
=>
import
(
'./views/Course.vue'
)
},
{
name
:
'learnCourseView'
,
path
:
'course/:id'
,
component
:
()
=>
import
(
'./views/CourseView.vue'
),
props
:
true
},
{
path
:
'doc/:id'
,
component
:
()
=>
import
(
'./views/DocView.vue'
),
props
:
true
},
{
path
:
'publish'
,
component
:
()
=>
import
(
'./views/Publish.vue'
),
meta
:
{
requireLogin
:
true
}
}
]
}
...
...
src/modules/
course/views/Index
.vue
→
src/modules/
learn/views/Course
.vue
浏览文件 @
08f3f29a
File moved
src/modules/
course/views/
View.vue
→
src/modules/
learn/views/Course
View.vue
浏览文件 @
08f3f29a
File moved
src/modules/learn/views/DocView.vue
0 → 100644
浏览文件 @
08f3f29a
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
}
from
'vue'
import
{
getDocView
}
from
'../api'
const
props
=
defineProps
<
{
id
:
string
}
>
()
const
data
=
ref
()
function
fetchDocView
()
{
getDocView
({
id
:
props
.
id
}).
then
(
res
=>
{
data
.
value
=
res
.
data
})
}
onMounted
(()
=>
{
fetchDocView
()
})
</
script
>
<
template
>
<AppContainer
backgroundColor=
"#fff"
headerAlign=
"center"
v-if=
"data"
class=
"doc"
>
<div
class=
"doc-hd"
>
<h1>
{{
data
.
title
}}
</h1>
<p>
<span>
{{
data
.
created_time
}}
</span>
<span>
{{
data
.
pv
}}
观看
</span>
</p>
</div>
<div
class=
"doc-bd"
>
<article
v-html=
"data.desc"
></article>
</div>
</AppContainer>
</
template
>
<
style
lang=
"scss"
scoped
>
.doc-hd
{
h1
{
font-size
:
0
.32rem
;
font-weight
:
500
;
line-height
:
0
.45rem
;
color
:
#333333
;
}
p
{
margin-top
:
0
.15rem
;
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#b2b2b2
;
span
+
span
{
margin-left
:
0
.5rem
;
}
}
}
.doc-bd
{
padding
:
0
.5rem
0
;
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
0
.42rem
;
}
</
style
>
src/modules/
course
/views/Publish.vue
→
src/modules/
learn
/views/Publish.vue
浏览文件 @
08f3f29a
...
...
@@ -14,7 +14,7 @@ function onSubmit() {
const
params
=
Object
.
assign
({},
form
,
{
picture
:
JSON
.
stringify
(
form
.
picture
)
})
createCourseRecord
(
params
).
then
(()
=>
{
Toast
.
success
(
'发布成功'
)
router
.
push
({
name
:
'
c
ourseView'
,
params
:
{
id
:
form
.
course_id
}
})
router
.
push
({
name
:
'
learnC
ourseView'
,
params
:
{
id
:
form
.
course_id
}
})
})
}
</
script
>
...
...
src/router/index.ts
浏览文件 @
08f3f29a
...
...
@@ -8,10 +8,16 @@ const router = createRouter({
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
const
user
=
useUserStore
()
if
(
to
.
meta
.
requireLogin
)
{
try
{
await
user
.
getUser
()
if
(
to
.
meta
.
requireLogin
&&
!
user
.
isLogin
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
}
if
(
!
user
.
isLogin
)
{
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
}
}
next
()
})
...
...
src/utils/axios.ts
浏览文件 @
08f3f29a
...
...
@@ -40,8 +40,8 @@ httpRequest.interceptors.response.use(
return
Promise
.
reject
(
data
)
}
if
(
data
.
code
===
1
)
{
Toast
.
fail
(
data
.
message
)
//
return Promise.reject(data)
Toast
.
fail
(
data
.
message
||
data
.
msg
)
return
Promise
.
reject
(
data
)
}
return
data
},
...
...
vite.config.ts
浏览文件 @
08f3f29a
...
...
@@ -18,12 +18,7 @@ export default defineConfig(({ mode }) => {
cert
:
fs
.
readFileSync
(
path
.
join
(
__dirname
,
'./https/dev.ezijing.com.pem'
))
},
proxy
:
{
'/api/psp'
:
{
target
:
'https://psp-api.ezijing.com'
,
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
'/api/psp/'
,
'/'
)
},
'/api'
:
'https://project-api.ezijing.com'
'/api'
:
'https://psp-show-h5.ezijing.com'
}
},
resolve
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论