Files
dvcp_v2_wechat_app/src/project/qujing/AppLegalLearning/components/OnlineClass.vue

130 lines
2.8 KiB
Vue
Raw Normal View History

2023-01-30 14:57:39 +08:00
<template>
2023-01-31 09:49:26 +08:00
<div class="OnlineClass">
2023-01-31 16:19:20 +08:00
<div class="search_box">
2023-02-17 09:54:49 +08:00
<u-search placeholder="请输入需要搜索的课程" bg-color="#FFF" v-model="title" :show-action="false" @clear="title='',getList()" @search="getList"></u-search>
2023-01-31 16:19:20 +08:00
</div>
<p class="all_class">全部课程</p>
2023-02-14 09:53:27 +08:00
<div class="card_list" v-if="classList.length">
2023-02-14 15:15:34 +08:00
<div class="card" v-for="item in classList" :key="item.id" @click="handleToDetail(item.id)">
2023-01-31 16:19:20 +08:00
<div class="card_left">
2023-02-14 09:53:27 +08:00
<img :src="item.pictureUrl" alt="">
2023-01-31 16:19:20 +08:00
</div>
<div class="card_right">
2023-02-14 09:53:27 +08:00
<div class="title">{{ item.title }}</div>
2023-02-17 10:05:26 +08:00
<div class="num">
<div>{{ item.learnerNumber }}人已学习</div>
<div v-if="item.videoDuration">视频时长{{ item.videoDuration }}</div>
</div>
2023-01-31 16:19:20 +08:00
</div>
</div>
</div>
2023-02-14 09:53:27 +08:00
<AiEmpty :description="`暂无数据`" class="emptyWrap" v-else/>
2023-01-30 14:57:39 +08:00
</div>
</template>
<script>
export default {
data() {
return {
current: 1,
2023-02-14 08:55:54 +08:00
title: '',
2023-02-13 16:13:27 +08:00
classList: [],
2023-01-30 14:57:39 +08:00
}
},
onLoad() {
},
methods: {
getList() {
2023-02-14 15:15:34 +08:00
this.$instance.post(`/app/appcourseinfo/listByApplet`, null, {
2023-02-14 08:55:54 +08:00
params: {
current: this.current,
size: 10,
title: this.title
}
}).then(res=> {
if(res?.data) {
2023-02-17 10:53:57 +08:00
this.classList = res.data.records
2023-02-14 08:55:54 +08:00
}
})
2023-01-31 16:19:20 +08:00
},
2023-02-14 15:15:34 +08:00
handleToDetail(id) {
this.$emit('toDetail',id)
2023-01-30 14:57:39 +08:00
}
},
2023-01-31 09:49:26 +08:00
onReachBottom() {
this.current ++;
this.getList()
},
2023-01-30 14:57:39 +08:00
}
</script>
<style lang="scss" socped>
2023-01-31 09:49:26 +08:00
.OnlineClass {
2023-01-31 16:19:20 +08:00
.search_box {
margin: 24px 0;
padding: 0 32px;
box-sizing: border-box;
}
2023-01-30 14:57:39 +08:00
2023-01-31 16:19:20 +08:00
.all_class {
font-size: 28px;
color: #333333;
font-weight: 600;
padding: 0 32px;
box-sizing: border-box;
}
.card_list {
padding: 8px 32px;
box-sizing: border-box;
.card {
margin-top: 24px;
background: #FFFFFF;
box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
border-radius: 16px;
display: flex;
padding: 24px;
box-sizing: border-box;
.card_left {
margin-right: 24px;
img {
width: 160px;
height: 160px;
border-radius: 8px;
}
}
.card_right {
2023-02-17 10:05:26 +08:00
width: calc(100% - 184px);
2023-01-31 16:19:20 +08:00
.title {
font-weight: 500;
font-size: 34px;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.num {
2023-02-17 10:05:26 +08:00
display: flex;
justify-content: space-between;
2023-01-31 16:19:20 +08:00
margin-top: 28px;
font-weight: 400;
font-size: 26px;
color: #999999;
}
}
.col_blue {
color: #2D7DFF;
}
}
}
2023-01-30 14:57:39 +08:00
}
</style>