<template>
  <uni-popup ref="popup" type="center" :mask-click="false">
    <view class="bg-white rounded overflow-hidden" style="width: 690rpx;">
      <view class="px-15 py-12 text-center text-lg font-semibold text-dark">
        认证须知
      </view>
      <view class="text-base text-dark px-15 leading-normal font-semibold mt-10">
        1、认证通过后，您个人账号病历档案管理数（含所有团队）上限由10个升级至100个；
      </view>
      <view class="px-15 leading-normal mt-10 ">
        <text class="text-base text-dark">2、认证前请仔细核对个人信息，确保准确无误。认证后部分信息不支持修改，包括姓名、岗位等。如需修改以上信息，请联系客服人工处理</text>
      </view>
      <view class="mt-10 px-15 leading-normal font-semibold pb-50 text-lg text-primary" @click="toService()">点击添加客服
      </view>
      <view class="footer-buttons">
        <button-footer hideden-shadow confirmText="去认证" @confirm="confirm()" @cancel="close()" />
      </view>
    </view>
  </uni-popup>
</template>

<script setup>
import { ref, watch } from 'vue';

import ButtonFooter from '@/components/button-footer.vue';

const emits = defineEmits(['close', 'confirm'])
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  }
})
const popup = ref()

function close() {
  emits('close')
}

function confirm() {
  close()
  uni.navigateTo({
    url: "/pages/work/profile?type=cert",
  });
}

function toService() {
  close()
}

watch(() => props.visible, n => {
  if (n) {
    popup.value && popup.value.open()
  } else {
    popup.value && popup.value.close()
  }
})
</script>

<style lang="scss" scoped>
.pb-50 {
  padding-bottom: 100rpx;
}
</style>