feat:
This commit is contained in:
@ -82,9 +82,16 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
setProductRecord(result);
|
||||
}, [data.id]);
|
||||
|
||||
const getProductBalance = useCallback(async () => {
|
||||
const getProductBalance = useCallback(async (loading?: boolean) => {
|
||||
if (loading) {
|
||||
Taro.showLoading();
|
||||
}
|
||||
const [, resp] = await requestProductBalance(ProductType.VIP);
|
||||
setProductInfo(resp);
|
||||
console.log(resp);
|
||||
if (loading) {
|
||||
Taro.hideLoading();
|
||||
}
|
||||
return resp;
|
||||
}, []);
|
||||
|
||||
@ -179,6 +186,10 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
// return productInfo?.isCreateResume? '升级会员即可查看': '创建模卡,免费查看';
|
||||
// }, [productInfo, haveSeen]);
|
||||
|
||||
const handleRefresh = useCallback(async () => {
|
||||
await getProductBalance(true);
|
||||
}, [getProductBalance]);
|
||||
|
||||
useEffect(() => {
|
||||
Taro.eventCenter.on(EventName.CREATE_PROFILE, getProductBalance);
|
||||
return () => {
|
||||
@ -200,7 +211,12 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
<Button className={`${PREFIX}__share-button`} openType="share">
|
||||
分享
|
||||
</Button>
|
||||
<LoginButton needRefresh className={`${PREFIX}__contact-publisher`} onClick={handleClickContact}>
|
||||
<LoginButton
|
||||
needRefresh
|
||||
onRefresh={handleRefresh}
|
||||
className={`${PREFIX}__contact-publisher`}
|
||||
onClick={handleClickContact}
|
||||
>
|
||||
{data.isAuthed ? '在线沟通' : '查看联系方式'}
|
||||
{needPhone ? (
|
||||
<div className={`${PREFIX}__contact-publisher-tag`}>登录后可免费报单</div>
|
||||
|
||||
Reference in New Issue
Block a user