UNPKG

node-swallowjs

Version:

epp portal

39 lines (38 loc) 1.21 kB
var RenewDomain = React.createClass({ mixins: [FormMixin], getInitialState() { return {name:'', y:'1', value:''} }, handleSubmit(e) { api.renew(TRIM(this.state.name), this.state.y, function(code, data) { switch(code) { case '2501': logout(); break; default: this.setState({value: data}); } }.bind(this)); }, render() { return ( <div> {this.props.children} <div style={{"lineHeight":"36px"}}> <strong>域名续费</strong><span className="help"></span><br/> 域名 <input {...this.linkState({ name: 'name', type: 'text', size: '30', onFocus: this.onSetState({name:'', value:''}) })}/> 续费 <SelectYears {...this.linkState({name: 'y'})}/>年<br/> <input type="button" value="提交" onClick={this.handleSubmit}/> </div> <OpResult content={this.state.value} /> </div> ) } });