ApplyResult.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import React from 'react'
  2. import { Form, Modal } from 'antd'
  3. import SuccessSvg from 'assets/success.svg'
  4. import FailSvg from 'assets/fail.svg'
  5. import NButton from 'components/NButton/NButton'
  6. import { EOrderStatus, IOrderPayStatusRes } from '../Material.service'
  7. import styles from '../css/NoPermission.module.scss'
  8. const { Item } = Form
  9. interface IApplyPermissionProps {
  10. visible: boolean
  11. info: IOrderPayStatusRes | null
  12. onCloseModel: () => void
  13. }
  14. /**
  15. * 支付结果
  16. */
  17. const ApplyResult: React.FC<IApplyPermissionProps> = props => {
  18. const { visible, info, onCloseModel } = props
  19. const handleToClose = () => {
  20. onCloseModel()
  21. }
  22. if (!info) return null
  23. return (
  24. <Modal
  25. open={visible}
  26. centered={true}
  27. onCancel={handleToClose}
  28. destroyOnClose={true}
  29. maskClosable={false}
  30. title="支付结果"
  31. footer={null}
  32. >
  33. <div className={styles['paymodel-content-wrapper']}>
  34. {info.Source === 'article' && (
  35. <>
  36. <div className="paymodel-title">
  37. {info.OrderStatus === EOrderStatus.Payed ? (
  38. <>
  39. <img src={SuccessSvg} alt="图标" className="paymodel-success-icon" />
  40. <span>畅读卡购买成功</span>
  41. </>
  42. ) : (
  43. <>
  44. <img src={FailSvg} alt="图标" className="paymodel-success-icon" />
  45. <span>畅读卡购买失败</span>
  46. </>
  47. )}
  48. </div>
  49. <div className="paymodel-text">有效期至:{info.EndDate}</div>
  50. </>
  51. )}
  52. {info.Source === 'activity' && (
  53. <>
  54. <div className="paymodel-title">
  55. {info.OrderStatus === EOrderStatus.Payed ? (
  56. <>
  57. <img src={SuccessSvg} alt="图标" className="paymodel-success-icon" />
  58. <span>支付成功</span>
  59. </>
  60. ) : (
  61. <>
  62. <img src={FailSvg} alt="图标" className="paymodel-success-icon" />
  63. <span>支付失败</span>
  64. </>
  65. )}
  66. </div>
  67. <div className="paymodel-text">请到活动页面选择参会方式</div>
  68. </>
  69. )}
  70. </div>
  71. <div className={styles['paymodel-footer-wrapper']}>
  72. {}
  73. <NButton type="primary" onClick={handleToClose} size="large" className="pay-btn">
  74. {info.Source === 'article' ? '关闭' : '返回活动页'}
  75. </NButton>
  76. </div>
  77. </Modal>
  78. )
  79. }
  80. export default ApplyResult