Açıklama Yok

WantedPaymentView.tsx 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { Divider, Input, Button } from 'antd';
  4. import wantedCover from '@/assets/payment/cover_wanted@2x.png';
  5. import styles from './WantedPaymentView.less';
  6. interface WantedpaymentViewProps {
  7. type?: 'pop'|'modal';
  8. current_wanted: number|string|null;
  9. InputWantedValueChange: Function;
  10. InputWantedPressEnter: Function;
  11. InputWantedOnBlur: Function;
  12. InputWantedClear: Function;
  13. CloseFunction: Function;
  14. }
  15. interface WantedpaymentViewState {
  16. payment?: number
  17. }
  18. class WantedpaymentView extends React.Component<WantedpaymentViewProps, WantedpaymentViewState> {
  19. constructor(props: WantedpaymentViewProps) {
  20. super(props);
  21. this.state = {};
  22. }
  23. render() {
  24. const { current_wanted } = this.props;
  25. return (
  26. <div className={styles.wrapper}>
  27. <header>设置悬赏金额</header>
  28. <section className={styles.wanted_middle}>
  29. <img className={styles.wanted_cover} src={wantedCover} alt="wanted_image"/>
  30. <div>悬赏提问</div>
  31. </section>
  32. <Divider style={{ minWidth: 'auto', marginLeft: 'auto', marginRight: 'auto', width: '266px'}} />
  33. <section className={styles.wanted_bottom}>
  34. <div className={styles.wanted_bottom_title}>设置悬赏金额范围¥5.00~¥10000</div>
  35. <Input
  36. className={styles.wanted_input_number}
  37. suffix="元"
  38. value={current_wanted || ''}
  39. onChange={v => {
  40. if (!/^[.0-9]*$/g.test(v.target.value)) return;
  41. this.props.InputWantedValueChange(v.target.value);
  42. }}
  43. onPressEnter={() => {
  44. this.props.InputWantedPressEnter(current_wanted);
  45. }}
  46. onBlur={() => {
  47. this.props.InputWantedOnBlur(current_wanted);
  48. }}
  49. autoFocus
  50. />
  51. <div className={styles.wanted_bottom_tips}>
  52. 若5天内没人回答该问题, 所支付的金额将退还至您的钱包
  53. </div>
  54. </section>
  55. <footer>
  56. <Button
  57. className={styles.wanted_confirm_button}
  58. onClick={() => this.props.CloseFunction()}
  59. >
  60. 确定
  61. </Button>
  62. <div
  63. role="button"
  64. tabIndex={-1}
  65. onClick={() => this.props.InputWantedClear()}
  66. className={styles.wanted_cancel_button}
  67. >
  68. 取消悬赏
  69. </div>
  70. </footer>
  71. </div>
  72. )
  73. }
  74. }
  75. export default WantedpaymentView;