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

isFirstTime

上级 745beaa9
......@@ -103,16 +103,19 @@ export default {
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.$emit('jumpToSS',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
this.$router.push({
path: '/search'
})
rocNative.readMessage();
// alert("000");
// this.$emit('setAppMsg',false)
// this.$emit('jumpToSS',false)
// this.pageBurialPoin({
// menuLevel:1,
// menuCode:'m_home',
// functionCode:'f_notification',
// actionCode:'c_notification',
// })
// rocNative.readMessage();
}
},
......
......@@ -2,13 +2,21 @@
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<section class="history-labels-title">
<span>{{title}}</span>
<img v-show="showDelete" src="../../images/sousuo/recicle.png" alt="删除">
<span v-show="showDelete" class="history-labels-title-all">
<span @click="deleteLabels(true)">全部删除</span><span>|</span><span @click="toggleDelete">取消</span>
</span>
<img @click="toggleDelete" v-show="!showDelete" src="../../images/sousuo/recicle.png" alt="删除">
</section>
<section class="history-labels-item"
@click="searchAction"
@click="searchAction(item)"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">{{item.doctorName}}</span>
<span class="history-labels-item-name">
<span>{{item}}</span>
<img @click="deleteLabels(false, index)" v-show="showDelete"
src="../../images/sousuo/delete.png" alt=""
>
</span>
</section>
</article>
</template>
......@@ -17,37 +25,81 @@
export default {
name: 'HistoryLabels',
props: {
allLabels: {
type: Array
},
// allLabels: {
// type: Array
// },
title: {
type: String,
default: '历史搜索'
},
showDelete: {
type: Boolean,
default: true
}
},
data () {
return {
allLabels: [],
showDelete: false
}
},
mounted(){
this.getData()
},
methods: {
searchAction() {
searchAction(searchText) {
if(this.showDelete) return
console.log(22222)
this.$router.push({
path: '/result'
path: '/result',
query: {
searchText: searchText
}
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers'
}
let url = 'contents/searchHistory/listHistory'
this.GET(url, para).then(res => {
if (res.code == '000000') {
this.allLabels = res.data.list
console.log(res)
}
})
},
// 删除关键词
deleteLabels(isAll, index=0, length=1) {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers',
keywords: []
};
let url = 'contents/searchHistory/deleteHistory'
if (isAll) {
para.keywords = this.allLabels
} else {
para.keywords.push(this.allLabels[index])
}
this.POST(url, para).then(res => {
if (res.code == '000000') {
// this.allLabels = res.data.list
this.allLabels.splice(index,length)
}
})
},
toggleDelete() {
this.showDelete = !this.showDelete
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.history-labels {
......@@ -62,13 +114,20 @@ export default {
justify-content: space-between;
span {
font-size: px2rem(12px);
color: 6;
color: #666;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
&-all {
span {
padding: px2rem(4px) px2rem(5px);
font-size: px2rem(12px);
color: #999;
}
}
}
&-item {
display: inline-flex;
......@@ -77,11 +136,22 @@ export default {
text-align: center;
align-items: center;
&-name {
position: relative;
top: 0;
left: 0;
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
background-color: #F8F8F8;
color: #999;
font-size: px2rem(13px);
img {
position: absolute;
top: px2rem(-10px);
right: px2rem(-10px);
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
}
}
......
<template>
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<section class="history-labels-title">
<span>{{title}}</span>
</section>
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<section class="history-labels-title">
<span>{{title}}</span>
</section>
<section class="history-labels-item"
@click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">{{item.doctorName}}</span>
</section>
</article>
<section class="history-labels-item" @click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)" v-for="(item, index) in allLabels" :key="index">
<span class="history-labels-item-name">{{item.keyword}}</span>
</section>
</article>
</template>
<script>
import {mapMutations} from 'vuex'
import {
mapMutations
} from 'vuex'
export default {
name: 'YqyHotLabel',
props: {
allLabels: {
type: Array
},
direction: {
type: String,
default: 'left'
},
title: {
type: String,
default: '历史搜索'
name: 'HotLabels',
props: {
title: {
type: String,
default: '热门搜索'
}
},
hasBanner: {
type: Boolean,
default: false
data() {
return {
allLabels: []
}
},
hasInfo: {
type: Boolean,
default: false
mounted() {
this.getData()
},
showDelete: {
type: Boolean,
default: true
}
},
data () {
return {
}
},
mounted(){
},
methods: {
...mapMutations([
'SET_CLEAR_VUEX'
]),
hotLabel(val,id,url,name,item){
this.$emit('hotLabel',id,name)
//讲师集
switch (val) {
case 1:
this.SET_CLEAR_VUEX()
this.jumpToCourse(item.resourceId);
break;
case 2:
this.SET_CLEAR_VUEX()
//window.location.href=url;
this.jumpToCartoon(url,name)
break;
case 3:
this.SET_CLEAR_VUEX()
this.$router.push({path:'/lecturer',query:{id:id}})
break;
default:
break;
}
},
dispatchEventByModuleCode(itemData) {
methods: {
// ...mapMutations([
// 'SET_CLEAR_VUEX'
// ]),
hotLabel(val, id, url, name, item) {
this.$emit('hotLabel', id, name)
//讲师集
switch (val) {
case 1:
this.SET_CLEAR_VUEX()
this.jumpToCourse(item.resourceId);
break;
case 2:
this.SET_CLEAR_VUEX()
//window.location.href=url;
this.jumpToCartoon(url, name)
break;
case 3:
this.SET_CLEAR_VUEX()
this.$router.push({
path: '/lecturer',
query: {
id: id
}
})
break;
default:
break;
}
},
dispatchEventByModuleCode(itemData) {
let modeCode = itemData.appModuleInfo.code
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
if (modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
} else if( modeCode === 'M100' || modeCode === 'M300' ) {
} else if (modeCode === 'M100' || modeCode === 'M300') {
let urlPara = this.getUrlPara(paramList)
paramList[0].value += urlPara
}
if(typeof paramList === 'string' && !paramList){
if (typeof paramList === 'string' && !paramList) {
paramList = []
}
rocNative.dispatchEventByModuleCode({
......@@ -92,27 +79,26 @@ export default {
},
//跳到相应的课程
jumpToCourse(id){
let itemData={
"title":"测试课介绍页",
"imageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"appModuleInfo":{
"code":"M200",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"key":"className",
"value":"com.picahealth.yunque.activitys.courseplaynew.CourseIntroduceActivity###WeexCourseIntroViewController",
"type":4,
"seqNo":1
jumpToCourse(id) {
let itemData = {
"title": "测试课介绍页",
"imageUrl": "https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"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":`${id}`,
"type":1,
"seqNo":2
"key": "courseId",
"value": `${id}`,
"type": 1,
"seqNo": 2
}
]
}
......@@ -120,72 +106,93 @@ export default {
this.dispatchEventByModuleCode(itemData);
},
// 跳到漫画详情页
jumpToCartoon(url,name) {
let itemData={
"title":"测试课介绍页",
"imageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"appModuleInfo":{
"code":"M300",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"key":"pageUrl",
"value": url,
"type":4,
"seqNo":1
},{
"key":"showTitle",
"value": true,
"type":1,
"seqNo":2
},{
"key":"title",
"value": name,
"type":1,
"seqNo":2
}
]
jumpToCartoon(url, name) {
let itemData = {
"title": "测试课介绍页",
"imageUrl": "https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"appModuleInfo": {
"code": "M300",
"type": 4,
"name": "课程介绍页",
"paramFlag": 1,
"paramList": [{
"key": "pageUrl",
"value": url,
"type": 4,
"seqNo": 1
}, {
"key": "showTitle",
"value": true,
"type": 1,
"seqNo": 2
}, {
"key": "title",
"value": name,
"type": 1,
"seqNo": 2
}]
}
};
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: itemData.appModuleInfo.paramList
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
type: 2,
token: _this.token,
setEntry: 'headers'
}
let url = '/contents/searchKeyword/listKeywords'
this.GET(url, para).then(res => {
if (res.code == '000000') {
this.allLabels = res.data
console.log(res)
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.history-labels {
width: 100%;
padding: 0 px2rem(15px) 0;
margin-bottom: px2rem(6px);
background-color: #fff;
&-title {
display: inline-flex;
width: 100%;
align-items: center;
justify-content: space-between;
span {
font-size: px2rem(12px);
color: 6;
color: #666;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
&-item {
display: inline-flex;
height: px2rem(30px);
margin: px2rem(0px) px2rem(15px) 0 0;
text-align: center;
align-items: center;
&-name {
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
......@@ -195,5 +202,4 @@ export default {
}
}
}
</style>
<template>
<article class="search-wrapper">
<section class="search-wrapper-input">
<form action="" @submit.stop="search">
<!-- <form action="" @submit.stop.prevent="search"> -->
<img src='../../images/search-grey.png'>
<input type="search" v-model="searchText"/>
</form>
<input type="search" v-model="currentText" @keydown.enter="search"/>
<!-- <button type="submit" v-show="false"/> -->
<!-- </form> -->
</section>
<section class="search-wrapper-cancle">
<span @click="cancel">取消</span>
......@@ -15,18 +16,39 @@
export default {
data() {
return {
searchText: '搜索疾病、课程、讲师'
currentText: ''
}
},
props: {
searchText: {
type: String,
default: ''
}
},
// computed: {
// currentText() {
// return this.searchText
// }
// },
watch: {
searchText(val) {
this.currentText = val
console.log(val)
}
},
mounted() {
// this.getData()
},
methods: {
// 取消
cancel() {
console.log('in cancel')
this.searchText = ''
this.currentText = ''
},
// 搜索
search() {
this.$emit('search', this.searchText)
console.log(this.currentText)
this.$emit('search', this.currentText)
}
}
}
......@@ -40,13 +62,14 @@ export default {
position: fixed;
top: 0;
left: 0;
z-index: 1;
z-index: 2;
width: 100%;
background: #fff;
flex-direction: row;
padding: px2rem(20px) px2rem(10px) px2rem(10px) px2rem(15px);
text-align: center;
align-items: center;
background: #fff;
border-bottom: 1px solid #F8F8F8;
&-input {
width: px2rem(290px);
height: px2rem(30px);
......@@ -55,21 +78,22 @@ export default {
background: rgba(245, 246, 246, 1);
img {
position: relative;
top: px2rem(-18px);
top: px2rem(-13px);
left: px2rem(0px);
width: px2rem(14px);
height: px2rem(14px);
}
input {
position: relative;
top: px2rem(-20px);
top: px2rem(-15px);
left: px2rem(-8px);
width: px2rem(240px);
text-decoration-color: #bbb;
color: #bbb;
color: #666;
font-size: px2rem(13px);
font-weight: 400;
background: rgba(245, 246, 246, 1);
user-select: all;
&[type="search"]::-webkit-search-cancel-button{
display: none;
}
......
* {
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
// * {
// -webkit-user-select: none;
// -moz-user-select: none;
// -o-user-select: none;
// user-select: none;
// }
body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, h6, i, b, textarea, button, input, select, figure, figcaption, {
padding: 0;
......
......@@ -226,11 +226,14 @@ export function jumpEvaluatPage(){
return evaluatPageUrl
}
// // dev地址
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
// const apiUrl = 'https://dev-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// dev地址
// const baseUrl = 'http://192.168.140.14:10201/'
const baseUrl = 'http://10.177.10.149:10201/'
// const baseUrl = 'http://192.168.140.14:10201/'
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
const apiUrl = 'https://dev-api.yunqueyi.com/'
const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// // test1地址
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
......@@ -243,11 +246,11 @@ export function jumpEvaluatPage(){
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://uat-phome.yunqueyi.com/appl/#/'
// pro地址
const baseUrl = 'https://sc.yunqueyi.com/'
const apiUrl = 'https://api.yunqueyi.com/'
const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// // pro地址
// const baseUrl = 'https://sc.yunqueyi.com/'
// const apiUrl = 'https://api.yunqueyi.com/'
// const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// 获取BaseUrl
......
......@@ -117,13 +117,9 @@ module.exports = {
return paramList;
},
// 通用GET请求
GET(api, para, callback,str) {
if(para.token){
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC'
}
para.token = para.token || this.token || 'FA95BE7379684E419050F72BCEB0DE12'
let url = api + this.getUrlPara(para)
return fetch({
url: getBaseUrl(url),
......@@ -134,10 +130,7 @@ module.exports = {
// 通用POST请求
POST(api, para, callback) {
if(para.token){
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC'
}
//para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
para.token = para.token || this.token || 'FA95BE7379684E419050F72BCEB0DE12'
return fetch({
url: getBaseUrl(api),
method: 'post',
......
......@@ -29,6 +29,9 @@
if(t == 'getToken'){
__getToken(n);
}
if(t == '__isFirstTime'){
window.__isFirstTime(n)
}
},
__callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o);
......@@ -75,7 +78,7 @@
})
}
})
}("dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "gotoLogin", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight","setTabMiniIcon","getUserInfo","pauseAudioView");
}("isFirstTime","setFirstTime","dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "gotoLogin", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight","setTabMiniIcon","getUserInfo","pauseAudioView");
if (e.__rocAndroid) {
e.__isAndroid = true
e.__isIOS = false
......
<template>
<div class="main-body" ref="wrapper">
<section :class="isIntStyle">
<!--展开收起学习评价-->
<YqyTopEvaluat :isShowEvluat="isShowEvluat" v-if="isShowEvluat" :parmData="evaluctObj" v-on:evluatFun="getEluatFun"/>
<section class="home-header">
<div class="home-topMenu">
<YqyHomeHeader :msgCount="msgCount" :searchFix="searchFix" v-on:setAppMsg="goAppMsg" @jumpToSS="jumpToSS"/>
</div>
<div class="swiper" style="padding-top:100px;">
<mt-swipe :auto="3000" :speed="speedSwiper" :stopPropagation="prevent">
<mt-swipe-item v-for="(item,index) in listSwiper" :key="index" >
<!-- <img :src="item.imageUrl" @click="goLinkByswiper(item)"/> -->
<img :src="item.imageUrl" @click="goLinkByswiper(item)"/>
</mt-swipe-item>
</mt-swipe>
</div>
</section>
<section class="home-body">
<YqyHomeBanner :userToken="userToken"/>
<div class="pathologic-list">
<div
v-for="(item, index) in listMiddle"
class="pathologic-item"
:style="index % 2 == 1 ? 'margin-right: 0' : ''"
@click="goToPatholo(item)"
:key="index">
<span class="pathologic-icon">
<img :src="item.imageUrl"/>
</span>
<!-- <span class="pathologic-txt fs14">{{item.name}}</span> -->
</div>
<div class="clear"></div>
</div>
<!--继续学习-->
<YqyHomeKeepon :parmData="keeponData" v-if="isShowKeep" v-on:hideKeepon="hideKeepon"/>
<div style="background:#333;">
<input type="search" @click="goToPage" />
</div>
<!--专题分类-->
<YqyCategoryThree1 />
<!--云雀名师-->
<YqyHomeAdv :userToken="userToken"/>
<!--最新课程-->
<YqyTeacherList :parmData="newsDatalist" :userToken="userToken" v-on:setRefrshParm="getRefrshParm"/>
<!--分钟医学院-->
<YqyFiveMinutes :parmData="fiveList" v-if="fiveList.length>0"/>
<!--为你推荐-->
<YqyHomeAdjust :isFixed="isFixed" :statusBarHeight="statusBarHeight" :parmData="adjustList" v-if="adjustList.length>0" :userToken="userToken" v-on:setRefrshParm="getRefrshParm" :adjustPageNo="adjustPageNo"/>
<!--返回顶部-->
<BackTop v-if="isShowBackTop"/>
<a class="news-update" @click="goAnchors" v-show="showNewCorse">
<span class="news-info">
{{updateStr}}个新内容
<i></i>
</span>
</a>
</section>
</section>
</div>
</template>
<script>
import { Swipe, SwipeItem ,Header} from 'mint-ui';
// import { setEventByModuleCode } from '@/utils/index'
// import pullRefresh from '../components/common/pullrefresh'
import {mapState, mapMutations} from 'vuex'
import BackTop from '../components/common/backTop';
import YqyTeacherList from '../components/business-new/yqy-teacher-list';
import YqyTopEvaluat from '../components/business-new/yqy-home-learn-evaluation';
import YqyHomeHeader from '../components/business-new/yqy-home-header';
import YqyHomeAdv from '../components/business-new/yqy-home-adv';
import YqyFiveMinutes from '../components/business-new/yqy-five-minutes';
import YqyCategoryThree1 from '../components/business-new/yqy-category-three-1';
import YqyHomeBanner from '../components/business-new/yqy-home-banner';
import YqyHomeKeepon from '../components/business-new/yqy-home-keepon';
import YqyHomePorter from '../components/business-new/yqy-home-porter';
import YqyHomeAdjust from '../components/business-new/yqy-adjust';
export default {
data(){
return {
wrapperHeight:0,
prevent:true,
topDistance:20,
allLoaded:false,
isAutoFill:false,
showNewCorse:false, // 是否显示新内容 默认不显示
isFixed:false,
isShowBackTop:false,
isShowEvluat:false, //是否显示下拉
evaluctObj:{}, //下拉数据
iconList:[], //icon数据
keeponData:{}, //继续学习
isShowKeep:false,
listCategory:[{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}], //专题分类数据
yqDoctorList:[],//云雀名师数据
newsDatalist:[],//最新课程
fiveList:[],//五分钟医学院
adjustList:[],//为您推荐
isBodyPull:false,
speedSwiper:300,
stopPropagation:true,
isIntStyle:'',
listSwiper:[{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}],//轮播图数据
listMiddle: [{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}],//中间栏数据
scrollTimer:null,
scrollTop:0,
hideNewCourse:true,
updateTotal:0,
msgCount:'',
userToken:'',
searchFix:false,
statusBarHeight:0,
userMobile:'',
userToken:'',
isHeightFromApp:false,
isFirstPull:true,
updateStr:'',
isRefreshFromBack:false,
isRefrshMsg:false,
isFailSwiper:1,
isFailCatagory1:false,
isFailCatagory2:false,
isFailCatagory3:false,
isFailTeaches:false,
isFailFive:false,
adjustPageNo:1,
setTimer:null,
}
},
components:{
Header,
Swipe,
SwipeItem,
BackTop,
YqyTopEvaluat,
YqyTeacherList,
YqyHomeHeader,
YqyHomeAdv,
YqyFiveMinutes,
YqyCategoryThree1,
YqyHomeBanner,
YqyHomeKeepon,
YqyHomePorter,
YqyHomeAdjust
},
created () {
// alert(222)
let _this = this;
_this.initAll()
_this.getUserInfo();
window.__nativeCallMsg = function(params){
_this.msgCount = params.msgNum || '';
// alert(_this.msgCount);
}
window.__getToken = function(params){
//alert(params.userToken);
// _this.userToken = params.userToken
// _this.getUserInfo();
// _this.initByToken(params.userToken);
}
window.__refresh = function(params){
_this.adjustPageNo = 1;
if(_this.setTimer != null){
clearInterval(_this.setTimer);
_this.isShowEvluat = false;
_this.isIntStyle = '';
}
//alert(_this.isShowEvluat);
//返回
if(_this.isRefreshFromBack){
_this.getAdjustData(_this.userToken);
_this.getNewsData(_this.userToken);
} else if(_this.isShowEvluat && !_this.isRefreshFromBack){
_this.isIntStyle = 'font-style pull-down';
_this.fiveTimePull();
} else {
//alert("000")
_this.isIntStyle = '';
_this.isShowEvluat = false;
_this.getUserInfo();
}
}
// window.__getStatusBarHeight = function(parm){
// alert(JSON.stringify(parm))
// _this.statusBarHeight = parm.statusBarHeight;
// _this.isHeightFromApp = true;
// // alert(parm.statusBarHeight);
// }
// alert("token之前");
window.__getUserInfo = function(parm){
//alert(JSON.stringify(parm))
_this.systemType = parm.systemType;
_this.appVersion = parm.appVersion;
_this.token = parm.userToken;
_this.userToken = parm.userToken;
_this.userMobile = parm.userMobile;
if(parm.userMobile && parm.userMobile != ''){
_this.getKeepData(parm.userToken);
}
_this.initByToken(parm.userToken);
}
//_this.getStatusHight();
//
// _this.token = '593F679F62964076AF1C7489DA3343ED';
// _this.msgCount = '2'
// _this.isShowKeep = true;
// _this.isHeightFromApp = true;
// _this.getKeepData(_this.token);
_this.initByToken('593F679F62964076AF1C7489DA3343ED');
// _this.getIconData(_this.token);
// _this.isIntStyle = 'font-style pull-down';
// _this.fiveTimePull();
//_this.getUserInfo();
window.__isFirstTime = function(param) {
alert(JSON.stringify(param))
if(param.isFirst == 'true') {
alert(222)
rocNative.setFirstTime({
projectName: 'YQY_PROJECT_SOUSUO',
isFirst: 'false'
})
}
}
this.isFirstTime()
},
mounted(){
// this.wrapperHeight =document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
window.addEventListener('scroll', this.scrollFun);
},
beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun)
},
watch:{
//监听是否收起
isShowEvluat:function(n){
///alert(n);
if(!n && this.isIntStyle == 'font-style pull-up'){
rocNative.setTabMiniIcon({
tabIndex:3,
iconTitle:'学习评价',
iconColor:'',
isSet:true
})
}
}
},
methods:{
...mapMutations([
'SET_DATA'
]),
goToPage(){
this.$router.push({
path: '/search'
})
},
isFirstTime() {
rocNative.isFirstTime({
projectName: 'YQY_PROJECT_SOUSUO',
__funcName: '__isFirstTime'
})
},
jumpToSS() {
this.$router.push({
path:'/search'
})
},
goAppMsg(){
this.isRefrshMsg = true;
// alert(this.isRefrshMsg);
},
hideKeepon(){
this.isShowKeep = false;
},
getRefrshParm(obj){
this.isRefreshFromBack = obj.isclick;
},
//轮播图开始滚动
swiperFun(){
// var swiper = new Swiper('.swiper-container', {
// speed: 600,
//             //loop: true,
//             observer:true,
//             observeParents:true,
//             autoplayDisableOnInteraction : false,
//             autoplay:3000,
// pagination: '.pagination'
// });
},
loadTop(){
//location.reload();
this.$refs.loadmore.onTopLoaded();
},
initByToken(userToken){
this.getAdjustData(userToken);
this.getNewsData(userToken);
this.getEvaluctData(userToken);
},
initAll(){
this.getSwiper()
/// this.getUpdateData();
this.getMiddel();
this.getIconData();
this.getCategoryData();
this.getYqDoctorData();
this.getFiveData();
},
//获取状态栏高度
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
getToken(){
rocNative.getToken({
__funcName: '__getToken'
})
},
//获取版本号
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
//轮播图跳转
goLinkByswiper(itemData){
///alert("0000");
// console.log(item);
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_banner',
actionCode:'c_banner',
labelId:itemData.id,
labelValue:itemData.name
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//获取评价
getEvaluctData(userToken){
//alert(userToken);
let _this = this, para = {
sysCode: 27,
token: userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
clearInterval(_this.setTimer);
_this.isShowEvluat = false;
_this.isIntStyle = ''
_this.GET('contents/gp/v1/homepage', para).then(res => {
if(res.code == '000000'){
// res.data = {
// avatarImageUrl: "https://test-file.yunqueyi.com/File/doctor_default.png",
// certificateAcquireNumOfHospital: 10,
// certificateAcquireNumOfSelf: 9,
// courseOverNumOfHospital: 10,
// courseOverNumOfSelf: 5,
// examOverNumOfHospital: 10,
// examOverNumOfSelf: 5,
// gradePKToHospital: 0.67,
// showFlag: true
// }
_this.evaluctObj = res.data || {};
if(res.data.certificateAcquireNumOfSelf == 0 && res.data.courseOverNumOfSelf == 0 && res.data.examOverNumOfSelf == 0){
_this.isShowEvluat = false;
}else{
_this.isShowEvluat = res.data.showFlag;
if(!_this.isShowEvluat){
_this.isIntStyle = ''
}else{
_this.fiveTimePull();
_this.isIntStyle = 'font-style pull-down'
}
}
}
if(!_this.isShowEvluat){
rocNative.setTabMiniIcon({
tabIndex:3,
iconTitle:'学习评价',
iconColor:'',
isSet:true
})
}
})
},
//获取小icon数据
getIconData(){
let _this = this,
para = {
category: 1,
position:1,
setEntry: 'headers',
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
_this.iconList = res.data && res.data.iconColumnInformationModels || []
}
})
},
//获取专题分类s数据
getCategoryData(){
let _this = this,
para = {
category: 1,
position:3,
setEntry: 'headers'
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
//console.log(res);
_this.listCategory = res.data && res.data.iconColumnInformationModels || [];
/// console.log(_this.list);
}
})
},
//继续学习数据
getKeepData(userToken){
let _this = this,
parm = {
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('contents/courses/continueLearningCourse',parm).then(function(res){
if(res.code === '000000'){
_this.keeponData = res.data && res.data.continueLearningCourseModel || {};
if(_this.keeponData.remanentCourseNum == 0){
_this.isShowKeep = false;
}else{
_this.isShowKeep = _this.keeponData.showFlag ? true : false;
}
}
})
},
//云雀名师
getYqDoctorData(){
let _this = this,
para = {
pageNo:1,
pageSize:10,
setEntry: 'headers'
}
this.GET('contents/HomeLecturer/LecturerInformation', para).then(res => {
if(res.code == '000000'){
_this.yqDoctorList = res.data && res.data.pCourseDoctorModels || []
}
})
},
//最新课程
getNewsData(userToken){
this.newsDatalist = [];
let _this = this,
parm = {
pageNo:1,
pageSize:6,
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('/contents/HomeNewCourse/NewCourseInformation',parm).then(function(res){
if(res.code === '000000'){
_this.newsDatalist = res.data.contentAppModels || [];
//alert( _this.newsDatalist[0].joinNum)
if(_this.newsDatalist.length>0){
_this.userToken = userToken;
}
}
})
},
//五分钟医学院
getFiveData(){
let _this = this,
parm = {
pageNo: 1,
pageSize: 3,
data:{
setEntry: 'headers'
}
}
this.API_GET('contents/fiveMinutes/contents',parm).then(res => {
if(res.respCode == '200'){
_this.fiveList = _this.handelFive(res.fiveMinutesMedicalContentList) || []
}
})
},
//处理五分钟数据 初始化播放状态
handelFive(d){
for(let i=0;i<d.length;i++){
d[i].play = '0';
}
return d;
},
//为您推荐
getAdjustData(userToken){
this.adjustList = []
let _this = this,
parm = {
pageNo:1,
pageSize:10,
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('contents/courses/recommendCourseList',parm).then(function(res){
if(res.code === '000000'){
_this.adjustList = res.data || [];
_this.adjustPageNo = 1;
_this.SET_DATA(_this.adjustList)
if(_this.adjustList.length>0){
_this.userToken = userToken
}
}
})
},
//有更新数据
getUpdateData(){
let _this = this,
para = {
setEntry: 'headers'
}
//alert("000");
this.GET('contents/courses/queryCourseCount', para).then(res => {
if(res.code == '000000'){
if(res.data != null){
// _this.updateTotal = res.data.courseCount + res.data.fiveHospCount || 0
// if(_this.updateTotal > 0){
// _this.showNewCorse = true;
// _this.updateStr = _this.updateTotal>9 ? '9+' : _this.updateTotal
// }else{
// _this.showNewCorse = false
// }
}
}
})
},
goAnchors(){
if(document.querySelector('#new-course')){
document.documentElement.scrollTop = document.querySelector('#new-course').offsetTop;
document.body.scrollTop = document.querySelector('#new-course').offsetTop;
}
this.hideNewCourse = false;
this.showNewCorse = false;
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_new_course',
actionCode:'c_newcourse_list',
})
},
scrollEndFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
// let newCourseTop = document.querySelector('#famus-teacher').offsetTop;
// let fivesTop = document.querySelector('#fiveBoxMenu').offsetTop;
if(this.scrollTop != scrollTop){
this.showNewCorse = false;
}else{
this.showNewCorse = this.updateTotal>0 ? true : false;
}
},
scrollFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
this.showNewCorse = false;
if(this.hideNewCourse){
this.scrollTop = scrollTop;
clearTimeout(this.scrollTimer);
this.scrollTimer = setTimeout(this.scrollEndFun, 200);
}
if( this.isIntStyle == 'font-style pull-down'){
this.isIntStyle = 'font-style pull-up';
clearInterval(this.setTimer)
this.isShowEvluat = false;
}
var adjustTop = 100;
//滚动条滚动到最新课程
var newCourseTop = document.querySelector('#famus-teacher').offsetTop;
var clientHeight = document.querySelector('#famus-teacher').clientHeight;
if(document.querySelector('#adjust-u')){
adjustTop = document.querySelector('#adjust-u').offsetTop;
}
var searchBox = document.querySelector('#search-top').offsetParent.offsetTop;
//console.log(searchBox);
if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
//this.showNewCorse = false;
this.isShowBackTop = true;
}else{
this.isShowBackTop = false;
}
if(scrollTop+30 >= adjustTop){
this.isFixed = true;
this.searchFix = false;
}else{
this.isFixed = false;
}
if(scrollTop > searchBox){
//alert("000");
///console.log(scrollTop,searchBox);
this.searchFix = true;
}else{
this.searchFix = false;
}
},
//五秒之后收起
fiveTimePull(){
let _this = this;
_this.setTimer = setInterval(function(){
_this.isIntStyle = 'font-style pull-up';
_this.isShowEvluat = false;
///alert("0")
clearInterval(_this.setTimer)
},5000);
},
getEluatFun(obj){
///console.log(obj);
if(obj.isPull == '1'){
this.isIntStyle = 'font-style pull-down';
this.fiveTimePull()
}else if(obj.isPull == '2'){
this.isIntStyle = ''
}else if(obj.isPull == '0'){
this.isIntStyle = 'font-style pull-up'
}
},
//获取轮播图数据
getSwiper(){
let _this = this,
para = {
category:1,
position:4,
setEntry: 'headers',
data:{
setEntry: 'headers'
}
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
_this.listSwiper = res.data.iconColumnInformationModels || [];
_this.swiperFun();
}
if( _this.listSwiper.length == 0){
_this.isFailSwiper += 1;
}
_this.isFailSwiper = _this.listSwiper.length == 0 ? 2 : 1 ;
})
},
//中间栏数据
getMiddel(){
let _this = this,
para = {
category: 1,
position:2,
setEntry: 'headers',
// token:_this.token
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
// console.log(res);
_this.listMiddle = (res.data && res.data.iconColumnInformationModels || []).slice()
}
_this.isFailCatagory2 = _this.listMiddle.length == 0 ? true : false;
})
},
//中间栏跳转
goToPatholo(itemData){
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_middle',
actionCode:'c_field',
labelId:itemData.id,
labelValue :itemData.name,
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
},
}
</script>
<style>
.swiper .mint-swipe-indicators{
right: 6px;
top:50%;
bottom: inherit;
left:inherit;
width:10px;
text-align: center;
transform: translateX(0%);
transform: translateY(-50%);
}
.swiper .mint-swipe-item img{
width: 100%;
height: 100%;
}
.swiper .mint-swipe-indicator{
width:2px;
height: 8px;
background: #fff;
opacity: 0.4;
float: left;
margin-top:3px;
}
.swiper .is-active{
opacity: 1;
}
.mint-loadmore-top .mint-loadmore-text{font-size: 12px;}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets{
width: 2px;
left: inherit;
transform: translateY(-50%);
position: absolute;
right: 6px;
top:50%;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{
width: 2px;
height: 7px;
background: #fff;
margin:6px 0 0 0;
float: left;
opacity: 0.4;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet-active{
opacity: 1
}
.banner-pagination{
width: 2px;
z-index: 100;
right: 10px;
top:10px;
position: absolute;
}
.swiper-pagination-bullet{
}
.swiper-slide img{
width: 100%;
height: 100%;
}
</style>
<style lang="scss" scoped>
@import '../style/mixin';
@import '../style/swiper.min.css';
img {
@include bis('../images/icon-p3-2.png');
}
.banner-container{
height: px2rem(210px)
}
.main-body{
position: relative;
}
.box-BG{
width: 100%;
height: 100%;
position: absolute;
top:0;
left: 0;
z-index: 10000
}
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
@include sc(0.6rem, #666);
}
.top-evaluat{
}
@keyframes myPullDown{
from {padding-top: 0;}
to {padding-top:px2rem(225px)}
}
@keyframes myPullUp{
from {padding-top: px2rem(225px);}
to {padding-top:0}
}
.pull-down{
-webkit-animation: myPullDown 1.2s;
animation: myPullDown 1.2s;
padding-top:px2rem(225px)
}
.pull-up{
-webkit-animation: myPullUp 1.2s;
animation: myPullUp 1.2s;
padding-top:0
}
.news-update{
display: block;
position: fixed;
background: #F9F6EF;
right: 0;
bottom: px2rem(140px);
height: px2rem(27px);
padding:0 px2rem(12px);;
line-height: px2rem(27px);
border:1px solid RGBA(162, 129, 60, 0.2);
font-size: px2rem(13px);
box-shadow: 0 px2rem(2px) px2rem(3px) RGBA(202, 168, 97, 0.4);
border-radius: px2rem(14px) 0 0 px2rem(14px);
z-index: 101;
.news-info{
color: #A2813C;
position: relative;
display: inline-block;
i{
position: absolute;
right: -(px2rem(6px));
top:px2rem(4px);
display: inline-block;
width: px2rem(4px);
height: px2rem(4px);
border-radius: 100%;
background: #F47A48
}
}
}
.home-topMenu{
width: 100%;
text-align:center;
top:0;
position: absolute;
z-index: 10;
}
.home-header {
height: px2rem(202px);
background: #333;
.swiper{
height: 100%;
/* @include bis('../images/552064153@2x.png');*/
}
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
.home-body{
background: #fff
}
.pathologic-list{
width: 100%;
height: px2rem(52px);
padding: 0 px2rem(15px);
margin-top: px2rem(15px);
.pathologic-item{
float: left;
width: 48%;
box-shadow: 0 px2rem(2px) px2rem(6px) RGBA(42, 94, 161, 0.15);
border-radius: px2rem(3px);
background: #fff;
/* padding: px2rem(12px) 0 px2rem(12px) 0;*/
margin-right: 4%;
text-align: center;
.pathologic-icon{
/* height: px2rem(20px);*/
img{
width: 100%;
height: px2rem(52px);
vertical-align: middle;
display: inline-block;
}
}
.pathologic-txt{
font-size: px2rem(14px);
line-height: px2rem(20px);
font-weight: 700;
display: inline-block;
vertical-align: middle;
}
}
.clear{
clear: both;
}
}
</style>
<template>
<div class="main-body" ref="wrapper">
<section :class="isIntStyle">
<!--展开收起学习评价-->
<YqyTopEvaluat :isShowEvluat="isShowEvluat" v-if="isShowEvluat" :parmData="evaluctObj" v-on:evluatFun="getEluatFun"/>
<section class="home-header">
<div class="home-topMenu">
<YqyHomeHeader :msgCount="msgCount" :searchFix="searchFix" v-on:setAppMsg="goAppMsg" @jumpToSS="jumpToSS"/>
</div>
<div class="swiper">
<mt-swipe :auto="3000" :speed="speedSwiper" :stopPropagation="prevent">
<mt-swipe-item v-for="(item,index) in listSwiper" :key="index" >
<!-- <img :src="item.imageUrl" @click="goLinkByswiper(item)"/> -->
<img :src="item.imageUrl" @click="goLinkByswiper(item)"/>
</mt-swipe-item>
</mt-swipe>
</div>
</section>
<section class="home-body">
<YqyHomeBanner :userToken="userToken"/>
<div class="pathologic-list">
<div
v-for="(item, index) in listMiddle"
class="pathologic-item"
:style="index % 2 == 1 ? 'margin-right: 0' : ''"
@click="goToPatholo(item)"
:key="index">
<span class="pathologic-icon">
<img :src="item.imageUrl"/>
</span>
<!-- <span class="pathologic-txt fs14">{{item.name}}</span> -->
</div>
<div class="clear"></div>
</div>
<!--继续学习-->
<YqyHomeKeepon :parmData="keeponData" v-if="isShowKeep" v-on:hideKeepon="hideKeepon"/>
<!--专题分类-->
<YqyCategoryThree1 />
<!--云雀名师-->
<YqyHomeAdv :userToken="userToken"/>
<!--最新课程-->
<YqyTeacherList :parmData="newsDatalist" :userToken="userToken" v-on:setRefrshParm="getRefrshParm"/>
<!--分钟医学院-->
<YqyFiveMinutes :parmData="fiveList" v-if="fiveList.length>0"/>
<!--为你推荐-->
<YqyHomeAdjust :isFixed="isFixed" :statusBarHeight="statusBarHeight" :parmData="adjustList" v-if="adjustList.length>0" :userToken="userToken" v-on:setRefrshParm="getRefrshParm" :adjustPageNo="adjustPageNo"/>
<!--返回顶部-->
<BackTop v-if="isShowBackTop"/>
<a class="news-update" @click="goAnchors" v-show="showNewCorse">
<span class="news-info">
{{updateStr}}个新内容
<i></i>
</span>
</a>
</section>
</section>
</div>
<template>
<section class="search-container">
<input type="search" @click="gotoPage"/>
</section>
</template>
<script>
import { Swipe, SwipeItem ,Header} from 'mint-ui';
// import { setEventByModuleCode } from '@/utils/index'
// import pullRefresh from '../components/common/pullrefresh'
import {mapState, mapMutations} from 'vuex'
import BackTop from '../components/common/backTop';
import YqyTeacherList from '../components/business-new/yqy-teacher-list';
import YqyTopEvaluat from '../components/business-new/yqy-home-learn-evaluation';
import YqyHomeHeader from '../components/business-new/yqy-home-header';
import YqyHomeAdv from '../components/business-new/yqy-home-adv';
import YqyFiveMinutes from '../components/business-new/yqy-five-minutes';
import YqyCategoryThree1 from '../components/business-new/yqy-category-three-1';
import YqyHomeBanner from '../components/business-new/yqy-home-banner';
import YqyHomeKeepon from '../components/business-new/yqy-home-keepon';
import YqyHomePorter from '../components/business-new/yqy-home-porter';
import YqyHomeAdjust from '../components/business-new/yqy-adjust';
export default {
data(){
data() {
return {
wrapperHeight:0,
prevent:true,
topDistance:20,
allLoaded:false,
isAutoFill:false,
showNewCorse:false, // 是否显示新内容 默认不显示
isFixed:false,
isShowBackTop:false,
isShowEvluat:false, //是否显示下拉
evaluctObj:{}, //下拉数据
iconList:[], //icon数据
keeponData:{}, //继续学习
isShowKeep:false,
listCategory:[{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}], //专题分类数据
yqDoctorList:[],//云雀名师数据
newsDatalist:[],//最新课程
fiveList:[],//五分钟医学院
adjustList:[],//为您推荐
isBodyPull:false,
speedSwiper:300,
stopPropagation:true,
isIntStyle:'',
listSwiper:[{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}],//轮播图数据
listMiddle: [{
"imageUrl": require('../images/error.png')
},{
"imageUrl": require('../images/error.png')
}],//中间栏数据
scrollTimer:null,
scrollTop:0,
hideNewCourse:true,
updateTotal:0,
msgCount:'',
userToken:'',
searchFix:false,
statusBarHeight:0,
userMobile:'',
userToken:'',
isHeightFromApp:false,
isFirstPull:true,
updateStr:'',
isRefreshFromBack:false,
isRefrshMsg:false,
isFailSwiper:1,
isFailCatagory1:false,
isFailCatagory2:false,
isFailCatagory3:false,
isFailTeaches:false,
isFailFive:false,
adjustPageNo:1,
setTimer:null,
}
},
components:{
Header,
Swipe,
SwipeItem,
BackTop,
YqyTopEvaluat,
YqyTeacherList,
YqyHomeHeader,
YqyHomeAdv,
YqyFiveMinutes,
YqyCategoryThree1,
YqyHomeBanner,
YqyHomeKeepon,
YqyHomePorter,
YqyHomeAdjust
},
created () {
// alert(222)
let _this = this;
_this.initAll()
_this.getUserInfo();
window.__nativeCallMsg = function(params){
_this.msgCount = params.msgNum || '';
// alert(_this.msgCount);
}
window.__getToken = function(params){
//alert(params.userToken);
// _this.userToken = params.userToken
// _this.getUserInfo();
// _this.initByToken(params.userToken);
}
window.__refresh = function(params){
_this.adjustPageNo = 1;
if(_this.setTimer != null){
clearInterval(_this.setTimer);
_this.isShowEvluat = false;
_this.isIntStyle = '';
}
//alert(_this.isShowEvluat);
//返回
if(_this.isRefreshFromBack){
_this.getAdjustData(_this.userToken);
_this.getNewsData(_this.userToken);
} else if(_this.isShowEvluat && !_this.isRefreshFromBack){
_this.isIntStyle = 'font-style pull-down';
_this.fiveTimePull();
} else {
//alert("000")
_this.isIntStyle = '';
_this.isShowEvluat = false;
_this.getUserInfo();
}
}
// window.__getStatusBarHeight = function(parm){
// alert(JSON.stringify(parm))
// _this.statusBarHeight = parm.statusBarHeight;
// _this.isHeightFromApp = true;
// // alert(parm.statusBarHeight);
// }
// alert("token之前");
window.__getUserInfo = function(parm){
//alert(JSON.stringify(parm))
_this.systemType = parm.systemType;
_this.appVersion = parm.appVersion;
_this.token = parm.userToken;
_this.userToken = parm.userToken;
_this.userMobile = parm.userMobile;
if(parm.userMobile && parm.userMobile != ''){
_this.getKeepData(parm.userToken);
}
_this.initByToken(parm.userToken);
}
//_this.getStatusHight();
//
// _this.token = '593F679F62964076AF1C7489DA3343ED';
// _this.msgCount = '2'
// _this.isShowKeep = true;
// _this.isHeightFromApp = true;
// _this.getKeepData(_this.token);
_this.initByToken('593F679F62964076AF1C7489DA3343ED');
// _this.getIconData(_this.token);
// _this.isIntStyle = 'font-style pull-down';
// _this.fiveTimePull();
//_this.getUserInfo();
},
mounted(){
// this.wrapperHeight =document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
window.addEventListener('scroll', this.scrollFun);
},
beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun)
},
watch:{
//监听是否收起
isShowEvluat:function(n){
///alert(n);
if(!n && this.isIntStyle == 'font-style pull-up'){
rocNative.setTabMiniIcon({
tabIndex:3,
iconTitle:'学习评价',
iconColor:'',
isSet:true
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()
},
methods:{
...mapMutations([
'SET_DATA'
]),
jumpToSS() {
this.$router.push({
path:'/search'
})
},
goAppMsg(){
this.isRefrshMsg = true;
// alert(this.isRefrshMsg);
},
hideKeepon(){
this.isShowKeep = false;
},
getRefrshParm(obj){
this.isRefreshFromBack = obj.isclick;
},
//轮播图开始滚动
swiperFun(){
// var swiper = new Swiper('.swiper-container', {
// speed: 600,
//             //loop: true,
//             observer:true,
//             observeParents:true,
//             autoplayDisableOnInteraction : false,
//             autoplay:3000,
// pagination: '.pagination'
// });
},
loadTop(){
//location.reload();
this.$refs.loadmore.onTopLoaded();
},
initByToken(userToken){
this.getAdjustData(userToken);
this.getNewsData(userToken);
this.getEvaluctData(userToken);
},
initAll(){
this.getSwiper()
/// this.getUpdateData();
this.getMiddel();
this.getIconData();
this.getCategoryData();
this.getYqDoctorData();
this.getFiveData();
},
//获取状态栏高度
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
getToken(){
rocNative.getToken({
__funcName: '__getToken'
})
},
//获取版本号
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
//轮播图跳转
goLinkByswiper(itemData){
///alert("0000");
// console.log(item);
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_banner',
actionCode:'c_banner',
labelId:itemData.id,
labelValue:itemData.name
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//获取评价
getEvaluctData(userToken){
//alert(userToken);
let _this = this, para = {
sysCode: 27,
token: userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
clearInterval(_this.setTimer);
_this.isShowEvluat = false;
_this.isIntStyle = ''
_this.GET('contents/gp/v1/homepage', para).then(res => {
if(res.code == '000000'){
// res.data = {
// avatarImageUrl: "https://test-file.yunqueyi.com/File/doctor_default.png",
// certificateAcquireNumOfHospital: 10,
// certificateAcquireNumOfSelf: 9,
// courseOverNumOfHospital: 10,
// courseOverNumOfSelf: 5,
// examOverNumOfHospital: 10,
// examOverNumOfSelf: 5,
// gradePKToHospital: 0.67,
// showFlag: true
// }
_this.evaluctObj = res.data || {};
if(res.data.certificateAcquireNumOfSelf == 0 && res.data.courseOverNumOfSelf == 0 && res.data.examOverNumOfSelf == 0){
_this.isShowEvluat = false;
}else{
_this.isShowEvluat = res.data.showFlag;
if(!_this.isShowEvluat){
_this.isIntStyle = ''
}else{
_this.fiveTimePull();
_this.isIntStyle = 'font-style pull-down'
}
}
}
if(!_this.isShowEvluat){
rocNative.setTabMiniIcon({
tabIndex:3,
iconTitle:'学习评价',
iconColor:'',
isSet:true
})
}
})
},
//获取小icon数据
getIconData(){
let _this = this,
para = {
category: 1,
position:1,
setEntry: 'headers',
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
_this.iconList = res.data && res.data.iconColumnInformationModels || []
}
})
},
//获取专题分类s数据
getCategoryData(){
let _this = this,
para = {
category: 1,
position:3,
setEntry: 'headers'
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
//console.log(res);
_this.listCategory = res.data && res.data.iconColumnInformationModels || [];
/// console.log(_this.list);
}
})
},
//继续学习数据
getKeepData(userToken){
let _this = this,
parm = {
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('contents/courses/continueLearningCourse',parm).then(function(res){
if(res.code === '000000'){
_this.keeponData = res.data && res.data.continueLearningCourseModel || {};
if(_this.keeponData.remanentCourseNum == 0){
_this.isShowKeep = false;
}else{
_this.isShowKeep = _this.keeponData.showFlag ? true : false;
}
}
})
},
//云雀名师
getYqDoctorData(){
let _this = this,
para = {
pageNo:1,
pageSize:10,
setEntry: 'headers'
}
this.GET('contents/HomeLecturer/LecturerInformation', para).then(res => {
if(res.code == '000000'){
_this.yqDoctorList = res.data && res.data.pCourseDoctorModels || []
}
})
},
//最新课程
getNewsData(userToken){
this.newsDatalist = [];
let _this = this,
parm = {
pageNo:1,
pageSize:6,
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('/contents/HomeNewCourse/NewCourseInformation',parm).then(function(res){
if(res.code === '000000'){
_this.newsDatalist = res.data.contentAppModels || [];
//alert( _this.newsDatalist[0].joinNum)
if(_this.newsDatalist.length>0){
_this.userToken = userToken;
}
}
})
},
//五分钟医学院
getFiveData(){
let _this = this,
parm = {
pageNo: 1,
pageSize: 3,
data:{
setEntry: 'headers'
}
}
this.API_GET('contents/fiveMinutes/contents',parm).then(res => {
if(res.respCode == '200'){
_this.fiveList = _this.handelFive(res.fiveMinutesMedicalContentList) || []
}
})
},
//处理五分钟数据 初始化播放状态
handelFive(d){
for(let i=0;i<d.length;i++){
d[i].play = '0';
}
return d;
},
//为您推荐
getAdjustData(userToken){
this.adjustList = []
let _this = this,
parm = {
pageNo:1,
pageSize:10,
token:userToken,
setEntry: 'headers',
data:{
token:userToken,
}
}
_this.GET('contents/courses/recommendCourseList',parm).then(function(res){
if(res.code === '000000'){
_this.adjustList = res.data || [];
_this.adjustPageNo = 1;
_this.SET_DATA(_this.adjustList)
if(_this.adjustList.length>0){
_this.userToken = userToken
}
}
})
},
//有更新数据
getUpdateData(){
let _this = this,
para = {
setEntry: 'headers'
}
//alert("000");
this.GET('contents/courses/queryCourseCount', para).then(res => {
if(res.code == '000000'){
if(res.data != null){
// _this.updateTotal = res.data.courseCount + res.data.fiveHospCount || 0
// if(_this.updateTotal > 0){
// _this.showNewCorse = true;
// _this.updateStr = _this.updateTotal>9 ? '9+' : _this.updateTotal
// }else{
// _this.showNewCorse = false
// }
}
}
})
},
goAnchors(){
if(document.querySelector('#new-course')){
document.documentElement.scrollTop = document.querySelector('#new-course').offsetTop;
document.body.scrollTop = document.querySelector('#new-course').offsetTop;
}
this.hideNewCourse = false;
this.showNewCorse = false;
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_new_course',
actionCode:'c_newcourse_list',
})
},
scrollEndFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
// let newCourseTop = document.querySelector('#famus-teacher').offsetTop;
// let fivesTop = document.querySelector('#fiveBoxMenu').offsetTop;
if(this.scrollTop != scrollTop){
this.showNewCorse = false;
}else{
this.showNewCorse = this.updateTotal>0 ? true : false;
}
},
scrollFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
this.showNewCorse = false;
if(this.hideNewCourse){
this.scrollTop = scrollTop;
clearTimeout(this.scrollTimer);
this.scrollTimer = setTimeout(this.scrollEndFun, 200);
}
if( this.isIntStyle == 'font-style pull-down'){
this.isIntStyle = 'font-style pull-up';
clearInterval(this.setTimer)
this.isShowEvluat = false;
}
var adjustTop = 100;
//滚动条滚动到最新课程
var newCourseTop = document.querySelector('#famus-teacher').offsetTop;
var clientHeight = document.querySelector('#famus-teacher').clientHeight;
if(document.querySelector('#adjust-u')){
adjustTop = document.querySelector('#adjust-u').offsetTop;
}
var searchBox = document.querySelector('#search-top').offsetParent.offsetTop;
//console.log(searchBox);
if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
//this.showNewCorse = false;
this.isShowBackTop = true;
}else{
this.isShowBackTop = false;
}
if(scrollTop+30 >= adjustTop){
this.isFixed = true;
this.searchFix = false;
}else{
this.isFixed = false;
}
if(scrollTop > searchBox){
//alert("000");
///console.log(scrollTop,searchBox);
this.searchFix = true;
}else{
this.searchFix = false;
}
},
//五秒之后收起
fiveTimePull(){
let _this = this;
_this.setTimer = setInterval(function(){
_this.isIntStyle = 'font-style pull-up';
_this.isShowEvluat = false;
///alert("0")
clearInterval(_this.setTimer)
},5000);
},
getEluatFun(obj){
///console.log(obj);
if(obj.isPull == '1'){
this.isIntStyle = 'font-style pull-down';
this.fiveTimePull()
}else if(obj.isPull == '2'){
this.isIntStyle = ''
}else if(obj.isPull == '0'){
this.isIntStyle = 'font-style pull-up'
}
},
//获取轮播图数据
getSwiper(){
let _this = this,
para = {
category:1,
position:4,
setEntry: 'headers',
data:{
setEntry: 'headers'
}
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
_this.listSwiper = res.data.iconColumnInformationModels || [];
_this.swiperFun();
}
if( _this.listSwiper.length == 0){
_this.isFailSwiper += 1;
}
_this.isFailSwiper = _this.listSwiper.length == 0 ? 2 : 1 ;
})
methods: {
gotoPage() {
// this.$router.push('/search')
},
//中间栏数据
getMiddel(){
let _this = this,
para = {
category: 1,
position:2,
setEntry: 'headers',
// token:_this.token
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
// console.log(res);
_this.listMiddle = (res.data && res.data.iconColumnInformationModels || []).slice()
}
_this.isFailCatagory2 = _this.listMiddle.length == 0 ? true : false;
isFirstTime() {
rocNative.isFirstTime({
projectName: 'YQY_PROJECT_SOUSUO',
__funcName: '__isFirstTime'
})
},
//中间栏跳转
goToPatholo(itemData){
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_middle',
actionCode:'c_field',
labelId:itemData.id,
labelValue :itemData.name,
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
},
}
}
</script>
<style>
.swiper .mint-swipe-indicators{
right: 6px;
top:50%;
bottom: inherit;
left:inherit;
width:10px;
<style lang="scss">
.search-container {
height: 100px;
text-align: center;
transform: translateX(0%);
transform: translateY(-50%);
}
.swiper .mint-swipe-item img{
width: 100%;
height: 100%;
}
.swiper .mint-swipe-indicator{
width:2px;
height: 8px;
background: #fff;
opacity: 0.4;
float: left;
margin-top:3px;
}
.swiper .is-active{
opacity: 1;
}
.mint-loadmore-top .mint-loadmore-text{font-size: 12px;}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets{
width: 2px;
left: inherit;
transform: translateY(-50%);
position: absolute;
right: 6px;
top:50%;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{
width: 2px;
height: 7px;
background: #fff;
margin:6px 0 0 0;
float: left;
opacity: 0.4;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet-active{
opacity: 1
}
.banner-pagination{
width: 2px;
z-index: 100;
right: 10px;
top:10px;
position: absolute;
}
.swiper-pagination-bullet{
}
.swiper-slide img{
width: 100%;
height: 100%;
}
</style>
<style lang="scss" scoped>
@import '../style/mixin';
@import '../style/swiper.min.css';
img {
@include bis('../images/icon-p3-2.png');
}
.banner-container{
height: px2rem(210px)
}
.main-body{
position: relative;
background-color: #333;
}
.box-BG{
width: 100%;
height: 100%;
position: absolute;
top:0;
left: 0;
z-index: 10000
}
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
@include sc(0.6rem, #666);
}
.top-evaluat{
}
@keyframes myPullDown{
from {padding-top: 0;}
to {padding-top:px2rem(225px)}
}
@keyframes myPullUp{
from {padding-top: px2rem(225px);}
to {padding-top:0}
}
.pull-down{
-webkit-animation: myPullDown 1.2s;
animation: myPullDown 1.2s;
padding-top:px2rem(225px)
}
.pull-up{
-webkit-animation: myPullUp 1.2s;
animation: myPullUp 1.2s;
padding-top:0
}
.news-update{
display: block;
position: fixed;
background: #F9F6EF;
right: 0;
bottom: px2rem(140px);
height: px2rem(27px);
padding:0 px2rem(12px);;
line-height: px2rem(27px);
border:1px solid RGBA(162, 129, 60, 0.2);
font-size: px2rem(13px);
box-shadow: 0 px2rem(2px) px2rem(3px) RGBA(202, 168, 97, 0.4);
border-radius: px2rem(14px) 0 0 px2rem(14px);
z-index: 101;
.news-info{
color: #A2813C;
position: relative;
display: inline-block;
i{
position: absolute;
right: -(px2rem(6px));
top:px2rem(4px);
display: inline-block;
width: px2rem(4px);
height: px2rem(4px);
border-radius: 100%;
background: #F47A48
}
}
}
.home-topMenu{
width: 100%;
text-align:center;
top:0;
position: absolute;
z-index: 10;
}
.home-header {
height: px2rem(202px);
.swiper{
height: 100%;
/* @include bis('../images/552064153@2x.png');*/
}
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
.home-body{
background: #fff
}
.pathologic-list{
width: 100%;
height: px2rem(52px);
padding: 0 px2rem(15px);
margin-top: px2rem(15px);
.pathologic-item{
float: left;
width: 48%;
box-shadow: 0 px2rem(2px) px2rem(6px) RGBA(42, 94, 161, 0.15);
border-radius: px2rem(3px);
background: #fff;
/* padding: px2rem(12px) 0 px2rem(12px) 0;*/
margin-right: 4%;
text-align: center;
.pathologic-icon{
/* height: px2rem(20px);*/
img{
width: 100%;
height: px2rem(52px);
vertical-align: middle;
display: inline-block;
}
}
.pathologic-txt{
font-size: px2rem(14px);
line-height: px2rem(20px);
font-weight: 700;
display: inline-block;
vertical-align: middle;
}
}
.clear{
clear: both;
}
}
</style>
<template>
<section>
<SearchHeader @search="search"/>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SplitLine/> -->
<!-- 没有结果页面 -->
<section v-show="!hasResult" class="mt-100">
......@@ -105,12 +105,49 @@ export default {
this.searchText = this.$route.query.searchText || ''
},
mounted(){
this.search()
this.search(this.searchText)
},
methods: {
// 搜索
search() {
console.log('in result search: ' + this.searchText)
// 搜索结果
search(searchText) {
let _this = this,
para = {
searchCategory: '1,2,3,4',
searchValue: searchText,
sortItem: 1,
pageNo: 1,
pageSize: 4,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => {
if (res.code == '000000') {
// 课程
this.contentAppModels = this.data.contentAppModels
this.contentAppModelCount = this.data.contentAppModelCount
// 健康漫画
this.educationContents = this.data.educationContents
this.educationContentCount = this.data.educationContentCount
// 五分钟医学
this.fiveMinutesMedicalContentList = this.data.fiveMinutesMedicalContentList
this.fiveMinutesMedicalContentListCount = this.data.fiveMinutesMedicalContentListCount
// 讲师
this.pCourseDoctorModels = this.data.pCourseDoctorModels
this.pCourseDoctorModelCount = this.data.pCourseDoctorModelCount
// contentAppModelCount: 0
// contentAppModels: []
// educationContentCount: 0
// educationContents: []
// fiveMinutesMedicalContentList: []
// fiveMinutesMedicalContentListCount: 0
// pCourseDoctorModelCount: 0
// pCourseDoctorModels: []
}
})
},
showIndex(index) {
console.log(index)
......
<template>
<div>
<SearchHeader @search="search"/>
<SplitLine />
<HisttoryLabels :allLabels="allLabels" :hasResult="hasResult"/>
<HotLabels title="热门搜索" :showDelete="false" :allLabels="allLabels" :hasResult="hasResult"/>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SplitLine /> -->
<div class="mt-100"></div>
<HistoryLabels/>
<HotLabels/>
</div>
</template>
<script>
import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import HisttoryLabels from '../components/business/history-labels';
import HistoryLabels from '../components/business/history-labels';
import HotLabels from '../components/business/hot-labels';
export default {
data() {
return {
showDelete: false,
hasResult: true,
allLabels: [{"doctorId":452,"doctorName":"刘飞刘","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/452.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/10/12/20181012134114808-5339c711.jpg","doctorHospital":"沈阳市第四人民医院","joinNum":818,"resourceNum":1,"structureId":132},{"doctorId":424,"doctorName":"阮园阮园阮园","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/424.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/08/30/20180830111232896-de2f9015.jpg","doctorHospital":"浙江医院","joinNum":533,"resourceNum":2,"structureId":132},{"doctorId":351,"doctorName":"李翔李翔李翔","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/351.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2017-04/06/lixiang.jpg","doctorHospital":"解放军306医院全军糖尿病中心","joinNum":503,"resourceNum":2,"structureId":132},{"doctorId":360,"doctorName":"高蕾莉","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/360.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/web_360.png","doctorHospital":"北京大学人民医院","joinNum":376,"resourceNum":1,"structureId":132}]
searchText: ''
}
},
components: {
SearchHeader,
SplitLine,
HisttoryLabels,
HistoryLabels,
HotLabels
},
created(){
......@@ -32,7 +31,7 @@ export default {
},
mounted(){
this.getData()
},
methods: {
// 跳转到结果页面,并
......@@ -45,6 +44,24 @@ export default {
searchText: searchText
}
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
type: 1,
token: _this.token,
setEntry: 'headers'
}
let url = '/contents/searchKeyword/listKeywords'
this.GET(url, para).then(res => {
if (res.code == '000000') {
if (res.data && res.data.length) {
let index = Math.floor(Math.random() * res.data.length)
this.searchText = res.data[index].keyword
}
}
})
}
},
}
......@@ -54,5 +71,7 @@ export default {
<style lang="scss" scoped>
@import '../style/mixin.scss';
@import '../style/global.scss';
.mt-100 {
padding-top: px2rem(63px) !important;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册