|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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 () => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
|---|
|  |  |  | Taro.redirectTo({ url: `${RouterPath.extraPage}?url=${res.signContractLongUrl}` }); | 
|---|
|  |  |  | Taro.redirectTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | btnLoading.value = false; | 
|---|