-
Notifications
You must be signed in to change notification settings - Fork 0
/
changeBank.js
143 lines (131 loc) · 5.07 KB
/
changeBank.js
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
import React, { Component } from 'react';
import { NavBar } from "antd-mobile";
import GoBack from "../assets/images/goback.png";
import Logo from "../assets/images/logo.png";
import styles from "./styles/common.css";
import inputS from "./styles/inputS.css"
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import {Toast} from "antd-mobile"
@connect(state => ({
user: state.user,
}))
export default class Change extends Component {
constructor() {
super();
this.state = {
visible: true,
selected: '',
bgcol:'#33333',
codeVal:"获取验证码",
disabledattr:false,
};
}
//发送验证码
async onClickYzm() {
this.setState({disabledattr:true})
////console.log()
//var mobile = this.refs.mobbile.value;
// var code = await user.smscode({ mobile: mobile });
//console.log(code)
this.setState({ bgcol: "#c4c4c4" })
const _this = this;
let num = 60;
let Countdown = setInterval(function () {
num = num - 1;
if (num >= 0) {
_this.setState({ codeVal: num });
return;
}
_this.setState({ codeVal: '获取验证码' });
_this.setState({ bgcol: "#33333" })
_this.setState({disabledattr:false})
clearInterval(Countdown);
}, 100)
}
tap(){
var mobbile = this.refs.mobbile.value;
var psw = this.refs.psw.value;
// var two_psw = this.refs.two_psw.value;
//var pay_psw = this.refs.pay_psw.value;
var code = this.refs.code.value;
// var commer = this.refs.commer.value;
if(mobbile === ''){
Toast.offline("手机号不能为空!", 2);
return;
}
if(psw === ''){
Toast.offline("邮箱不能为空!", 2);
return;
}
// if(pay_psw === ''){
// Toast.offline("支付密码不能为空!", 2);
// return;
// }
if(code === ''){
Toast.offline("验证码不能为空!", 2);
return;
}
// if (two_psw !== psw) {
// Toast.offline("密码输入不一致!", 2);
// return;
// }
let data = {
mobbile,
psw:psw,
code,
}
console.log("post",data)
Toast.success("成功", 2);
}
render() {
const { history } = this.props;
//const infoList = this.props.user.gonggao;
//console.log("router", infoList)
const NavbarProps = {
history
}
return (
<div>
<style>
{`
.am-toast-text-info{
font-size:.26rem;
line-height:.52rem;
}
.am-toast-notice-content .am-toast-text.am-toast-text-icon {
border-radius: .15rem;
padding: .25rem .15rem ;
}
`}
</style>
<NavBar
style={{ height: "1.1rem", background: "rgba(0,0,0,1)", borderBottom: "1px solid #C4A060" }}
mode="light"
icon={
<img src={GoBack} style={{ height: ".38rem" }} alt=""></img>
}
onLeftClick={() => history.goBack()}
>
<span style={{ fontSize: "0.4rem", color: "rgba(255,214,137,1)" }}>
修改银行卡
</span>
</NavBar>
<div className={styles.mine}>
<input className={inputS.iptlogin} placeholder="请输入手机号" ref="mobbile"/>
<div className={inputS.getcode}>
<input className={inputS.iptlogin} placeholder="请输入验证码" ref="code"/>
<button styles={{color:this.state.bgcol}} onClick={this.onClickYzm.bind(this)} disabled={this.state.disabledattr}>{this.state.codeVal}</button>
</div>
<input className={inputS.iptlogin} placeholder="设置邮箱" ref="psw"/>
{/* <input className={inputS.iptlogin} placeholder="确认登陆密码" ref="two_psw"/> */}
{/* <input className={inputS.iptlogin} placeholder="确认支付密码" ref="pay_psw"/>
<input className={inputS.iptlogin} placeholder="推荐人账号" ref="commer"/> */}
<div className={inputS.btn}>
<button onClick={this.tap.bind(this)}>注册</button>
</div>
</div>
</div>
)
}
}