<!--
  支付宝官方： 【签约开通】 页面内容

  @author terrfly
  @site https://www.jeequan.com
  @date 2022/11/03 08:35
-->
<template>
  <a-result :title="vdata.idCardPhoneTxt">
    <template #icon>
      <smile-twoTone />
    </template>
  </a-result>
</template>

<script lang="ts" setup>

import {reactive, ref} from 'vue'
import {API_URL_MCH_APPLYMENT_LIST, req} from "@/api/manage";
// import NextBizsCommonPage from '../../commons/NextBizsCommonPage.vue'

// const nextBizsCommonPage = ref()

const vdata : any = reactive({
  idCardPhoneTxt:"",
  idCardPhone:"",
});
// // 对外暴露的 页面渲染函数  也用作初始化
function pageRender (applyId){
  req.getById(API_URL_MCH_APPLYMENT_LIST, applyId, { originData: '1' }).then( (res) => {
    const applyDetailInfo = JSON.parse(res.applyDetailInfo)

    const idCardPhone =  hidePhoneNumber(applyDetailInfo.bindingAlipayLogonId)
    vdata.idCardPhoneTxt =  "请查看支付宝账号 "+idCardPhone+" 系统消息，服务消息中的商家平台消息中心";
  })
  // nextBizsCommonPage.value.pageRender(applyId) // 直接调用通用组件
}

function hidePhoneNumber(phone) {
  return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); // 将前三位保持不变，后面四位改为"*"
}

defineExpose({ pageRender })
</script>
