Commit b72de57e authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理订单详情内部状态显示异常,处理销售待审核订单修改运费后价格总计价格不同步更新的问题

parent 840c58e1
import React, { ReactNode } from 'react' import React, { ReactNode } from 'react'
import { Row, Col, Skeleton } from 'antd' import { Row, Col, Skeleton } from 'antd'
import { history } from 'umi' import { history } from 'umi'
import { ArrowLeftOutlined } from '@ant-design/icons' import { ArrowLeftOutlined } from '@ant-design/icons'
import style from './index.less' import style from './index.less'
export interface OrderDetailHeaderProps { export interface OrderDetailHeaderProps {
extraRight?: ReactNode, extraRight?: ReactNode,
detailList?: { label: string, name: string, render?(text, record?), [key: string]: any }[], detailList?: { label: string, name: string, render?(text, record?), [key: string]: any }[],
detailData?: any detailData?: any
} }
/** /**
* 订单详情头部 * 订单详情头部
*/ */
const OrderDetailHeader:React.FC<OrderDetailHeaderProps> = ({ extraRight, detailList = [], detailData}) => { const OrderDetailHeader:React.FC<OrderDetailHeaderProps> = ({ extraRight, detailList = [], detailData}) => {
const isLoading = !!detailData const isLoading = !!detailData
return ( return (
<div className={style.detailHeader}> <div className={style.detailHeader}>
{ {
isLoading ? isLoading ?
<Row> <Row>
{ {
<Col> <Col>
<Row align='middle'> <Row align='middle'>
<Col> <Col>
<ArrowLeftOutlined onClick={() => history.goBack()}/> <ArrowLeftOutlined onClick={() => history.goBack()}/>
</Col> </Col>
<Col className={style.titleAvator}></Col> <Col className={style.titleAvator}></Col>
</Row> </Row>
</Col> </Col>
} }
<Col style={{flex: 1}}> <Col style={{flex: 1}}>
<Row justify='space-between' align='middle' style={{paddingTop: 14}}> <Row justify='space-between' align='middle' style={{paddingTop: 14}}>
<Col style={{flex: 1}}> <Col style={{flex: 1}}>
<div className={style.titleAvatorText}>订单号: {detailData.orderNo}</div> <div className={style.titleAvatorText}>订单号: {detailData.orderNo}</div>
<Row> <Row>
{detailList.map(v => { {detailList.map(v => {
const { label, render, name, ...colProps } = v const { label, render, name, ...colProps } = v
return detailData[name] ? <Col key={label} {...colProps} className={style.detailCol}> return (detailData[name] || detailData[name] === 0) ? <Col key={label} {...colProps} className={style.detailCol}>
<span className={style.colLabel}>{label}:</span> <span className={style.colLabel}>{label}:</span>
{render ? render(detailData[name], detailData) : <span>{detailData[name]}</span>} {render ? render(detailData[name], detailData) : <span>{detailData[name]}</span>}
</Col> : null </Col> : null
})} })}
</Row> </Row>
</Col> </Col>
<Col>{extraRight}</Col> <Col>{extraRight}</Col>
</Row> </Row>
</Col> </Col>
</Row> </Row>
: <Skeleton avatar={{shape: 'square'}} active paragraph={{ rows: 3 }} /> : <Skeleton avatar={{shape: 'square'}} active paragraph={{ rows: 3 }} />
} }
</div> </div>
) )
} }
OrderDetailHeader.defaultProps = {} OrderDetailHeader.defaultProps = {}
export default OrderDetailHeader export default OrderDetailHeader
\ No newline at end of file
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