<template>
|
<PageLayout title="合同预览" has-border v-if="url && lgGigSignId">
|
<ContentScrollView>
|
<iframe :src="url" class="contract-preview-body"></iframe>
|
</ContentScrollView>
|
<PageFooter>
|
<PageFooterBtn @click="handleConfirm">前往签约</PageFooterBtn>
|
</PageFooter>
|
</PageLayout>
|
</template>
|
|
<script setup lang="ts">
|
import * as lgGigWorkerServices from '@/services/api/LgGigWorker';
|
import { SignUserType, SignChannelEnum } from '@/constants';
|
import { useSignChannelBySignId } from '@/hooks';
|
import { Message } from '@bole-core/core';
|
|
defineOptions({
|
name: 'ContractPreview',
|
});
|
|
const route = useRoute();
|
const url = (route.query.url as string) ?? '';
|
const lgGigSignId = (route.query.lgGigSignId as string) ?? '';
|
console.log('lgGigSignId: ', lgGigSignId);
|
|
const { signChannel, ensureSignChannelBySignId } = useSignChannelBySignId({ signId: lgGigSignId });
|
|
onMounted(async () => {
|
try {
|
await ensureSignChannelBySignId();
|
if (signChannel.value === SignChannelEnum.Alipay) {
|
handleConfirm();
|
}
|
} catch (error) {}
|
});
|
|
async function handleConfirm() {
|
try {
|
let params: API.LgGigUserToSignUrlInput = {
|
lgGigSignId: lgGigSignId,
|
userType: SignUserType.Person,
|
};
|
let res = await lgGigWorkerServices.lgGigUserToSignUrl(params);
|
if (res) {
|
if (res.success) {
|
location.href = res.data;
|
} else {
|
Message.errorMessage(res.msg);
|
}
|
}
|
} catch (error) {}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@use '@/style/common.scss' as *;
|
|
.contract-preview-body {
|
width: 100%;
|
height: 100%;
|
}
|
</style>
|