From 43fbfb9674f1be9dc38f4770d3a2d7f0f8eff2dc Mon Sep 17 00:00:00 2001
From: zhaofang <752743406@qq.com>
Date: Wed, 9 Nov 2022 14:28:20 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=AF=BE=E7=A8=8B=E6=A8=A1?=
=?UTF-8?q?=E6=9D=BF=E6=8F=90=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/course-list/course-list.vue | 148 ++++++++++++++++++
.../recommend-index/recommend-index.vue | 97 +-----------
pages/index/index.vue | 134 +---------------
3 files changed, 155 insertions(+), 224 deletions(-)
create mode 100644 components/course-list/course-list.vue
diff --git a/components/course-list/course-list.vue b/components/course-list/course-list.vue
new file mode 100644
index 0000000..7cc6ca9
--- /dev/null
+++ b/components/course-list/course-list.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+ {{converToScore(course.score)}}分
+
+
+
+
+ {{course.name}}
+
+
+ {{course.teacher || course.sysCreateBy}} | {{course.studys}}人已学
+
+
+ {{sysTypeName(course.sysType1)}}
+ {{sysTypeName(course.sysType2)}}
+
+
+
+
+
+
+
+
diff --git a/components/recommend-index/recommend-index.vue b/components/recommend-index/recommend-index.vue
index 384fa32..47fbc3d 100644
--- a/components/recommend-index/recommend-index.vue
+++ b/components/recommend-index/recommend-index.vue
@@ -4,19 +4,19 @@
-
+
热门课程推荐
-
+
+
{{course.name}}
@@ -25,13 +25,11 @@
{{course.sysCreateBy}} | {{course.studys}}人已学
-
{{sysTypeName(course.sysType1)}}
{{sysTypeName(course.sysType2)}}
-
+ -->
@@ -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;
diff --git a/pages/index/index.vue b/pages/index/index.vue
index e3cb952..d49242c 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -46,7 +46,7 @@
-
+
-
-
-
-
-
-
- {{converToScore(c.score)}}分
-
-
-
-
-
-
-
- {{c.teacher}} | {{c.studies}}人已学
-
-
- {{sysTypeName(c.sysType1)}}
- {{sysTypeName(c.sysType2)}}
-
-
-
-
-
+
@@ -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 @@
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;
padding-bottom: 10upx;