zhengyiming
2 天以前 157eda36f3505ecff50b1ab1a1fdafa2e02e6d1b
src/views/SignMiddleware/SignU.vue
@@ -1,20 +1,43 @@
<template>
  <div class="sign-middleware-wrapper">
    <el-button type="primary" @click="goSign">前往签约</el-button>
  </div>
  <LoadingLayout :loading="isLoading">
    <div class="sign-middleware-wrapper">
      <!-- <el-button type="primary" @click="goSign">前往签约</el-button> -->
    </div>
  </LoadingLayout>
</template>
<script setup lang="ts">
import { LoadingLayout } from '@bole-core/components';
import * as codeUrlServices from '@/services/api/codeUrl';
import { useQuery } from '@tanstack/vue-query';
//跳转上上签或支付宝信任签的签约地址
defineOptions({
  name: 'SignU',
});
const route = useRoute();
const templateCode = (route.params.code as string) ?? '';
const code = (route.params.code as string) ?? '';
function goSign() {}
const { data, isLoading } = useQuery({
  queryKey: ['codeUrlServices/getCodeUrl', code],
  queryFn: () =>
    codeUrlServices.getCodeUrl(
      {
        scene: EnumCodeUrlScene.ElectronSignUrl,
        code: code,
      },
      { showLoading: false }
    ),
  enabled: computed(() => !!code),
  onSuccess(data) {
    if (data.url) {
      window.location.href = data.url;
    }
  },
});
</script>
<style lang="scss" scoped>