|  |  | 
 |  |  |       </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', | 
 |  |  | 
 |  |  |  | 
 |  |  | const { userDetail } = useUser(); | 
 |  |  | const router = Taro.useRouter(); | 
 |  |  | const launchOption = useLaunchOptions(); | 
 |  |  | const options = Taro.getLaunchOptionsSync(); | 
 |  |  | //灵工Id | 
 |  |  | const id = router.params?.id; | 
 |  |  | const code = launchOption?.query?.scene || router.params?.code; | 
 |  |  | 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 { | 
 |  |  |     // if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.BestSign) { | 
 |  |  |     btnLoading.value = true; | 
 |  |  |     let params: API.PersonalUserElectronSignCommand = { | 
 |  |  |       id: detail.value?.id, | 
 |  |  |       returnUrl: `${RouterPath.mineAgreementSignDetail}?id=${id}`, | 
 |  |  |     }; | 
 |  |  |     let res = await enterpriseEmployeeServices.personalUserElectronSign(params); | 
 |  |  |     if (res) { | 
 |  |  |       const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
 |  |  |       Taro.navigateTo({ url: `${RouterPath.mineAgreementSignExtraPage}?url=${encodedUrl}` }); | 
 |  |  |       if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.AlipaySign) { | 
 |  |  |         try { | 
 |  |  |           await Message.confirm({ | 
 |  |  |             message: `签约短信已发送至您${hiddenPhone( | 
 |  |  |               detail.value?.contactPhoneNumber | 
 |  |  |             )}的手机,请及时查看并签约`, | 
 |  |  |             cancelText: '未收到短信', | 
 |  |  |           }); | 
 |  |  |         } catch (error) { | 
 |  |  |           goToSign(); | 
 |  |  |         } | 
 |  |  |       } else { | 
 |  |  |         const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
 |  |  |         Taro.redirectTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
 |  |  |       } | 
 |  |  |     } else { | 
 |  |  |       btnLoading.value = false; | 
 |  |  |     } | 
 |  |  |     // } | 
 |  |  |     // if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.AlipaySign) { | 
 |  |  |     //   Message.confirm({ | 
 |  |  |     //     message: `签约短信已发送至您${hiddenPhone( | 
 |  |  |     //       detail.value?.contactPhoneNumber | 
 |  |  |     //     )}的手机,请及时查看并签约`, | 
 |  |  |     //     showCancelBtn: false, | 
 |  |  |     //   }); | 
 |  |  |     // } | 
 |  |  |   } catch (error) {} | 
 |  |  |   } catch (error) { | 
 |  |  |     btnLoading.value = false; | 
 |  |  |   } | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | Taro.useDidShow(() => { | 
 |  |  |   refetch(); | 
 |  |  | }); |