|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </ContentScrollView> | 
|---|
|  |  |  | <PageFooter v-if="detail?.userSignContractStatus === EnumTaskUserSignContractStatus.Wait"> | 
|---|
|  |  |  | <PageFooterBtn type="primary" @click="goToSign">去签约</PageFooterBtn> | 
|---|
|  |  |  | <PageFooterBtn type="primary" @click="goToSign" :loading="btnLoading">去签约</PageFooterBtn> | 
|---|
|  |  |  | </PageFooter> | 
|---|
|  |  |  | </LoadingLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | } from '@12333/constants'; | 
|---|
|  |  |  | import { format, hiddenPhone, Message, setOSSLink, openDocument } from '@12333/utils'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import _ from 'lodash'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | 
|---|
|  |  |  | //灵工Id | 
|---|
|  |  |  | const id = router.params?.id; | 
|---|
|  |  |  | const code = router.params?.code || options?.query?.scene; | 
|---|
|  |  |  | const btnLoading = ref(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | isLoading, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function checkAgreement() { | 
|---|
|  |  |  | if (detail?.value?.userSignContractStatus === EnumTaskUserSignContractStatus.Wait) { | 
|---|
|  |  |  | goToSign(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if ( | 
|---|
|  |  |  | detail?.value?.userSignContractStatus === EnumTaskUserSignContractStatus.Stop || | 
|---|
|  |  |  | detail?.value?.userSignContractStatus === EnumTaskUserSignContractStatus.Pass | 
|---|
|  |  |  | ) { | 
|---|
|  |  |  | if (!detail?.value?.contractUrl) { | 
|---|
|  |  |  | Message.warning('协议无法查看,请稍后再试'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | async function checkAgreement() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | const res = await refetch(); | 
|---|
|  |  |  | if (res?.data?.userSignContractStatus === EnumTaskUserSignContractStatus.Wait) { | 
|---|
|  |  |  | goToSign(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openDocument(setOSSLink(detail?.value?.contractUrl)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if ( | 
|---|
|  |  |  | res?.data?.userSignContractStatus === EnumTaskUserSignContractStatus.Stop || | 
|---|
|  |  |  | res?.data?.userSignContractStatus === EnumTaskUserSignContractStatus.Pass | 
|---|
|  |  |  | ) { | 
|---|
|  |  |  | if (!res?.data?.contractUrl) { | 
|---|
|  |  |  | Message.warning('协议无法查看,请稍后再试'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openDocument(setOSSLink(res?.data?.contractUrl)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const goToSign = useAccessReal(async () => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | btnLoading.value = true; | 
|---|
|  |  |  | let params: API.PersonalUserElectronSignCommand = { | 
|---|
|  |  |  | id: detail.value?.id, | 
|---|
|  |  |  | returnUrl: `${RouterPath.mineAgreementSignDetail}?id=${id}`, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await enterpriseEmployeeServices.personalUserElectronSign(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
|---|
|  |  |  | Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | Taro.redirectTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | btnLoading.value = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } catch (error) { | 
|---|
|  |  |  | btnLoading.value = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Taro.useDidShow(() => { | 
|---|
|  |  |  | refetch(); | 
|---|
|  |  |  | }); | 
|---|