building-sign/pages/worker/my/my.vue

57 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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>