Commit dd227fc6 authored by 李腾's avatar 李腾

fix: 消息提醒他弹框新增收缩按钮

parent 77bd48a0
...@@ -12,9 +12,15 @@ import styles from './index.less'; ...@@ -12,9 +12,15 @@ import styles from './index.less';
import { CHANNEL_ID } from '@/utils/constants'; import { CHANNEL_ID } from '@/utils/constants';
const Horn = props => { const Horn = props => {
const { count, toggle, animationClass } = props; const { count, toggle, animationClass, stowClass, onStow } = props;
return ( return (
<div className={classNames(styles.horn, styles[animationClass])} onClick={toggle}> <div
className={classNames(styles.horn, styles[animationClass], styles[stowClass])}
onClick={toggle}
>
<span className={styles['horn--btn']} onClick={e => onStow(e)}>
{stowClass ? '<' : '>'}
</span>
<Badge count={count}> <Badge count={count}>
<div className={styles['horn--num']}>消息提醒</div> <div className={styles['horn--num']}>消息提醒</div>
</Badge> </Badge>
...@@ -23,7 +29,17 @@ const Horn = props => { ...@@ -23,7 +29,17 @@ const Horn = props => {
}; };
const Message = props => { const Message = props => {
const { toggle, animationClass, messageData, openComplex, onMark, loading, viewDetail } = props; const {
toggle,
animationClass,
messageData,
openComplex,
onMark,
loading,
viewDetail,
onStow,
stowClass,
} = props;
const ReminderItem = args => { const ReminderItem = args => {
const { item } = args; const { item } = args;
...@@ -102,6 +118,7 @@ const Simple = props => { ...@@ -102,6 +118,7 @@ const Simple = props => {
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const [hornClass, setHornClass] = useState(''); const [hornClass, setHornClass] = useState('');
const [messageClass, setMessageClass] = useState(''); const [messageClass, setMessageClass] = useState('');
const [stowClass, setStowClass] = useState('');
const [messageData, setMessageData] = useState([]); const [messageData, setMessageData] = useState([]);
...@@ -166,6 +183,16 @@ const Simple = props => { ...@@ -166,6 +183,16 @@ const Simple = props => {
toggle(); toggle();
}; };
const onStow = e => {
e.preventDefault();
e.stopPropagation();
if (stowClass) {
setStowClass('');
} else {
setStowClass('stow');
}
};
// 标记已读信息 // 标记已读信息
const onMark = idsList => { const onMark = idsList => {
if (!idsList.length) { if (!idsList.length) {
...@@ -204,8 +231,10 @@ const Simple = props => { ...@@ -204,8 +231,10 @@ const Simple = props => {
const hornProps = { const hornProps = {
animationClass: hornClass, animationClass: hornClass,
stowClass,
toggle, toggle,
count, count,
onStow,
}; };
const messageProps = { const messageProps = {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// height: 50px; // height: 50px;
color: #fff; color: #fff;
background: #2d8cf0; background: #2d8cf0;
transform: translateY(0); transform: translate(0, 0);
cursor: pointer; cursor: pointer;
opacity: 1; opacity: 1;
transition: 0.2s ease-in; transition: 0.2s ease-in;
...@@ -16,6 +16,24 @@ ...@@ -16,6 +16,24 @@
opacity: 0; opacity: 0;
transition: 0.2s ease-out; transition: 0.2s ease-out;
} }
&.stow {
transform: translateX(142px);
transition: 0.2s ease-out;
}
&--btn {
display: inline-block;
width: 20px;
height: 50px;
line-height: 50px;
text-align: center;
vertical-align: top;
background: #006ad9;
border-right: 1px solid #2479d3;
&:hover {
background: #2479d3;
transition: 0.2s ease-out;
}
}
&--num { &--num {
width: 112px; width: 112px;
height: 50px; height: 50px;
......
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