Commit 5f3945aa authored by GuanHua's avatar GuanHua

feat:订单结算页面参数调整

parent fe54f9d5
...@@ -23,6 +23,7 @@ const InformationDetail: React.FC<InformationDetailPropsType> = (props) => { ...@@ -23,6 +23,7 @@ const InformationDetail: React.FC<InformationDetailPropsType> = (props) => {
const { query: { id } } = props.location const { query: { id } } = props.location
const [newsDetail, setNewsDetail] = useState<GetManageContentInformationFindByIdResponse>() const [newsDetail, setNewsDetail] = useState<GetManageContentInformationFindByIdResponse>()
let collectFlg = true let collectFlg = true
useEffect(() => { useEffect(() => {
if (id) { if (id) {
fetchNewsDetail() fetchNewsDetail()
......
...@@ -78,20 +78,21 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -78,20 +78,21 @@ const Order: React.FC<OrderPropsType> = (props) => {
result.push(item) result.push(item)
} }
const productId = sessionOrderInfo?.orderList[0]?.orderList[0].id const productId = sessionOrderInfo?.orderList[0]?.orderList[0].id
if (productId) { // 根据商品ID获取工作流信息,判断是否需要签署合同
try { // if (productId) {
const rulesRes = await PublicApi.getOrderTradingRulesByProductId({ productId }) // try {
const { data } = rulesRes // const rulesRes = await PublicApi.getOrderTradingRulesByProductId({ productId })
if (data) { // const { data } = rulesRes
// 是否选用电子合同 // if (data) {
if (data.isElectronicContract) { // // 是否选用电子合同
setIsElectronicContract(true) // if (data.isElectronicContract) {
} // setIsElectronicContract(true)
} // }
} catch (error) { // }
console.log("获取交易规则失败") // } catch (error) {
} // console.log("获取交易规则失败")
} // }
// }
setOrderList(result) setOrderList(result)
setOrderInfo(sessionOrderInfo) setOrderInfo(sessionOrderInfo)
setSpinningState(false) setSpinningState(false)
...@@ -235,6 +236,7 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -235,6 +236,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
temp.memberDiscount = orderItem.memberDiscount temp.memberDiscount = orderItem.memberDiscount
temp.category = orderItem.category temp.category = orderItem.category
temp.brand = orderItem.brand temp.brand = orderItem.brand
temp.logistics = orderItem.logistics
orderProductRequests.push(temp) orderProductRequests.push(temp)
} }
} }
...@@ -252,10 +254,13 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -252,10 +254,13 @@ const Order: React.FC<OrderPropsType> = (props) => {
setConfirmLoading(true) setConfirmLoading(true)
PublicApi.postOrderProcurementOrderAdd(params).then(res => { PublicApi.postOrderProcurementOrderAdd(params).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
if (res.data.isPay === 0) {
const data = res.data const data = res.data
history.push(`/pay?orderId=${data.orderId}`) history.push(`/pay?orderId=${data.orderId}`)
} else {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/orderDetail?modelType=5&spam_id=${spam_id}`)
}
} }
// history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/orderDetail?modelType=5&spam_id=${spam_id}`)
setConfirmLoading(false) setConfirmLoading(false)
}).catch(() => { }).catch(() => {
setConfirmLoading(false) setConfirmLoading(false)
...@@ -264,6 +269,11 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -264,6 +269,11 @@ const Order: React.FC<OrderPropsType> = (props) => {
const checkOrder = () => { const checkOrder = () => {
message.destroy() message.destroy()
if (!selectAddressInfo) {
message.info('请选择收货地址')
return
}
if (isEmpty(selectPayWay)) { if (isEmpty(selectPayWay)) {
message.info('请选择支付方式') message.info('请选择支付方式')
return return
......
...@@ -8,10 +8,14 @@ import BankPayWay from './components/bank' ...@@ -8,10 +8,14 @@ import BankPayWay from './components/bank'
import TransferPayWay from './components/transfer' import TransferPayWay from './components/transfer'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi' import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { LAYOUT_TYPE } from '@/constants'
import styles from './index.less' import styles from './index.less'
interface PayPagePropsType { interface PayPagePropsType {
location: any location: any;
shopInfo: any;
mallInfo: any;
layoutType: LAYOUT_TYPE;
} }
enum PayWayType { enum PayWayType {
...@@ -42,6 +46,7 @@ const getPayTypeTitle = (type) => { ...@@ -42,6 +46,7 @@ const getPayTypeTitle = (type) => {
} }
const PayPage: React.FC<PayPagePropsType> = (props) => { const PayPage: React.FC<PayPagePropsType> = (props) => {
const { shopInfo, mallInfo, layoutType, } = props
const { orderId } = props.location.query const { orderId } = props.location.query
const [pageTitle, setPageTitle] = useState<string>() const [pageTitle, setPageTitle] = useState<string>()
const [payType] = useState<string | number>(PayWayType.bank) const [payType] = useState<string | number>(PayWayType.bank)
...@@ -87,7 +92,10 @@ const PayPage: React.FC<PayPagePropsType> = (props) => { ...@@ -87,7 +92,10 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
return payInfo ? ( return payInfo ? (
<div className={styles.pay}> <div className={styles.pay}>
<CommonHeader title={pageTitle} /> <CommonHeader
logoUrl={(layoutType === LAYOUT_TYPE.channel || layoutType === LAYOUT_TYPE.ichannel) ? shopInfo?.logo : mallInfo.logoUrl}
title={pageTitle}
/>
<div className={styles.pay_container}> <div className={styles.pay_container}>
{ {
payInfo && renderPayWay() payInfo && renderPayWay()
......
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