Commit 64d8e163 authored by GuanHua's avatar GuanHua

fix: 渠道商城返回商城首页链接问题

parent ee658bec
import React, { useState, useEffect } from 'react'
import { inject } from 'mobx-react'
import CommonHeader from '../components/CommonHeader'
import PointPayWay from './components/point'
import BablancePayWay from './components/balance'
......@@ -17,6 +18,7 @@ interface PayPagePropsType {
shopInfo: any;
mallInfo: any;
layoutType: LAYOUT_TYPE;
SiteStore: any,
}
enum PayWayType {
......@@ -47,7 +49,7 @@ const getPayTypeTitle = (type) => {
}
const PayPage: React.FC<PayPagePropsType> = (props) => {
const { shopInfo, mallInfo, layoutType } = props
const { shopInfo, mallInfo, layoutType, SiteStore: { currentLayoutInfo } } = props
const [payState, setPayState] = useState<boolean>(false)
const { orderId } = props.location.query
const [pageTitle, setPageTitle] = useState<string>()
......@@ -120,7 +122,7 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
}
const backHome = () => {
window.location.href = '/'
window.location.href = currentLayoutInfo.mallLink
}
const renderError = () => {
......@@ -153,4 +155,4 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
) : loading ? null : renderError(): renderError()
}
export default PayPage
export default inject("SiteStore")(PayPage)
/*
* @Author: ghua
* @Date: 2020-11-09 18:18:52
* @LastEditTime: 2021-02-22 14:47:14
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /lingxi-business-paltform/src/pages/lxMall/payResult/index.tsx
*/
import React, { useState, useEffect } from 'react'
import CommonHeader from '../components/CommonHeader'
import { LAYOUT_TYPE } from '@/constants'
import { history } from 'umi'
import { inject } from 'mobx-react'
import { Button, message } from 'antd'
import cx from 'classnames'
import paySuccessIcon from '@/assets/imgs/pay_success.png'
......@@ -12,11 +21,12 @@ interface PayResultPropsType {
shopInfo: any;
mallInfo: any;
layoutType: LAYOUT_TYPE;
SiteStore: any,
}
let timer = null
const PayResult: React.FC<PayResultPropsType> = (props) => {
const { shopInfo, mallInfo, layoutType, } = props
const { shopInfo, mallInfo, layoutType, SiteStore: { currentLayoutInfo }} = props
const { orderId } = props.location.query
const [count ,setCount] = useState<number>(10)
......@@ -36,7 +46,7 @@ const PayResult: React.FC<PayResultPropsType> = (props) => {
}
const backHome = () => {
window.location.href = "/"
window.location.href = currentLayoutInfo.mallLink
}
const goToDetail = () => {
......@@ -58,9 +68,9 @@ const PayResult: React.FC<PayResultPropsType> = (props) => {
<img className={styles.success_icon} src={paySuccessIcon} />
<div className={styles.result_text}>支付成功!</div>
<div className={styles.btn_group}>
<Button
className={cx(styles.btn_item, styles.primary)}
type="primary"
<Button
className={cx(styles.btn_item, styles.primary)}
type="primary"
onClick={() => goToDetail()}
>
去订单查看({count}s)
......@@ -72,4 +82,4 @@ const PayResult: React.FC<PayResultPropsType> = (props) => {
)
}
export default PayResult
export default inject("SiteStore")(PayResult)
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