<template>

  <el-form
      ref="formRef"
      :model="form"
      label-width="100px"
  >
    <el-form-item label="用户头像" prop="avatarUrl">
      <img :src="form.avatarUrl" alt="空" width="50" height="50"/>
    </el-form-item>
    <el-form-item label="用户昵称" prop="username">
      {{form.username}}
    </el-form-item>
    <el-form-item label="用户账号" prop="userAccount">
      {{form.userAccount}}
    </el-form-item>
    <el-form-item label="性别" prop="gender">
      <template v-if="form.gender==0">女</template>
      <template v-else>男</template>
    </el-form-item>
    <el-form-item label="电话" prop="phone">
      {{form.phone}}
    </el-form-item>
    <el-form-item label="邮箱" prop="email">
      {{form.email}}
    </el-form-item>
    <el-form-item label="用户状态" prop="userStatus">
      <template v-if="form.userStatus==0">禁用</template>
      <template v-else>启用</template>

    </el-form-item>
    <el-form-item label="用户角色" prop="userRole">
      <template v-if="form.userRole===0">普通用户</template>
      <template v-else-if="form.userRole===1">管理员</template>
      <template v-else-if="form.userRole===2">商家</template>
      <template v-else>美甲师</template>
    </el-form-item>
  </el-form>
</template>

<script setup>
import {ref, watch} from "vue";
import axios from "@/util/axios";

const form=ref({
  avatarUrl: "",
  createTime:"",
  email:"",
  gender:null,
  isDelete:null,
  openId:null,
  phone:null,
  unionId:null,
  updateTime:"",
  userAccount:"",
  userPassword:"",
  userRole:null,
  userStatus:null,
  username:""
})
const initFormData=()=>{
// console.log(ids)
 let token=window.sessionStorage.getItem('USER_LOGIN_STATE');

  // const temp=[]
  // temp.push(token)
  console.log(token)
  form.value=JSON.parse(token);

}
initFormData();
</script>

<style scoped>

</style>