yuanmingze 3 mēneši atpakaļ
vecāks
revīzija
3a3d3aa74c

+ 6 - 0
src/router/routes.ts

@@ -54,6 +54,12 @@ export const routes: RouteRecordRaw[] = [
     component: () => import('@/views/success/index.vue'),
     meta: { title: '开票完成', requiresAuth: false },
   },
+  {
+    path: '/login-success',
+    name: 'LoginSuccess',
+    component: () => import('@/views/success/loginSuccess.vue'),
+    meta: { title: '自然人开票', requiresAuth: false },
+  },
   {
     path: '/:pathMatch(.*)*',
     redirect: '/login',

+ 1 - 2
src/services/modules/login/index.ts

@@ -23,10 +23,9 @@ export const loginEtssmsApi = (data: LoginEtssmsRequest) => {
   })
 }
 
-export const registerUrlApi = (params: RegisterUrlRequest, data: SendTtsSmsRequest) => {
+export const registerUrlApi = (params: RegisterUrlRequest) => {
   return http.get({
     url: '/admin/invoice/register-url',
     params: params,
-    data,
   })
 }

+ 1 - 0
src/services/modules/login/type.d.ts

@@ -14,4 +14,5 @@ export interface SendTtsSmsRequest {
 export interface RegisterUrlRequest {
   areaId: string
   returnUrl: string
+  pushRecordId: string
 }

+ 13 - 6
src/views/login/index.vue

@@ -89,6 +89,7 @@ import {
   loginEtssmsApi,
   registerUrlApi,
 } from '@/services/modules/login'
+import { getStatusApi } from '@/services/modules/invoiceInformation'
 import type {
   SendTtsSmsRequest,
   LoginEtssmsRequest,
@@ -212,6 +213,15 @@ const loginBtn = useDebounceFn(async () => {
     const res: any = await loginEtssmsApi(formData)
     if (res?.access_token) {
       userStore.setAccessToken(res.access_token)
+      const statusRes = await getStatusApi({ pushRecordId: formData.pushRecordId })
+      if (statusRes.code == 0) {
+        if (statusRes.data.invoiceEventStatus === 'SUBMITTED') {
+          return router.replace({
+            path: '/login-success',
+          })
+        }
+      }
+
       router.replace({ path: '/invoice-information' })
     } else if (res.code == 401) {
       loginMessage.value = res.msg
@@ -234,15 +244,11 @@ const loginBtn = useDebounceFn(async () => {
 const registerUrlParams = ref<RegisterUrlRequest>({
   areaId: '',
   returnUrl: '',
+  pushRecordId: '',
 })
 const registerUrl = useDebounceFn(async () => {
-  if (!formData.mobile) {
-    showFailToast('请输入手机号')
-    return
-  }
-  sendEtsSms.mobile = formData.mobile
   try {
-    const res = await registerUrlApi(registerUrlParams.value, sendEtsSms)
+    const res = await registerUrlApi(registerUrlParams.value)
     if (res.code === 0 && res.data.url) {
       // 保存一次性链接
       sessionStorage.setItem(REGISTER_URL_KEY, res.data.url as string)
@@ -264,6 +270,7 @@ const getPubName = async () => {
     if (res.code === 0) {
       pubName.value = res.data.projectName
       registerUrlParams.value.areaId = res.data.cityCode
+      registerUrlParams.value.pushRecordId = sendEtsSms.pushRecordId
     }
   } catch (err) {
     console.log('err', err)

+ 68 - 0
src/views/success/loginSuccess.vue

@@ -0,0 +1,68 @@
+<template>
+  <div class="success-page">
+    <van-nav-bar title="自然人开票" fixed placeholder safe-area-inset-top />
+
+    <div class="content">
+      <!-- 成功图标 -->
+      <van-icon name="passed" class="success-icon" />
+
+      <!-- 标题 -->
+      <div class="title">登录成功</div>
+
+      <!-- 描述文本 -->
+      <div class="desc">您的开票申请流程恢复正常,感谢您的配合。</div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { onMounted } from 'vue'
+// import { useRouter } from 'vue-router'
+// const router = useRouter()
+
+onMounted(() => {
+  // 可选:例如 3 秒后自动跳转
+  // setTimeout(() => router.replace('/invoice-information'), 3000)
+})
+</script>
+
+<style scoped lang="scss">
+.success-page {
+  min-height: 100vh;
+  background: #f6f7f9;
+  font-family:
+    -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei',
+    sans-serif;
+  text-align: center;
+
+  .content {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding-top: 20vw;
+    padding-left: 6vw;
+    padding-right: 6vw;
+  }
+
+  .success-icon {
+    font-size: 16vw;
+    color: #ff8036; /* 微信绿 */
+    margin-bottom: 6vw;
+  }
+
+  .title {
+    font-size: 5vw;
+    font-weight: 600;
+    color: #333;
+    margin-bottom: 4vw;
+  }
+
+  .desc {
+    font-size: 3.8vw;
+    color: #666;
+    line-height: 1.8;
+    text-align: center;
+    width: 80vw;
+  }
+}
+</style>