<template>
  <view class="page">
    <u-navbar
      class="u-navbar"
      title="首页"
      placeholder
      @leftClick="leftClick"
      leftIconColor="#fff"
      bgColor="#00337A"
      :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
    />

    <scroll-view :scroll-top="scrollTop" scroll-y="true">
      <!-- 日风险概况 -->
      <DayRiskView />
      <!-- 滚动提示 -->
      <HomeNoticeBar />
      <!-- 风险日历 -->
      <RiskCalendar />
    </scroll-view>

    <m-tabbar fixed fill :current="0" :tabbar="tabbar"></m-tabbar>
  </view>
</template>

<script>
import TabbarConfig from '../util/tabbar'

import DayRiskView from './components/day-risk-view'
import HomeNoticeBar from './components/home-notice-bar'
import RiskCalendar from './components/risk-calendar.vue'
export default {
  components: {
    DayRiskView,
    HomeNoticeBar,
    RiskCalendar
  },
  data() {
    return {
      userId: uni.getStorageSync('userId'),
      tabbar: TabbarConfig
    }
  },
  onLoad() {},

  methods: {
    // 返回
    leftClick() {
      uni.reLaunch({
        url: '/pages/gzt/index'
      })
    }
  },
  onShow() {}
}
</script>

<style lang="scss" scoped>
/* 修改U-Navbar中链接的字体颜色 */
/deep/.u-navbar .navbar-nav > li > a {
  color: #fff; /* 将颜色改为红色 */
}
/* 如果你想修改当前激活链接的字体颜色 */
/deep/.u-navbar .navbar-nav > li.active > a {
  color: #fff; /* 将激活链接的颜色改为绿色 */
}
.page {
  width: 100vw;
  height: 100vh;
  // background-color: #efefef;
  background: #fff;
  box-sizing: border-box;
  padding: 0 10rpx;

  h2 {
    margin: 20rpx 0;
    font-size: 26rpx;
  }
}
</style>
