<template>
  <div>这里是用户中心信息查看</div>
  <div class="user-info">
    <div>{{ company }}</div>
    <div>
      <img :src="userImg" />
      <p>{{ userName }}</p>
    </div>
    <div class="phone">
      <span>绑定手机号</span>
      <span>{{ userPhone }}</span>
      <span @click="goback">返回上一页</span>
    </div>
  </div>
</template>

<script>
import { reactive, ref, toRefs, onMounted } from "vue"
import { useRouter } from "vue-router"
import { getStatus, getUserbyUserId } from "@/api/fileDeduplication"

export default {
  name: "UserInfo1",
  setup(props, context) {
    const { $attrs, slot, $emit } = context
    const router = useRouter()

    let company = ref("雷克沙")
    let userImg = ref("")
    let userPhone = ref("")
    let userName = ref("")

    async function getStatusFn() {
      const data = await getStatus({ kid: Cookie.get("kid") })
      if (data.error_code == 0 && data.data.status) {
        // const userInfo = await getUserbyUserId({})
        // console.log(888, userInfo)
        company.value = "雷克沙测试"
        userName.value = "雷小沙"
        userPhone.value = "15201654415"
        userImg.value =
          "https://www.baidu.com/link?url=zMW9_uJenXdqHzAwGAkOidYygAdjWIF1e0bkMSyCWXcGYJZuq-1JnlucDzg-Mmuj&wd=&eqid=bd0330430000168d000000066287485e"
      }
    }

    function goback() {
      router.go(-1)
    }

    onMounted(() => {
      getStatusFn()
    })

    return {
      company,
      userImg,
      userPhone,
      userName,
      goback,
    }
  },
}
</script>

<style lang="less" scoped></style>
