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

test1 之前

上级 81d3aee2
无法预览此类型文件
此差异已折叠。
<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 v-lazy="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}} ({{groupNum}})</span>
<span class="group-title-name">{{groupTitle}} </span>
<span v-show="isShowNum"> ({{groupNum}})</span>
</section>
</template>
<script>
......@@ -15,6 +16,10 @@ export default {
type: String,
default: '课程'
},
isShowNum: {
type: Boolean,
default: true
},
groupNum: {
type: String,
default: "0"
......@@ -29,6 +34,9 @@ export default {
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);
......
<template>
<section>
<GroupTitle groupTitle="健康漫画" groupNum="6" />
<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 list" :key="index"
@click="goToDetail(item)"
v-show="index < 4">
<div :class="index%2==1 ? 'list-item mr0':'list-item'"
v-for="(item, index) in parmData" :key="index"
@click="goToPage(item)">
<div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.doctorImg">
<img v-lazy="item.imageUrl">
<!-- <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}}
{{item.headerName}}
</div>
</div>
</div>
</div>
</div>
</div>
<ShowAllItem />
<NoMoreItem v-show="false" />
<!-- <SplitLine borderWidth="3px" /> -->
</section>
</template>
......@@ -40,15 +36,24 @@
// teacherother
// } from '../../utils/buryingPoint';
import GroupTitle from '@/components/business/group-title';
import NoMoreItem from '@/components/business/no-more-item';
import ShowAllItem from '@/components/business/show-all-item';
import SplitLine from '@/components/business/split-line';
export default {
components: {
GroupTitle,
NoMoreItem,
ShowAllItem,
SplitLine
GroupTitle
},
props: {
parmData: {
type: Array,
default: () => []
},
groupNum: {
type: String,
default: '0'
}
},
computed: {
// groupNum() {
// return this.parmData.length + ''
// }
},
data() {
return {
......@@ -67,7 +72,9 @@ export default {
let _this = this
this.token = this.$route.query.userToken || this.$route.query.token
// this.getUserInfo()
this.getData();
// this.getData();
// window.__getUserInfo = function(parm){
// // alert('in __getUserInfo')
// _this.token = parm.userToken || _this.$route.query.token;
......@@ -78,9 +85,6 @@ export default {
}
window.addEventListener('scroll', this.handleScroll)
},
computed: {
},
methods: {
handleScroll: function () {
......@@ -97,6 +101,58 @@ export default {
__funcName: '__getUserInfo'
})
},
goToPage(item) {
let obj = {
}
console.log(item);
// let url = pageJumpUrl();
// console.log(url.pageListUrl);
let itemData = {
"imageUrl": "",
"appModuleInfo": {
"code": "M200",
"type": 4,
"name": "课程介绍页",
"paramFlag": 1,
"paramList": []
}
};
obj = {
menuLevel: 1,
menuCode: 'm_home',
functionCode: 'f_five_minutes',
actionCode: 'c_content',
labelId: item.id,
labelValue: item.title,
}
itemData.title = item.name;
itemData.appModuleInfo["paramList"] = [{
"key": "className",
"value": 'com.picahealth.yunque.activitys.webs.CaricatureDetailActivity###EducationDetailViewController',
// "value": 'com.picahealth.yunque.activitys.music.WebMusicListActivity###FiveMinutesMedicalSchoolWebViewController',
"type": 4,
"seqNo": 1
},
{
"key": "id",
"value": `${item.id}`,
"type": 1,
"seqNo": 2
}
]
this.pageBurialPoin(obj)
let paramList = this.setEventByModuleCode(itemData);
// alert(itemData.appModuleInfo.code)
// alert(JSON.stringify(paramList))
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
goToDetail(item) {
let _this = this;
this.$router.push({
......
......@@ -9,10 +9,10 @@
</section>
<section class="history-labels-item"
@click="searchAction(item)"
@click="searchAction(item.keyword)"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">
<span>{{item}}</span>
<span>{{item.keyword}}</span>
<img @click="deleteLabels(false, index)" v-show="showDelete"
src="../../images/sousuo/delete.png" alt=""
>
......@@ -45,7 +45,6 @@ export default {
methods: {
searchAction(searchText) {
if(this.showDelete) return
console.log(22222)
this.$router.push({
path: '/result',
query: {
......@@ -75,19 +74,21 @@ export default {
para = {
token: _this.token,
setEntry: 'headers',
keywords: []
keywordIds: []
};
let url = 'contents/searchHistory/deleteHistory'
if (isAll) {
para.keywords = this.allLabels
para.keywordIds = this.allLabels.map(element => {
return element.id
});
} else {
para.keywords.push(this.allLabels[index])
para.keywordIds.push(this.allLabels[index].id)
}
this.POST(url, para).then(res => {
if (res.code == '000000') {
// this.allLabels = res.data.list
this.allLabels.splice(index,length)
this.allLabels.splice(index, para.keywordIds.length)
}
})
},
......
<template>
<section class="no-result">
<img src="../../images/sousuo/search-big.png" alt="">
<p>没有找到相关内容</p>
<p>您可以修改条件后重新搜索</p>
</section>
</template>
<script>
export default {
data() {
return {
}
},
}
</script>
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.no-result {
height: px2rem(180px);
margin-top: px2rem(0px);
text-align: center;
img {
width: px2rem(100px);
height: px2rem(100px);
}
p {
font-size: px2rem(15px);
color: #999;
}
}
</style>
......@@ -3,7 +3,7 @@
<section class="search-wrapper-input">
<!-- <form action="" @submit.stop.prevent="search"> -->
<img src='../../images/search-grey.png'>
<input type="search" v-model="currentText" @keydown.enter="search"/>
<input type="search" v-model="currentText2" @keydown.enter="search"/>
<!-- <button type="submit" v-show="false"/> -->
<!-- </form> -->
</section>
......@@ -16,7 +16,7 @@
export default {
data() {
return {
currentText: ''
currentText2: ''
}
},
props: {
......@@ -25,17 +25,22 @@ export default {
default: ''
}
},
// computed: {
// currentText() {
// return this.searchText
// }
// },
watch: {
searchText(val) {
this.currentText = val
console.log(val)
computed: {
currentText: {
get: function(){
return this.searchText
},
set: function(val) {
this.currentText2 = val
}
}
},
// watch: {
// searchText(val) {
// this.currentText = val
// console.log(val)
// }
// },
mounted() {
// this.getData()
},
......@@ -47,8 +52,8 @@ export default {
},
// 搜索
search() {
console.log(this.currentText)
this.$emit('search', this.currentText)
console.log(this.currentText2)
this.$emit('search', this.currentText2)
}
}
}
......@@ -88,6 +93,8 @@ export default {
top: px2rem(-15px);
left: px2rem(-8px);
width: px2rem(240px);
height: px2rem(30px);
line-height: px2rem(30px);
text-decoration-color: #bbb;
color: #666;
font-size: px2rem(13px);
......
......@@ -21,14 +21,14 @@ export default {
type: String,
default: '查看全部'
},
showIndex: {
type: Number,
default: 0
itemIndex: {
type: String,
default: '0'
}
},
methods: {
showAllItem() {
this.$emit('showAllItem', this.showIndex)
this.$emit('showAllItem', this.itemIndex)
}
}
}
......
<template>
<section>
<GroupTitle groupTitle="讲师" groupNum="6" />
<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 list" :key="index"
@click="goToDetail(item)"
v-show="index < 4">
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>
......@@ -23,9 +22,6 @@
</div>
</div>
</div>
<ShowAllItem />
<NoMoreItem v-show="false" />
<SplitLine borderWidth="3px" />
</section>
</template>
......@@ -40,15 +36,9 @@
// teacherother
// } from '../../utils/buryingPoint';
import GroupTitle from '@/components/business/group-title';
import NoMoreItem from '@/components/business/no-more-item';
import ShowAllItem from '@/components/business/show-all-item';
import SplitLine from '@/components/business/split-line';
export default {
components: {
GroupTitle,
NoMoreItem,
ShowAllItem,
SplitLine
GroupTitle
},
data() {
return {
......@@ -63,6 +53,16 @@ export default {
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
......@@ -80,7 +80,9 @@ export default {
},
computed: {
// groupNum() {
// return this.parmData.length + ''
// }
},
methods: {
handleScroll: function () {
......
......@@ -119,7 +119,7 @@ module.exports = {
// 通用GET请求
GET(api, para, callback,str) {
para.token = para.token || this.token || '2B6FF44E89674C57BC614032EE301A5A'
para.token = para.token || this.token || '4DB26DF025DA4289BDC4077AE28D921A'
let url = api + this.getUrlPara(para)
return fetch({
url: getBaseUrl(url),
......@@ -130,7 +130,7 @@ module.exports = {
// 通用POST请求
POST(api, para, callback) {
para.token = para.token || this.token || '2B6FF44E89674C57BC614032EE301A5A'
para.token = para.token || this.token || '4DB26DF025DA4289BDC4077AE28D921A'
return fetch({
url: getBaseUrl(api),
method: 'post',
......@@ -140,7 +140,7 @@ module.exports = {
// 通用GET请求
API_GET(api, para, callback) {
para.token = para.token || this.token || '2B6FF44E89674C57BC614032EE301A5A' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
para.token = para.token || this.token || '4DB26DF025DA4289BDC4077AE28D921A' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
let url = api + this.getUrlPara(para)
return fetch({
url: getApiUrl(url),
......@@ -151,7 +151,7 @@ module.exports = {
// 通用POST请求
API_POST(api, para, callback) {
para.token = para.token || this.token || '2B6FF44E89674C57BC614032EE301A5A' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
para.token = para.token || this.token || '4DB26DF025DA4289BDC4077AE28D921A' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
return fetch({
url: getApiUrl(api),
method: 'post',
......
......@@ -2,6 +2,11 @@
<template>
<section class="search-container">
<input type="search" @click="gotoPage"/>
<!-- <form @submit.prevent="search"> -->
<!-- <mt-search @onkeydown="gotoPage"></mt-search> -->
<!-- <button v-show="false" type="submit" /> -->
<!-- </form> -->
</section>
</template>
<script>
......@@ -13,20 +18,63 @@ export default {
},
created() {
window.__isFirstTime = function(param) {
alert(JSON.stringify(param))
if(param.isFirst == 'true') {
alert(222)
rocNative.setFirstTime({
projectName: 'YQY_PROJECT_SOUSUO',
isFirst: 'false'
})
}
}
this.isFirstTime()
// this.isFirstTime()
},
methods: {
gotoPage() {
// this.$router.push('/search')
this.$router.push('/search')
},
gotoPage(item) {
let obj = {
}
console.log(item);
// let url = pageJumpUrl();
// console.log(url.pageListUrl);
let itemData = {
"imageUrl": "",
"appModuleInfo": {
"code": "M300",
"type": 4,
"name": "课程介绍页",
"paramFlag": 1,
"paramList": []
}
};
obj = {
menuLevel: 1,
menuCode: 'm_home',
functionCode: 'f_five_minutes',
actionCode: 'c_content',
labelId: item.id,
labelValue: item.title,
}
itemData.title = item.name;
itemData.appModuleInfo["paramList"] = [{
"key": "pageUrl",
"value": 'https://phome.yunqueyi.com/app/#/home',
// "value": 'com.picahealth.yunque.activitys.music.WebMusicListActivity###FiveMinutesMedicalSchoolWebViewController',
"type": 4,
"seqNo": 1
}
]
// this.pageBurialPoin(obj)
let paramList = this.setEventByModuleCode(itemData);
// alert(itemData.appModuleInfo.code)
// alert(JSON.stringify(paramList))
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
isFirstTime() {
rocNative.isFirstTime({
......@@ -38,11 +86,51 @@ export default {
}
}
</script>
<style >
.mint-search {
position: fixed;
top: 0px;
z-index: 2;
height: 66px;
width: 100%;
border-bottom: 1px solid #E7E7E7;
}
.mint-searchbar {
position: relative;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #fff;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
padding: 30px 10px 8px;
z-index: 1;
}
.mint-searchbar-cancel {
margin-left: 10px;
font-size: 14px ;
color: #999;
text-decoration: none;
}
.mint-searchbar-inner {
background: #F5F6F6;
}
.mint-searchbar-core {
background: #F5F6F6;
}
</style>
<style lang="scss">
.search-container {
height: 100px;
height: 200px;
text-align: center;
background-color: #333;
background-color: #E7E7E7;
padding-top: 60px;
input {
width: 320px;
padding: 4px 10px;
}
}
</style>
<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>
此差异已折叠。
<template>
<div>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SearchHeader @search="search" :searchText="searchText"/> -->
<form @submit.prevent="search">
<mt-search v-model="searchText" ></mt-search>
<button v-show="false" type="submit" />
</form>
<!-- <SplitLine /> -->
<div class="mt-100"></div>
<HistoryLabels/>
......@@ -13,6 +18,7 @@ import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import HistoryLabels from '../components/business/history-labels';
import HotLabels from '../components/business/hot-labels';
// import { Search } from 'mint-ui';
export default {
data() {
......@@ -35,13 +41,12 @@ export default {
},
methods: {
// 跳转到结果页面,并
search(searchText) {
console.log(searchText)
if(!searchText) return;
search() {
if(!this.searchText) return;
this.$router.push({
path: '/result',
query: {
searchText: searchText
searchText: this.searchText
}
})
},
......@@ -66,6 +71,41 @@ export default {
},
}
</script>
<style >
.mint-search {
position: fixed;
top: 0px;
z-index: 2;
height: 66px;
width: 100%;
border-bottom: 1px solid #E7E7E7 !important;
}
.mint-searchbar {
position: relative;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #fff;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
padding: 30px 10px 8px;
z-index: 1;
}
.mint-searchbar-cancel {
margin-left: 10px;
font-size: 14px ;
color: #999;
text-decoration: none;
}
.mint-searchbar-inner {
background: #F5F6F6;
}
.mint-searchbar-core {
background: #F5F6F6;
}
</style>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册