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

代码整理 hlab

上级 6f229625
无法预览此类型文件
此差异已折叠。
<template>
<section>
<GroupTitle :groupNum="groupNum" />
<div class="cource-teach">
<div class="couse-list">
<div
:class="index % 2 == 1 ? 'course-item end-left' : 'course-item'"
v-for="(item, index) in parmData" :key="index">
<div class="course-pic" @click="goToPage(item)">
<img :src="item.courseInfoUrl" class="pic-tec" />
<span class="course-tag">{{item.disName}}</span>
</div>
<p class="course-txt">
{{item.name}}
</p>
<div class="course-opt">
<span class="opt-info">{{!item.showTime ? '' : item.showTime + ' |'}} {{item.joinNum}}人已学</span>
<span :class="item.whetherFavors==2?'opt collect':'opt collected'"@click="collectFun(item.whetherFavors,item.id,item.name)">
{{item.whetherFavors==2?'收藏':'已收藏'}}
</span>
</div>
</div>
</div>
<div v-if="parmData.length==0" class="noSource">暂无最新教程数据</div>
</div>
</section>
</template>
<script>
//import { setEventByModuleCode } from '@/utils/index'
import GroupTitle from '@/components/business/group-title';
export default {
name: 'CourseList',
data() {
return {
list: [],
title: '最新课程',
pageNo: 1,
pageSize: 6,
needShow: true
// parmData: []
}
},
props: {
userToken: {
type: String,
default: ''
},
parmData: {
type: Array,
default: () => []
},
groupNum: {
type: String,
default: '0'
}
},
computed: {
cParmData() {
return this.parmData
},
// groupNum() {
// return this.parmData.length + ''
// }
},
components: {
GroupTitle
},
mounted() {
// this.getData()
// this.list = this.parmData;
},
methods: {
showAllItem(index) {
// this.needShow = !this.needShow
},
//跳转
goToPage(item) {
this.$emit("setRefrshParm", {
isclick: true
})
this.pageBurialPoin({
menuLevel: 1,
menuCode: 'm_home',
functionCode: 'f_new_course',
actionCode: 'c_course',
labelId: item.id,
labelValue: item.name,
})
let itemData = {};
if (item == '') {
itemData = {
"title": item.name,
"imageUrl": "",
"appModuleInfo": {
"code": "M200",
"type": 4,
"name": "课程介绍页",
"paramFlag": 1,
"paramList": [{
"key": "className",
"value": "com.picahealth.yunque.activitys.famousteacherschool.AllDiseaseActivity###MicroProfessionMoreTableController",
"type": 4,
"seqNo": 1
},
{
"key": "disCategoryId",
"value": '-1',
"type": 1,
"seqNo": 2
}
]
}
};
} else {
itemData = {
"title": item.name,
"imageUrl": "",
"appModuleInfo": {
"code": "M200",
"type": 4,
"name": "课程介绍页",
"paramFlag": 1,
"paramList": [{
"key": "className",
"value": "com.picahealth.yunque.activitys.courseplaynew.CourseIntroduceActivity###WeexCourseIntroViewController",
"type": 4,
"seqNo": 1
},
{
"key": "courseId",
"value": `${item.id}`,
"type": 1,
"seqNo": 2
}
]
}
};
}
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//收藏 取消收藏
collectFun(status, id, name) {
// alert(this.userToken)
status = status == 1 ? 2 : 1;
this.pageBurialPoin({
menuLevel: 1,
menuCode: 'm_home',
functionCode: 'f_new_course',
actionCode: 'c_collect',
labelId: id,
labelValue: name,
})
let _this = this,
parm = {
token: _this.userToken,
type: status,
courseId: id,
setEntry: 'headers'
}
_this.POST('contents/favors', parm).then(function (res) {
if (res.code === '000000') {
_this.handelData(id, status);
} else {
rocNative.showNativeToast({
message: '注册登陆后才能收藏哦'
})
}
})
},
handelData(id, status) {
let d = this.parmData;
for (let i = 0; i < d.length; i++) {
if (id == d[i].id) {
d[i].whetherFavors = status;
}
}
},
getData() {
//alert("最新课程");
let _this = this,
parm = {
pageNo: _this.pageNo,
pageSize: _this.pageSize,
token: _this.userToken,
setEntry: 'headers'
}
_this.GET('/contents/HomeNewCourse/NewCourseInformation', parm).then(function (res) {
if (res.code === '000000') {
_this.parmData = res.data.contentAppModels || [];
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '../../style/global.scss';
@import '../../style/mixin.scss';
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
width: px2rem(170px);
}
.couse-list {
overflow: hidden;
}
.get-more {
border: 1px solid RGBA(169, 174, 183, 0.5);
border-radius: px2rem(16px);
padding: 0 px2rem(5px) 0 px2rem(6px);
vertical-align: middle;
display: inline-block;
float: right;
margin-top: px2rem(3px);
height: px2rem(16px);
line-height: px2rem(16px);
font-size: px2rem(11px);
}
.thorw-icon {
width: px2rem(8px);
height: px2rem(8px);
}
.noSource {
text-align: center;
font-size: px2rem(13px);
padding: px2rem(13px) 0;
color: #999;
}
.cource-teach {
padding: 0 px2rem(15px);
}
.course-item {
float: left;
margin-bottom: px2rem(19px);
margin-right: px2rem(5px);
}
.end-left {
margin-right: 0;
}
.course-pic {
width: px2rem(170px);
height: px2rem(95px);
border-radius: px2rem(3px);
position: relative;
.pic-tec {
width: 100%;
height: 100%;
border-radius: px2rem(3px);
display: block;
}
.course-tag {
position: absolute;
display: inline-block;
top: px2rem(5px);
left: px2rem(5px);
line-height: px2rem(16px);
height: px2rem(16px);
color: #4A87D4;
padding: 0 px2rem(3px);
background: #FAFCFF;
border: 1px solid #C3DCFB;
font-size: px2rem(10px);
border-radius: px2rem(2px);
}
}
.course-txt {
margin-top: px2rem(5px);
font-size: px2rem(14px);
line-height: px2rem(19px);
max-height: px2rem(38px);
color: #333;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
width: px2rem(170px);
}
.opt-info {
color: #999;
}
.course-opt {
font-size: px2rem(12px);
/* margin-top: px2rem(6px);*/
position: relative;
.opt {
display: inline-block;
top: 0;
right: 0;
position: absolute;
height: px2rem(18px);
line-height: px2rem(18px);
padding: 0 px2rem(4px);
}
.collect {
background: #F7F8F9;
color: #666;
}
.collected {
color: #F47A48;
background: RGBA(244, 122, 72, 0.04);
}
}
.title {
font-size: px2rem(18px);
height: px2rem(18px);
margin: 0 0 px2rem(21px) 0;
font-weight: bold;
color: #28344C
}
</style>
此差异已折叠。
此差异已折叠。
<template>
<section class="group-title">
<span class="group-title-name">{{groupTitle}} </span>
<span v-show="isShowNum"> ({{groupNum}})</span>
</section>
</template>
<script>
export default {
data() {
return {
}
},
props: {
groupTitle: {
type: String,
default: '课程'
},
isShowNum: {
type: Boolean,
default: true
},
groupNum: {
type: String,
default: "0"
}
}
}
</script>
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.group-title {
margin-left: px2rem(15px);
display: flex;
flex-direction: row;
&-name {
margin-right: px2rem(6px);
}
span {
padding: px2rem(20px) 0 px2rem(15px);
font-size: px2rem(18px);
font-weight: 500;
color: #28344C;
}
}
</style>
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
}, },
created() { created() {
let _self = this; let _self = this;
window.__getUserInfo = function(params){ window.__getUserInfo_HL = function(params){
_self.token = params.userToken _self.token = params.userToken
_self.getData() _self.getData()
} }
...@@ -151,7 +151,7 @@ export default { ...@@ -151,7 +151,7 @@ export default {
}, },
getUserInfo: function () { getUserInfo: function () {
// alert('in hist getUserInfo') // alert('in hist getUserInfo')
rocNative.getUserInfo({'__funcName': '__getUserInfo'}) rocNative.getUserInfo({'__funcName': '__getUserInfo_HL'})
}, },
confirmDelete() { confirmDelete() {
this.showConfirm = true this.showConfirm = true
......
<template>
<div id="search-top" :style="{height:menuptop}">
<div class="search-menu">
<div class="search-transparent search">
<input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" />
<img class="search-img" src='../../images/search-grey.png'>
</div>
<div class="bgFill" :style="{height:ptop}"></div>
<div class="fixBox">
<div class="header-right" @click="goToPage">
取消
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return {
placeholder: '即将上线,敬请期待',
disabled: 'disabled',
searchVal: '',
isTransparent: false, //更改颜色 背景
isMax: false,//消息数量是否大于99
count: '',
isShowMsg: true,
ptop: 0,
menuptop: 0,
popHeight: 0
}
},
props:{
msgCount:{
type:String,
default:''
},
statusBarHeight:{
type:Number,
default:0
},
searchFix:{
type: Boolean,
default: false,
}
},
watch:{
// searchFix:function(n){
// if(n){
// alert(this.searchFix)
// }
// }
},
created(){
let _this = this;
window.__getStatusBarHeight = function(parm){
//lert(parm.statusBarHeight)
if(window.__isAndroid){
_this.popHeight = parseInt(parm.statusBarHeight)/2.5
}else{
_this.popHeight = parm.statusBarHeight
}
_this.ptop = _this.popHeight+'px';
_this.menuptop = _this.popHeight+'px'
// alert(parm.statusBarHeight);
}
this.getStatusHight()
},
mounted(){
// this.getStatusHight();
// if(window.__isAndroid){
// this.popHeight = this.statusBarHeight/2
// }else{
// this.popHeight = this.statusBarHeight
// }
// this.count = this.msgCount;
// this.ptop = this.popHeight+7+'px';
// this.menuptop = this.popHeight+7+'px'
// console.log(this.statusBarHeight);
// if(this.msgCount == ''){
// this.isShowMsg = false
// }
// if(this.count>=99){
// this.count += '+';
// this.isMax = true
// }
},
methods: {
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
})
rocNative.readMessage();
}
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
@import '../../style/global.scss';
.search-transparent{
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.5);
color: #fff;
}
.search-transparent::-webkit-input-placeholder{
color:#fff;
}
.white{
color: #fff;
}
.header-right{
width: px2rem(20px);
height: px2rem(20px);
// position: relative;
// margin-top: px2rem(5px);
float: right;
font-size: px2rem(5px);
// img {
// width: 100%;
// height: 100%;
// display: block;
// }
}
.bgFill{
background: inherit;
height: 20px;
}
.fs30{
font-size: px2rem(15px);
}
.gxy-study{
margin-right: px2rem(19px);
}
.gxy{
font-size: px2rem(25px);
margin: px2rem(25px) 0 px2rem(11px) 0;
}
.header{
width: 100%;
/*//height: px2rem(50px);*/
position: relative;
}
.fixed {
.search-menu{
position: fixed;
z-index: 110;
top:0;
left: 0;
}
.fixBox{
background: #44A99B;
height:px2rem(30px);
padding:0 px2rem(25px);
/* padding-top: px2rem(7px)*/
}
.bgFill{
background: #44A99B;
}
.search-transparent::-webkit-input-placeholder{
color:#666;
}
.search{
border-color:#ddd;
}
.info-count{
background: #FB5B52;
color: #fff
}
}
.fixBox{
padding:0 px2rem(25px);
height: px2rem(30px);
/* padding-top: px2rem(7px)*/
}
.search-menu{
width: 100%;
position: absolute;
}
.search{
width: px2rem(290px);
height: px2rem(30px);
border-radius: px2rem(19px);
float: left;
}
.input{
outline: none;
border: none;
float: left;
font-size: px2rem(13px);
margin: px2rem(6px) 0 px2rem(6px) px2rem(15px);
line-height: px2rem(18px);
width: 80%;
}
.search-img{
width: px2rem(16px);
height: px2rem(16px);
margin: px2rem(6px) px2rem(15px) px2rem(9px) 0;
float: right;
}
.info-count{
position:absolute;
top: -(px2rem(5px));
left: (px2rem(10px));
/*max-width: px2rem(25px);*/
padding:0 px2rem(3px);
height: px2rem(15px);
line-height: px2rem(15px);
border-radius: px2rem(15px);
text-align: center;
font-size:px2rem(12px);
font-weight: bold;
background-color: #fff;
color: RGBA(53, 134, 126, 1);
}
.num-min{
max-width: px2rem(25px);
min-width: px2rem(15px);
/*padding:0;*/
}
.num-max{
width: auto;
/* background-color: RGBA(251, 91, 82, 1);
color: #fff;*/
}
.hot-tag{
width: 100%;
height: px2rem(150px);
}
.hotTagTitle{
font-size: px2rem(18px);
padding: px2rem(73px) px2rem(15px);
float: left;
background-color: #fff;
}
.cource{
width: 100%;
height: px2rem(350px);
}
.font-title{
font-size: px2rem(18px);
padding: 0 0 px2rem(21px) px2rem(15px);
float: left;
width: 100%;
text-align: left;
}
.title{
font-size: px2rem(16px);
}
.cource-left{
float: left;
padding-left: px2rem(15px);
}
.need-left{
float: left;
padding: 0 0 px2rem(40px) px2rem(15px);
}
.cource-time{
float: left;
}
.cource-img{
width: px2rem(170px);
height: px2rem(96px);
margin-bottom: px2rem(10px);
}
.cource-more{
font-size: px2rem(15px);
color: #999999;
}
.need{
width: 100%;
height: px2rem(325px);
margin-top: px2rem(35px);
}
</style>
<template>
<section :style="{'line-width':lineWidth, 'border-color': borderColor, 'border-style': borderStyle, 'border-width': borderWidth}">
</section>
</template>
<script>
export default {
props: {
lineWidth: {
type: String,
default: 'px2rem(375px)'
},
borderWidth: {
type: String,
default: '1px'
},
borderStyle: {
type: String,
default: 'solid'
},
borderColor: {
type: String,
default: '#e7e7e7'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
// @import '../../style/global.scss';
</style>
此差异已折叠。
<template>
<section class="font-style">
<teacherTop :topTitle="topTitle" :isScroll="isScroll" :isShowCount="isShowCount" :studyCount="studyCount" :followCount="followCount"></teacherTop>
<div class="teach-opt">
<div class="teach-title">讲师名录</div>
<div class="opt-span">
<span class="" @click="sortFun">人气
<img src="../../images/sort-u.png" v-if="dir == 1">
<img src="../../images/sort-d.png" v-if="dir == 2">
</span>
</div>
<div class="teach-list">
<div :class="index%2==1?'list-item mr0':'list-item'" v-for="(item, index) in list"
@click="goToDetail(item)" :key="index">
<div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.doctorImg">
<span class="learn-p">{{item.joinNum | yLocalString}}人已学</span>
</div>
<div class="tea-txt">
<div class="tea-name">{{item.doctorName}}</div>
<div class="tea-position">
{{item.doctorHospital}}
</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
import teacherTop from '../../components/teachers/teach-top-new';
import {teacher_back,fast_sicon,hot_teacher,screen,teacher,teacherother} from '../../utils/buryingPoint';
export default {
components:{
teacherTop
},
data(){
return {
topTitle: '讲师集',
isScroll:false,
token: '',
list:[],
isShowCount:true,
followCount:0,
studyCount:0,
col:1, //0综合,1人气,2资源数,3姓名首字母
dir:2,//1:正序 2:逆序
}
},
mounted(){
let _this = this
this.token = this.$route.query.userToken || this.$route.query.token
// this.getUserInfo()
this.getData();
// window.__getUserInfo = function(parm){
// // alert('in __getUserInfo')
// _this.token = parm.userToken || _this.$route.query.token;
// this.getData();
// }
window.__refresh = function(parm){
_this.getData();
}
window.addEventListener('scroll',this.handleScroll)
},
computed:{
},
methods:{
handleScroll:function(){
var scrollTop=window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
if(scrollTop > 25){
this.isScroll = true;
}else{
this.isScroll = false;
}
},
//获取版本号
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
goToDetail(item){
let _this = this;
this.$router.push({
path: '/teachersDetail',
query:{
id: item.doctorId,
token: _this.token
}
})
this.appBuryingPointEntrust({
...teacher,
labelId: item.doctorId,
labelValue: item.doctorName
})
},
// 埋点
appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val)
},
//排序
sortFun(){
this.dir = this.dir == 1 ? 2 : 1;
this.getData()
},
randomBg(d){
for(let i=0;i<d.length;i++){
if(i%4 == 0){
d[i].bgColor = '#EBF6F1'
}else if(i%4 == 1){
d[i].bgColor = '#EDF3FA'
}else if(i%4 == 2){
d[i].bgColor = '#F0F0FA'
}else if(i%4 == 3){
d[i].bgColor = '#F6EFE6'
}
}
/// console.log(d);
},
getData(){
let _this = this,
para = {
token: _this.token,
setEntry: 'headers'
}
let url = '/contents/courseDoctor/getAllTeacher/orderby/'+_this.col+'/dir/'+_this.dir
this.GET(url, para).then(res => {
if(res.code == '000000'){
_this.list = res.data.teacherList || [];
_this.followCount = res.data.followCount || 0;
_this.studyCount = res.data.studyCount || 0;
if(_this.list.length>0){
_this.randomBg(_this.list);
}
}
})
this.appBuryingPointEntrust({
...teacher,
labelId: _this.dir,
labelValue: _this.dir === 1 ? '升序' : '降序'
})
}
}
}
</script>
<style>
body{background: #fff}
</style>
<style lang="scss" scoped>
body{background: #fff}
@import '../../style/mixin';
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
width: 100%;
overflow: hidden;
@include sc(0.6rem, #666);
}
.teach-opt{
padding:px2rem(26px) px2rem(15px) px2rem(15px) px2rem(15px);
.teach-title{
font-size: px2rem(18px);
// padding-bottom: px2rem(0px);
color:#333;
}
.teach-list{
overflow: hidden;
}
.opt-span{
span{
color:#449284;
font-size: px2rem(13px);
display: inline-block;
vertical-align: middle;
height: px2rem(10px);
line-height: px2rem(10px);
img{
display: inline-block;
width: px2rem(15px);
height: px2rem(15px);
vertical-align: middle;
}
}
}
.list-item{
width: px2rem(170px);
margin-right: px2rem(5px);
margin-top: px2rem(15px);
border-radius: 0 0 px2rem(3px) px2rem(3px) ;
float: left;
box-shadow: 0 px2rem(4px) px2rem(6px) RGBA(0, 0, 0, 0.06);
}
.mr0{
margin-right: 0
}
.tea-txt{
padding:px2rem(5px) px2rem(7px) ;
}
.tea-img{
width: px2rem(170px);
height: px2rem(83px);
position: relative;
border-radius: px2rem(3px) px2rem(3px) 0 0 ;
img{
width: 100%;
height: 100%;
display: block;
border-radius: px2rem(3px) px2rem(3px) 0 0 ;
}
.learn-p{
padding-left: px2rem(5px);
position: absolute;
width: 100%;
left:0;
bottom: 0;
background: #333;
background: -webkit-linear-gradient(left, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: -o-linear-gradient(right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: -moz-linear-gradient(right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: linear-gradient(to right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
color:#fff;
font-size: px2rem(11px);
height: px2rem(20px);
line-height: px2rem(20px);
}
}
.tea-name{
padding: 0;
color:#333;
font-size: px2rem(14px);
font-weight: 500;
}
.tea-position{
height: px2rem(30px);
font-size: px2rem(12px);
line-height: px2rem(15px);
color: #666;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
}
}
.home-header {
height: px2rem(185px);
@include bis('../../images/headerTop.png');
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
</style>
<template>
<section>
<GroupTitle groupTitle="讲师" :groupNum="groupNum" />
<div class="font-style">
<div class="teach-opt">
<div class="teach-list">
<div :class="index%2==1?'list-item mr0':'list-item'"
v-for="(item, index) in parmData" :key="index"
@click="goToDetail(item)">
<div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.doctorImg">
<span class="learn-p">{{item.joinNum}}人已学</span>
<!-- <span class="learn-p">{{item.joinNum | yLocalString}}人已学</span> -->
</div>
<div class="tea-txt">
<div class="tea-name">{{item.doctorName}}</div>
<div class="tea-position">
{{item.doctorHospital}}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
// import teacherTop from '../../components/teachers/teach-top-new';
// import {
// teacher_back,
// fast_sicon,
// hot_teacher,
// screen,
// teacher,
// teacherother
// } from '../../utils/buryingPoint';
import GroupTitle from '@/components/business/group-title';
export default {
components: {
GroupTitle
},
data() {
return {
topTitle: '讲师集',
isScroll: false,
token: '',
list: [],
isShowCount: true,
followCount: 0,
studyCount: 0,
col: 1, //0综合,1人气,2资源数,3姓名首字母
dir: 2, //1:正序 2:逆序
}
},
props: {
parmData: {
type: Array,
default: () => []
},
groupNum: {
type: String,
default: '0'
}
},
mounted() {
let _this = this
this.token = this.$route.query.userToken || this.$route.query.token
// this.getUserInfo()
// this.getData();
// window.__getUserInfo = function(parm){
// // alert('in __getUserInfo')
// _this.token = parm.userToken || _this.$route.query.token;
// this.getData();
// }
window.__refresh = function (parm) {
_this.getData();
}
window.addEventListener('scroll', this.handleScroll)
},
computed: {
// groupNum() {
// return this.parmData.length + ''
// }
},
methods: {
handleScroll: function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop > 25) {
this.isScroll = true;
} else {
this.isScroll = false;
}
},
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
goToDetail(item) {
let _this = this;
this.$router.push({
path: '/details',
query: {
id: item.doctorId,
token: _this.token
}
})
// this.appBuryingPointEntrust({
// ...teacher,
// labelId: item.doctorId,
// labelValue: item.doctorName
// })
},
// 埋点
appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val)
},
//排序
sortFun() {
this.dir = this.dir == 1 ? 2 : 1;
this.getData()
},
randomBg(d) {
for (let i = 0; i < d.length; i++) {
if (i % 4 == 0) {
d[i].bgColor = '#EBF6F1'
} else if (i % 4 == 1) {
d[i].bgColor = '#EDF3FA'
} else if (i % 4 == 2) {
d[i].bgColor = '#F0F0FA'
} else if (i % 4 == 3) {
d[i].bgColor = '#F6EFE6'
}
}
/// console.log(d);
},
getData() {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers'
}
let url = 'contents/courseDoctor/getAllTeacher/orderby/' + _this.col + '/dir/' + _this.dir
this.GET(url, para).then(res => {
if (res.code == '000000') {
_this.list = res.data.teacherList || [];
_this.followCount = res.data.followCount || 0;
_this.studyCount = res.data.studyCount || 0;
if (_this.list.length > 0) {
_this.randomBg(_this.list);
}
}
})
// this.appBuryingPointEntrust({
// ...teacher,
// labelId: _this.dir,
// labelValue: _this.dir === 1 ? '升序' : '降序'
// })
}
}
}
</script>
<style>
body {
background: #fff
}
</style>
<style lang="scss" scoped>
body {
background: #fff
}
@import '../../style/mixin';
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
width: 100%;
overflow: hidden;
@include sc(0.6rem, #666);
}
.teach-opt {
padding: 0 px2rem(15px) px2rem(15px) px2rem(15px);
.teach-title {
font-size: px2rem(18px);
// padding-bottom: px2rem(0px);
color: #333;
}
.teach-list {
margin-top: px2rem(-14px);
overflow: hidden;
}
.opt-span {
span {
color: #449284;
font-size: px2rem(13px);
display: inline-block;
vertical-align: middle;
height: px2rem(10px);
line-height: px2rem(10px);
img {
display: inline-block;
width: px2rem(15px);
height: px2rem(15px);
vertical-align: middle;
}
}
}
.list-item {
width: px2rem(170px);
margin-right: px2rem(5px);
margin-top: px2rem(15px);
border-radius: 0 0 px2rem(3px) px2rem(3px);
float: left;
box-shadow: 0 px2rem(4px) px2rem(6px) RGBA(0, 0, 0, 0.06);
}
.mr0 {
margin-right: 0
}
.tea-txt {
padding: px2rem(5px) px2rem(7px);
}
.tea-img {
width: px2rem(170px);
height: px2rem(83px);
position: relative;
border-radius: px2rem(3px) px2rem(3px) 0 0;
img {
width: 100%;
height: 100%;
display: block;
border-radius: px2rem(3px) px2rem(3px) 0 0;
}
.learn-p {
padding-left: px2rem(5px);
position: absolute;
width: 100%;
left: 0;
bottom: 0;
background: #333;
background: -webkit-linear-gradient(left, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: -o-linear-gradient(right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: -moz-linear-gradient(right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: linear-gradient(to right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
color: #fff;
font-size: px2rem(11px);
height: px2rem(20px);
line-height: px2rem(20px);
}
}
.tea-name {
padding: 0;
color: #333;
font-size: px2rem(14px);
font-weight: 500;
}
.tea-position {
height: px2rem(30px);
font-size: px2rem(12px);
line-height: px2rem(15px);
color: #666;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
}
}
.home-header {
height: px2rem(185px);
@include bis('../../images/headerTop.png');
.logo_img {
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
</style>
<template>
<section>
<GroupTitle groupTitle="讲师" :groupNum="groupNum" :showTitle="showTitle" :showOrder="showOrder"/>
<div class="font-style">
<div class="teach-opt">
<div class="teach-list">
<div :class="index%2==1?'list-item mr0':'list-item'"
v-for="(item, index) in parmData" :key="index"
@click="goToDetail(item)">
<div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.appImageUrl">
<span class="learn-p">{{item.joinNum}}人已学</span>
<!-- <span class="learn-p">{{item.joinNum | yLocalString}}人已学</span> -->
</div>
<div class="tea-txt">
<div class="tea-name" v-html="item.highLightName">{{item.name}}</div>
<div class="tea-position">
{{item.doctorHospital}}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
// import {
// teacher_back,
// fast_sicon,
// hot_teacher,
// screen,
// teacher,
// teacherother
// } from '../../utils/buryingPoint';
import GroupTitle from '@/components/business/group-title';
export default {
components: {
GroupTitle
},
data() {
return {
topTitle: '讲师集',
isScroll: false,
token: '',
list: [],
isShowCount: true,
followCount: 0,
studyCount: 0,
col: 1, //0综合,1人气,2资源数,3姓名首字母
dir: 2, //1:正序 2:逆序
}
},
props: {
parmData: {
type: Array,
default: () => []
},
groupNum: {
type: String,
default: '0'
},
showTitle: {
type: Boolean,
default: true
},
showOrder: {
type: Boolean,
default: false
}
},
mounted() {
let _this = this
this.token = this.$route.query.userToken || this.$route.query.token
// this.getUserInfo()
// this.getData();
// window.__getUserInfo = function(parm){
// // alert('in __getUserInfo')
// _this.token = parm.userToken || _this.$route.query.token;
// this.getData();
// }
window.__refresh = function (parm) {
_this.getData();
}
window.addEventListener('scroll', this.handleScroll)
},
computed: {
// groupNum() {
// return this.parmData.length + ''
// }
},
methods: {
handleScroll: function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop > 25) {
this.isScroll = true;
} else {
this.isScroll = false;
}
},
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
goToDetail(item) {
let _this = this;
this.$router.push({
path: '/details',
query: {
id: item.doctorId,
token: _this.token
}
})
// this.appBuryingPointEntrust({
// ...teacher,
// labelId: item.doctorId,
// labelValue: item.doctorName
// })
},
// 埋点
appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val)
},
//排序
sortFun() {
this.dir = this.dir == 1 ? 2 : 1;
this.getData()
},
randomBg(d) {
for (let i = 0; i < d.length; i++) {
if (i % 4 == 0) {
d[i].bgColor = '#EBF6F1'
} else if (i % 4 == 1) {
d[i].bgColor = '#EDF3FA'
} else if (i % 4 == 2) {
d[i].bgColor = '#F0F0FA'
} else if (i % 4 == 3) {
d[i].bgColor = '#F6EFE6'
}
}
/// console.log(d);
},
getData() {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers'
}
let url = 'contents/courseDoctor/getAllTeacher/orderby/' + _this.col + '/dir/' + _this.dir
this.GET(url, para).then(res => {
if (res.code == '000000') {
_this.list = res.data.teacherList || [];
_this.followCount = res.data.followCount || 0;
_this.studyCount = res.data.studyCount || 0;
if (_this.list.length > 0) {
_this.randomBg(_this.list);
}
}
})
// this.appBuryingPointEntrust({
// ...teacher,
// labelId: _this.dir,
// labelValue: _this.dir === 1 ? '升序' : '降序'
// })
}
}
}
</script>
<style>
body {
background: #fff
}
</style>
<style lang="scss" scoped>
body {
background: #fff
}
@import '../../style/mixin';
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
width: 100%;
overflow: hidden;
@include sc(0.6rem, #666);
}
.teach-opt {
padding: 0 px2rem(15px) px2rem(15px) px2rem(15px);
.teach-title {
font-size: px2rem(18px);
// padding-bottom: px2rem(0px);
color: #333;
}
.teach-list {
margin-top: px2rem(-14px);
overflow: hidden;
}
.opt-span {
span {
color: #449284;
font-size: px2rem(13px);
display: inline-block;
vertical-align: middle;
height: px2rem(10px);
line-height: px2rem(10px);
img {
display: inline-block;
width: px2rem(15px);
height: px2rem(15px);
vertical-align: middle;
}
}
}
.list-item {
width: px2rem(170px);
margin-right: px2rem(5px);
margin-top: px2rem(15px);
border-radius: 0 0 px2rem(3px) px2rem(3px);
float: left;
box-shadow: 0 px2rem(4px) px2rem(6px) RGBA(0, 0, 0, 0.06);
}
.mr0 {
margin-right: 0
}
.tea-txt {
padding: px2rem(5px) px2rem(7px);
}
.tea-img {
width: px2rem(170px);
height: px2rem(83px);
position: relative;
border-radius: px2rem(3px) px2rem(3px) 0 0;
img {
width: 100%;
height: 100%;
display: block;
border-radius: px2rem(3px) px2rem(3px) 0 0;
}
.learn-p {
padding-left: px2rem(5px);
position: absolute;
width: 100%;
left: 0;
bottom: 0;
background: #333;
background: -webkit-linear-gradient(left, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: -o-linear-gradient(right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: -moz-linear-gradient(right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
background: linear-gradient(to right, RGBA(0, 0, 0, 0.2), RGBA(0, 0, 0, 0));
color: #fff;
font-size: px2rem(11px);
height: px2rem(20px);
line-height: px2rem(20px);
}
}
.tea-name {
padding: 0;
color: #333;
font-size: px2rem(14px);
font-weight: 500;
}
.tea-position {
height: px2rem(30px);
font-size: px2rem(12px);
line-height: px2rem(15px);
color: #666;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
}
}
.home-header {
height: px2rem(185px);
@include bis('../../images/headerTop.png');
.logo_img {
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
</style>
...@@ -40,7 +40,6 @@ export default { ...@@ -40,7 +40,6 @@ export default {
data() { data() {
return { return {
topTitle: '讲师集', topTitle: '讲师集',
isScroll: false,
token: '', token: '',
list: [], list: [],
isShowCount: true, isShowCount: true,
...@@ -92,20 +91,6 @@ export default { ...@@ -92,20 +91,6 @@ export default {
} }
}, },
methods: { methods: {
handleScroll: function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop > 25) {
this.isScroll = true;
} else {
this.isScroll = false;
}
},
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
//跳转 //跳转
goToPage(item){ goToPage(item){
let _this = this, let _this = this,
......
...@@ -2,7 +2,7 @@ import App from '../App' ...@@ -2,7 +2,7 @@ import App from '../App'
const search = r => require.ensure([], () => r(require('../views/search-index')), 'search') const search = r => require.ensure([], () => r(require('../views/search-index')), 'search')
const result = r => require.ensure([], () => r(require('../views/result')), 'result') const result = r => require.ensure([], () => r(require('../views/result')), 'result')
const details = r => require.ensure([], () => r(require('../views/teacher-details')), 'details') // const details = r => require.ensure([], () => r(require('../views/teacher-details')), 'details')
export default [{ export default [{
path: '/', path: '/',
...@@ -23,10 +23,6 @@ export default [{ ...@@ -23,10 +23,6 @@ export default [{
{ {
path: '/result', path: '/result',
component: result component: result
},
{
path: '/details',
component: details
} }
] ]
}] }]
module.exports = {
// 搜索首页
m_search_search: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_search',
actionCode: 'c_search',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_search_hs: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_history_search',
actionCode: 'c_history_search',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_search_db: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_history_search',
actionCode: 'c_delete_button',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_search_d: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_history_search',
actionCode: 'c_delete',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_search_da: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_history_search',
actionCode: 'c_delete_all',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_search_dc: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_history_search',
actionCode: 'c_delete_confirm',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_hot_search: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_hot_search',
actionCode: 'c_hot_search',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_history_no_search_result_d: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_no_search_result',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 暂时不做
m_search_history_no_search_result_m: {
menuCode: 'm_search',
menuLevel: 2,
functionCode: 'f_no_search_result',
actionCode: 'c_more',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'f_home',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 搜索结果
m_search_result_tab_switch: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_tab_switch',
actionCode: 'c_switch',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 综合
m_search_result_colligation_detail: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_colligation',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_colligation_all: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_colligation',
actionCode: 'c_all',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_colligation_top: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_colligation',
actionCode: 'c_top',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 课程
m_search_result_course_detail: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_course',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_course_order: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_course',
actionCode: 'c_order',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_course_more: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_course',
actionCode: 'c_more',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_course_top: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_course',
actionCode: 'c_top',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 五分钟
m_search_result_five_minutes_detail: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_five_minutes',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_five_minutes_order: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_five_minutes',
actionCode: 'c_order',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_five_minutes_top: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_five_minutes',
actionCode: 'c_top',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 讲师
m_search_result_lecturer_detail: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_lecturer',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_lecturer_order: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_lecturer',
actionCode: 'c_order',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_lecturer_top: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_lecturer',
actionCode: 'c_top',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
// 健康漫画
m_search_result_health_cartoon_detail: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_health_cartoon',
actionCode: 'c_detail',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_health_cartoon_order: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_health_cartoon',
actionCode: 'c_order',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
m_search_result_health_cartoon_top: {
menuCode: 'm_search_result',
menuLevel: 3,
functionCode: 'f_health_cartoon',
actionCode: 'c_top',
labelId: '',
labelValue: '',
duration: 1,
menuFromCode: 'm_search',
params: '',
session: '',
createdTime: new Date().getTime(),
},
}
\ No newline at end of file
...@@ -4,33 +4,37 @@ ...@@ -4,33 +4,37 @@
e.rocNative = { e.rocNative = {
// 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法 // 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法
__nativeCall: function (e, t, n) { __nativeCall: function (e, t, n) {
if(t == '__refresh'){ if( window[t] ){
__refresh(n) window[t](n)
}
if(t == '__getUserInfo'){
__getUserInfo(n);
}
if(t == '__getUserInfo_S'){
__getUserInfo_S(n)
}
if(t == '__getUserInfo_CA'){
__getUserInfo_CA(n)
}
if(t == '__getStatusBarHeight'){
__getStatusBarHeight(n);
}
if(t == 'pauseAudioView'){
__pauseAudioView(n);
}
if(t == 'playAudioView'){
__playAudioView(n);
}
if(t == 'closeAudioView'){
__closeAudioView(n);
}
if(t == '__isFirstTime'){
window.__isFirstTime(n)
} }
// if(t == '__refresh'){
// __refresh(n)
// }
// if(t == '__getUserInfo'){
// __getUserInfo(n);
// }
// if(t == '__getUserInfo_S'){
// __getUserInfo_S(n)
// }
// if(t == '__getUserInfo_CA'){
// __getUserInfo_CA(n)
// }
// if(t == '__getStatusBarHeight'){
// __getStatusBarHeight(n);
// }
// if(t == 'pauseAudioView'){
// __pauseAudioView(n);
// }
// if(t == 'playAudioView'){
// __playAudioView(n);
// }
// if(t == 'closeAudioView'){
// __closeAudioView(n);
// }
// if(t == '__isFirstTime'){
// window.__isFirstTime(n)
// }
}, },
__callNative: function (t, a, o) { __callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o); "function" == typeof o && (n++ , i[n] = o);
......
此差异已折叠。
此差异已折叠。
<template>
<section>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SplitLine/> -->
<!-- 没有结果页面 -->
<section v-show="!(showTab1 || showTab2 || showTab3 || showTab4)" class="mt-80">
<section></section>
<NoResultPage/>
<SplitLine borderWidth="3px"/>
<CourseAdjust/>
</section>
<!-- 有结果页面 -->
<section v-show="showTab1 || showTab2 || showTab3 || showTab4" class="mt-100">
<mt-navbar v-model="selected" :fixed="true" style="top: 58px;">
<mt-tab-item v-show="showTab0" id="0">综合</mt-tab-item>
<mt-tab-item v-show="showTab1" id="1">课程</mt-tab-item>
<mt-tab-item v-show="showTab2" id="2">五分钟医学</mt-tab-item>
<mt-tab-item v-show="showTab3" id="3">讲师</mt-tab-item>
<mt-tab-item v-show="showTab4" id="4">健康漫画</mt-tab-item>
</mt-navbar>
<!-- tab-container -->
<mt-tab-container v-model="selected">
<mt-tab-container-item v-show="showTab0" id="0">
<!-- 课程 -->
<div v-show="showTab1">
<CourseList :parmData="contentAppModels" :groupNum="contentAppModelCount"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="1" />
<SplitLine borderWidth="3px"/>
</div>
<!-- 五分钟医学 -->
<div v-show="showTab2">
<FiveMinutes :parmData="fiveMinutesMedicalContentList" :groupNum="fiveMinutesMedicalContentListCount"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="2" />
<SplitLine borderWidth="3px"/>
</div>
<!-- 讲师 -->
<div v-show="showTab3">
<TeacherList :parmData="pCourseDoctorModels" :groupNum="pCourseDoctorModelCount"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="3" />
<SplitLine borderWidth="3px"/>
</div>
<!-- 健康漫画 -->
<div v-show="showTab4">
<HealthComics :parmData="educationContents" :groupNum="educationContentCount"/>
<ShowAllItem @showAllItem="showAllItem" itemIndex="4" />
<NoMoreItem/>
</div>
</mt-tab-container-item>
<mt-tab-container-item v-show="showTab1" id="1">
<CourseList :parmData="contentAppModelsAll" :groupNum="contentAppModelCount"/>
<NoMoreItem/>
</mt-tab-container-item>
<mt-tab-container-item v-show="showTab2" id="2">
<FiveMinutes :parmData="fiveMinutesMedicalContentListAll" :groupNum="fiveMinutesMedicalContentListCount"/>
<NoMoreItem/>
</mt-tab-container-item>
<mt-tab-container-item v-show="showTab3" id="3">
<TeacherList :parmData="pCourseDoctorModelsAll" :groupNum="pCourseDoctorModelCount"/>
<NoMoreItem/>
</mt-tab-container-item>
<mt-tab-container-item v-show="showTab4" id="4">
<HealthComics :parmData="educationContentsAll" :groupNum="educationContentCount"/>
<NoMoreItem/>
</mt-tab-container-item>
</mt-tab-container>
</section>
</section>
</template>
<script>
import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import NoMoreItem from '../components/business/no-more-item';
import ShowAllItem from '../components/business/show-all-item';
import GroupTitle from '../components/business/group-title';
import CourseList from '../components/business/course-list';
import FiveMinutes from '../components/business/five-minutes';
import TeacherList from '@/components/business/teacher-list';
import HealthComics from '@/components/business/health-comics';
import CourseAdjust from '../components/business/course-adjust';
import NoResultPage from '@/components/business/no-result-page'
import { Navbar, TabItem } from 'mint-ui';
export default {
data() {
return {
hasResult: true,
searchText: '',
selected: '0',
contentAppModelCount: '0',
contentAppModels: [],
contentAppModelsAll: [],
educationContentCount: '0',
educationContents: [],
educationContentsAll: [],
fiveMinutesMedicalContentListCount: '0',
fiveMinutesMedicalContentList: [],
fiveMinutesMedicalContentListAll: [],
pCourseDoctorModelCount: '0',
pCourseDoctorModels: [],
pCourseDoctorModelsAll: [],
showTab0: true,
showTab1: true,
showTab2: true,
showTab3: true,
showTab4: true
}
},
components: {
SearchHeader,
SplitLine,
Navbar,
TabItem,
NoMoreItem,
ShowAllItem,
GroupTitle,
CourseList,
CourseAdjust,
FiveMinutes,
TeacherList,
HealthComics,
NoResultPage
},
watch: {
selected(val) {
this.showIndex(val)
// this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll')
}
},
created(){
this.searchText = this.$route.query.searchText || ''
console.log(this.searchText)
},
mounted(){
this.search(this.searchText)
// this.searchAll(this.searchText, '1', 'contentAppModels', 'contentAppModelsAll')
},
methods: {
showAllItem(index) {
console.log(index)
this.selected = index
},
// 搜索结果
search(searchText) {
this.showTab0 = true
this.showTab1 = true
this.showTab2 = true
this.showTab3 = true
this.showTab4 = true
let _this = this,
para = {
searchCategory: '1,2,3,4',
searchValue: searchText,
sortItem: 1,
pageNo: 1,
pageSize: 100,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => {
if (res.code == '000000') {
console.log(res)
// 课程
_this.contentAppModels = this.spliceCertenNumData(res.data.contentAppModels, 4)
_this.contentAppModelsAll = res.data.contentAppModels
_this.contentAppModelCount = res.data.contentAppModelCount + ''
if(res.data.contentAppModelCount === 0){
this.showTab1 = false
}
// 五分钟医学
_this.fiveMinutesMedicalContentList = this.spliceCertenNumData(res.data.fiveMinutesMedicalContentList, 4)
_this.fiveMinutesMedicalContentListAll = res.data.fiveMinutesMedicalContentList
_this.fiveMinutesMedicalContentListCount = res.data.fiveMinutesMedicalContentListCount + ''
if(res.data.fiveMinutesMedicalContentListCount === 0){
this.showTab2 = false
}
// 讲师
_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.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
}
}
})
},
searchAll(searchText, searchCategory, receive, receiveList) {
let _this = this,
para = {
searchCategory: searchCategory,
searchValue: searchText,
sortItem: 1,
pageNo: 1,
pageSize: 100,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => {
if (res.code == '000000') {
// 课程
_this[receiveList] = res.data[receive]
}
})
},
showIndex(index) {
console.log(index)
},
spliceCertenNumData(oriData, num) {
let result = []
if (oriData.length === 0 || oriData.length < num) {
return oriData
} else {
for ( let i = 0; i < num; i ++){
result.push(oriData[i])
}
return result
}
console.log(result)
}
},
}
</script>
<style lang="scss">
@import '../style/mixin.scss';
.mint-tab-item-label {
color: inherit;
font-size: px2rem(14px);
line-height: 1;
}
.mint-navbar {
background-color: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
text-align: center;
border-bottom: px2rem(1px) solid #f0f0f0 !important;
}
.mint-navbar .mint-tab-item.is-selected {
border-bottom: px2rem(2px) solid #449284;
color: #449284;
margin-bottom: px2rem(-1px);
}
.mint-navbar .mint-tab-item {
padding: px2rem(19px) 0 px2rem(11px);
font-size: px2rem(14px);
}
</style>
<style lang="scss" scoped>
@import '../style/mixin.scss';
@import '../style/global.scss';
.mt-80 {
margin-top: px2rem(80px);
}
.mt-100 {
margin-top: px2rem(105px);
}
</style>
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册