|
@@ -21,10 +21,11 @@ interface IPayProcessModelProps {
|
|
|
continuePayFlag?: boolean // 继续支付
|
|
|
countDownRender?: React.ReactNode
|
|
|
onRefresh?: () => void // 刷新页面
|
|
|
+ parentMethod?: () => void
|
|
|
}
|
|
|
/**支付流程汇总弹框 */
|
|
|
const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
- const { dataInfo, tryType, open, applyTrial, continuePayFlag, countDownRender, onRefresh } = props
|
|
|
+ const { dataInfo, tryType, open, applyTrial, continuePayFlag, countDownRender, parentMethod, onRefresh } = props
|
|
|
const [visibleApply, setVisibleApply] = useState(false) // 普通申请权限弹框
|
|
|
const [visibleUpload, setVisibleUpload] = useState(false) // 机构申请试用弹框
|
|
|
const [visibleBuyCard, setVisibleBuyCard] = useState(false) // 购买畅读卡弹框
|
|
@@ -77,7 +78,11 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
if (tryType === ITryType.Activity && payType === PayType.Single && continuePayFlag) {
|
|
|
// 继续支付(现在只有活动有继续支付的需求)
|
|
|
// todo 二维码的倒计时,需要后端返回订单剩余支付时间
|
|
|
- postCreateOrderByActivity(dataInfo.GoodsList[0]?.GoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
|
|
|
+ postCreateOrderByActivity(
|
|
|
+ dataInfo.GoodsList[0]?.GoodsId,
|
|
|
+ (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
|
|
|
+ sessionStorage.getItem('invite_code')
|
|
|
+ )
|
|
|
}
|
|
|
}, [open, applyTrial, continuePayFlag])
|
|
|
// 关闭支付结果弹框
|
|
@@ -96,6 +101,7 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
}
|
|
|
// 关闭购买畅读卡弹框
|
|
|
const handleCloseBuy = () => {
|
|
|
+ parentMethod && parentMethod()
|
|
|
setVisibleBuyCard(false)
|
|
|
}
|
|
|
// 上传名片成功后,关闭上传名片弹框,并请求创建订单接口
|
|
@@ -103,10 +109,18 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
handleCloseUpload()
|
|
|
// 调接口获取支付二维码
|
|
|
if (tryType === ITryType.Article) {
|
|
|
- postCreateOrderByArticle(wantBuyGoodsId, (dataInfo as IArcticleInfo).Detail.ArticleId)
|
|
|
+ postCreateOrderByArticle(
|
|
|
+ wantBuyGoodsId,
|
|
|
+ (dataInfo as IArcticleInfo).Detail.ArticleId,
|
|
|
+ sessionStorage.getItem('invite_code')
|
|
|
+ )
|
|
|
}
|
|
|
if (tryType === ITryType.Activity) {
|
|
|
- postCreateOrderByActivity(wantBuyGoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
|
|
|
+ postCreateOrderByActivity(
|
|
|
+ wantBuyGoodsId,
|
|
|
+ (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
|
|
|
+ sessionStorage.getItem('invite_code')
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
// 关闭上传名片弹框
|
|
@@ -133,10 +147,18 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
}
|
|
|
// 调接口获取支付二维码
|
|
|
if (tryType === ITryType.Article) {
|
|
|
- postCreateOrderByArticle(GoodsId, (dataInfo as IArcticleInfo).Detail.ArticleId)
|
|
|
+ postCreateOrderByArticle(
|
|
|
+ GoodsId,
|
|
|
+ (dataInfo as IArcticleInfo).Detail.ArticleId,
|
|
|
+ sessionStorage.getItem('invite_code')
|
|
|
+ )
|
|
|
}
|
|
|
if (tryType === ITryType.Activity) {
|
|
|
- postCreateOrderByActivity(GoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
|
|
|
+ postCreateOrderByActivity(
|
|
|
+ GoodsId,
|
|
|
+ (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
|
|
|
+ sessionStorage.getItem('invite_code')
|
|
|
+ )
|
|
|
}
|
|
|
setVisibleBuyCard(false)
|
|
|
}
|
|
@@ -197,7 +219,7 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
|
|
|
visible={visibleOrderCode}
|
|
|
codeUrl={articleOrderInfo?.Data.CodeUrl || activityOrderInfo?.Data.CodeUrl || ''}
|
|
|
orderCode={articleOrderInfo?.Data.OrderCode || activityOrderInfo?.Data.OrderCode || ''}
|
|
|
- // countDown={todo} 需要后端返回订单剩余支付时间
|
|
|
+ countDown={articleOrderInfo?.Data.PayTimeCountdown || activityOrderInfo?.Data.PayTimeCountdown}
|
|
|
onCloseModel={handleCloseCode}
|
|
|
onSendPayResult={handleDoPayResult}
|
|
|
/>
|