Handy_Cao 2 vuotta sitten
vanhempi
commit
e40c20c05c

+ 3 - 5
src/packages/mobile/views/swap/detail/Index.vue

@@ -57,12 +57,11 @@ const Tik = defineAsyncComponent(() => import('@mobile/components/modules/quote/
 const componentMap = new Map<string, unknown>([
     ['delisting', defineAsyncComponent(() => import('./components/delisting/Index.vue'))],
     ['listing', defineAsyncComponent(() => import('./components/listing/Index.vue'))],
-    ['certification-next', defineAsyncComponent(() => import('../../../../tjmd/views/account/certification/components/certification-next/Index.vue'))],
 ])
 
 const pullRefreshRef = shallowRef()
 const loginStore = useLoginStore()
-const { getGlobalUrlParams } = useNavigation()
+const { getGlobalUrlParams, router } = useNavigation()
 const item: Model.QuoteGoodsListRsp = getGlobalUrlParams()
 const tabIndex = shallowRef(0)
 const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
@@ -74,7 +73,6 @@ const goodsCode = computed(() => quote.value?.goodscode ?? '')
 const userStore = useUserStore()
 /// 所属机构 ID
 const memberUserId = shallowRef(getMemberUserId())
-
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => onTabChange())
 
 /// 查询用户掉期协议签署表
@@ -156,8 +154,8 @@ const onDelisting = (row: Model.TjmdTradeOrderDetailRsp) => {
             break;
         case 1:  /// 未签署
             /// 传对应的机构 ID
-            memberUserId.value = row.userid
-            openComponent('certification-next')
+            /// 进行下一步
+            router.push({name: 'account-protocol', query: { memberUserId: row.userid.toString() }})
             break; 
         default: /// 其他状态
             break;

+ 5 - 0
src/packages/tjmd/router/index.ts

@@ -118,6 +118,11 @@ const routes: Array<RouteRecordRaw> = [
         path: 'certification',
         name: 'account-certification',
         component: () => import('../views/account/certification/Index.vue'),
+      },
+      {
+        path: 'protocol',
+        name: 'account-protocol',
+        component: () => import('../views/account/protocol/Index.vue'),
       }
     ],
   },

+ 11 - 22
src/packages/tjmd/views/account/certification/Index.vue

@@ -35,16 +35,14 @@
         <img src="../../../assets/images/certification.png" />
         <template #footer>
             <div class="g-form__footer inset">
-                <Button type="danger" :loading="buttonLoading" @click="onSubmit" round block>提交实名认证</Button>
+                <Button type="danger" :loading="buttonLoading" @click="onCheckCardNum" round block>提交实名认证</Button>
             </div>
         </template>
-        <component ref="componentRef" v-bind="{ memberUserId: getMemberUserId() }" :is="componentMap.get(componentId)" @closed="closeComponent"
-            v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, onMounted } from 'vue'
+import { shallowRef, onMounted } from 'vue'
 import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Image } from 'vant'
 import { fullloading, dialog } from '@/utils/vant';
 import { getFileUrl } from '@/filters';
@@ -53,26 +51,17 @@ import { useRequest } from '@/hooks/request'
 import { queryTencentUsereSignRecords, requestCheckCardNum } from '@/services/api/account';
 import { addAuthReq } from '@/business/user/account';
 import { validateRules } from '@/constants/regex';
-import { useComponent } from '@/hooks/component'
 import { useUserStore } from '@/stores'
 import AppSelect from '@mobile/components/base/select/index.vue'
 import AppUploader from '@mobile/components/base/uploader/index.vue'
 import { useNavigation } from '@mobile/router/navigation'
 import { getUserId, getMemberUserId } from '@/services/methods/user'
 
-const componentMap = new Map<string, unknown>([
-    ['certification-next', defineAsyncComponent(() => import('./components/certification-next/Index.vue'))], // 实名认证第二步
-])
-
 const { router } = useNavigation()
 const userStore = useUserStore()
 const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit, loading } = addAuthReq()
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
-    router.back()
-})
-
 const isReadonly = false//computed(() => userESignRecords.value.some((e) => e.recordstatus === 3))
 
 /// 查询记录
@@ -141,7 +130,7 @@ const onCheckCardNum = () => {
                 hideLoading()
                 dialog('提交请求成功').then(() => {
                     /// 进行下一步
-                    openComponent('certification-next')
+                    router.push({name: 'account-protocol', query: { memberUserId: getMemberUserId().toString() }})
                 })
             }).catch((err) => {
                 hideLoading(err, 'fail')
@@ -152,14 +141,14 @@ const onCheckCardNum = () => {
     })
 }
 
