fix: register flow

This commit is contained in:
Hasta Ragil Saputra 2019-01-31 21:33:09 +07:00
parent 8935bca9b0
commit e178fe8410

View File

@ -130,13 +130,13 @@ class RegisterPage extends React.Component {
register = () => {
if (this.state.upload_photo === '') {
return message.warning("please upload photo");
}
if (this.state.upload_ktp === '') {
return message.warning("please upload ktp");
}
// if (this.state.upload_photo === '') {
// return message.warning("please upload photo");
// }
//
// if (this.state.upload_ktp === '') {
// return message.warning("please upload ktp");
// }
this.setState({ isLoading: true });
@ -146,14 +146,14 @@ class RegisterPage extends React.Component {
phone_number: this.state.phone_number,
password: this.state.password,
nric_number: this.state.no_ktp,
nric_photo_path: this.state.upload_ktp,
photo: this.state.upload_photo,
address: this.state.address,
province_id: this.state.province,
city_id: this.state.city,
district_id: this.state.district,
subdistrict_id: this.state.subdistrict,
zip_code: this.state.zip_code,
// nric_photo_path: this.state.upload_ktp,
// photo: this.state.upload_photo,
// address: this.state.address,
// province_id: this.state.province,
// city_id: this.state.city,
// district_id: this.state.district,
// subdistrict_id: this.state.subdistrict,
// zip_code: this.state.zip_code,
referal: this.state.query.referal,
additional_data: {}
};
@ -366,108 +366,108 @@ class RegisterPage extends React.Component {
/>
</Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5,paddingTop:16 }}>
<Upload
name="avatar"
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
{...this.createUploadProps("ktp")}
>
{upload_ktp ? <img src={upload_ktp} alt="avatar" style={{
width: 104,
height: 104
}}/> : uploadButtonKtp}
</Upload>
</Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5, paddingTop:16 }}>
<Upload
style={{ marginTop: 16, marginBottom: 8 }}
name="avatar"
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
{...this.createUploadProps("photo")}
>
{upload_photo ? <img src={upload_photo} alt="avatar" style={{
width: 104,
height: 104
}}/> : uploadButtonPhoto}
</Upload>
</Grid>
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5,paddingTop:16 }}>*/}
{/*<Upload*/}
{/*name="avatar"*/}
{/*listType="picture-card"*/}
{/*className="avatar-uploader"*/}
{/*showUploadList={false}*/}
{/*{...this.createUploadProps("ktp")}*/}
{/*>*/}
{/*{upload_ktp ? <img src={upload_ktp} alt="avatar" style={{*/}
{/*width: 104,*/}
{/*height: 104*/}
{/*}}/> : uploadButtonKtp}*/}
{/*</Upload>*/}
{/*</Grid>*/}
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5, paddingTop:16 }}>*/}
{/*<Upload*/}
{/*style={{ marginTop: 16, marginBottom: 8 }}*/}
{/*name="avatar"*/}
{/*listType="picture-card"*/}
{/*className="avatar-uploader"*/}
{/*showUploadList={false}*/}
{/*{...this.createUploadProps("photo")}*/}
{/*>*/}
{/*{upload_photo ? <img src={upload_photo} alt="avatar" style={{*/}
{/*width: 104,*/}
{/*height: 104*/}
{/*}}/> : uploadButtonPhoto}*/}
{/*</Upload>*/}
{/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<TextField
id="address"
label="Address"
value={this.state.address}
onChange={this.handleChange('address')}
margin="normal"
variant="outlined"
fullWidth
/>
</Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<AutoComplete
placeholder={"Province"}
onChange={({value}) => this.onChangeProvince(value)}
suggestions={this.place.provinces.map(p => {
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<TextField*/}
{/*id="address"*/}
{/*label="Address"*/}
{/*value={this.state.address}*/}
{/*onChange={this.handleChange('address')}*/}
{/*margin="normal"*/}
{/*variant="outlined"*/}
{/*fullWidth*/}
{/*/>*/}
{/*</Grid>*/}
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<AutoComplete*/}
{/*placeholder={"Province"}*/}
{/*onChange={({value}) => this.onChangeProvince(value)}*/}
{/*suggestions={this.place.provinces.map(p => {*/}
return {
label: p.name,
value: p.id
}
})}/>
</Grid>
{/*return {*/}
{/*label: p.name,*/}
{/*value: p.id*/}
{/*}*/}
{/*})}/>*/}
{/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<AutoComplete
placeholder={"City"}
onChange={({value}) => this.onChangeCity(value)}
suggestions={this.place.cities.map(p => {
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<AutoComplete*/}
{/*placeholder={"City"}*/}
{/*onChange={({value}) => this.onChangeCity(value)}*/}
{/*suggestions={this.place.cities.map(p => {*/}
return {
label: p.name,
value: p.id
}
})}/>
</Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<AutoComplete
placeholder={"District"}
onChange={({value}) => this.onChangeDistrict(value)}
suggestions={this.place.districts.map(p => {
{/*return {*/}
{/*label: p.name,*/}
{/*value: p.id*/}
{/*}*/}
{/*})}/>*/}
{/*</Grid>*/}
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<AutoComplete*/}
{/*placeholder={"District"}*/}
{/*onChange={({value}) => this.onChangeDistrict(value)}*/}
{/*suggestions={this.place.districts.map(p => {*/}
return {
label: p.name,
value: p.id
}
})}/>
</Grid>
{/*return {*/}
{/*label: p.name,*/}
{/*value: p.id*/}
{/*}*/}
{/*})}/>*/}
{/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<AutoComplete
placeholder={"Subdistrict"}
onChange={({value}) => this.onChangeSubdistrict(value)}
suggestions={this.place.subdistricts.map(p => {
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<AutoComplete*/}
{/*placeholder={"Subdistrict"}*/}
{/*onChange={({value}) => this.onChangeSubdistrict(value)}*/}
{/*suggestions={this.place.subdistricts.map(p => {*/}
return {
label: p.name,
value: p.id
}
})}/>
</Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<TextField
id="zip_code"
label="Zip Code"
value={this.state.zip_code}
onChange={this.handleChange('zip_code')}
margin="normal"
variant="outlined"
fullWidth
/>
</Grid>
{/*return {*/}
{/*label: p.name,*/}
{/*value: p.id*/}
{/*}*/}
{/*})}/>*/}
{/*</Grid>*/}
{/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
{/*<TextField*/}
{/*id="zip_code"*/}
{/*label="Zip Code"*/}
{/*value={this.state.zip_code}*/}
{/*onChange={this.handleChange('zip_code')}*/}
{/*margin="normal"*/}
{/*variant="outlined"*/}
{/*fullWidth*/}
{/*/>*/}
{/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<TextField