<style scoped>
* {
  margin: 0;
  padding: 0;
}
.box{
  overflow: hidden;
  border-radius: 15px;
  width: 660px;
  margin: 20px auto;
}
.van-cell {
  height: 100px;
  line-height: 100px;
  padding-left: 15px;
  padding-right: 15px;
  font-size: 26px;
  font-weight: 500;
}
:deep(.van-cell__right-icon) {
  line-height: 100px;
}
.van-cell:after {
  border-bottom: 4px solid #e7e7e7;
}
.van-button {
  width: 660px;
  height: 100px;
  margin: 20px auto 0 !important;
  border-radius: 15px;
  margin-top: 20px;
}
:deep(.van-button__content) {
  display: block;
  text-align: left;
  line-height: 100px;
  padding-left: 15px;
  font-size: 26px;
  font-weight: 500;
  color: #000000FF;
}

</style>
<template>
  <!-- 设置界面 -->
  <!-- 显示当前用户信息 -->
  <van-nav-bar
    :title="$route.meta.name"
    left-arrow
    @click-left="$router.go(-1)"
  >
  </van-nav-bar>
  <div class="box">
    <van-cell-group>
      <van-cell title="用户名" :value="$store.state.user.name"></van-cell>

      <!-- 系统初始化界面跳转功能-->
      <van-cell is-link title="系统初始化" @click="doInitialization" />
      <van-cell is-link title="人员信息" @click="doInitializationUser" />
      <!-- 设备管理界面 -->
      <van-cell is-link title="设备信息" @click="doEquipmentInformation" />
      <!-- 版本升级界面 -->
      <van-cell is-link title="版本升级" @click="doVersionUpgrade" />
      <!-- 系统帮助界面 -->
      <van-cell is-link title="系统帮助" @click="getHelp" />
    </van-cell-group>
  </div>
  <div class="box">
    <van-cell-group>
      <!-- 系统帮助界面 -->
      <van-cell title="状态" :value="hearBeatStatus=='true'?'在线':'离线'"></van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import { Button, Dialog, NavBar, Cell, CellGroup } from "vant";

export default {
  name: "setup",
  components: {
    [Button.name]: Button,
    [NavBar.name]: NavBar,
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
  },
  data() {
    return {
      hearBeatStatus:'',
    };
  },
  watch: {},
  created() {
    // this.getCookie();
    // console.log($store.state.user)
  },
  mounted() {
    this.$nativeQRCode.setStatusBarColor("#006953", "white");
    this.hearBeatStatus=localStorage.getItem('hearBeatStatus');
  },
  methods: {
    // 系统初始化
    doInitialization() {
      this.$router.push({ name: "system-init" });
    },
    // 人员信息
    doInitializationUser() {
      this.$router.push({ name: "user-info" });
    },
    // 设备信息
    doEquipmentInformation() {
      this.$router.push({ name: "equipment-information" });
    },
    // 版本升级
    doVersionUpgrade() {
      this.$router.push({ name: "version-upgrade" });
    },
    // 系统帮助
    getHelp(){
      this.$router.push({ name: "systemHelp" });
    }
  },
};
</script>

