<template>
  <view class="container">
    <view class="box" v-if="userInfo">
      <view class="">
        手机号：{{userInfo.mobile}}
      </view>
      <view class="">
        唯一身份标识：{{userInfo.yige_open_id}}
      </view>
      <view class="">
        姓名：{{userInfo.real_name}}
      </view>
      <view class="">
        身份证号：{{userInfo.identity_card}}
      </view>
      <view class="">
        昵称：{{userInfo.nickname}}
      </view>
      <view class="">
        头像{{userInfo.head_photo}}
      </view>
      <block v-if="userInfo.current_ent">
        <view class="">
        	企业名称{{userInfo.current_ent.ent_name}}
        </view>
        <view class="">
        	统一社会信用代码{{userInfo.current_ent.credit_code}}
        </view>
      </block>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        userInfo: null
      }
    },
    onLoad(options) {
      console.log(options, 'redirect')
      if (options.ticket) {
        this.getUserInfo(options)
      }
    },
    methods: {
      getUserInfo(data) {
        this.$http.post('/auth/getUserByTicket', data).then(res => {
          if (res.code == 200) {
            this.userInfo = res.data
            console.log('userInfo===>', res)
          }
        })
      }
    }
  }
</script>

<style lang="scss">
  .container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-size: contain;
    position: relative;

    .box {
      padding: 30rpx;
      padding-top: 200rpx;
      word-break: break-all;
    }
  }
</style>