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

updates

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