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

fix:处理订单自提方式显示自提地址

parent b0204163
import React, { useContext, useState, useRef, useEffect, useCallback } from 'react'
import { StandardTable } from 'god'
import { Card, Table, Form, Input, Row, Col, Button, Modal } from 'antd'
import { Card, Table, Form, Input, Row, Col, Button, Modal, Space, Popover } from 'antd'
import { OrderDetailContext } from '../../context'
import { EditOutlined, SettingOutlined } from '@ant-design/icons'
import { EditOutlined, EnvironmentOutlined, SettingOutlined } from '@ant-design/icons'
import style from './index.less'
import { PublicApi } from '@/services/api'
import styled from 'styled-components'
......@@ -165,6 +165,32 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
</RowStyle>
}
// 自提地址框
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && JSON.parse(pickInfo.render)
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
{/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */}
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address}</p>
</>
}
</div>
</Row>
}>
{children}
</Popover>
</Space> : children
}
const EditableRow: React.FC<EditableRowProps> = ({ index, ...props }) => {
const [form] = Form.useForm();
return (
......@@ -392,7 +418,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: (text) => text && text.deliveryType && DELIVERY_TYPE[text.deliveryType]
// render: (text) => text && text.deliveryType && DELIVERY_TYPE[text.deliveryType]
render: (text) => (text && text.deliveryType && text.deliveryType === 2) ?
<AddressPop pickInfo={text}>{DELIVERY_TYPE[text.deliveryType]}</AddressPop> : DELIVERY_TYPE[text?.deliveryType]
},
{
title: '仓位库存扣减记录',
......
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