<template>
  <view class="PerfectInfo" v-if="isPerfectInfo">
    <!--    <i class="iconfont icondengpao"></i>-->
    <uni-row>
      <uni-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
        <view class="content">
          <view class="icon">
            <cwg-icon color="#333" icon="crm-user-pen" />
          </view>
          <view class="title">
            {{ t('Home.msg.content') }}
          </view>
        </view>
      </uni-col>
      <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
        <button
          class="btn-improve"
          @click="immediately"
        >
          {{ t('Home.msg.btn') }}
        </button>
      </uni-col>
    </uni-row>
  </view>
</template>

<script setup lang="ts">
  import { computed, ref } from 'vue'
  import { useI18n } from 'vue-i18n'
  import useUserStore from '@/stores/use-user-store'
  import useRouter from '@/hooks/useRouter'
  import useRoute from '@/hooks/useRoute'


  const router = useRouter()
  const route = useRoute()
  const { userInfo } = useUserStore()
  const { t } = useI18n()
  const customInfo = computed(() => {
    return userInfo.customInfo
  })

  const isPerfectInfo = computed(() => {
    const {status,applyRealStatus} = userInfo.customInfo
    console.log(route)
    return (status === 2 || applyRealStatus == 1|| applyRealStatus ==2) && route.path != '/pages/mine/improveImmediately'
  })

  function immediately() {
    console.log(customInfo.value)
    router.push({
      path:'/pages/mine/improveImmediately'
    })
  }

</script>

<style scoped lang="scss">
  @import "@/uni.scss";

  .PerfectInfo {
    width: 100%;
    padding: px2rpx(16);
    background-color: #fff9eb;

    .content {
      width: 100%;
      display: flex;
      align-items: center;
      height: px2rpx(40);
      flex: 1;
      .icon{
        margin-right: 10px;
      }
      //justify-content: center;
      .title {
        font-weight: 400;
        line-height: px2rpx(24);
        font-size: px2rpx(16);
        letter-spacing: 0px;
      }
    }

    .btn-improve {
      width: px2rpx(120);
      height: px2rpx(40);
      background-color: #ffde02;
      line-height: px2rpx(40);
      font-size: px2rpx(14);
      margin: 0;
    }
  }
</style>
