Commit d61e98b9 authored by 李腾's avatar 李腾

feat: 修复sort key 报错

parent dac974fc
...@@ -30,8 +30,8 @@ const MessageItem = props => { ...@@ -30,8 +30,8 @@ const MessageItem = props => {
console.error('消息数据格式错误'); console.error('消息数据格式错误');
} }
const goodList = message.items.map(good => ( const goodList = message.items.map((good, index) => (
<div className={styles.good}> <div className={styles.good} key={String(index)}>
<span className={styles.good__name}>{good.skuName}</span> <span className={styles.good__name}>{good.skuName}</span>
<span className={styles.good__count}>x{good.quantity}</span> <span className={styles.good__count}>x{good.quantity}</span>
</div> </div>
...@@ -174,7 +174,6 @@ const Complex = props => { ...@@ -174,7 +174,6 @@ const Complex = props => {
*/ */
const viewDetail = message => { const viewDetail = message => {
const { orderNo, type } = message; const { orderNo, type } = message;
console.log(type);
if ([1, 2].includes(type)) { if ([1, 2].includes(type)) {
history.push({ history.push({
...@@ -268,32 +267,21 @@ const Complex = props => { ...@@ -268,32 +267,21 @@ const Complex = props => {
); );
}; };
const FilterRender = filterProps => { const FilterRender = filterProps => (
console.log(filterProps); <div className={styles['filter-box']}>
return ( <div className={styles['filter-box__content']}>
<div className={styles['filter-box']}> <Checkbox checked={queryParams.readStatus === '0'} value="0" onChange={onReadStatusChange}>
<div className={styles['filter-box__content']}> 未读
<Checkbox </Checkbox>
checked={queryParams.readStatus === '0'} <Checkbox checked={queryParams.readStatus === '1'} value="1" onChange={onReadStatusChange}>
value="0" 已读
onChange={onReadStatusChange} </Checkbox>
>
未读
</Checkbox>
<Checkbox
checked={queryParams.readStatus === '1'}
value="1"
onChange={onReadStatusChange}
>
已读
</Checkbox>
</div>
<div className={styles['filter-box__actions']}>
<a onClick={() => onMark(onFilterMessageParams(messageData))}>全部标记为已读</a>
</div>
</div> </div>
); <div className={styles['filter-box__actions']}>
}; <a onClick={() => onMark(onFilterMessageParams(messageData))}>全部标记为已读</a>
</div>
</div>
);
return ( return (
<Modal {...modalProps}> <Modal {...modalProps}>
...@@ -316,8 +304,13 @@ const Complex = props => { ...@@ -316,8 +304,13 @@ const Complex = props => {
<FilterRender /> <FilterRender />
<div className={styles['complex-list']}> <div className={styles['complex-list']}>
{visible && messageData.length ? ( {visible && messageData.length ? (
messageData.map(item => ( messageData.map((item, index) => (
<MessageItem key={item.id} item={item} onMark={onMark} viewDetail={viewDetail} /> <MessageItem
key={String(index)}
item={item}
onMark={onMark}
viewDetail={viewDetail}
/>
)) ))
) : ( ) : (
<Empty text="暂无数据" /> <Empty text="暂无数据" />
......
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