feat:
This commit is contained in:
22
src/components/invite-operations-banner/index.less
Normal file
22
src/components/invite-operations-banner/index.less
Normal file
@ -0,0 +1,22 @@
|
||||
@import '@/styles/variables.less';
|
||||
@import '@/styles/common.less';
|
||||
|
||||
.invite-operations-fragment-banner {
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
position: relative;
|
||||
margin-bottom: 24px;
|
||||
|
||||
&__image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&__close {
|
||||
width: 64px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
40
src/components/invite-operations-banner/index.tsx
Normal file
40
src/components/invite-operations-banner/index.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import { Image } from '@tarojs/components';
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { getPartnerBannerClose, setPartnerBannerClose } from '@/utils/partner';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'invite-operations-fragment-banner';
|
||||
|
||||
export default function InviteOperationsBanner() {
|
||||
const [bannerClose, setBannerClose] = useState<boolean>(getPartnerBannerClose());
|
||||
|
||||
const handlePartnerBannerClose = useCallback(e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setBannerClose(true);
|
||||
setPartnerBannerClose();
|
||||
}, []);
|
||||
|
||||
const handleClick = useCallback(async () => {
|
||||
navigateTo(PageUrl.InviteOperations);
|
||||
}, []);
|
||||
|
||||
if (bannerClose) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={PREFIX} onClick={handleClick}>
|
||||
<Image
|
||||
className={`${PREFIX}__image`}
|
||||
src="https://publiccdn.neighbourhood.com.cn/img/invite-operations-banner.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -44,7 +44,7 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
||||
// },
|
||||
{
|
||||
type: GET_CONTACT_TYPE.INVITE,
|
||||
icon: '',
|
||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/invite-operations.png',
|
||||
title: '邀请运营进群(进会员)',
|
||||
desc: '每邀请进一个主播群送一个日会员',
|
||||
btnText: '邀请',
|
||||
|
||||
Reference in New Issue
Block a user