<template>
  <view class="container">
    <uni-list>
      <uni-list-item showExtraIcon="true" title="用户名称" :rightText="user.nickName" />
      <uni-list-item showExtraIcon="true" title="手机号" :rightText="user.phoneNo" />

      <uni-list-item showExtraIcon="true" title="邮箱" :rightText="user.mail" />
      <!--      <uni-list-item showExtraIcon="true" title="名称" :rightText="user.userName" /> -->
      <uni-list-item showExtraIcon="true" title="角色" :rightText="user.roleNames" />
      <uni-list-item showExtraIcon="true" title="单位" :rightText="user.deptName" />

      <uni-list-item showExtraIcon="true" title="创建日期" :rightText="user.createTime" />
    </uni-list>

    <!-- <button style="margin: 10px 15px 0px 15px;" type="primary" @click="handleEdit">修改信息</button> -->
  </view>
</template>

<script>
  import {
    getUserProfile
  } from "@/apis/system/user"

  export default {
    data() {
      return {
        user: {},
        dept: {},
        roleGroup: "",
        postGroup: ""
      }
    },
    onShow() {

    },
    mounted() {
      this.getUser()
    },
    onLoad() {
      //  this.getUser()
    },
    methods: {
      getUser() {
        getUserProfile().then(response => {
          console.log(response, 999);
          //debugger
          this.user = response.data
          // this.dept = response.data.dept
          // this.roleGroup = response.roleGroup
          // this.postGroup = response.postGroup
        })
      },
      handleEdit() {
        this.$tab.navigateTo('/pages/mine/info/edit')
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>