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

add

上级 a1156208
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div :class="isFixed ? 'cource-header fixed' : 'cource-header'"> <div :class="isFixed ? 'cource-header fixed' : 'cource-header'">
<div class="fixBox"> <div class="fixBox">
<div class="bgFill"></div> <div class="bgFill" :style="{height:ptop}"></div>
<div class="font-title"> <div class="font-title">
{{title}} {{title}}
</div> </div>
...@@ -94,11 +94,32 @@ export default { ...@@ -94,11 +94,32 @@ export default {
this.ptop = this.popHeight + "px"; this.ptop = this.popHeight + "px";
// this.getData(); // this.getData();
},
created(){
let _this = this;
window.__getStatusBarHeight = function(parm){
if(window.__isAndroid){
_this.popHeight = parm.statusBarHeight/2
}else{
_this.popHeight = parm.statusBarHeight
}
_this.ptop = _this.popHeight+7+'px';
_this.menuptop = _this.popHeight+7+'px'
//alert(parm.statusBarHeight+'kkkkk');
}
this.getStatusHight()
},
watch:{
}, },
components:{ components:{
// LOADING // LOADING
}, },
methods: { methods: {
getStatusHight(){ getStatusHight(){
rocNative.getStatusBarHeight({ rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight' __funcName: '__getStatusBarHeight'
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<img v-if="searchFix" class="search-img" src='../../images/search-grey.png'> <img v-if="searchFix" class="search-img" src='../../images/search-grey.png'>
<img v-else class="search-img" src='../../images/search-white.png'> <img v-else class="search-img" src='../../images/search-white.png'>
</div> --> </div> -->
<div class="bgFill"></div> <div class="bgFill" :style="{height:ptop}"></div>
<div class="fixBox"> <div class="fixBox">
<div class="header-right" @click="goToPage"> <div class="header-right" @click="goToPage">
<img v-if="searchFix" class="info" src='../../images/msg2.png'> <img v-if="searchFix" class="info" src='../../images/msg2.png'>
...@@ -49,6 +49,13 @@ export default { ...@@ -49,6 +49,13 @@ export default {
default:false, default:false,
} }
}, },
watch:{
// searchFix:function(n){
// if(n){
// alert(this.searchFix)
// }
// }
},
created(){ created(){
let _this = this; let _this = this;
window.__getStatusBarHeight = function(parm){ window.__getStatusBarHeight = function(parm){
...@@ -59,13 +66,16 @@ export default { ...@@ -59,13 +66,16 @@ export default {
_this.popHeight = parm.statusBarHeight _this.popHeight = parm.statusBarHeight
} }
_this.ptop = _this.popHeight+7+'px'; _this.ptop = _this.popHeight+7+'px';
_this.menuptop = _this.popHeight+7+'px' _this.menuptop = _this.popHeight+7+'px'
// alert(parm.statusBarHeight); // alert(parm.statusBarHeight);
} }
this.getStatusHight()
}, },
mounted(){ mounted(){
// this.getStatusHight(); // this.getStatusHight();
// if(window.__isAndroid){ // if(window.__isAndroid){
// this.popHeight = this.statusBarHeight/2 // this.popHeight = this.statusBarHeight/2
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
msgCount:'', msgCount:'',
userToken:'', userToken:'',
searchFix:false, searchFix:false,
statusBarHeight:20, statusBarHeight:0,
userMobile:'', userMobile:'',
userToken:'', userToken:'',
isHeightFromApp:false, isHeightFromApp:false,
...@@ -158,6 +158,7 @@ export default { ...@@ -158,6 +158,7 @@ export default {
}, },
created () { created () {
let _this = this; let _this = this;
_this.initAll()
_this.getUserInfo(); _this.getUserInfo();
window.__nativeCallMsg = function(params){ window.__nativeCallMsg = function(params){
...@@ -175,8 +176,8 @@ export default { ...@@ -175,8 +176,8 @@ export default {
window.__refresh = function(params){ window.__refresh = function(params){
//__getToken() //__getToken()
alert('__refresh'); // alert('__refresh');
alert(JSON.stringify(params)) //alert(JSON.stringify(params))
//返回 //返回
if(_this.isRefreshFromBack){ if(_this.isRefreshFromBack){
...@@ -194,19 +195,20 @@ export default { ...@@ -194,19 +195,20 @@ export default {
} }
window.__getStatusBarHeight = function(parm){ // window.__getStatusBarHeight = function(parm){
alert("__getStatusBarHeight"); // alert(JSON.stringify(parm))
_this.statusBarHeight = parm.statusBarHeight; // _this.statusBarHeight = parm.statusBarHeight;
_this.isHeightFromApp = true; // _this.isHeightFromApp = true;
// alert(parm.statusBarHeight); // // alert(parm.statusBarHeight);
// }
}
// alert("token之前"); // alert("token之前");
window.__getUserInfo = function(parm){ window.__getUserInfo = function(parm){
alert("__getUserInfo"); // alert("__getUserInfo");
alert(JSON.stringify(parm)) // alert(JSON.stringify(parm))
_this.systemType = parm.systemType; _this.systemType = parm.systemType;
_this.appVersion = parm.appVersion; _this.appVersion = parm.appVersion;
_this.token = parm.userToken; _this.token = parm.userToken;
...@@ -220,8 +222,9 @@ export default { ...@@ -220,8 +222,9 @@ export default {
_this.initByToken(parm.userToken); _this.initByToken(parm.userToken);
} }
_this.getStatusHight();
_this.initAll() //_this.getStatusHight();
// _this.token = 'BE1D60CAE8F24649B4F72D47E964A58B'; // _this.token = 'BE1D60CAE8F24649B4F72D47E964A58B';
...@@ -242,6 +245,7 @@ export default { ...@@ -242,6 +245,7 @@ export default {
mounted(){ mounted(){
this.wrapperHeight =document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top; this.wrapperHeight =document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
window.addEventListener('scroll', this.scrollFun);
}, },
beforeDestroyed(){ beforeDestroyed(){
...@@ -306,7 +310,7 @@ export default { ...@@ -306,7 +310,7 @@ export default {
this.getAdjustData(userToken); this.getAdjustData(userToken);
this.getNewsData(userToken); this.getNewsData(userToken);
this.getEvaluctData(userToken); this.getEvaluctData(userToken);
window.addEventListener('scroll', this.scrollFun);
}, },
initAll(){ initAll(){
...@@ -672,7 +676,7 @@ export default { ...@@ -672,7 +676,7 @@ export default {
} }
var searchBox = document.querySelector('#search-top').offsetParent.offsetTop; var searchBox = document.querySelector('#search-top').offsetParent.offsetTop;
//console.log(newCourseTop); //console.log(searchBox);
if(scrollTop +clientHeight/2 >= newCourseTop){ if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop); //alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
//this.showNewCorse = false; //this.showNewCorse = false;
...@@ -680,12 +684,7 @@ export default { ...@@ -680,12 +684,7 @@ export default {
}else{ }else{
this.isShowBackTop = false; this.isShowBackTop = false;
} }
if(scrollTop > searchBox){
///console.log(scrollTop,searchBox);
this.searchFix = true;
}else{
this.searchFix = false;
}
if(scrollTop+30 >= adjustTop){ if(scrollTop+30 >= adjustTop){
this.isFixed = true; this.isFixed = true;
this.searchFix = false; this.searchFix = false;
...@@ -693,6 +692,14 @@ export default { ...@@ -693,6 +692,14 @@ export default {
this.isFixed = false; this.isFixed = false;
} }
if(scrollTop > searchBox){
//alert("000");
///console.log(scrollTop,searchBox);
this.searchFix = true;
}else{
this.searchFix = false;
}
}, },
//五秒之后收起 //五秒之后收起
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册