| | |
| | | } from '@12333/constants'; |
| | | import { format, hiddenPhone, Message, setOSSLink, openDocument } from '@12333/utils'; |
| | | import Taro from '@tarojs/taro'; |
| | | import _ from 'lodash'; |
| | | |
| | | defineOptions({ |
| | | name: 'InnerPage', |
| | |
| | | } |
| | | } |
| | | |
| | | const goToSign = useAccessReal(async () => { |
| | | try { |
| | | let params: API.PersonalUserElectronSignCommand = { |
| | | id: detail.value?.id, |
| | | }; |
| | | let res = await enterpriseEmployeeServices.personalUserElectronSign(params); |
| | | if (res) { |
| | | if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.AlipaySign) { |
| | | try { |
| | | await Message.confirm({ |
| | | message: `签约短信已发送至您${hiddenPhone( |
| | | detail.value?.contactPhoneNumber |
| | | )}的手机,请及时查看并签约`, |
| | | cancelText: '未收到短信', |
| | | }); |
| | | } catch (error) { |
| | | goToSign(); |
| | | const goToSign = _.debounce( |
| | | useAccessReal(async () => { |
| | | try { |
| | | let params: API.PersonalUserElectronSignCommand = { |
| | | id: detail.value?.id, |
| | | }; |
| | | let res = await enterpriseEmployeeServices.personalUserElectronSign(params); |
| | | if (res) { |
| | | 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.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); |
| | | } |
| | | } else { |
| | | const encodedUrl = encodeURIComponent(res.signContractLongUrl); |
| | | Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | }); |
| | | } catch (error) {} |
| | | }), |
| | | 1000, |
| | | { leading: true, trailing: true } |
| | | ); |
| | | |
| | | Taro.useDidShow(() => { |
| | | refetch(); |
| | | }); |