|
@@ -16,53 +16,54 @@ export default class Login extends BasePage {
|
|
|
verification_text: '获取验证码',
|
|
|
verification_code: '',
|
|
|
http_verification_code: '',
|
|
|
- deviceCode: '',
|
|
|
- sss: ''
|
|
|
+ deviceCode: ''
|
|
|
};
|
|
|
render() {
|
|
|
return (
|
|
|
<View style={styles.wrapper}>
|
|
|
- <StatusBar backgroundColor={'white'} translucent={true} barStyle={'dark-content'} />
|
|
|
- <View style={styles.jump}>
|
|
|
- <TouchableOpacity style={styles.jumpBtn} onPress={this.jumpBtn.bind(this)}>
|
|
|
- <Text style={styles.jumpText}>跳过</Text>
|
|
|
- <Image source={require('./images/common/arrowRight.png')} />
|
|
|
- </TouchableOpacity>
|
|
|
- </View>
|
|
|
- <View style={styles.phoneNumberBox}>
|
|
|
- <Text style={styles.phoneNumber}>手机号</Text>
|
|
|
- <TextInput
|
|
|
- style={styles.phoneText}
|
|
|
- onChangeText={(text) => this.setState({ phone_num: text })}
|
|
|
- value={this.state.phone_num}
|
|
|
- placeholder={'请输入手机号'}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View style={styles.signNumberBox}>
|
|
|
- <Text style={styles.phoneNumber}>验证码</Text>
|
|
|
- <View style={styles.signNumberLine2}>
|
|
|
+ <View style={{ height: this.getWindowHeight() }}>
|
|
|
+ <StatusBar backgroundColor={'white'} translucent={true} barStyle={'dark-content'} />
|
|
|
+ <View style={styles.jump}>
|
|
|
+ <TouchableOpacity style={styles.jumpBtn} onPress={this.jumpBtn.bind(this)}>
|
|
|
+ <Text style={styles.jumpText}>跳过</Text>
|
|
|
+ <Image source={require('./images/common/arrowRight.png')} />
|
|
|
+ </TouchableOpacity>
|
|
|
+ </View>
|
|
|
+ <View style={styles.phoneNumberBox}>
|
|
|
+ <Text style={styles.phoneNumber}>手机号</Text>
|
|
|
<TextInput
|
|
|
- style={styles.signText}
|
|
|
- onChangeText={(text) => this.setState({ verification_code: text })}
|
|
|
- value={this.state.verification_code}
|
|
|
- placeholder={'请输入验证码'}
|
|
|
+ style={styles.phoneText}
|
|
|
+ onChangeText={(text) => this.setState({ phone_num: text })}
|
|
|
+ value={this.state.phone_num}
|
|
|
+ placeholder={'请输入手机号'}
|
|
|
/>
|
|
|
- <TouchableOpacity onPress={this.getVerification.bind(this)}>
|
|
|
- <Text style={styles.getSign}> {this.state.verification_text}</Text>
|
|
|
- </TouchableOpacity>
|
|
|
</View>
|
|
|
- </View>
|
|
|
- <View style={styles.loginIn}>
|
|
|
- <Text style={styles.loginText} onPress={this.clickOK.bind(this)}>
|
|
|
- 登录
|
|
|
- </Text>
|
|
|
- </View>
|
|
|
- <View style={styles.wechatLogin}>
|
|
|
- <Image source={require('./images/common/wechat.png')} />
|
|
|
- <Text style={styles.wechatLoginText} onPress={this.wechatLogin.bind(this)}>
|
|
|
- 微信登录
|
|
|
- </Text>
|
|
|
- <Image source={require('./images/common/arrowRight.png')} />
|
|
|
+ <View style={styles.signNumberBox}>
|
|
|
+ <Text style={styles.phoneNumber}>验证码</Text>
|
|
|
+ <View style={styles.signNumberLine2}>
|
|
|
+ <TextInput
|
|
|
+ style={styles.signText}
|
|
|
+ onChangeText={(text) => this.setState({ verification_code: text })}
|
|
|
+ value={this.state.verification_code}
|
|
|
+ placeholder={'请输入验证码'}
|
|
|
+ />
|
|
|
+ <TouchableOpacity onPress={this.getVerification.bind(this)}>
|
|
|
+ <Text style={styles.getSign}> {this.state.verification_text}</Text>
|
|
|
+ </TouchableOpacity>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View style={styles.loginIn}>
|
|
|
+ <Text style={styles.loginText} onPress={this.clickOK.bind(this)}>
|
|
|
+ 登录
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.wechatLogin}>
|
|
|
+ <Image source={require('./images/common/wechat.png')} />
|
|
|
+ <Text style={styles.wechatLoginText} onPress={this.wechatLogin.bind(this)}>
|
|
|
+ 微信登录
|
|
|
+ </Text>
|
|
|
+ <Image source={require('./images/common/arrowRight.png')} />
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
);
|
|
@@ -133,7 +134,7 @@ export default class Login extends BasePage {
|
|
|
body: {
|
|
|
mobile: this.state.phone_num,
|
|
|
sign: this.state.verification_code,
|
|
|
- channel: '006',
|
|
|
+ channel: commonutil.getAppCode(),
|
|
|
deviceCode: this.state.deviceCode
|
|
|
}
|
|
|
};
|
|
@@ -175,19 +176,7 @@ export default class Login extends BasePage {
|
|
|
}
|
|
|
|
|
|
jumpBtn() {
|
|
|
- let option = {
|
|
|
- method: 'POST',
|
|
|
- body: {
|
|
|
- channel: '006',
|
|
|
- deviceCode: this.state.deviceCode,
|
|
|
- openId: '',
|
|
|
- unionId: '',
|
|
|
- avatar: '',
|
|
|
- sex: '',
|
|
|
- nickName: ''
|
|
|
- }
|
|
|
- };
|
|
|
- http_user.jumpLogin(option).then((result) => {
|
|
|
+ http_user.jumpLogin(this.state.deviceCode, commonutil.getAppCode()).then((result) => {
|
|
|
if (result.code == 200) {
|
|
|
//登陆成功了,可以存储用户数据到本地
|
|
|
console.log('====================================');
|
|
@@ -225,7 +214,7 @@ export default class Login extends BasePage {
|
|
|
let option = {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
- channel: '006',
|
|
|
+ channel: commonutil.getAppCode(),
|
|
|
deviceCode: this.state.deviceCode,
|
|
|
openId: user['openid'],
|
|
|
unionId: user['unionid'],
|