<template>
  <div>
    <a-result :isSuccess="true" :content="false" :title="email" :sub-title="description">
      <template #extra>
        <a-button size="large" type="primary" style="margin-right: 8px" @click="goUserInfo">
          完善信息
        </a-button>
        <a-button size="large" style="margin-left: 8px" @click="goHomeHandle">返回首页</a-button>
      </template>
    </a-result>
    <PersonForm ref="personForm"></PersonForm>
  </div>
</template>

<script>
import PersonForm from '@/views/person/PersonForm.vue'

export default {
  name: 'RegisterResult',
  components: { PersonForm },
  data () {
    return {
      description: '您的账号已经注册成功,但是还有很多信息未完善,您可以继续完善您的个人信息~',
      form: {}
    }
  },
  computed: {
    email () {
      const v = (this.form && this.form.username) || 'xxx'
      return `你的账户：${v} 注册成功`
    }
  },
  created () {
    this.form = this.$route.query
  },
  methods: {
    goHomeHandle () {
      this.$router.push({ name: 'login' })
    },
    goUserInfo () {
      // 打开编辑弹出框
      this.$refs.personForm.edit({id: this.form.personId})
    }
  }
}
</script>

<style scoped></style>
