...
|
...
|
@@ -8,7 +8,8 @@ import * as globalData from '../../actions/globalData'; |
|
|
import config from '../../config';
|
|
|
import './index.scss';
|
|
|
import event from '../../utils/event.js'
|
|
|
import { getUserInfo, getPhoneNumber, checkUnionIdIsBind } from '../../libs/login/login.js'
|
|
|
import { getUserInfo, getPhoneNumber, checkUnionIdIsBind, getGlobalData } from '../../libs/login/login.js'
|
|
|
import router from '../../router/index.js';
|
|
|
|
|
|
const USER_GET_PHONENUMBER_ERROR = 'user-get-phonenumber-error';
|
|
|
const USER_LOGIN_CALLBACK = 'user-login-callback';
|
...
|
...
|
@@ -60,6 +61,21 @@ export default class Login extends Component { |
|
|
this.eventOnAll();
|
|
|
}
|
|
|
|
|
|
componentDidShow() {
|
|
|
const globalData = getGlobalData();
|
|
|
let country = globalData.country;
|
|
|
if (country) {
|
|
|
this.setState({
|
|
|
countryArea: country.area || '86'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
const globalData = getGlobalData();
|
|
|
globalData.country = null;
|
|
|
}
|
|
|
|
|
|
addPrefix(prefix, eventName) {
|
|
|
return `${prefix}-${eventName}`;
|
|
|
}
|
...
|
...
|
@@ -116,7 +132,7 @@ export default class Login extends Component { |
|
|
}
|
|
|
|
|
|
chooseCountry() {
|
|
|
|
|
|
router.go('selectCountry');
|
|
|
}
|
|
|
|
|
|
phoneInputChanged(e) {
|
...
|
...
|
|