提交 205183f2 编写于 作者: chendeli's avatar chendeli

add

上级 a73409e4
......@@ -2,7 +2,7 @@
<div class="hot-teacher">
<div class="space-between">
<img class="img" src="../../images/mins.png"/>
<div @click="playMore" class="five-more gray fs11">
<div @click="goToPage('')" class="five-more gray fs11">
更多<img src="../../images/right-throw.png" class="thorw-icon"/>
</div>
</div>
......@@ -38,32 +38,51 @@ export default {
},
methods: {
goToPage(item){
///console.log(item);
let url = pageJumpUrl();
//console.log(url);
console.log(url.pageListUrl);
let itemData={
"title":item.name,
"imageUrl":"",
"appModuleInfo":{
"code":"M300",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"imageUrl":"",
"appModuleInfo":{
"code":"M300",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[]
}
};
if(!!item){
itemData.title = item.name;
itemData.appModuleInfo["paramList"] = [
{
"key":"pageUrl",
"value":url,
"value":url.detailUrl,
"type":4,
"seqNo":1
},
{
},
{
"key":"audioId",
"value":`${item.id}`,
"type":1,
"seqNo":2
}
]
}
};
}
]
}else{
itemData.appModuleInfo.paramList = [
{
"key":"pageUrl",
"value":url.pageListUrl,
"type":4,
"seqNo":1
}
]
}
console.log(itemData);
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
......
<template>
<div class="space-between header">
<div :class="isTransparent?'search-transparent':'bgWhite'" class="search">
<input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" />
<img class="search-img" src='../../images/Group2@2x.png'>
</div>
<div class="header-right" @click="goToPage">
<img class="info" src='../../images/msg1.png'>
<div :class="isMax?'num-max':'num-min'" class="info-count fs10" v-show="isShowMsg">{{count}}</div>
<div :class="searchFix?'header fixed' : 'header' " id="search-top">
<div class="search-menu">
<div :class="isTransparent?'search-transparent':'bgWhite'" class="search">
<input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" />
<img v-if="searchFix" class="search-img" src='../../images/search-grey.png'>
<img v-else class="search-img" src='../../images/search-white.png'>
</div>
<div class="header-right" @click="goToPage">
<img v-if="searchFix" class="info" src='../../images/msg2.png'>
<img e-else class="info" src='../../images/msg1.png'>
<div :class="isMax?'num-max':'num-min'" class="info-count fs10" v-show="isShowMsg">{{count}}</div>
</div>
</div>
</div>
</template>
......@@ -28,6 +32,10 @@ export default {
msgCount:{
type:String,
default:''
},
searchFix:{
type:Boolean,
default:false,
}
},
......@@ -67,6 +75,7 @@ html,body{
height: 100%;
background-color: #F8F8F8;
}
.search-transparent{
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.5);
......@@ -83,6 +92,7 @@ html,body{
height: px2rem(20px);
position: relative;
margin-top:px2rem(5px);
float: right;
img{
width: 100%;
height: 100%;
......@@ -101,13 +111,36 @@ html,body{
}
.header{
width: 100%;
padding: 0 px2rem(25px) 0 px2rem(15px);
height: px2rem(50px);
position: relative;
}
.fixed {
.search-menu{
background: #fff;
position: fixed;
height: px2rem(50px);
top:0;
left: 0;
padding:px2rem(10px) px2rem(25px) 0 px2rem(15px);
}
.search-transparent::-webkit-input-placeholder{
color:#666;
}
.search{
border-color:#ddd;
}
}
.search-menu{
padding: 0 px2rem(25px) 0 px2rem(15px);
height: px2rem(30px);
width: 100%;
}
.search{
width: px2rem(290px);
height: px2rem(30px);
border-radius: px2rem(19px);
float: left;
}
.input{
outline: none;
......
......@@ -216,8 +216,12 @@ function getUrlParmByCode(paramList) {
}
export function pageJumpUrl(){
const pageJumpUrl = 'https://test1-contents.yunqueyi.com/content_list';
return pageJumpUrl;
let url = {
pageListUrl : 'https://test1-contents.yunqueyi.com/content_list',
detailUrl : 'https://test1-contents.yunqueyi.com/content_detail'
};
return url;
}
......
......@@ -84,9 +84,10 @@ module.exports = {
},
setEventByModuleCode(itemData){
console.log(itemData);
let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) {
......@@ -95,6 +96,7 @@ module.exports = {
// paramList[0].value += urlPara;
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
let path = paramList[0]['key'];
......
......@@ -15,6 +15,9 @@
if(t == '__getUserInfo'){
__getUserInfo(n);
}
if(t == '__getStatusBarHeight'){
__getStatusBarHeight(n);
}
},
......@@ -70,6 +73,23 @@
}
})
}("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")
if (e.__rocAndroid) {
e.__isAndroid = true
e.__isIOS = false
e.__isWeb = false
} else if (e.webkit && window.webkit.messageHandlers.rociOS) {
e.__isAndroid = false
e.__isIOS = true
e.__isWeb = false
} else {
e.__isAndroid = false
e.__isIOS = false
e.__isWeb = true
}
if(window.__isIOS){
rocNative.appInit()
}
}(window);
window.__gotoAuthentication = function (params) {
alert('I am in __gotoAuthentication')
......
......@@ -5,7 +5,7 @@
<section class="home-header">
<div class="home-topMenu">
<YqyHomeHeader :msgCount="msgCount"/>
<YqyHomeHeader :msgCount="msgCount" :searchFix="searchFix"/>
</div>
<div class="swiper">
<mt-swipe :auto="0" :speed="speedSwiper">
......@@ -100,7 +100,9 @@ export default {
msgCount:'',
systemType:'',
appVersion:'',
userToken:''
userToken:'',
searchFix:false,
statusBarHeight:0,
}
},
components:{
......@@ -137,6 +139,11 @@ export default {
_this.getSwiper();
}
}
window.__getStatusBarHeight = function(parm){
_this.statusBarHeight = parm.statusBarHeight
//alert(_this.statusBarHeight)
//alert("状态栏高度"+jp);
}
},
......@@ -144,6 +151,7 @@ export default {
this.listSwiper = [{"picturePath":"https://test-file.yunqueyi.com/image/jpeg/2018/04/18/20180418110556320-5fdbc235.jpg","pictureName":"云鹊医典","pictureIntro":"242","link":"https://test1-phome.yunqueyi.com/psa.js","moduleCode":"M015","type":4,"userRoleList":"R001,R002,R003,R004","params":"0","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.com/File/2.jpeg","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/09/18/20180918152451538-0e8f6d4e.png","pictureName":"chc大会","pictureIntro":null,"link":"https://test1-phome.yunqueyi.com/chcNew.js","moduleCode":"M025","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://test1-phome.yunqueyi.com/chcNew.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":"chc大会阿萨德发","param2":"阿萨德飞机看看哈看电视发射的健康发哈思考多久发货咳嗽的好达克赛德啊"},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/10/16/20181016105038941-a77a2121.png","pictureName":"老年病竞赛","pictureIntro":null,"link":"https://dev-phome.yunqueyi.com/gdcHG.js","moduleCode":"M025","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://dev-phome.yunqueyi.com/gdcHG.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/10/15/20181015105400428-b0715da5.png","pictureName":"眼科专场","pictureIntro":null,"link":"https://test1-phome.yunqueyi.com/ykzc.js","moduleCode":"M025","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://test1-phome.yunqueyi.com/ykzc.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/jpeg/2018/10/21/20181021141114910-4349f2bb.jfif","pictureName":"大赛","pictureIntro":null,"link":"https://dev-phome.yunqueyi.com/chcNew.js","moduleCode":"M025","type":4,"userRoleList":"R004","params":"https://dev-phome.yunqueyi.com/chcNew.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/08/29/20180829153915489-623841ff.png","pictureName":"让前沿科技助力智慧管理","pictureIntro":null,"link":"https://test1-phome.yunqueyi.com/psa.js","moduleCode":"M025","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://test1-phome.yunqueyi.com/psa.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/jpeg/2018/10/17/2018101713591225-9fd47e86.jpg","pictureName":"CHC测试大赛风采回顾风采","pictureIntro":null,"link":"https://test-file.yunqueyi.comnull","moduleCode":"M027","type":4,"userRoleList":"R004","params":"0","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":"CHC测试大赛风采回顾风采","param2":"2018年8月由中华医学会、国家心血管中心等联合主办的中国心脏大会 (CHC) 在京举行。\n本次大会汇集了国内外心血管领域的顶尖专家,对心血管科各个疾病的最新临床研究进展,做了精彩的学术报告和经验分享。"},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/10/16/20181016134846454-1b78fd74.png","pictureName":"学霸带你来学习","pictureIntro":null,"link":"https://test-file.yunqueyi.comnull","moduleCode":"M020","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://test1-phome.yunqueyi.com/comp.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/png/2018/09/27/20180927140657640-d507fd69.png","pictureName":"奥测未来,精准之测","pictureIntro":null,"link":"https://test1-phome.yunqueyi.com/nde.js","moduleCode":"M025","type":4,"userRoleList":"R001,R002,R003,R004","params":"https://test1-phome.yunqueyi.com/nde.js","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null},{"picturePath":"https://test-file.yunqueyi.com/image/jpeg/2018/10/15/2018101513463874-239e7499.jpg","pictureName":"链接测试","pictureIntro":null,"link":"http://10.177.10.121:8080/web/index.html#/gpranking","moduleCode":"","type":1,"userRoleList":"R001,R002,R003,R004","params":"0","hasBannerDetail":0,"bannerPicPath":"https://test-file.yunqueyi.comnull","shareUrl":"","medicalDisplayType":null,"param1":null,"param2":null}]
window.addEventListener('scroll', this.scrollFun);
this.getUserInfo();
this.getStatusHight();
this.getUpdateData();
this.getMiddel();
......@@ -169,6 +177,13 @@ export default {
},
methods:{
//获取状态栏高度
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
//获取版本号
getUserInfo(){
......@@ -252,7 +267,7 @@ export default {
this.showNewCorse = false;
}else{
//alert("000");
if(_this.updateTotal.length>0){
if(this.updateTotal.length>0){
this.showNewCorse = true;
}
......@@ -262,10 +277,10 @@ export default {
scrollFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
this.showNewCorse = false;
clearTimeout(this.scrollTimer);
if(this.hideNewCourse){
this.scrollTop = scrollTop;
clearTimeout(this.scrollTimer);
this.scrollTimer = setTimeout(this.scrollEndFun, 200);
}
......@@ -278,6 +293,7 @@ export default {
var newCourseTop = document.querySelector('#famus-teacher').offsetTop;
var clientHeight = document.querySelector('#famus-teacher').clientHeight;
var adjustTop = document.querySelector('#adjust-u').offsetTop;
var searchBox = document.querySelector('#search-top').offsetParent.offsetTop;
//console.log(newCourseTop);
if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
......@@ -286,6 +302,12 @@ export default {
}else{
this.isShowBackTop = false;
}
if(scrollTop >= searchBox){
///console.log(scrollTop,searchBox);
this.searchFix = true;
}else{
this.searchFix = false;
}
if(scrollTop >= adjustTop){
this.isFixed = true;
}else{
......@@ -454,7 +476,7 @@ export default {
.home-topMenu{
width: 100%;
text-align:center;
top:0.84375rem;
top:px2rem(27px);
position: absolute;
z-index: 10;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册