Commit 60302a68 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理e账户认证绑定/解绑手机输入禁用

parent dcb1f0bd
......@@ -169,22 +169,27 @@ const CompanyFinish: React.FC<{}> = () => {
confirm={handleBindSubmit}
actions={bindActions}
schema={data?.phone ? unbindSchema : bindSchema}
modalProps={{confirmLoading: bindLoading}}
modalProps={{confirmLoading: bindLoading, destroyOnClose: true}}
components={{PhoneCode}}
effects={($, actions) => {
useAsyncSelect('areaCode', fetchTelCode)
$('onFormMount').subscribe(() => {
$('onFormInit').subscribe(() => {
if(data?.phone) {
actions.setFieldValue('phone', data.phone)
actions.setFieldState('verificationCode', state => {
state.props['x-component-props']['type'] = UNBIND_PHONE
})
actions.setFieldState('phone', state => {
state.props['x-component-props']['disabled'] = true
})
} else {
actions.setFieldState('phone', state => {
state.props['x-component-props']['disabled'] = false
})
actions.setFieldState('verificationCode', state => {
state.props['x-component-props']['type'] = BIND_PHONE
})
}
})
}}
/>
......
......@@ -33,7 +33,6 @@ const PersonalFinish: React.FC<{}> = () => {
}, [data])
const onFinish = async (values: any) => {
console.log('Received values of form: ', values);
// 绑定银行卡
const p1 = await postPayAllInPayBindBankCard({phone: data.phone, verificationCode: values.captcha, cardNo: values.cardNo}, { ctlType: "none" })
// 进一步完善个人信息
......@@ -110,9 +109,9 @@ const PersonalFinish: React.FC<{}> = () => {
// 绑定解绑手机
const handleBindSubmit = () => {
setBindLoading(true)
const fn = data?.phone ? postPayAllInPayUnbindPhone : postPayAllInPayBindPhone
bindActions.submit().then(async ({values}: any) => {
setBindLoading(true)
fn(values).then(res => {
if(res.code === 1000) {
reloadFormData()
......@@ -295,22 +294,27 @@ const PersonalFinish: React.FC<{}> = () => {
confirm={handleBindSubmit}
actions={bindActions}
schema={data?.phone ? unbindSchema : bindSchema}
modalProps={{confirmLoading: bindLoading}}
modalProps={{confirmLoading: bindLoading, destroyOnClose: true}}
components={{PhoneCode}}
effects={($, actions) => {
useAsyncSelect('areaCode', fetchTelCode)
$('onFormMount').subscribe(() => {
$('onFormInit').subscribe(() => {
if(data?.phone) {
actions.setFieldValue('phone', data.phone)
actions.setFieldState('verificationCode', state => {
state.props['x-component-props']['type'] = UNBIND_PHONE
})
actions.setFieldState('phone', state => {
state.props['x-component-props']['disabled'] = true
})
} else {
actions.setFieldState('phone', state => {
state.props['x-component-props']['disabled'] = false
})
actions.setFieldState('verificationCode', state => {
state.props['x-component-props']['type'] = BIND_PHONE
})
}
})
}}
/>
......
......@@ -36,7 +36,6 @@ const PhoneCode = (props) => {
}
setLoading(true)
form.validate('phone').then(result => {
console.log(result, type)
// 发送验证码
const phone = form.getFieldValue('phone')
postPayAllInPaySendVerificationCode({phone, verificationCodeType: type}).then(res => {
......
......@@ -41,7 +41,7 @@ const SetStrategy: React.FC<{}> = () => {
let res = await postProductCommoditySaveOrUpdateUnitPriceStrategy({ ...params, ..._params })
if (res.code === 1000) {
setTimeout(() => {
history.goBack(-1)
history.goBack()
}, 1000)
}
setBtnLoading(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment