提交 91f6334a 编写于 作者: guangjun.yang's avatar guangjun.yang

默认排序问题

上级 87c6996f
<template>
<section>
<GroupTitle :groupNum="groupNum" :showTitle="showTitle" :showOrder="showOrder" @order="orderAction"/>
<GroupTitle ref="courseListGT" :groupNum="groupNum" :showTitle="showTitle" :showOrder="showOrder" @order="orderAction"/>
<div class="hot-teacher">
<!-- <div :class="index>1 && (index+1 == cParmData.length)?'teacher-item item-end' : 'teacher-item'" :key="index" -->
<div :class="index>1 && (index+1 == cParmData.length)?'teacher-item item-end' : 'teacher-item'" :key="index"
......@@ -30,8 +30,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { mapActions, mapGetters } from 'vuex'
import { sortParmData } from '@/utils/index'
import {
m_search_result_course_detail,
......@@ -92,9 +91,15 @@ export default {
})
},
...mapGetters({
cSearchText: 'cSearchText'
cSearchText: 'cSearchText',
orderNum: 'orderNum'
})
},
watch: {
orderNum(val) {
this.orderAction(1, true)
}
},
components: {
GroupTitle
},
......@@ -172,12 +177,17 @@ export default {
})
},
orderAction(orderIndex) {
this.pageBurialPoin({
...m_search_result_course_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
// resetGT() {
// this.$refs.courseListGT.resetShowOrderIndex()
// },
orderAction(orderIndex, notBP) {
if(!notBP) {
this.pageBurialPoin({
...m_search_result_course_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
}
this.searchForOrder('1', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.list = param
})
......
......@@ -81,7 +81,8 @@ export default {
},
computed: {
...mapGetters({
cSearchText: 'cSearchText'
cSearchText: 'cSearchText',
orderNum: 'orderNum'
}),
cParamData() {
if (this.list && this.list.length) {
......@@ -96,6 +97,9 @@ export default {
if (val > 100) {
this.searchForOrder
}
},
orderNum(val) {
this.orderAction(1, true)
}
},
created() {
......@@ -237,12 +241,14 @@ export default {
}
return d;
},
orderAction(orderIndex) {
this.pageBurialPoin({
...m_search_result_five_minutes_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
orderAction(orderIndex, notBP) {
if(!notBP) {
this.pageBurialPoin({
...m_search_result_five_minutes_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
}
this.searchForOrder('2', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.list = param
})
......
......@@ -16,6 +16,7 @@
</section>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
......@@ -44,6 +45,16 @@ export default {
default: false
}
},
computed: {
...mapGetters({
orderNum: 'orderNum'
})
},
watch: {
orderNum(val) {
this.showOrderIndex = 1
}
},
methods: {
toggle() {
this.showTitle = !showTitle
......@@ -52,7 +63,10 @@ export default {
order(index) {
this.showOrderIndex = index
this.$emit('order', index)
}
},
// resetShowOrderIndex(){
// this.showOrderIndex = 1
// }
}
}
</script>
......
......@@ -72,7 +72,8 @@ export default {
},
computed: {
...mapGetters({
cSearchText: 'cSearchText'
cSearchText: 'cSearchText',
orderNum: 'orderNum'
}),
cParamData() {
if (this.list && this.list.length) {
......@@ -82,6 +83,11 @@ export default {
}
}
},
watch: {
orderNum(val) {
this.orderAction(1, true)
}
},
mounted() {
let _this = this
this.token = this.$route.query.userToken || this.$route.query.token
......@@ -154,12 +160,14 @@ export default {
})
},
orderAction(orderIndex) {
this.pageBurialPoin({
...m_search_result_health_cartoon_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
orderAction(orderIndex, notBP) {
if(!notBP) {
this.pageBurialPoin({
...m_search_result_health_cartoon_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
}
this.searchForOrder('4', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.list = param
})
......
......@@ -80,7 +80,8 @@ export default {
computed: {
...mapGetters({
cSearchText: 'cSearchText',
userInfo: 'userInfo'
userInfo: 'userInfo',
orderNum: 'orderNum'
}),
cParamData() {
if (this.list && this.list.length) {
......@@ -90,6 +91,11 @@ export default {
}
}
},
watch: {
orderNum(val) {
this.orderAction(1, true)
}
},
methods: {
//跳转
goToPage(item){
......@@ -171,12 +177,14 @@ export default {
return d
},
orderAction(orderIndex) {
this.pageBurialPoin({
...m_search_result_lecturer_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
orderAction(orderIndex, notBP) {
if(!notBP) {
this.pageBurialPoin({
...m_search_result_lecturer_order,
labelValue: orderIndex,
createdTime: new Date().getTime(),
})
}
this.searchForOrder('3', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.list = param
})
......
......@@ -2,6 +2,7 @@ const getters = {
userInfo: state => state.sousuo.userInfo,
statusBarHeight: state => state.sousuo.statusBarHeight,
cSearchText: state => state.sousuo.cSearchText,
refreshNum: state => state.sousuo.refreshNum
refreshNum: state => state.sousuo.refreshNum,
orderNum: state => state.sousuo.orderNum
}
export default getters
......@@ -3,7 +3,8 @@ const sousuo = {
userInfo: {},
statusBarHeight: {},
cSearchText: '',
refreshNum: 1
refreshNum: 1,
orderNum: 1
},
mutations: {
SET_USER_INFO: (state, userInfo) => {
......@@ -17,7 +18,10 @@ const sousuo = {
},
SET_REFRESH_NUM: (state, refreshNum) => {
state.refreshNum = refreshNum
}
},
SET_ORDER_NUM: (state, orderNum) => {
state.orderNum = orderNum
},
},
actions: {
setUserInfo({ commit }, userInfo) {
......@@ -32,6 +36,9 @@ const sousuo = {
setRefreshNum({ commit }, refreshNum) {
commit('SET_REFRESH_NUM', refreshNum)
},
setOrderNum({ commit }, orderNum) {
commit('SET_ORDER_NUM', orderNum)
},
}
}
......
......@@ -42,7 +42,7 @@
<div class="list-container" v-show="navIndex === '0' && showTab0">
<!-- 课程 -->
<div v-show="showTab1">
<CourseList :parmData="contentAppModels" :groupNum="contentAppModelCount"/>
<CourseList ref="courseListRef" :parmData="contentAppModels" :groupNum="contentAppModelCount"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="1" />
<SplitLine borderWidth="3px"/>
</div>
......@@ -159,9 +159,9 @@ export default {
BackTop
},
computed: {
// ...mapGetters({
// refreshNum: 'refreshNum'
// })
...mapGetters({
orderNum: 'orderNum'
})
},
watch: {
searchText(val){
......@@ -188,7 +188,8 @@ export default {
},
methods: {
...mapActions({
setCSearchText: 'setCSearchText'
setCSearchText: 'setCSearchText',
setOrderNum: 'setOrderNum'
}),
showAllItem(index) {
console.log(typeof index)
......@@ -244,29 +245,31 @@ export default {
console.log('2222', param)
})
}
// _this.$refs.courseListRef.resetGT()
_this.setOrderNum((_this.orderNum + 1))
if(res.data.contentAppModelCount === 0){
this.showTab1 = false
_this.showTab1 = false
}
// 五分钟医学
_this.fiveMinutesMedicalContentList = this.spliceCertenNumData(res.data.fiveMinutesMedicalContentList, 4)
_this.fiveMinutesMedicalContentListAll = this.handelFive(res.data.fiveMinutesMedicalContentList || [])
_this.fiveMinutesMedicalContentList = _this.spliceCertenNumData(res.data.fiveMinutesMedicalContentList, 4)
_this.fiveMinutesMedicalContentListAll = _this.handelFive(res.data.fiveMinutesMedicalContentList || [])
_this.fiveMinutesMedicalContentListCount = res.data.fiveMinutesMedicalContentListCount + ''
if(res.data.fiveMinutesMedicalContentListCount === 0){
this.showTab2 = false
_this.showTab2 = false
}
// 讲师
_this.pCourseDoctorModels = this.spliceCertenNumData(res.data.pCourseDoctorModels, 4)
_this.pCourseDoctorModels = _this.spliceCertenNumData(res.data.pCourseDoctorModels, 4)
_this.pCourseDoctorModelsAll = res.data.pCourseDoctorModels
_this.pCourseDoctorModelCount = res.data.pCourseDoctorModelCount + ''
if(res.data.pCourseDoctorModelCount === 0){
this.showTab3 = false
_this.showTab3 = false
}
// 健康漫画
_this.educationContents = this.spliceCertenNumData(res.data.educationContents, 4)
_this.educationContents = _this.spliceCertenNumData(res.data.educationContents, 4)
_this.educationContentsAll = res.data.educationContents
_this.educationContentCount = res.data.educationContentCount + ''
if(res.data.educationContentCount === 0){
this.showTab4 = false
_this.showTab4 = false
}
}
})
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册