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

getStatusBarHeight

上级 148811af
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { sortParmData } from '@/utils/index' import { sortParmData } from '@/utils/index'
import { import {
m_search_result_course_detail1, m_search_result_course_detail1,
...@@ -75,7 +77,13 @@ export default { ...@@ -75,7 +77,13 @@ export default {
}, },
computed: { computed: {
cParmData() { cParmData() {
return this.parmData.map(function(item){ let cCourseList = []
if (this.list && this.list.length) {
cCourseList = this.list
} else {
cCourseList = this.parmData
}
return cCourseList.map(function(item){
let cItem = Object.assign({}, item) let cItem = Object.assign({}, item)
if(cItem.highLightField) { if(cItem.highLightField) {
cItem.highLightName = cItem.highLightName + ' (' + mapDesc[cItem.highLightField] + ')' cItem.highLightName = cItem.highLightName + ' (' + mapDesc[cItem.highLightField] + ')'
...@@ -83,10 +91,11 @@ export default { ...@@ -83,10 +91,11 @@ export default {
return cItem return cItem
}) })
}, },
// groupNum() { ...mapGetters({
// return this.parmData.length + '' cSearchText: 'cSearchText'
// } })
}, },
components: { components: {
GroupTitle GroupTitle
}, },
...@@ -223,11 +232,9 @@ export default { ...@@ -223,11 +232,9 @@ export default {
labelValue: orderIndex, labelValue: orderIndex,
createdTime: new Date().getTime(), createdTime: new Date().getTime(),
}) })
if(orderIndex == 1) { this.searchForOrder('1', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.parmData = sortParmData(this.parmData, 'joinNum', -1) this.list = param
} else { })
this.parmData = sortParmData(this.parmData, 'modifyTime', -1)
}
} }
} }
} }
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
<section> <section>
<GroupTitle groupTitle="5分钟医学院" :groupNum="groupNum" :showTitle="showTitle" :showOrder="showOrder" @order="orderAction"/> <GroupTitle groupTitle="5分钟医学院" :groupNum="groupNum" :showTitle="showTitle" :showOrder="showOrder" @order="orderAction"/>
<div class="hot-teacher"> <div class="hot-teacher">
<div :class="index>1 && (index+1 == parmData.length)?'teacher-item item-end' : 'teacher-item'" :key="index" <div :class="index>1 && (index+1 == cParamData.length)?'teacher-item item-end' : 'teacher-item'" :key="index"
v-for="(item,index) in parmData" @click="goToPage(item)"> v-for="(item,index) in cParamData" @click="goToPage(item)">
<div class="teacher-itemimg"> <div class="teacher-itemimg">
<img :src="item.appImageUrl"/> <img v-show="index < 6" :src="item.appImageUrl"/>
<img v-show="index >= 6" v-lazy="item.appImageUrl"/>
</div> </div>
<div class="five-text"> <div class="five-text">
<div class="teacher-itemname fs14" v-html="item.highLightTitle">{{item.title}}</div> <div class="teacher-itemname fs14" v-html="item.highLightTitle">{{item.title}}</div>
...@@ -33,7 +34,8 @@ ...@@ -33,7 +34,8 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapGetters } 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,
...@@ -42,13 +44,12 @@ import { ...@@ -42,13 +44,12 @@ 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',
data() { data() {
return { return {
// list: [], list: [],
isPlay: false, isPlay: false,
id: '' id: ''
} }
...@@ -82,9 +83,20 @@ export default { ...@@ -82,9 +83,20 @@ export default {
...mapGetters({ ...mapGetters({
cSearchText: 'cSearchText' cSearchText: 'cSearchText'
}), }),
// compParmData() { cParamData() {
// return this.handelFive(this.parmData) if (this.list && this.list.length) {
// } return this.list
} else {
return this.parmData
}
}
},
watch: {
groupNum(val) {
if (val > 100) {
this.searchForOrder
}
}
}, },
created() { created() {
let _this = this; let _this = this;
...@@ -231,7 +243,9 @@ export default { ...@@ -231,7 +243,9 @@ export default {
labelValue: orderIndex, labelValue: orderIndex,
createdTime: new Date().getTime(), createdTime: new Date().getTime(),
}) })
this.searchForOrder('2', this.cSearchText, orderIndex, this.groupNum, this.parmData) this.searchForOrder('2', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.list = param
})
} }
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="teach-opt"> <div class="teach-opt">
<div class="teach-list"> <div class="teach-list">
<div :class="index%2==1 ? 'list-item mr0':'list-item'" <div :class="index%2==1 ? 'list-item mr0':'list-item'"
v-for="(item, index) in parmData" :key="index" v-for="(item, index) in cParamData" :key="index"
@click="goToPage(item)"> @click="goToPage(item)">
<div class="tea-img" :style="'background:'+ item.bgColor"> <div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.imageUrl"> <img :src="item.imageUrl">
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { sortParmData } from '@/utils/index' import { sortParmData } from '@/utils/index'
import { import {
m_search_result_health_cartoon_detail, m_search_result_health_cartoon_detail,
...@@ -34,6 +36,19 @@ import { ...@@ -34,6 +36,19 @@ import {
} from '@/utils/buryingPoint' } from '@/utils/buryingPoint'
import GroupTitle from '@/components/business/group-title'; import GroupTitle from '@/components/business/group-title';
export default { export default {
data() {
return {
topTitle: '讲师集',
isScroll: false,
token: '',
list: [],
isShowCount: true,
followCount: 0,
studyCount: 0,
col: 1, //0综合,1人气,2资源数,3姓名首字母
dir: 2, //1:正序 2:逆序
}
},
components: { components: {
GroupTitle GroupTitle
}, },
...@@ -56,21 +71,15 @@ export default { ...@@ -56,21 +71,15 @@ export default {
} }
}, },
computed: { computed: {
// groupNum() { ...mapGetters({
// return this.parmData.length + '' cSearchText: 'cSearchText'
// } }),
}, cParamData() {
data() { if (this.list && this.list.length) {
return { return this.list
topTitle: '讲师集', } else {
isScroll: false, return this.parmData
token: '', }
list: [],
isShowCount: true,
followCount: 0,
studyCount: 0,
col: 1, //0综合,1人气,2资源数,3姓名首字母
dir: 2, //1:正序 2:逆序
} }
}, },
mounted() { mounted() {
...@@ -151,11 +160,9 @@ export default { ...@@ -151,11 +160,9 @@ export default {
labelValue: orderIndex, labelValue: orderIndex,
createdTime: new Date().getTime(), createdTime: new Date().getTime(),
}) })
if(orderIndex == 1) { this.searchForOrder('4', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.parmData = sortParmData(this.parmData, 'joinNum', -1) this.list = param
} else { })
this.parmData = sortParmData(this.parmData, 'modifyTime', -1)
}
} }
} }
......
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
.history-labels { .history-labels {
width: 100%; width: 100%;
padding: 0 px2rem(15px) 0; padding: 0 px2rem(15px) 0;
margin-bottom: px2rem(6px); margin-bottom: px2rem(20px);
background-color: #fff; background-color: #fff;
&-title { &-title {
display: inline-flex; display: inline-flex;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div class="font-style"> <div class="font-style">
<div class="teach-opt"> <div class="teach-opt">
<div class="teach-list"> <div class="teach-list">
<div :class="index%2==1?'list-item mr0':'list-item'" <div :class="index % 2 == 1 ? 'list-item mr0' : 'list-item'"
v-for="(item, index) in parmData" :key="index" v-for="(item, index) in cParamData" :key="index"
@click="goToDetail(item)"> @click="goToDetail(item)">
<div class="tea-img" :style="'background:'+ item.bgColor"> <div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.appImageUrl"> <img :src="item.appImageUrl">
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { sortParmData } from '@/utils/index' import { sortParmData } from '@/utils/index'
import { import {
m_search_result_lecturer_detail, m_search_result_lecturer_detail,
...@@ -34,9 +36,6 @@ import { ...@@ -34,9 +36,6 @@ import {
} from '@/utils/buryingPoint' } from '@/utils/buryingPoint'
import GroupTitle from '@/components/business/group-title'; import GroupTitle from '@/components/business/group-title';
export default { export default {
components: {
GroupTitle
},
data() { data() {
return { return {
topTitle: '讲师集', topTitle: '讲师集',
...@@ -50,6 +49,9 @@ export default { ...@@ -50,6 +49,9 @@ export default {
dir: 2, //1:正序 2:逆序 dir: 2, //1:正序 2:逆序
} }
}, },
components: {
GroupTitle
},
props: { props: {
parmData: { parmData: {
type: Array, type: Array,
...@@ -85,9 +87,16 @@ export default { ...@@ -85,9 +87,16 @@ export default {
}, },
computed: { computed: {
// groupNum() { ...mapGetters({
// return this.parmData.length + '' cSearchText: 'cSearchText'
// } }),
cParamData() {
if (this.list && this.list.length) {
return this.list
} else {
return this.parmData
}
}
}, },
methods: { methods: {
handleScroll: function () { handleScroll: function () {
...@@ -166,11 +175,9 @@ export default { ...@@ -166,11 +175,9 @@ export default {
labelValue: orderIndex, labelValue: orderIndex,
createdTime: new Date().getTime(), createdTime: new Date().getTime(),
}) })
if(orderIndex == 1) { this.searchForOrder('3', this.cSearchText, orderIndex, this.groupNum, this.parmData).then( param => {
this.parmData = sortParmData(this.parmData, 'joinNum', -1) this.list = param
} else { })
this.parmData = sortParmData(this.parmData, 'modifyTime', -1)
}
} }
} }
......
...@@ -87,8 +87,16 @@ module.exports = { ...@@ -87,8 +87,16 @@ module.exports = {
} }
return '' return ''
}, },
//处理五分钟数据 初始化播放状态
handelFive(d) {
for (let i = 0; i < d.length; i++) {
d[i].play = '0';
}
return d;
},
searchForOrder(searchCategory = '1', searchValue = '', sortItem = 1, pageSize = 10, sourceData = []) { // 根据条件排序
async searchForOrder(searchCategory = '1', searchValue = '', sortItem = 1, pageSize = 10, sourceData = []) {
let str2 = (searchValue || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符 let str2 = (searchValue || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符
let _this = this, let _this = this,
para = { para = {
...@@ -103,24 +111,27 @@ module.exports = { ...@@ -103,24 +111,27 @@ module.exports = {
} }
let url = 'contents/searchKeyword/searchContent' let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => { let csourceData = await this.GET(url, para).then(res => {
// _this.searchText = '' // _this.searchText = ''
if (res.code == '000000') { if (res.code == '000000') {
// 课程 // 课程
if(searchCategory.indexOf('1') > 0) { if(searchCategory.indexOf('1') > 0) {
sourceData = res.data.contentAppModels sourceData = (res.data && res.data.contentAppModels) || []
} }
if(searchCategory.indexOf('2') > 0) { if(searchCategory.indexOf('2') > 0) {
// sourceData = []
sourceData = this.handelFive(res.data.fiveMinutesMedicalContentList || []) sourceData = this.handelFive(res.data.fiveMinutesMedicalContentList || [])
} }
if(searchCategory.indexOf('3') > 0) { if(searchCategory.indexOf('3') > 0) {
sourceData = res.data.pCourseDoctorModels sourceData = (res.data && res.data.pCourseDoctorModels) || []
} }
if(searchCategory.indexOf('4') > 0) { if(searchCategory.indexOf('4') > 0) {
sourceData = res.data.educationContents sourceData = res.data.educationContents
} }
} }
return sourceData || []
}) })
return csourceData
}, },
setEventByModuleCode(itemData){ setEventByModuleCode(itemData){
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
import { Swipe, SwipeItem ,Header} from 'mint-ui'; import { Swipe, SwipeItem ,Header} from 'mint-ui';
// import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
// import pullRefresh from '../components/common/pullrefresh' // import pullRefresh from '../components/common/pullrefresh'
import {mapState, mapMutations} from 'vuex'
import BackTop from '../components/common/backTop'; import BackTop from '../components/common/backTop';
import YqyTeacherList from '../components/business-new/yqy-teacher-list'; import YqyTeacherList from '../components/business-new/yqy-teacher-list';
import YqyTopEvaluat from '../components/business-new/yqy-home-learn-evaluation'; import YqyTopEvaluat from '../components/business-new/yqy-home-learn-evaluation';
...@@ -310,9 +309,6 @@ export default { ...@@ -310,9 +309,6 @@ export default {
}, },
methods:{ methods:{
...mapMutations([
'SET_DATA'
]),
goToPage(){ goToPage(){
this.$router.push({ this.$router.push({
path: '/search' path: '/search'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<button v-show="false" type="submit" /> <button v-show="false" type="submit" />
</form> </form>
<div class="mt-80"></div>
<!-- <SplitLine /> --> <!-- <SplitLine /> -->
<!-- <div class="mt-100"></div> --> <!-- <div class="mt-100"></div> -->
<HistoryLabels/> <HistoryLabels/>
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
</template> </template>
<script> <script>
import {mapState, mapMutations} from 'vuex'
import SearchHeader from '../components/business/search-header'; import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line'; import SplitLine from '../components/business/split-line';
import HistoryLabels from '../components/business/history-labels'; import HistoryLabels from '../components/business/history-labels';
...@@ -54,9 +52,7 @@ export default { ...@@ -54,9 +52,7 @@ export default {
}, },
computed:{ computed:{
...mapState([
'sousuo'
])
}, },
created() { created() {
let _self = this; let _self = this;
...@@ -66,18 +62,17 @@ export default { ...@@ -66,18 +62,17 @@ export default {
// _self.SET_USER_INFO(params) // _self.SET_USER_INFO(params)
_self.getData() _self.getData()
} }
// window.__isFirstTime = function(param) { window.__getStatusBarHeight = function (param) {
// alert(JSON.stringify(param)) alert('__getStatusBarHeight: ' + JSON.stringify(param))
// if(param.isFirst === 'true') { // if (window.__isAndroid) {
// _self.needShowFirstTime = true // _this.popHeight = parseInt(parm.statusBarHeight) / 2
// rocNative.setFirstTime({ // } else {
// projectName: 'YQY_PROJECT_SOUSUO_1', // _this.popHeight = parm.statusBarHeight
// isFirst: 'faalse' // }
// }) // _this.ptop = _this.popHeight + 'px';
// } else { // _this.menuptop = _this.popHeight + 36 + 'px'
// _self.needShowFirstTime = false }
// } this.getStatusBarHeight()
// }
}, },
mounted(){ mounted(){
// window.__refresh = function(){ // window.__refresh = function(){
...@@ -109,9 +104,9 @@ export default { ...@@ -109,9 +104,9 @@ export default {
// _self.getStatusBarHeight() // _self.getStatusBarHeight()
}, },
methods: { methods: {
...mapMutations([ // ...mapMutations([
'SET_USER_INFO', 'SET_NAVBAR_HEIGHT' // 'SET_USER_INFO', 'SET_NAVBAR_HEIGHT'
]), // ]),
// 跳转到结果页面,并 // 跳转到结果页面,并
search() { search() {
// if(!this.searchText) return; // if(!this.searchText) return;
...@@ -262,6 +257,9 @@ export default { ...@@ -262,6 +257,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../style/mixin.scss'; @import '../style/mixin.scss';
@import '../style/global.scss'; @import '../style/global.scss';
.mt-80 {
padding-top: px2rem(60px);
}
.mt-100 { .mt-100 {
padding-top: px2rem(63px) !important; padding-top: px2rem(63px) !important;
} }
...@@ -273,14 +271,14 @@ export default { ...@@ -273,14 +271,14 @@ export default {
} }
.search-container { .search-container {
display: flex; display: flex;
position: relative; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 3; z-index: 3;
width: 100%; width: 100%;
flex-direction: row; flex-direction: row;
text-align: center; text-align: center;
padding: px2rem(10px) 0; padding: px2rem(10px) 0 px2rem(4px);
background: #fff; background: #fff;
border-bottom: 1px solid #E7E7E7; border-bottom: 1px solid #E7E7E7;
&-img { &-img {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册