首页课程模板提取

This commit is contained in:
zhaofang
2022-11-09 14:28:20 +08:00
parent 7edbcfa743
commit 43fbfb9674
3 changed files with 155 additions and 224 deletions

View File

@@ -46,7 +46,7 @@
</view>
<!--内容列表区域,采用同一个列表只是根据不同的选项来查询内容的结果不一样-->
<view v-if="conType == 1" style="background-color: #fff;">
<view v-if="conType == 1" style="background-color: #fff;padding: 0 30upx;">
<!-- <view class="tags" v-if="dataFilter.courseTags.length>0">
<u-scroll-list :indicator="false">
<view v-for="(tag, tagIdx) in dataFilter.courseTags" :key="tagIdx" >
@@ -69,30 +69,7 @@
</view>
</view> -->
<!-- 课程列表 -->
<view class="course-re-list">
<view v-for="(c,cidx) in courseList" :key="cidx" class="course-re-index" @click="toCourseDetail(c)">
<!-- <view @click="toCourseDetail(c)"> -->
<view class="course-img">
<text class="img-score">
<image style="width:28upx;height:28upx;margin-right: 6upx;" src="../../static/images/icon/index-start.png" mode=""></image>
{{converToScore(c.score)}}</text>
<course-image :course="c" width="332upx" height="192upx"></course-image>
</view>
<view class="course-title">
<view v-html="c.name">
</view>
</view>
<view class="course-text">
{{c.teacher}} | {{c.studies}}人已学
</view>
<view class="course-type">
<text class="type-index" v-if="sysTypeName(c.sysType1) != ''">{{sysTypeName(c.sysType1)}}</text>
<text class="type-tow" v-if="sysTypeName(c.sysType2) != ''">{{sysTypeName(c.sysType2)}}</text>
</view>
<!-- </view> -->
</view>
</view>
<course-list :items="courseList"></course-list>
</view>
<!-- 文章 -->
<view>
@@ -558,24 +535,6 @@
url: '/pages/resource/qaDetail?id=' + item.id
});
},
//课程跳转详情
toCourseDetail(citem) {
if(citem.source == 1){
uni.navigateTo({
url: '/pages/study/studydetail?id='+citem.id+'&type='+citem.type
});
} else {
if (citem.type == 10) {
uni.navigateTo({
url: '/pages/resource/microDetail?id=' + citem.id
});
} else if (citem.type == 20) {
uni.navigateTo({
url: '/pages/resource/courseDetail?id=' +citem.id
});
}
}
},
toMessage() {
uni.navigateTo({
url: '/pages/my/message'
@@ -774,95 +733,6 @@
font-size: 32rpx;
text-align: center;
padding: 5upx 10upx 0upx 0upx;
}
.course-re-list{
padding: 30upx;
display: flex;
flex-wrap: wrap;
.course-re-index{
width: 335upx;
min-width: 335upx;
padding: 15upx 0;
&:nth-child(2n-1){
margin-right: 20upx;
}
.course-img{
width: 335upx;
height: 188upx;
border-radius: 16upx;
position: relative;
/deep/ uni-image {
border-radius: 8upx;
}
.img-score{
display: inline-block;
padding: 7upx 15upx;
box-sizing: border-box;
position: absolute;
right:2upx;
bottom: -2px;
color: #FFFFFF;
font-size: 28upx;
z-index: 99;
width: 136upx;
height: 44upx;
background: #1767FF;
// background: rgba($color: #1767FF, $alpha: 0.2);
border-radius: 24upx 0px 4upx 0px;
backdrop-filter: blur(20px);
}
}
.course-title{
margin-top: 20upx;
font-size: 28upx;
color: #39424C;
display: -webkit-box;
word-break:break-all;
// white-space:pre-wrap;
overflow: hidden;
// text-overflow:ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
box-sizing: border-box;
}
.course-text{
margin-top: 20upx;
font-size: 28upx;
color: #6E7B84;
}
.course-type{
margin-top: 20upx;
.type-index{
font-size: 22upx;
color: #6E7B84;
background: rgba($color: #387DF7, $alpha: 0.1);
border-radius: 16upx;
margin-right: 12upx;
padding: 4upx 12upx;
}
.type-tow{
font-size: 22upx;
color: #D98135;
background: rgba($color: #FF7900, $alpha: 0.1);
border-radius: 16upx;
margin-right: 12upx;
padding: 4upx 12upx;
}
}
}
}
// .con_box {
// margin-bottom: 10px;
// background-color: #FFFFFF;
// padding: 10px 15px;
// // margin-top: 10px;
// .tit {
// font-size: 32rpx;
// color: #4c4c4c;
// font-weight: 35upx;
// margin-bottom: 10upx;
// }
}
.tab-article{
padding: 30upx;