<template>
  <view class="water-box">
  <u-status-bar></u-status-bar>
   <view class="nav-bar">
         <u-icon name="arrow-left" color="#000" size="20" @click="backTo" style="margin-left:10px"></u-icon>
         <view class="title">
            水情
         </view>
   </view>
   <view class="tab-bar" >
     <view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
       河道水情
     </view>
     <view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
       水库水情
     </view>
   </view>
   <view class="water-detail-content">
     <HdWater  v-if="activeOne == 0" :height="tableHeight"/>
     <SkWater  v-if="activeOne == 1" :height="tableHeight"/>
   </view>
  </view>
</template>

<script>
  import HdWater from "./hdWater/hdWater.vue"
  import SkWater from "./skWater/skWater.vue"
  export default {
    data() {
      return {
        activeOne:0,
        tableHeight:0
      }
    },
    components:{
      HdWater,
      SkWater
    },

    methods: {
      backTo(){
        uni.navigateBack({delta:1})
      }
    },
       onReady(){
      console.log(123333);
      let that = this
        uni.getSystemInfo({
          success: (res) => {
            that.tableHeight = res.windowHeight - 220;
            console.log("that.tableHeight",that.tableHeight);
          }
        })
      }
  }
</script>

<style lang="scss">
 .water-box{
    .nav-bar{
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 44px;
      // margin-top: 30px;
      // padding-top: 40px;
      // padding-bottom: 10px;
      border-bottom: 1px solid #dfdfdf;
      // box-shadow: 0 5px 10px -8px #dfdfdf inset;
    }
    .title{
      flex:1;
      text-align: center;
      margin-right: 15px;
      font-size: 18px;
    }
    .tab-bar{
      display: flex;
      justify-content: space-around;
      padding: 10px 40px;
      border-bottom: 1px solid #dfdfdf;
    }
    .rain-detail-content{
      padding: 10px;
    }
    .active{
      color: #39a6ff;
    }
    .rain-detail-content{
      padding: 10px;
    }
    }
</style>
