提交 01990e06 authored 作者: matian's avatar matian

updates

上级 770490fe
...@@ -33,10 +33,10 @@ export function getVideoView(params: { id: string }) { ...@@ -33,10 +33,10 @@ export function getVideoView(params: { id: string }) {
return httpRequest.get('/api/psp/v1/admission/video-view', { params }) return httpRequest.get('/api/psp/v1/admission/video-view', { params })
} }
// 获取推荐课程列表 // 获取推荐课程列表
export function getRecommendCourse() { export function getRecommendCourse(params: { page_size?: string; page?: string }) {
return httpRequest.get('/api/psp/v1/recommend-course/list') return httpRequest.get('/api/psp/v1/recommend-course/list', { params })
} }
// 获取导师列表 // 获取导师列表
export function getTeacherList() { export function getTeacherList(params: { page_size?: string; page?: string; type?: string }) {
return httpRequest.get('/api/psp/v1/lecturer/list') return httpRequest.get('/api/psp/v1/lecturer/list', { params })
} }
...@@ -11,8 +11,9 @@ interface IRecommendCourseAllList { ...@@ -11,8 +11,9 @@ interface IRecommendCourseAllList {
} }
const courseList = reactive<IRecommendCourseAllList>({ loading: false, page: 1, total: 0, list: [] }) const courseList = reactive<IRecommendCourseAllList>({ loading: false, page: 1, total: 0, list: [] })
const handleGetTeacherList = () => { const handleGetCourseList = () => {
getRecommendCourse() const params: any = { page_size: 10, page: courseList.page }
getRecommendCourse(params)
.then(res => { .then(res => {
const { total, list } = res.data const { total, list } = res.data
courseList.total = total courseList.total = total
...@@ -26,22 +27,19 @@ const handleGetTeacherList = () => { ...@@ -26,22 +27,19 @@ const handleGetTeacherList = () => {
}) })
} }
onMounted(() => {
courseList.page = 1
courseList.list = []
// 获取持证人列表
handleGetTeacherList()
})
// 滚动加载 // 滚动加载
const el = ref<HTMLElement>() const el = ref<HTMLElement>()
useInfiniteScroll( useInfiniteScroll(
document, document,
() => { () => {
// load more // load more
!courseList.loading && handleGetTeacherList() !courseList.loading && handleGetCourseList()
}, },
{ distance: 10 } { distance: 10 }
) )
onMounted(() => {
handleGetCourseList()
})
</script> </script>
<template> <template>
......
...@@ -114,6 +114,7 @@ function showTips() { ...@@ -114,6 +114,7 @@ function showTips() {
background: #ffffff; background: #ffffff;
padding: 0.14rem 0.2rem; padding: 0.14rem 0.2rem;
border-radius: 0.3rem; border-radius: 0.3rem;
cursor: pointer;
} }
p { p {
flex: 1; flex: 1;
...@@ -139,6 +140,7 @@ function showTips() { ...@@ -139,6 +140,7 @@ function showTips() {
background: #fff; background: #fff;
border-radius: 0.2rem; border-radius: 0.2rem;
box-sizing: border-box; box-sizing: border-box;
cursor: pointer;
h2 { h2 {
font-size: 0.28rem; font-size: 0.28rem;
line-height: 1.5; line-height: 1.5;
......
...@@ -33,7 +33,7 @@ const handleViewNews = (item: INews) => { ...@@ -33,7 +33,7 @@ const handleViewNews = (item: INews) => {
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
</div> </div>
<img src="https://webapp-pub.ezijing.com/project/prp-h5/exam_banner.png" class="exam_banner" />
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -47,8 +47,8 @@ const handleViewNews = (item: INews) => { ...@@ -47,8 +47,8 @@ const handleViewNews = (item: INews) => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding-left: 0.2rem; padding-left: 0.2rem;
cursor: pointer;
} }
:deep(.van-swipe__indicator) { :deep(.van-swipe__indicator) {
display: none; display: none;
...@@ -81,8 +81,5 @@ const handleViewNews = (item: INews) => { ...@@ -81,8 +81,5 @@ const handleViewNews = (item: INews) => {
margin-left: 1.1rem; margin-left: 1.1rem;
} }
} }
.exam_banner {
width: 6.9rem;
margin-top: 0.3rem;
}
</style> </style>
...@@ -75,4 +75,7 @@ const handleViewMore = () => { ...@@ -75,4 +75,7 @@ const handleViewMore = () => {
:deep(van-button--large) { :deep(van-button--large) {
height: 0.69rem; height: 0.69rem;
} }
:deep(.van-button) {
cursor: pointer;
}
</style> </style>
...@@ -13,6 +13,8 @@ getRecommendCourse().then(res => { ...@@ -13,6 +13,8 @@ getRecommendCourse().then(res => {
</script> </script>
<template> <template>
<img src="https://webapp-pub.ezijing.com/project/prp-h5/course_banner.png" class="exam_banner" />
<AppCard title="推荐课程" id="team"> <AppCard title="推荐课程" id="team">
<template #header-aside> <template #header-aside>
<div class="more"> <div class="more">
...@@ -37,6 +39,10 @@ getRecommendCourse().then(res => { ...@@ -37,6 +39,10 @@ getRecommendCourse().then(res => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.exam_banner {
width: 6.9rem;
margin-top: 0.3rem;
}
.course_list { .course_list {
.list_item { .list_item {
display: flex; display: flex;
......
...@@ -68,7 +68,5 @@ onMounted(() => { ...@@ -68,7 +68,5 @@ onMounted(() => {
<TeamRanking :teams="data.ranking"></TeamRanking> <TeamRanking :teams="data.ranking"></TeamRanking>
<!-- 考试攻略 --> <!-- 考试攻略 -->
<!-- <ExamStrategy :docs="data.exam_strategy_docs"></ExamStrategy> --> <!-- <ExamStrategy :docs="data.exam_strategy_docs"></ExamStrategy> -->
<RouterLink to="/qa"> <img src="https://webapp-pub.ezijing.com/project/prp-h5/exam_banner.png" style="width: 100%; margin-bottom: 0.5rem" />
<img src="https://webapp-pub.ezijing.com/project/prp-h5/qa_banner.png" style="width: 100%; margin-bottom: 0.5rem" />
</RouterLink>
</template> </template>
...@@ -9,10 +9,18 @@ interface ITeacherAllList { ...@@ -9,10 +9,18 @@ interface ITeacherAllList {
total: number total: number
list: ITeacherList[] list: ITeacherList[]
} }
const teacherList = reactive<ITeacherAllList>({ loading: false, page: 1, total: 0, list: [] })
const teacherList = $ref<ITeacherAllList>({
loading: false,
page: 1,
total: 0,
list: []
})
const tabIndex = $ref(0) const tabIndex = $ref(0)
const handleGetTeacherList = () => { const handleGetTeacherList = () => {
getTeacherList() const params: any = { page_size: 10, page: teacherList.page }
getTeacherList(params)
.then(res => { .then(res => {
const { total, list } = res.data const { total, list } = res.data
teacherList.total = total teacherList.total = total
...@@ -26,12 +34,6 @@ const handleGetTeacherList = () => { ...@@ -26,12 +34,6 @@ const handleGetTeacherList = () => {
}) })
} }
onMounted(() => {
teacherList.page = 1
teacherList.list = []
// 获取持证人列表
handleGetTeacherList()
})
// 滚动加载 // 滚动加载
const el = ref<HTMLElement>() const el = ref<HTMLElement>()
useInfiniteScroll( useInfiniteScroll(
...@@ -42,6 +44,9 @@ useInfiniteScroll( ...@@ -42,6 +44,9 @@ useInfiniteScroll(
}, },
{ distance: 10 } { distance: 10 }
) )
onMounted(() => {
handleGetTeacherList()
})
</script> </script>
<template> <template>
...@@ -55,15 +60,22 @@ useInfiniteScroll( ...@@ -55,15 +60,22 @@ useInfiniteScroll(
紫荆实战导师团 紫荆实战导师团
</div> </div>
</div> </div>
<div class="teacher_list" ref="el"> <div
class="teacher_list"
ref="el"
v-if="teacherList.list.filter(item => item.type === (tabIndex + 1).toString()).length > 0"
>
<div class="list_item" v-for="(item, index) in teacherList.list" :key="index"> <div class="list_item" v-for="(item, index) in teacherList.list" :key="index">
<img :src="item.avatar" alt="" /> <div v-if="(tabIndex + 1).toString() === item.type">
<div class="item_bottom"> <img :src="item.avatar" alt="" />
<div class="name">{{ item.name }}</div> <div class="item_bottom">
<div class="desc" v-html="item.desc_type_name"></div> <div class="name">{{ item.name }}</div>
<div class="desc" v-html="item.desc_type_name"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
<van-empty v-else description="暂无" />
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -74,9 +86,6 @@ useInfiniteScroll( ...@@ -74,9 +86,6 @@ useInfiniteScroll(
border-top-left-radius: 0.4rem; border-top-left-radius: 0.4rem;
border-top-right-radius: 0.4rem; border-top-right-radius: 0.4rem;
position: relative; position: relative;
// top: -20px;
// left: 50%;
// transform: translateX(-50%);
z-index: 100; z-index: 100;
margin: -20px auto; margin: -20px auto;
display: flex; display: flex;
...@@ -93,6 +102,7 @@ useInfiniteScroll( ...@@ -93,6 +102,7 @@ useInfiniteScroll(
.tab_name { .tab_name {
font-size: 0.28rem; font-size: 0.28rem;
font-weight: 400; font-weight: 400;
cursor: pointer;
} }
.inactive_tab { .inactive_tab {
color: #999999; color: #999999;
......
...@@ -93,6 +93,10 @@ export interface ITeacherList { ...@@ -93,6 +93,10 @@ export interface ITeacherList {
id: string id: string
name: string name: string
pv: string pv: string
title: string
url: string url: string
weight: string weight: string
type: string
type_name: string
office: string
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论