Merge branch 'master' of https://git.loafle.net/overflow/Test_Web
This commit is contained in:
parent
436fd597b2
commit
bac329e31e
|
@ -56,6 +56,8 @@ const muiTheme = getMuiTheme({
|
|||
},
|
||||
});
|
||||
|
||||
var EMailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
|
||||
export class MemberRegist extends React.Component<any, any> {
|
||||
constructor(props: any, context: any) {
|
||||
super(props, context);
|
||||
|
@ -68,12 +70,14 @@ export class MemberRegist extends React.Component<any, any> {
|
|||
open: false,
|
||||
value: 1,
|
||||
|
||||
id:0,
|
||||
id: 0,
|
||||
email: "",
|
||||
name: "",
|
||||
company: "",
|
||||
phone: "",
|
||||
pw: "",
|
||||
|
||||
isEmail: true
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -95,6 +99,8 @@ export class MemberRegist extends React.Component<any, any> {
|
|||
"phone": this.state.phone
|
||||
};
|
||||
|
||||
|
||||
|
||||
let os: OFRest = new OFRest("Member", "Regist", obj);
|
||||
|
||||
os.Call().then(function (res) {
|
||||
|
@ -103,49 +109,20 @@ export class MemberRegist extends React.Component<any, any> {
|
|||
console.log(json);
|
||||
ReactDOM.render(<MemberRegistResult />, document.getElementById('example'));
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
// let exeObj: any;
|
||||
// exeObj = {
|
||||
// "serviceName": "Member",
|
||||
// "methodName": "Regist",
|
||||
// "param": obj
|
||||
// }
|
||||
|
||||
|
||||
// output = JSON.stringify(exeObj);
|
||||
|
||||
// // obj = { "value": output };
|
||||
|
||||
// fetch('http://192.168.1.203:8080/v1/overflow/services', {
|
||||
// method: 'POST',
|
||||
// headers: {
|
||||
// 'Accept': 'application/json',
|
||||
// // mode: 'no-cors'
|
||||
// },
|
||||
// body: output
|
||||
// }).then(function (response) {
|
||||
// return response.json();
|
||||
// }).then(function (json) {
|
||||
// console.log(json);
|
||||
// ReactDOM.render(<MemberRegistResult />, document.getElementById('example')
|
||||
// );
|
||||
// }).catch((err) => {
|
||||
// console.log(err);
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public validateEmail(email: any) {
|
||||
return EMailRegex.test(email);
|
||||
}
|
||||
|
||||
handleTestRead = () => {
|
||||
let output: string;
|
||||
let obj: any; //new object declaration
|
||||
obj = {
|
||||
"id":this.state.id,
|
||||
"id": this.state.id,
|
||||
"email": this.state.email,
|
||||
"pwSalt": this.state.pw,
|
||||
"name": this.state.name,
|
||||
|
@ -178,13 +155,13 @@ console.log(err);
|
|||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleTestUpdate = () => {
|
||||
handleTestUpdate = () => {
|
||||
let output: string;
|
||||
let obj: any; //new object declaration
|
||||
obj = {
|
||||
"id":this.state.id,
|
||||
"id": this.state.id,
|
||||
"email": this.state.email,
|
||||
"pwSalt": this.state.pw,
|
||||
"name": this.state.name,
|
||||
|
@ -217,13 +194,13 @@ handleTestUpdate = () => {
|
|||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleTestDelete = () => {
|
||||
handleTestDelete = () => {
|
||||
let output: string;
|
||||
let obj: any; //new object declaration
|
||||
obj = {
|
||||
"id":this.state.id,
|
||||
"id": this.state.id,
|
||||
"email": this.state.email,
|
||||
"pwSalt": this.state.pw,
|
||||
"name": this.state.name,
|
||||
|
@ -259,19 +236,19 @@ handleTestDelete = () => {
|
|||
}
|
||||
|
||||
|
||||
handleResultContainer = () => {
|
||||
handleResultContainer = () => {
|
||||
ReactDOM.render(
|
||||
<MemberRegistResult />,
|
||||
document.getElementById('example')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
btnTouchTap = () => {
|
||||
btnTouchTap = () => {
|
||||
alert(event)
|
||||
};
|
||||
};
|
||||
|
||||
render() {
|
||||
render() {
|
||||
|
||||
return (
|
||||
<MuiThemeProvider muiTheme={muiTheme}>
|
||||
|
@ -283,11 +260,16 @@ render() {
|
|||
ref="email"
|
||||
hintText="smith@gmail.com"
|
||||
floatingLabelText="Email address*"
|
||||
errorText=""
|
||||
errorText={this.state.isEmail ? "":"Please Email Format"}
|
||||
style={styles.textfield}
|
||||
underlineShow={true}
|
||||
value={this.state.email}
|
||||
onChange={(e, newValue) => this.setState({ email: newValue })}
|
||||
onChange={(e, newValue) => {
|
||||
this.setState({ email: newValue });
|
||||
|
||||
this.state.isEmail = this.validateEmail(this.state.email);
|
||||
}
|
||||
}
|
||||
/>
|
||||
<br />
|
||||
<TextField
|
||||
|
@ -339,7 +321,7 @@ render() {
|
|||
<RaisedButton label="Read" primary={true} style={styles.button} onClick={this.handleTestRead.bind(this)} />
|
||||
<RaisedButton label="Update" primary={true} style={styles.button} onClick={this.handleTestUpdate.bind(this)} />
|
||||
<RaisedButton label="Delete" primary={true} style={styles.button} onClick={this.handleTestDelete.bind(this)} />
|
||||
<br/>
|
||||
<br />
|
||||
<TextField
|
||||
hintText="id"
|
||||
floatingLabelText="id"
|
||||
|
@ -352,6 +334,6 @@ render() {
|
|||
|
||||
</MuiThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user