首页课程模板提取

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

@@ -4,19 +4,19 @@
<image style="width: 100%;height:301upx" src="../../static/images/banner-index.png" mode=""></image>
</view>
<view class="course-re">
<view class="recommend-index-title">
<view class="recommend-index-title" style="margin-bottom: 20upx;">
<text class="title-line"></text>
热门课程推荐
<!-- <text class="tetle-text">查看更多</text> -->
</view>
<view class="course-re-list">
<course-list :items="courseDataList"></course-list>
<!-- <view class="course-re-list">
<view class="course-re-index" v-for="course in courseDataList" :key="course.id" @click="toCourseDetail(course)">
<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(course.score)}}</text>
<course-image :course="course" width="332upx" height="192upx"></course-image>
<!-- <image style="width: 100%;height:100%;border-radius: 16upx;" src="../../static/images/course.png" mode=""></image> -->
</view>
<view class="course-title">
{{course.name}}
@@ -25,13 +25,11 @@
{{course.sysCreateBy}} | {{course.studys}}人已学
</view>
<view class="course-type">
<!-- <text class="type-index">通用力</text>
<text class="type-index">产品经理</text> -->
<text class="type-index" v-if="sysTypeName(course.sysType1) != ''">{{sysTypeName(course.sysType1)}}</text>
<text class="type-tow" v-if="sysTypeName(course.sysType2) != ''">{{sysTypeName(course.sysType2)}}</text>
</view>
</view>
</view>
</view> -->
</view>
<view style="margin:30upx 0 60upx 0">
<image style="width: 100%;height:220upx" src="../../static/images/banner-tow.png" mode=""></image>
@@ -131,7 +129,6 @@
import apiIndex from '@/api/phase2/index.js';
import { mapGetters,mapActions} from 'vuex';
import apiUser from '@/api/system/user.js';
import {toScore} from '@/utils/tools.js'
export default {
data() {
return {
@@ -142,11 +139,10 @@
qaRankingList:[],
arlRankingList:[],
courseRankingList:[],
converToScore:toScore,
}
},
computed: {
...mapGetters(['userInfo','sysTypeMap'])
...mapGetters(['userInfo'])
},
mounted(){
this.getCourseData();
@@ -195,10 +191,6 @@
getSysTypeTree:'sysType/getSysTypeTree',
loadSysTypes:'sysType/loadSysTypes'
}),
sysTypeName(code){
if(code=='' || code==0){return '';}
return this.sysTypeMap.get(code);
},
//问答排行榜
getQaRanking(){
apiIndex.qaAnswers(3).then(res=>{
@@ -253,7 +245,6 @@
})
this.qaDataList = res.result;
this.loadAuthorInfo(res.result,ids);
console.log(this.qaDataList,'this.qaDataList')
}
})
},
@@ -326,84 +317,6 @@
font-weight: 400;
}
}
.course-re-list{
display: flex;
flex-wrap: wrap;
margin-top: 20upx;
.course-re-index{
padding: 15upx 0;
width: 335upx;
min-width: 335upx;
&: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: -2upx;
color: #FFFFFF;
font-size: 28upx;
z-index: 99999;
width: 136upx;
height: 44upx;
background: #1767FF;
// background: ;
// background: rgba($color: #1767FF, $alpha: 0.2);
border-radius: 24upx 0px 0px 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: 8upx;
margin-right: 12upx;
padding: 2upx 12upx;
}
.type-tow{
font-size: 22upx;
color: #D98135;
background: rgba($color: #FF7900, $alpha: 0.1);
border-radius: 8upx;
margin-right: 12upx;
padding: 4upx 12upx;
}
}
}
}
.ranking-list{
.list-box{
// width: 1720upx;