Commit 28c0ace3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 933b48cb 901b34cc
...@@ -201,6 +201,13 @@ const LogisticsRoute: RouterChild = { ...@@ -201,6 +201,13 @@ const LogisticsRoute: RouterChild = {
component: '@/pages/logistics/components/orderSearchDetail', component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true hideInMenu: true
}, },
// 待确认物流单-详情
{
path: '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option',
name: 'orderResultDeatil',
component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true
},
] ]
} }
] ]
......
...@@ -9,7 +9,7 @@ export const productModalByMemberSchema: ISchema = { ...@@ -9,7 +9,7 @@ export const productModalByMemberSchema: ISchema = {
type: 'string', type: 'string',
'x-component': 'ModalSearch', 'x-component': 'ModalSearch',
'x-component-props': { 'x-component-props': {
placeholder: '请输入商品名称/ID', placeholder: '请输入商品名称',
align: 'flex-left', align: 'flex-left',
}, },
}, },
......
export const NOT_CHANGE_VALUE = 'hello, world' export const NOT_CHANGE_VALUE = 'hello, world'
// socket的链接地址, 默认会使用后端接口网关地址 // socket的链接地址, 默认会使用后端接口网关地址
export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY || "ws://10.0.0.25:9400" export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY.replace('http', 'ws') || "ws://10.0.0.25:9400"
export const MALL_TYPE = { export const MALL_TYPE = {
1: '企业商城', 1: '企业商城',
......
...@@ -13,6 +13,7 @@ export interface Params { ...@@ -13,6 +13,7 @@ export interface Params {
dialogVisible: boolean; dialogVisible: boolean;
onCancel: Function; onCancel: Function;
onOK?: Function; onOK?: Function;
freightPrice?: any;
dontReceive?: boolean; //默认展示 dontReceive?: boolean; //默认展示
} }
const actions = createFormActions() const actions = createFormActions()
...@@ -24,7 +25,9 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -24,7 +25,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handletOk = (values: any) => { const handletOk = (values: any) => {
let value = { ...values } let value = { ...values }
value.id = props.id value.id = props.id
console.log(values) if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => { PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
props.onOK() props.onOK()
...@@ -81,19 +84,6 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -81,19 +84,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
status: 4 status: 4
}} }}
> >
{props.dontReceive &&
<>
<Field
title='运费'
name='freightPrice'
x-component="numberpicker"
x-mega-prop={{
wrapperWidth: 300,
labelAlign: 'left'
}}
/>
</>
}
<Field <Field
enum={ enum={
[ [
......
...@@ -288,6 +288,15 @@ const detailInfo: React.FC<{}> = () => { ...@@ -288,6 +288,15 @@ const detailInfo: React.FC<{}> = () => {
history.goBack() history.goBack()
} }
// 获取路由link
const { pathname } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const [freightPrice, setfreightPrice] = useState<any>(null);
// 输入报价价格
const inputOnchange = (e: any) => {
const value = e.target.value;
setfreightPrice(value);
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -303,19 +312,15 @@ const detailInfo: React.FC<{}> = () => { ...@@ -303,19 +312,15 @@ const detailInfo: React.FC<{}> = () => {
</div> </div>
</> </>
} }
// extra={ extra={
// dataInfo.status === 2 && type === 'option' &&
// <> <>
// <Button onClick={() => setvisible(true)}> <Button onClick={() => setvisible(true)} className={style['saveBtn']}>
// <StopOutlined /> <CheckSquareOutlined />
// 不接受物流单 确认物流单
// </Button> </Button>
// <Button onClick={() => setvisible(true)} className={style['saveBtn']}> </>
// <CheckSquareOutlined /> }
// 接受物流单
// </Button>
// </>
// }
content={ content={
<div className={style['headerMain']}> <div className={style['headerMain']}>
<div className={style['headerMain-left']}> <div className={style['headerMain-left']}>
...@@ -410,7 +415,7 @@ const detailInfo: React.FC<{}> = () => { ...@@ -410,7 +415,7 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['base'].rightElem.map( {infoTem['base'].rightElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={`base${index + 1}`}>
<div className={style['cols-main-options']}> <div className={style['cols-main-options']}>
{item.title} {item.title}
</div> </div>
...@@ -421,22 +426,7 @@ const detailInfo: React.FC<{}> = () => { ...@@ -421,22 +426,7 @@ const detailInfo: React.FC<{}> = () => {
}, },
)} )}
</div> </div>
</div>
{/* <div className={style['mainCol-row']}>
{infoTem['base'].elem.map((item: any, index: number) => {
return (
<div className={style['mainCol-row-col']} key={index}>
<div className={style['mainCol-row-col-option']}>
{item.title}
</div>
<div className={style['mainCol-row-col-option']}>
185 2929 6547
</div>
</div> </div>
);
})}
</div> */}
</Col> </Col>
<Col className={style['mainCol']} span={24}> <Col className={style['mainCol']} span={24}>
<div className={style['mainCol-title']}> <div className={style['mainCol-title']}>
...@@ -473,16 +463,27 @@ const detailInfo: React.FC<{}> = () => { ...@@ -473,16 +463,27 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['freight'].leftElem.map( {infoTem['freight'].leftElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={`freight${index + 1}`}>
<div className={style['cols-main-options']}> <div className={style['cols-main-options']}>
{item.title} {item.title}
</div> </div>
{ {
item.key === 'freight' ? item.key === 'freight' ?
<>
{type === 'option' ?
<Input
addonBefore="¥"
onBlur={inputOnchange}
type='number'
maxLength={25}
style={{width: '300px'}}
/>
:
<div className={style['cols-main-options']}> <div className={style['cols-main-options']}>
{dataInfo.status < 3 ? '未报价' : item.value} {dataInfo.status < 3 ? '未报价' : item.value}
</div> </div>
}
</>
: <div className={style['cols-main-options']}> : <div className={style['cols-main-options']}>
{item.value} {item.value}
</div> </div>
...@@ -501,19 +502,12 @@ const detailInfo: React.FC<{}> = () => { ...@@ -501,19 +502,12 @@ const detailInfo: React.FC<{}> = () => {
外部流转记录 外部流转记录
</div> </div>
<OrderLog id={id} pathName={history.location.pathname} /> <OrderLog id={id} pathName={history.location.pathname} />
{/* <StandardTable
tableProps={{rowKey:'id'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/> */}
</Col> </Col>
</Row> </Row>
<ConfirmModal <ConfirmModal
id={id} id={id}
dialogVisible={visible} dialogVisible={visible}
freightPrice={freightPrice}
onCancel={() => setvisible(false)} onCancel={() => setvisible(false)}
onOK={() => handleModalOK()} onOK={() => handleModalOK()}
/> />
......
...@@ -158,7 +158,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -158,7 +158,7 @@ const OrderList: React.FC<ListProps> = (props) => {
align: 'center', align: 'center',
key: 'logisticsOrderNo', key: 'logisticsOrderNo',
render: (text: any, reconds: any) => render: (text: any, reconds: any) =>
<span className="commonPickColor" onClick={() => handleSee(reconds.id)}>{text}&nbsp;<EyeOutlined /></span> <span className="commonPickColor" onClick={() => handleSee(false ,reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
}, },
{ {
title: '对应订单号', title: '对应订单号',
...@@ -232,7 +232,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -232,7 +232,7 @@ const OrderList: React.FC<ListProps> = (props) => {
render: (_: any, record: any) => { render: (_: any, record: any) => {
return ( return (
<> <>
<Button type='link' onClick={() => handleDialog(record.id)}>确认</Button> <Button type='link' onClick={() => handleSee(true, record.id)}>确认</Button>
</> </>
) )
} }
...@@ -271,9 +271,13 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -271,9 +271,13 @@ const OrderList: React.FC<ListProps> = (props) => {
const handleDelete = () => { const handleDelete = () => {
console.log('delete') console.log('delete')
} }
const handleSee = (id: any) => { const handleSee = (option: boolean ,id: any) => {
if(option) {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option?id=${id}`)
}else {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail?id=${id}`) history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail?id=${id}`)
} }
}
const confirm = () => { const confirm = () => {
console.log('confirm') console.log('confirm')
......
...@@ -42,12 +42,12 @@ interface imgItemType { ...@@ -42,12 +42,12 @@ interface imgItemType {
const integralPayWay = [ const integralPayWay = [
{ {
payType: 5, payType: 0,
payVal: "积分支付", payVal: "积分支付",
payList: [ payList: [
{ {
id: 8, id: 0,
payType: 5, payType: 0,
way: "积分支付" way: "积分支付"
} }
] ]
......
...@@ -17,7 +17,7 @@ import SignModal from '@/components/SignModal' ...@@ -17,7 +17,7 @@ import SignModal from '@/components/SignModal'
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE } from '@/constants' import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE, ORDER_TYPE2_POINTS, ORDER_TYPE2_CHANNEL_POINTS } from '@/constants'
interface OrderPropsType { interface OrderPropsType {
location: any; location: any;
...@@ -232,13 +232,25 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -232,13 +232,25 @@ const Order: React.FC<OrderPropsType> = (props) => {
let mode = OrderModalType.PURCHASE_ORDER let mode = OrderModalType.PURCHASE_ORDER
switch (layoutType) { switch (layoutType) {
case LAYOUT_TYPE.channel: case LAYOUT_TYPE.channel:
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 25
} else {
mode = OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER mode = OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER
}
break break
case LAYOUT_TYPE.ichannel: case LAYOUT_TYPE.ichannel:
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 25
} else {
mode = OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER mode = OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER
}
break break
default: default:
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 24
} else {
mode = OrderModalType.PURCHASE_ORDER mode = OrderModalType.PURCHASE_ORDER
}
break break
} }
return mode return mode
......
...@@ -94,19 +94,3 @@ ...@@ -94,19 +94,3 @@
color: #909399; color: #909399;
} }
} }
.pay_btn {
width: 160px;
height: 50px;
color: #ffffff;
text-align: center;
line-height: 50px;
background-color: #D32F2F;
cursor: pointer;
margin-top: 20px;
&:hover {
opacity: .9;
}
}
\ No newline at end of file
import React, { useState } from 'react' import React, { useState, useEffect } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { LAYOUT_TYPE } from '@/constants'
import PasswordInput from '../passwordInput' import PasswordInput from '../passwordInput'
import { Button, message, Spin } from 'antd'
import { history } from 'umi'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { GetPayAssetAccountGetUserBalanceResponse } from "@/services/PayApi";
import { GetMemberSecurityGetResponse } from '@/services/MemberApi'
import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { linkToUrl } from '../../utils'
import styles from './index.less' import styles from './index.less'
interface BablancePayWayPropsType { interface BablancePayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
} }
const BablancePayWay: React.FC<BablancePayWayPropsType> = () => { const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
const { payInfo, orderId, orderInfo, layoutType, shopUrlParam } = props
const [balanceInfo, setBalanceInfo] = useState<GetPayAssetAccountGetUserBalanceResponse>(0)
const [securityInfo, setSecurityInfo] = useState<GetMemberSecurityGetResponse>()
const [payPassword, setPayPassword] = useState<string>('') const [payPassword, setPayPassword] = useState<string>('')
const [type, setType] = useState<string>('normal') // normal: 普通;member:会员 const [type, setType] = useState<string>('normal') // normal: 普通;member:会员
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [pageLoading, setPageLoading] = useState<boolean>(true)
const [payDisabled, setPayDisabled] = useState<boolean>(false)
const handlePasswordChange = (value: string) => { const handlePasswordChange = (value: string) => {
setPayPassword(value) setPayPassword(value)
} }
useEffect(() => {
if (orderInfo) {
fetchBalanceInfo()
fetchSecurity()
}
}, [orderInfo])
const fetchBalanceInfo = () => {
let param = {
parentMemberId: orderInfo.supplyMembersId,
parentMemberRoleId: orderInfo.supplyMembersRoleId
}
PublicApi.getPayAssetAccountGetUserBalance(param).then(res => {
if (res.code === 1000) {
setBalanceInfo(res.data)
setPageLoading(false)
}
})
}
const fetchSecurity = () => {
PublicApi.getMemberSecurityGet().then(res => {
if (res.code === 1000) {
setSecurityInfo(res.data)
}
})
}
const pay = () => {
if(balanceInfo < payInfo.payPrice) {
message.info("账户余额不足")
return
}
if (!payPassword || payPassword.length < 6) {
message.info("请输入支付密码")
return
}
let param = {
id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword)
}
setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
setConfirmLoading(false)
message.destroy()
message.error(res.message)
}
}).catch(() => {
setConfirmLoading(false)
})
}
return ( return (
<> <Spin spinning={pageLoading}>
<div className={styles.common_title}> <div className={styles.common_title}>
<span>余额支付</span> <span>余额支付</span>
<div className={styles.common_title_amount}> <div className={styles.common_title_amount}>
<label>当前需支付:</label> <label>当前需支付:</label>
<span>20,000</span> <span>{priceFormat(payInfo?.payPrice)}</span>
<label>RMB</label> <label>RMB</label>
</div> </div>
</div> </div>
...@@ -31,25 +113,34 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = () => { ...@@ -31,25 +113,34 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = () => {
<div className={styles.pay_point_way_list_item_title}>账户可用余额</div> <div className={styles.pay_point_way_list_item_title}>账户可用余额</div>
<div className={styles.pay_point_way_list_item_content}> <div className={styles.pay_point_way_list_item_content}>
<div className={styles.pay_point_way_list_item_point}> <div className={styles.pay_point_way_list_item_point}>
<label>30,000</label> <label>{balanceInfo}</label>
<span>RMB</span> <span>RMB</span>
</div> </div>
<div className={styles.pay_point_way_list_item_split}></div> <div className={styles.pay_point_way_list_item_split}></div>
<div className={styles.pay_point_way_list_item_needpay}> <div className={styles.pay_point_way_list_item_needpay}>
<label>当前需支付:</label> <label>当前需支付:</label>
<span>20,000</span> <span>{priceFormat(payInfo?.payPrice)}</span>
<label>RMB</label> <label>RMB</label>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{
securityInfo && securityInfo.hasPayPassword === 1 ? (
<div className={styles.pay_wray}> <div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div> <div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} /> <PasswordInput value={payPassword} onChange={handlePasswordChange} />
<div className={styles.pay_btn}>立即支付</div> <Button loading={confirmLoading} className={styles.pay_btn} onClick={() => pay()}>立即支付</Button>
</div>
) : (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>您还没有设置支付密码</div>
<Button loading={confirmLoading} disabled={payDisabled} className={styles.pay_btn} onClick={() => history.push(`/memberCenter/systemSetting/accountSetting/paycode?backPay=true`)} >去设置密码</Button>
</div> </div>
</> )
}
</Spin>
) )
} }
......
...@@ -76,19 +76,3 @@ ...@@ -76,19 +76,3 @@
color: #909399; color: #909399;
} }
} }
.pay_btn {
width: 160px;
height: 50px;
color: #ffffff;
text-align: center;
line-height: 50px;
background-color: #D32F2F;
cursor: pointer;
margin-top: 20px;
&:hover {
opacity: .9;
}
}
\ No newline at end of file
import React, { useState } from 'react' import React, { useState, useEffect } from 'react'
import cx from 'classnames' import cx from 'classnames'
import PasswordInput from '../passwordInput' import PasswordInput from '../passwordInput'
import { LAYOUT_TYPE } from '@/constants'
import { history } from 'umi'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { GetMemberSecurityGetResponse } from '@/services/MemberApi'
import { Button, message } from 'antd'
import { numFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { linkToUrl } from '../../utils'
import styles from './index.less' import styles from './index.less'
interface PointPayWayPropsType { interface PointPayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
} }
const PointPayWay: React.FC<PointPayWayPropsType> = () => { const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
const { payInfo, orderId, orderInfo, layoutType, shopUrlParam } = props
const [securityInfo, setSecurityInfo] = useState<GetMemberSecurityGetResponse>()
const [payPassword, setPayPassword] = useState<string>('') const [payPassword, setPayPassword] = useState<string>('')
const [type, setType] = useState<string>('normal') // normal: 普通;member:会员 const [type, setType] = useState<string>('normal') // normal: 普通;member:会员
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [payDisabled, setPayDisabled] = useState<boolean>(false)
const handlePasswordChange = (value: string) => { const handlePasswordChange = (value: string) => {
setPayPassword(value) setPayPassword(value)
...@@ -19,13 +36,57 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => { ...@@ -19,13 +36,57 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => {
setType(type) setType(type)
} }
useEffect(() => {
if (orderInfo) {
fetchSecurity()
}
}, [orderInfo])
const fetchSecurity = () => {
PublicApi.getMemberSecurityGet().then(res => {
if (res.code === 1000) {
setSecurityInfo(res.data)
}
})
}
const pay = () => {
if (!payPassword || payPassword.length < 6) {
message.error("请输入支付密码")
return
}
let param = {
id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword)
}
setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
setConfirmLoading(false)
message.destroy()
message.error(res.message)
}
}).catch(() => {
setConfirmLoading(false)
})
}
return ( return (
<> <>
<div className={styles.common_title}> <div className={styles.common_title}>
<span>积分支付</span> <span>积分支付</span>
<div className={styles.common_title_amount}> <div className={styles.common_title_amount}>
<label>当前需支付:</label> <label>当前需支付:</label>
<span>20,000</span> <span>{numFormat(payInfo?.payPrice)}</span>
<label>积分</label> <label>积分</label>
</div> </div>
</div> </div>
...@@ -53,11 +114,20 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => { ...@@ -53,11 +114,20 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => {
</div> </div>
</div> </div>
</div> </div>
{
securityInfo && securityInfo.hasPayPassword === 1 ? (
<div className={styles.pay_wray}> <div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div> <div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} /> <PasswordInput value={payPassword} onChange={handlePasswordChange} />
<div className={styles.pay_btn}>立即支付</div> <Button loading={confirmLoading} className={styles.pay_btn} onClick={() => pay()}>立即支付</Button>
</div> </div>
) : (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>您还没有设置支付密码</div>
<Button loading={confirmLoading} disabled={payDisabled} className={styles.pay_btn} onClick={() => history.push(`/memberCenter/systemSetting/accountSetting/paycode?backPay=true`)} >去设置密码</Button>
</div>
)
}
</> </>
) )
} }
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
&_imgbox { &_imgbox {
padding: 20px; padding: 20px;
width: 180px;
height: 180px;
border: 1px solid rgba(245, 245, 245, 1); border: 1px solid rgba(245, 245, 245, 1);
&>img { &>img {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
} }
......
...@@ -2,9 +2,10 @@ import React, { useEffect } from 'react' ...@@ -2,9 +2,10 @@ import React, { useEffect } from 'react'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi' import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import wechatIcon from '@/assets/imgs/wechat_icon.png' import wechatIcon from '@/assets/imgs/wechat_icon.png'
import wechatImg from '@/assets/imgs/wechat.png'
import { priceFormat } from '@/utils/numberFomat' import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { message, Spin } from 'antd'
import QRCode from 'qrcode'
import styles from './index.less' import styles from './index.less'
import { useState } from 'react' import { useState } from 'react'
...@@ -19,12 +20,23 @@ interface WechatPayWayPropsType { ...@@ -19,12 +20,23 @@ interface WechatPayWayPropsType {
const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => { const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
const { payInfo, orderId, onChange, orderInfo, layoutType, shopUrlParam } = props const { payInfo, orderId, onChange, orderInfo, layoutType, shopUrlParam } = props
const [wechatPayUrl, setWechatPayUrl] = useState<string>('') const [wechatPayUrl, setWechatPayUrl] = useState<any>('')
const [pageLoading, setPageLoading] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
pay() pay()
}, []) }, [])
const generateQrCode = (path: any) => {
// 生成二维码
QRCode.toDataURL(path).then((url: any) => {
setWechatPayUrl(url)
})
.catch((err: any) => {
console.error(err)
})
}
const pay = () => { const pay = () => {
let param = { let param = {
id: Number(orderId), id: Number(orderId),
...@@ -34,14 +46,20 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => { ...@@ -34,14 +46,20 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
} }
//@ts-ignore //@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => { PublicApi.postOrderPendingOrderPay(param).then(res => {
if(res.code === 1000) {
message.destroy()
generateQrCode(res.data)
}
setPageLoading(false)
// setWechatPayUrl(res.data) // setWechatPayUrl(res.data)
}).catch(() => { }).catch(() => {
onChange(false) onChange(false)
setPageLoading(false)
}) })
} }
return ( return (
<> <Spin spinning={pageLoading}>
<div className={styles.common_title}> <div className={styles.common_title}>
<div className={styles.common_title_icon}><img src={wechatIcon} /></div> <div className={styles.common_title_icon}><img src={wechatIcon} /></div>
<span>微信支付</span> <span>微信支付</span>
...@@ -49,7 +67,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => { ...@@ -49,7 +67,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
<div className={styles.wechat_payway}> <div className={styles.wechat_payway}>
<p className={styles.wechat_payway_title}>使用微信扫一扫下方二维码</p> <p className={styles.wechat_payway_title}>使用微信扫一扫下方二维码</p>
<div className={styles.wechat_payway_imgbox}> <div className={styles.wechat_payway_imgbox}>
<img src={wechatImg} /> {wechatPayUrl && <img src={wechatPayUrl} />}
</div> </div>
<div className={styles.wechat_payway_needpay}> <div className={styles.wechat_payway_needpay}>
<label>当前需支付:</label> <label>当前需支付:</label>
...@@ -57,7 +75,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => { ...@@ -57,7 +75,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
<label>RMB</label> <label>RMB</label>
</div> </div>
</div> </div>
</> </Spin>
) )
} }
......
...@@ -22,7 +22,7 @@ interface PayPagePropsType { ...@@ -22,7 +22,7 @@ interface PayPagePropsType {
} }
enum PayWayType { enum PayWayType {
point = 'point', // 积分支付 point = 0, // 积分支付
balance = 4, // 余额支付 balance = 4, // 余额支付
credit = 6, // 授信额度支付 credit = 6, // 授信额度支付
wechat = 2, // 微信支付 wechat = 2, // 微信支付
...@@ -101,9 +101,9 @@ const PayPage: React.FC<PayPagePropsType> = (props) => { ...@@ -101,9 +101,9 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
switch (payInfo.paymentChannelsId) { switch (payInfo.paymentChannelsId) {
case PayWayType.point: case PayWayType.point:
return <PointPayWay /> return <PointPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.balance: case PayWayType.balance:
return <BablancePayWay /> return <BablancePayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.credit: case PayWayType.credit:
return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} /> return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.wechat: case PayWayType.wechat:
......
...@@ -359,7 +359,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -359,7 +359,7 @@ const Details: React.FC<parmas> = (props) => {
</div > </div >
} }
> >
<Card className={style.item_wrap}> <div className={style.item_wrap}>
{ {
Number(page_type) === 4 ? Number(page_type) === 4 ?
<> <>
...@@ -419,8 +419,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -419,8 +419,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs> </Tabs>
} }
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title} style={view === 2 ? {paddingBottom: '0px'}: {paddingBottom: '24px'}}>询价商品</div> <div className={style.mainCol_title} style={view === 2 ? {paddingBottom: '0px'}: {paddingBottom: '24px'}}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />} {view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 && {view === 2 &&
...@@ -431,12 +431,12 @@ const Details: React.FC<parmas> = (props) => { ...@@ -431,12 +431,12 @@ const Details: React.FC<parmas> = (props) => {
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
/> />
} }
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div> <div className={style.mainCol_title}>{infoTem[type === 'quote' ? 'freight' : 'base'].title}</div>
<div className={style['mainCol-rows']}> <div className={style['mainCol-rows']}>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].leftElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].leftElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -452,7 +452,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -452,7 +452,7 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].centerElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].centerElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -467,7 +467,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -467,7 +467,7 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].rightElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].rightElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -482,8 +482,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -482,8 +482,8 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
</div> </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>附件</div> <div className={style.mainCol_title}>附件</div>
<div className={style.upload_data}> <div className={style.upload_data}>
{ {
...@@ -498,8 +498,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -498,8 +498,8 @@ const Details: React.FC<parmas> = (props) => {
)) ))
} }
</div> </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
{ {
Number(page_type) === 4 ? Number(page_type) === 4 ?
<> <>
...@@ -516,7 +516,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -516,7 +516,7 @@ const Details: React.FC<parmas> = (props) => {
</TabPane> </TabPane>
</Tabs> </Tabs>
} }
</Card> </div>
<AuditModal <AuditModal
id={id} id={id}
type={page_type} type={page_type}
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
margin-bottom: 24px; margin-bottom: 24px;
background-color: #FFF; background-color: #FFF;
border-radius: 8px; border-radius: 8px;
padding: 24px;
&:last-child { &:last-child {
margin-bottom: 0px; margin-bottom: 0px;
......
...@@ -79,6 +79,12 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -79,6 +79,12 @@ const TradingConditions: React.FC<queryProps> = (props) => {
const addressOnChange = (value:any, option:any) => { const addressOnChange = (value:any, option:any) => {
getAddress(option) getAddress(option)
} }
const disabledDate = (current) => {
return current && current < moment().endOf('day');
}
return ( return (
<Form <Form
{...layout} {...layout}
...@@ -88,7 +94,10 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -88,7 +94,10 @@ const TradingConditions: React.FC<queryProps> = (props) => {
<Row gutter={70}> <Row gutter={70}>
<Col span={12}> <Col span={12}>
<Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}> <Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" /> <DatePicker
disabledDate={disabledDate}
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item> </Form.Item>
<Form.Item label='交付地址' name='fullAddressId' rules={[{ required: true, message: '请选择交付地址' }]}> <Form.Item label='交付地址' name='fullAddressId' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select onChange={addressOnChange}> <Select onChange={addressOnChange}>
...@@ -98,7 +107,10 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -98,7 +107,10 @@ const TradingConditions: React.FC<queryProps> = (props) => {
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}> <Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" /> <DatePicker
format="YYYY-MM-DD HH:mm:ss"
disabledDate={disabledDate}
/>
</Form.Item> </Form.Item>
<Form.Item label='报价要求' name='offer'> <Form.Item label='报价要求' name='offer'>
<Input.TextArea placeholder='最长100个字符,50个汉字' /> <Input.TextArea placeholder='最长100个字符,50个汉字' />
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, ReactNode } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Input, Table, Form } from 'antd'; import { Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
...@@ -17,16 +17,24 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -17,16 +17,24 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 会员添加弹窗控制 // 会员添加弹窗控制
const [goodsList, setgoodsList] = useState([]); const [goodsList, setgoodsList] = useState([]);
// 计算金额
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(4);
}
/**输入框输入 */ /**输入框输入 */
const inputOnchange = (id, e) => { const inputOnchange = (id, e) => {
const { value } = e.target const { value } = e.target
goodsList.forEach(v => { goodsList.forEach(v => {
if (v.productId === id) { if (v.productId === id) {
v.money = value v.money = value
v.price = countMoney(v.purchaseCount, value);
} }
}) })
getGoodsList(goodsList) // 返回给父级 getGoodsList([...goodsList]) // 返回给父级
setgoodsList(goodsList) setgoodsList([...goodsList])
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
...@@ -70,8 +78,12 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -70,8 +78,12 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
console.log(123) console.log(123)
PublicApi.getOrderProductInquiryDetails({ id: inquiryNo.orderId }).then(res => { PublicApi.getOrderProductInquiryDetails({ id: inquiryNo.orderId }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
getGoodsList(res.data.inquiryListProductRequests) const data = res.data.inquiryListProductRequests;
setgoodsList(res.data.inquiryListProductRequests) data.forEach((item: any) => {
item.money = item.purchaseCount * item.price
})
getGoodsList(data)
setgoodsList(data)
} }
}) })
} }
......
...@@ -403,7 +403,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -403,7 +403,7 @@ const Details: React.FC<parmas> = (props) => {
</div > </div >
} }
> >
<Card className={style.item_wrap}> <div className={style.item_wrap}>
{ {
Number(page_type) === 4 ? Number(page_type) === 4 ?
<> <>
...@@ -463,8 +463,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -463,8 +463,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs> </Tabs>
} }
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>询价商品</div> <div className={style.mainCol_title}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />} {view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 && {view === 2 &&
...@@ -475,12 +475,12 @@ const Details: React.FC<parmas> = (props) => { ...@@ -475,12 +475,12 @@ const Details: React.FC<parmas> = (props) => {
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
/> />
} }
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div> <div className={style.mainCol_title}>{infoTem[type === 'quote' ? 'freight' : 'base'].title}</div>
<div className={style['mainCol-rows']}> <div className={style['mainCol-rows']}>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].leftElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].leftElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -496,7 +496,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -496,7 +496,7 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].centerElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].centerElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -511,7 +511,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -511,7 +511,7 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].rightElem.map( {infoTem[type === 'quote' ? 'freight' : 'base'].rightElem.map(
(item: any, index: number) => { (item: any, index: number) => {
return ( return (
<div className={style['cols-main']} key={index}> <div className={style['cols-main']} key={index}>
...@@ -526,8 +526,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -526,8 +526,8 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
</div> </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>附件</div> <div className={style.mainCol_title}>附件</div>
<div className={style.upload_data}> <div className={style.upload_data}>
{ {
...@@ -542,8 +542,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -542,8 +542,8 @@ const Details: React.FC<parmas> = (props) => {
)) ))
} }
</div> </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
{ {
Number(page_type) === 4 ? Number(page_type) === 4 ?
<> <>
...@@ -560,7 +560,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -560,7 +560,7 @@ const Details: React.FC<parmas> = (props) => {
</TabPane> </TabPane>
</Tabs> </Tabs>
} }
</Card> </div>
<AuditModal <AuditModal
id={id} id={id}
type={page_type} type={page_type}
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
margin-bottom: 24px; margin-bottom: 24px;
background-color: #FFF; background-color: #FFF;
border-radius: 8px; border-radius: 8px;
padding: 24px;
&:last-child { &:last-child {
margin-bottom: 0px; margin-bottom: 0px;
......
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