feat: 对接完接口

This commit is contained in:
anonymous
2025-01-09 15:47:16 +08:00
parent e70ca852d8
commit ffb887f3bf
12 changed files with 416 additions and 255 deletions
+37 -14
View File
@@ -10,17 +10,30 @@
<template>
<view class="home-page">
<NavBar />
<view class="main-container w-345 h-185 mx-auto rounded-14 px-20 pt-70 text-12">
<view>姓名***</view>
<view class="mt-15">社会xx号码***</view>
<view class="mt-15">中国工商银行卡号**************</view>
</view>
<view
class="mt-15 btn-gradient w-345 h-45 leading-45 mx-auto text-white rounded-full text-center"
@click="handleOpenAccount"
>
开通个人养老账号
</view>
<template v-if="userStore.userInfo.banknum">
<view class="main-container w-345 h-185 mx-auto rounded-14 px-20 pt-70 text-12">
<view>姓名{{ userStore.userInfo.nickname }}</view>
<view class="mt-10">社会xx号码{{ userStore.userInfo.banknum.substring(0, 4) }}</view>
<view class="mt-15">中国工商银行卡号</view>
<view class="mt-5 text-14 text-#333">
<!-- 每四位数字插入空格 -->
{{ userStore.userInfo.banknum.replace(/(\d{4})(?=\d)/g, '$1 ') }}
</view>
</view>
</template>
<template v-else>
<view class="main-container w-345 h-185 mx-auto rounded-14 px-20 pt-70 text-12">
<view>姓名***</view>
<view class="mt-15">社会xx号码***</view>
<view class="mt-15">中国工商银行卡号**************</view>
</view>
<view
class="mt-15 btn-gradient w-345 h-45 leading-45 mx-auto text-white rounded-full text-center"
@click="handleOpenAccount"
>
开通个人养老账号
</view>
</template>
<view class="bg-white pt-15 px-15 rounded-10 m-15">
<view class="flex justify-between items-center">
@@ -90,7 +103,13 @@
<script lang="ts" setup>
import NavBar from '@/components/NavBar.vue'
import { downloadAppAPI, getIntroductionAPI, getRealNameAuthAPI } from '@/service'
import {
downloadAppAPI,
getIntroductionAPI,
getOpenPersonalAccountAPI,
getRealNameAuthAPI,
} from '@/service'
import { useUserStore } from '@/store'
import { showModal } from '@/utils'
defineOptions({
@@ -161,8 +180,12 @@ watch(
},
)
const handleOpenAccount = () => {
showModal('开通个人养老账户时,需邀请一名用户')
const userStore = useUserStore()
const handleOpenAccount = async () => {
await getOpenPersonalAccountAPI()
await showModal('开通个人养老账户成功')
userStore.loadUserInfo()
// showModal('开通个人养老账户时,需邀请一名用户')
}
</script>