mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
首页推荐课程添加
This commit is contained in:
@@ -263,6 +263,58 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<!-- 推荐课程内容列表 -->
|
||||
<div
|
||||
v-for="(course, ccidx) in recommendedList.list"
|
||||
:key="'rr' + ccidx"
|
||||
class="xindex-course"
|
||||
style="position: relative"
|
||||
>
|
||||
<div style="position: absolute; right: 25px; bottom: 72px">
|
||||
<interactBar
|
||||
nodeWidth="20px"
|
||||
:courseExclusive="true"
|
||||
:type="1"
|
||||
:data="course"
|
||||
:comments="false"
|
||||
:praises="false"
|
||||
:shares="false"
|
||||
:views="false"
|
||||
>
|
||||
</interactBar>
|
||||
</div>
|
||||
<a @click="toCourseDetail(course)">
|
||||
<div class="xindex-course-image">
|
||||
<course-image :course="course"></course-image>
|
||||
<span v-if="course.type == 20 || 10" class="course-type"
|
||||
>录播课</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
style="width: 80%"
|
||||
:title="course.name"
|
||||
class="course-title portal-title-tow two-line-ellipsis"
|
||||
>
|
||||
{{ course.name }}
|
||||
</div>
|
||||
<div class="course-author">
|
||||
<div class="course-author-left">
|
||||
{{ course.authorInfo.name }}
|
||||
<span class="study-num"
|
||||
>{{ formatNum(course.studys) }}人学习</span
|
||||
>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<div v-if="course.score">
|
||||
<span class="course-score-value" style="margin-left: 10px"
|
||||
>{{ toScore(course.score) }}分</span
|
||||
>
|
||||
</div>
|
||||
<div v-else class="course-score-no">未评分</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1004,6 +1056,10 @@ export default {
|
||||
orderType: 2,
|
||||
list: [],
|
||||
},
|
||||
// 推荐课程
|
||||
recommendedList:{
|
||||
list: [],
|
||||
},
|
||||
caseList: {
|
||||
num: 3,
|
||||
orderType: 2,
|
||||
@@ -1027,6 +1083,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getCourseData(1);
|
||||
this.getRecommendList();
|
||||
this.getCaseData();
|
||||
this.getArticleData();
|
||||
this.getQaData();
|
||||
@@ -1219,7 +1276,7 @@ export default {
|
||||
},
|
||||
getScoreList() {
|
||||
//课程排行榜
|
||||
apiCourse.scorelist(10, 1).then((res) => {
|
||||
apiCourse.scorelist(15, 1).then((res) => {
|
||||
if (res.status == 200) {
|
||||
res.result.forEach((item) => {
|
||||
if (item.publishTime != "") {
|
||||
@@ -1280,6 +1337,29 @@ export default {
|
||||
if (this.isNext) {
|
||||
this.getCourseData(this.pageIndex);
|
||||
}
|
||||
},
|
||||
// 获取推荐课程list
|
||||
getRecommendList(){
|
||||
apiIndex.getRecommendList(1,3).then((res) => {
|
||||
if(res.code === 200){
|
||||
console.log(res.data.records);
|
||||
let courseIds = [];
|
||||
res.data.records.forEach((item) => {
|
||||
item.authorInfo = {
|
||||
aid: "",
|
||||
name: "",
|
||||
orgInfo: "",
|
||||
avatar: "",
|
||||
code: "",
|
||||
sex: null,
|
||||
};
|
||||
courseIds.push(item.id);
|
||||
});
|
||||
this.loadCouserTeacher(res.data.records, courseIds);
|
||||
console.log(res.result,'lalalala');
|
||||
this.recommendedList.list = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
getCourseData(pageIndex) {
|
||||
this.isNext = false;
|
||||
|
||||
Reference in New Issue
Block a user