mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 17:36:45 +08:00
最新最热的切铁控制调整
This commit is contained in:
@@ -114,8 +114,8 @@
|
||||
</u-scroll-list>
|
||||
</view> -->
|
||||
<view class="tab-qa">
|
||||
<text class="qa-tab-text" :class="{'qa-active':tabIndex==1}" @click="clicktab(1)">最热</text>
|
||||
<text class="qa-tab-text" :class="{'qa-active':tabIndex==0}" @click="clicktab(0)">最新</text>
|
||||
<text class="qa-tab-text" :class="{'qa-active':qaTabIndex==1}" @click="clickQaTab(1)">最热</text>
|
||||
<text class="qa-tab-text" :class="{'qa-active':qaTabIndex==0}" @click="clickQaTab(0)">最新</text>
|
||||
</view>
|
||||
<view class="qa" v-for="(item,irs) in qaList" :key="irs">
|
||||
<view class="content">
|
||||
@@ -198,7 +198,8 @@
|
||||
courseList:[],//课程列表数据
|
||||
articleList: [],//文章列表数据
|
||||
qaList: [],//问答列表数据
|
||||
tabIndex: 1,
|
||||
tabIndex: 1,//文章最新,最热的切换
|
||||
qaTabIndex:1,//问答最新/最热的切换
|
||||
conType: 0,
|
||||
loadStatus: 'more',
|
||||
pageSize:20,//统一每页多少条
|
||||
@@ -401,7 +402,7 @@
|
||||
isResolve:'',
|
||||
status:1
|
||||
};
|
||||
if(this.tabIndex==0){
|
||||
if(this.qaTabIndex==0){
|
||||
queryObj.orderField='id';
|
||||
}else{
|
||||
queryObj.orderField='answers';
|
||||
@@ -464,11 +465,18 @@
|
||||
type:''
|
||||
}
|
||||
query.type=this.dataFilter.courseParams.type;
|
||||
if(this.tabIndex==0){
|
||||
query.orderField='id';
|
||||
}else{
|
||||
// if(this.tabIndex==0){
|
||||
// query.orderField='publishTime';
|
||||
// }else{
|
||||
// query.orderField='studys';
|
||||
// }
|
||||
// 2022-11 课程无最新,最热区分,推荐就 是最热,列表就是最新
|
||||
if(this.conType==0){
|
||||
query.orderField='studys';
|
||||
}else if(this.conType==1){
|
||||
query.orderField='publishTime';
|
||||
}
|
||||
|
||||
if(this.dataFilter.courseParams.scenes){
|
||||
query.scenes=this.dataFilter.courseParams.scenes;
|
||||
}
|
||||
@@ -566,6 +574,9 @@
|
||||
},
|
||||
changeList(){
|
||||
this.dataName='list'+this.tabIndex+this.conType;
|
||||
if(this.conType == 4){
|
||||
this.dataName='list'+this.qaTabIndex+this.conType;
|
||||
}
|
||||
let curData=this.dataList[this.dataName];
|
||||
if(curData.list.length==0){
|
||||
if(this.conType== 1) {// 课程
|
||||
@@ -594,6 +605,11 @@
|
||||
this.noPageList= true,//判断接口是否还有数据
|
||||
this.noDataList= true,//判断接口是否还有数据
|
||||
this.changeList();
|
||||
},
|
||||
clickQaTab(idx) {
|
||||
this.qaTabIndex = idx;
|
||||
this.noPageList= true,//判断接口是否还有数据
|
||||
this.noDataList= true,//判断接口是否还有数据
|
||||
this.changeList();
|
||||
},
|
||||
changeConType(item) {
|
||||
|
||||
Reference in New Issue
Block a user