-const onSubmit = () => {
-    const isInclude = userESignRecords.value.some((e) => e.recordstatus === 1)
-    if (!userESignRecords.value.length || isInclude) {
-        formRef.value?.submit()
-    } else {
-        openComponent('certification-next')
-    }
-}
+// const onSubmit = () => {
+//     const isInclude = userESignRecords.value.some((e) => e.recordstatus === 1)
+//     if (!userESignRecords.value.length || isInclude) {
+//         formRef.value?.submit()
+//     } else {
+//         openComponent('certification-next')
+//     }
+// }
 
 onMounted(() => {
     formData.mobile = userStore.userInfo?.mobile2 ?? ''

+ 25 - 52
src/packages/tjmd/views/account/certification/components/certification-next/Index.vue → src/packages/tjmd/views/account/protocol/Index.vue

@@ -1,51 +1,42 @@
 <template>
-    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
-        <app-view class="g-form">
-            <template #header>
-                <app-navbar title="合同签署" @back="closed" />
-            </template>
-            <div class="g-form__container">
-                <CellGroup inset>
-                    <Cell title="姓名" :value="customername" />
-                    <Cell title="手机号码" :value="mobile2" />
-                    <Cell title="证件号码" :value="decryptAES(cardnum)" />
-                    <Cell title="签署机构" :value="memberUserId" />
-                </CellGroup>
-                <CellGroup inset>
-                    <template v-for="(item, index) in dataList" :key="index">
-                        <Cell :title="item.templatename" :icon="iconName(item.recordstatus)" @click="signer(item)"
-                            is-link />
-                    </template>
-                </CellGroup>
-            </div>
-        </app-view>
-    </app-modal>
+    <app-view class="g-form">
+        <template #header>
+            <app-navbar title="合同签署" />
+        </template>
+        <div class="g-form__container">
+            <CellGroup inset>
+                <Cell title="姓名" :value="customername" />
+                <Cell title="手机号码" :value="mobile2" />
+                <Cell title="证件号码" :value="decryptAES(cardnum)" />
+                <Cell title="签署机构" :value="memberUserId" />
+            </CellGroup>
+            <CellGroup inset>
+                <template v-for="(item, index) in dataList" :key="index">
+                    <Cell :title="item.templatename" :icon="iconName(item.recordstatus)" @click="signer(item)"
+                        is-link />
+                </template>
+            </CellGroup>
+        </div>
+    </app-view>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { CellGroup, Cell, showFailToast, showToast } from 'vant'
 import { fullloading } from '@/utils/vant';
+import { useNavigation } from '@mobile/router/navigation'
 import { useRequest } from '@/hooks/request'
 import { queryTencentUsereSignRecords, requestInitTencentESS } from '@/services/api/account';
 import { useRequestCreateFlowByTemplateDirectly } from '@/business/user/account';
 import plus from '@/utils/h5plus'
-import eventBus from '@/services/bus'
 import { getFileUrl } from '@/filters';
 import { getUserId } from '@/services/methods/user'
 import { useUserStore } from '@/stores'
 import { decryptAES } from '@/services/websocket/package/crypto'
 
-const props = defineProps({
-    memberUserId: {
-        type: Number,
-        required: true,
-    }
-})
-
-const showModal = shallowRef(true)
-// 是否刷新父组件数据
-const refresh = shallowRef(false)
+const { getQueryStringToNumber } = useNavigation()
+/// 所属机构
+const memberUserId = getQueryStringToNumber('memberUserId')
 /// userStore
 const userStore = useUserStore()
 /// 创建电子签合同
@@ -58,7 +49,7 @@ const { customername, cardnum, mobile2 } =  userStore.userInfo
 const { run } = useRequest(queryTencentUsereSignRecords, {
     params: {
         userId: getUserId(),
-        memberUserId: props.memberUserId
+        memberUserId: memberUserId
     },
     onSuccess: (res) => {
         if (res.data.length != 0) {
@@ -75,7 +66,7 @@ const { run: initTencentESS } = useRequest(requestInitTencentESS, {
     manual: true,
     params: {
         userId: getUserId(),
-        memberUserId: props.memberUserId
+        memberUserId: memberUserId
     },
     onSuccess: () => {
         /// 重新请求
@@ -143,22 +134,4 @@ const signer = (item: Model.TencentUsereSignRecordsRsq) => {
     }
 }
 
-// 接收窗口页面状态通知
-const documentVisibilityStateNotify = eventBus.$on('DocumentVisibilityStateNotify', (state) => {
-    if (state === 'visible') {
-        run()
-    }
-})
-
-// 关闭弹窗
-const closed = (isRefresh = false) => {
-    refresh.value = isRefresh
-    showModal.value = false
-    documentVisibilityStateNotify.cancel()
-}
-
-// 暴露组件属性给父组件调用
-defineExpose({
-    closed,
-})
 </script>

+ 2 - 1
src/packages/tjmd/views/mine/Index.vue

@@ -78,7 +78,7 @@
                         <Iconfont icon="g-icon-sign">签约账户</Iconfont>
                     </template>
                 </Cell>
-                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified">
+                <Cell is-link :to="{ name: 'account-protocol', query: { memberUserId: getMemberUserId()} }" v-if="authStatus === AuthStatus.Certified">
                     <template #title>
                         <Iconfont icon="g-icon-sign">合同签署</Iconfont>
                     </template>
@@ -131,6 +131,7 @@ import { queryBankAccountSign } from '@/services/api/bank'
 import { useLoginStore, useAccountStore, useUserStore, usePositionStore } from '@/stores'
 import eventBus from '@/services/bus'
 import Iconfont from '@/components/base/iconfont/index.vue'
+import { getMemberUserId } from '@/services/methods/user'
 
 const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()