57 lines
1.3 KiB
Vue
57 lines
1.3 KiB
Vue
<template>
|
||
<view class="pad-x120">
|
||
<!-- 头部 -->
|
||
<status-nav :ifReturn="false" navBarTitle="我的"></status-nav>
|
||
<!-- 尾部 -->
|
||
<tabbar :userType="userType" current="2"></tabbar>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import tabbar from '@/components/tabbar/tabbar';
|
||
export default {
|
||
components:{
|
||
tabbar
|
||
},
|
||
data() {
|
||
return {
|
||
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
||
userType:'worker', //账户类型 工人:worker 负责人:director
|
||
frontColor:'#ffffff', //状态栏文字颜色
|
||
backgroudColor:'none', //导航栏背景
|
||
titleColor:'#ffffff', //导航栏颜色
|
||
}
|
||
},
|
||
onPageScroll(object){
|
||
if(object.scrollTop >= this.statusHeight+60){
|
||
this.frontColor = '#000000';
|
||
this.backgroudColor = '#ffffff';
|
||
this.titleColor = '#3333333';
|
||
// 改变状态栏
|
||
this.changeStatusNav();
|
||
}
|
||
if(object.scrollTop <= this.statusHeight+40){
|
||
this.frontColor = '#ffffff';
|
||
this.backgroudColor = 'none';
|
||
this.titleColor = '#ffffff';
|
||
// 改变状态栏
|
||
this.changeStatusNav();
|
||
}
|
||
},
|
||
onLoad() {
|
||
// 改变状态栏
|
||
this.changeStatusNav();
|
||
},
|
||
methods: {
|
||
// 改变状态栏
|
||
changeStatusNav(){
|
||
wx.setNavigationBarColor({
|
||
frontColor: this.frontColor,
|
||
backgroundColor: 'none',
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style scoped>
|
||
|
||
</style> |