-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardAuth.tsx
148 lines (133 loc) · 2.94 KB
/
cardAuth.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import * as React from 'react'
// import { Link } from 'react-router-dom'
import { mClient } from 'frame/net/clientFactory'
import { connect } from 'react-redux'
import { setVars } from '../../../redux/action'
import requireVisitor from 'frame/hoc/requireVisitor'
import style from './cardAuth.scss'
import { Header } from 'frame/components'
import { DialogSms, DialogPwd } from '../components/index'
import { RouteComponentProps } from 'react-router'
import { toast } from 'frame/components/popup'
interface MatchParams {
id: string
}
interface Props extends RouteComponentProps<MatchParams> {
init: () => void
history: any
visitor: any
cartAuthData: any
}
interface State {
inputVal: string
isShowSms: boolean
isShowPwd: boolean
wayVal: number
accoreqserial: string
otherserial: string
xjbAccountStatus: string
yinliancdcard: string
}
@requireVisitor
export class CardAuth extends React.Component<Props, State> {
constructor(props: Props) {
super(props)
this.state = {
inputVal: '',
isShowSms: false,
isShowPwd: false,
wayVal: 1,
accoreqserial: '',
otherserial: '',
xjbAccountStatus: '',
yinliancdcard: ''
}
}
componentDidMount() {
this.props.init()
}
confirmSubmit(value?: string) {
//do
}
submitForm() {
//do
}
sentSmsApi() {
//do
}
smsSubmit(code: any) {
//do
}
tabWay(val: number) {
this.setState({
wayVal: val
})
}
smsResetSend() {
this.sentSmsApi()
}
smsClose() {
this.setState({
isShowSms: false
})
}
pwdClose() {
this.setState({
isShowPwd: false
})
}
pwdSubmit(values: string) {
this.setState({
isShowPwd: false
})
this.confirmSubmit(values)
}
public render() {
let { visitor, cartAuthData } = this.props
let { fortuneAccount = [] } = cartAuthData
let { mobile } = visitor || ''
let { isShowSms, isShowPwd, wayVal } = this.state
return (
<div>
<div className={style.botBtn}>
text ...
</div>
{isShowSms && (
<DialogSms
phone={mobile}
title="身份确认"
confirmClick={code => this.smsSubmit(code)}
layerClick={() => this.smsClose()}
resetSentClick={() => this.smsResetSend()}
/>
)}
{isShowPwd && (
<DialogPwd
title="设置基金交易密码"
againTitle="请您再次输入"
type="set"
confirmClick={values => this.pwdSubmit(values)}
layerClick={() => this.pwdClose()}
/>
)}
</div>
)
}
}
const mapStateToProps = (state: any) => {
return {
cartAuthData: state.vars.cartAuthData || {},
visitor: state.vars.visitor
}
}
const mapDispatchToProps = (dispath: any, props: any) => {
return {
init: () => {
//do
}
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(CardAuth)