Commit 783cd97c authored by 靳野's avatar 靳野

feat:消息提醒

parent fa99f46e
...@@ -16,5 +16,6 @@ module.exports = { ...@@ -16,5 +16,6 @@ module.exports = {
'import/extensions': 0, 'import/extensions': 0,
'no-unused-expressions': ['off'], 'no-unused-expressions': ['off'],
'template-curly-spacing': 'off', 'template-curly-spacing': 'off',
'no-shadow': 'off',
}, },
}; };
import RoleType, { isPlatForm } from './role.config'; import RoleType, { isPlatForm } from './role.config';
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'sc'; const environment = 'yxm2';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
......
...@@ -19,7 +19,7 @@ const INIT_QUERY_PARAMS = { ...@@ -19,7 +19,7 @@ const INIT_QUERY_PARAMS = {
const MessageItem = props => { const MessageItem = props => {
const { item, onMark, viewDetail } = props; const { item, onMark, viewDetail } = props;
/** /**
* type: 0订单消息,1售后消息 * type: 0订单消息,1售后消息,7提示补货,8竞价成功
* readStatus: 0未读,1已读 * readStatus: 0未读,1已读
*/ */
const { readStatus, type } = item; const { readStatus, type } = item;
...@@ -30,17 +30,33 @@ const MessageItem = props => { ...@@ -30,17 +30,33 @@ const MessageItem = props => {
console.error('消息数据格式错误'); console.error('消息数据格式错误');
} }
const goodList = message.items.map((good, index) => ( const goodList = message.items?.map((good, index) => (
<div className={styles.good} key={String(index)}> <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>
)); ));
const renderMessageHeader = message => {
switch (message.type) {
case 7:
return <span className={styles.time}>库存预警</span>;
case 8:
return <span className={styles.time}>竞价成功</span>;
default:
return (
<>
<span className={styles['order-number']}>订单编号:{message.orderNo}</span>
<span className={styles.time}>订单时间:{message.time}</span>
</>
);
}
};
return ( return (
<div className={styles['complex-list__item']}> <div className={styles['complex-list__item']}>
<div className={styles['complex-list__item--header']}> <div className={styles['complex-list__item--header']}>
<span className={styles['order-number']}> 订单编号:{message.orderNo}</span> {renderMessageHeader(message)}
<span className={styles.time}>订单时间:{message.time}</span>
<span className={styles['read-status']}> <span className={styles['read-status']}>
{readStatus === 0 ? ( {readStatus === 0 ? (
<a className={styles['read-status--un-read']} onClick={() => onMark([item.id])}> <a className={styles['read-status--un-read']} onClick={() => onMark([item.id])}>
...@@ -189,6 +205,12 @@ const Complex = props => { ...@@ -189,6 +205,12 @@ const Complex = props => {
query: { orderNo }, query: { orderNo },
}); });
} }
if ([7, 8].includes(type)) {
history.push({
pathname: '/goodsManage',
query: { orderNo },
});
}
close(); close();
}; };
......
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