提交 148811af 编写于 作者: 杨广俊's avatar 杨广俊

重新排序

上级 0f5c2ee3
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
import { sortParmData } from '@/utils/index' import { sortParmData } from '@/utils/index'
import { import {
m_search_result_five_minutes_detail, m_search_result_five_minutes_detail,
...@@ -41,6 +42,7 @@ import { ...@@ -41,6 +42,7 @@ import {
} from '@/utils/buryingPoint' } from '@/utils/buryingPoint'
import { pageJumpUrl } from '@/utils/index' import { pageJumpUrl } from '@/utils/index'
import GroupTitle from '@/components/business/group-title'; import GroupTitle from '@/components/business/group-title';
import { mapGetters } from 'vuex';
export default { export default {
name: 'YqyFiveMinutes', name: 'YqyFiveMinutes',
...@@ -67,24 +69,23 @@ export default { ...@@ -67,24 +69,23 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
searchText: {
type: String,
default: ''
},
showOrder: { showOrder: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
computed: { computed: {
...mapGetters({
cSearchText: 'cSearchText'
}),
// compParmData() { // compParmData() {
// return this.handelFive(this.parmData) // return this.handelFive(this.parmData)
// } // }
}, },
// watch: {
// parmData: {
// handler(curVal, oldVal){
// return curVal
//        },
//        deep: true
// }
// },
created() { created() {
let _this = this; let _this = this;
//暂停 //暂停
...@@ -103,17 +104,13 @@ export default { ...@@ -103,17 +104,13 @@ export default {
}, },
mounted() { mounted() {
// this.getFiveData()
}, },
methods: { methods: {
goToPage(item) { goToPage(item) {
let obj = { let obj = {
} }
///console.log(item);
// let url = pageJumpUrl();
// console.log(url.pageListUrl);
let itemData = { let itemData = {
"imageUrl": "", "imageUrl": "",
"appModuleInfo": { "appModuleInfo": {
...@@ -221,23 +218,6 @@ export default { ...@@ -221,23 +218,6 @@ export default {
}) })
}, },
//五分钟医学院
getFiveData() {
let _this = this,
parm = {
pageNo: 1,
pageSize: 4,
data: {
setEntry: 'headers'
}
}
this.API_GET('contents/fiveMinutes/contents', parm).then(res => {
if (res.respCode == '200') {
_this.list = _this.handelFive(res.fiveMinutesMedicalContentList) || []
}
})
},
//处理五分钟数据 初始化播放状态 //处理五分钟数据 初始化播放状态
handelFive(d) { handelFive(d) {
for (let i = 0; i < d.length; i++) { for (let i = 0; i < d.length; i++) {
...@@ -251,11 +231,7 @@ export default { ...@@ -251,11 +231,7 @@ export default {
labelValue: orderIndex, labelValue: orderIndex,
createdTime: new Date().getTime(), createdTime: new Date().getTime(),
}) })
if(orderIndex == 1) { this.searchForOrder('2', this.cSearchText, orderIndex, this.groupNum, this.parmData)
this.parmData = sortParmData(this.parmData, 'joinNum', -1)
} else {
this.parmData = sortParmData(this.parmData, 'publishTime', -1)
}
} }
}, },
......
const getters = { const getters = {
userInfo: state => state.sousuo.userInfo, userInfo: state => state.sousuo.userInfo,
navBarHeight: state => state.sousuo.navBarHeight navBarHeight: state => state.sousuo.navBarHeight,
cSearchText: state => state.sousuo.cSearchText
} }
export default getters export default getters
const sousuo = { const sousuo = {
state: { state: {
userInfo: {}, userInfo: {},
navBarHeight: {} navBarHeight: {},
cSearchText: ''
}, },
mutations: { mutations: {
SET_USER_INFO: (state, userInfo) => { SET_USER_INFO: (state, userInfo) => {
...@@ -11,6 +12,10 @@ const sousuo = { ...@@ -11,6 +12,10 @@ const sousuo = {
SET_NAVBAR_HEIGHT: (state, navBarHeight) => { SET_NAVBAR_HEIGHT: (state, navBarHeight) => {
console.log(state, navBarHeight); console.log(state, navBarHeight);
state.navBarHeight = navBarHeight state.navBarHeight = navBarHeight
},
SET_C_SEARCH_TEXT: (state, cSearchText) => {
console.log('SET_C_SEARCH_TEXT cSearchText', cSearchText)
state.cSearchText = cSearchText
} }
}, },
actions: { actions: {
...@@ -20,6 +25,10 @@ const sousuo = { ...@@ -20,6 +25,10 @@ const sousuo = {
setNavBarHeight({ commit }, navBarHeight) { setNavBarHeight({ commit }, navBarHeight) {
commit('SET_NAVBAR_HEIGHT', navBarHeight) commit('SET_NAVBAR_HEIGHT', navBarHeight)
}, },
setCSearchText({ commit }, cSearchText) {
console.log('setCSearchText cSearchText', cSearchText)
commit('SET_C_SEARCH_TEXT', cSearchText)
},
} }
} }
......
...@@ -88,6 +88,41 @@ module.exports = { ...@@ -88,6 +88,41 @@ module.exports = {
return '' return ''
}, },
searchForOrder(searchCategory = '1', searchValue = '', sortItem = 1, pageSize = 10, sourceData = []) {
let str2 = (searchValue || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符
let _this = this,
para = {
searchCategory: searchCategory,
searchValue: str2,
keywordColor: 'rgba(244,122,72,1)',
sortItem: sortItem,
pageNo: 1,
pageSize: pageSize,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => {
// _this.searchText = ''
if (res.code == '000000') {
// 课程
if(searchCategory.indexOf('1') > 0) {
sourceData = res.data.contentAppModels
}
if(searchCategory.indexOf('2') > 0) {
sourceData = this.handelFive(res.data.fiveMinutesMedicalContentList || [])
}
if(searchCategory.indexOf('3') > 0) {
sourceData = res.data.pCourseDoctorModels
}
if(searchCategory.indexOf('4') > 0) {
sourceData = res.data.educationContents
}
}
})
},
setEventByModuleCode(itemData){ setEventByModuleCode(itemData){
console.log(itemData); console.log(itemData);
let modeCode = itemData.appModuleInfo.code || ''; let modeCode = itemData.appModuleInfo.code || '';
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<!-- 五分钟医学 --> <!-- 五分钟医学 -->
<div v-show="showTab2"> <div v-show="showTab2">
<FiveMinutes :parmData="fiveMinutesMedicalContentList" :groupNum="fiveMinutesMedicalContentListCount"/> <FiveMinutes :parmData="fiveMinutesMedicalContentList" :groupNum="fiveMinutesMedicalContentListCount" :searchText="searchTextSub"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="2" /> <ShowAllItem @showAllItem="showAllItem" itemIndex="2" />
<SplitLine borderWidth="3px"/> <SplitLine borderWidth="3px"/>
</div> </div>
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex'
import { import {
m_search_search, m_search_search,
m_search_result_tab_switch m_search_result_tab_switch
...@@ -116,6 +117,7 @@ export default { ...@@ -116,6 +117,7 @@ export default {
showLoading: false, showLoading: false,
hasResult: true, hasResult: true,
searchText: '', searchText: '',
searchTextSub: '',
// selected: '0', // selected: '0',
contentAppModelCount: '0', contentAppModelCount: '0',
contentAppModels: [], contentAppModels: [],
...@@ -155,6 +157,10 @@ export default { ...@@ -155,6 +157,10 @@ export default {
BackTop BackTop
}, },
watch: { watch: {
searchText(val){
console.log(val)
this.searchTextSub = val
}
// selected(val) { // selected(val) {
// this.showIndex(val) // this.showIndex(val)
// // this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll') // // this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll')
...@@ -184,6 +190,9 @@ export default { ...@@ -184,6 +190,9 @@ export default {
// this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll') // this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll')
}, },
methods: { methods: {
...mapActions({
setCSearchText: 'setCSearchText'
}),
showAllItem(index) { showAllItem(index) {
console.log(typeof index) console.log(typeof index)
this.navIndex = index this.navIndex = index
...@@ -203,6 +212,7 @@ export default { ...@@ -203,6 +212,7 @@ export default {
}) })
this.showLoading = true this.showLoading = true
let str2 = (this.searchText || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符 let str2 = (this.searchText || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符
this.setCSearchText(str2)
let _this = this, let _this = this,
para = { para = {
searchCategory: '1,2,3,4', searchCategory: '1,2,3,4',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册