Showing
3 changed files
with
12 additions
and
9 deletions
| @@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
| 80 | </AdditionalOptions> | 80 | </AdditionalOptions> |
| 81 | </TestAction> | 81 | </TestAction> |
| 82 | <LaunchAction | 82 | <LaunchAction |
| 83 | - buildConfiguration = "Debug" | 83 | + buildConfiguration = "Release" |
| 84 | selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | 84 | selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
| 85 | selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | 85 | selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
| 86 | launchStyle = "0" | 86 | launchStyle = "0" |
| @@ -10,7 +10,9 @@ import { | @@ -10,7 +10,9 @@ import { | ||
| 10 | TextInput, | 10 | TextInput, |
| 11 | KeyboardAvoidingView, | 11 | KeyboardAvoidingView, |
| 12 | AsyncStorage, | 12 | AsyncStorage, |
| 13 | - Dimensions | 13 | + Dimensions, |
| 14 | + Alert, | ||
| 15 | + AlertIOS, | ||
| 14 | } from "react-native"; | 16 | } from "react-native"; |
| 15 | 17 | ||
| 16 | export default class Login extends Component { | 18 | export default class Login extends Component { |
| @@ -195,11 +197,11 @@ export default class Login extends Component { | @@ -195,11 +197,11 @@ export default class Login extends Component { | ||
| 195 | phone = this.state.phone, | 197 | phone = this.state.phone, |
| 196 | password = this.state.password; | 198 | password = this.state.password; |
| 197 | if (!/^1(3|4|5|7|8)\d{9}$/.test(phone)) { | 199 | if (!/^1(3|4|5|7|8)\d{9}$/.test(phone)) { |
| 198 | - alert("请正确输入手机号码"); | 200 | + Alert.alert("请正确输入手机号码"); |
| 199 | return; | 201 | return; |
| 200 | } | 202 | } |
| 201 | if (password === "") { | 203 | if (password === "") { |
| 202 | - alert("请输入密码"); | 204 | + Alert.alert("请输入密码"); |
| 203 | return; | 205 | return; |
| 204 | } | 206 | } |
| 205 | let formData = new FormData(); | 207 | let formData = new FormData(); |
| @@ -272,7 +274,7 @@ export default class Login extends Component { | @@ -272,7 +274,7 @@ export default class Login extends Component { | ||
| 272 | profession = this.state.profession, | 274 | profession = this.state.profession, |
| 273 | formData = new FormData(); | 275 | formData = new FormData(); |
| 274 | if (!phone || !password || !nickname || !profession) { | 276 | if (!phone || !password || !nickname || !profession) { |
| 275 | - alert("请完整填写信息"); | 277 | + Alert.alert("请完整填写信息"); |
| 276 | return false; | 278 | return false; |
| 277 | } | 279 | } |
| 278 | formData.append("phone", phone); | 280 | formData.append("phone", phone); |
| @@ -304,7 +306,8 @@ export default class Login extends Component { | @@ -304,7 +306,8 @@ export default class Login extends Component { | ||
| 304 | isRegister: !that.state.isRegister, | 306 | isRegister: !that.state.isRegister, |
| 305 | id: respJson.data.id | 307 | id: respJson.data.id |
| 306 | }); | 308 | }); |
| 307 | - alert("注册成功!"); | 309 | + // alert("注册成功!"); |
| 310 | + Alert.alert("注册成功!") | ||
| 308 | } | 311 | } |
| 309 | }) | 312 | }) |
| 310 | .catch(err => console.error(err)); | 313 | .catch(err => console.error(err)); |
| @@ -74,7 +74,7 @@ export default class Mine extends Component { | @@ -74,7 +74,7 @@ export default class Mine extends Component { | ||
| 74 | let that = this, | 74 | let that = this, |
| 75 | formData = new FormData(); | 75 | formData = new FormData(); |
| 76 | if (that.state.IS_LOGIN != "yes") { | 76 | if (that.state.IS_LOGIN != "yes") { |
| 77 | - alert("请先登录账号"); | 77 | + Alert.alert("请先登录账号"); |
| 78 | return false; | 78 | return false; |
| 79 | } | 79 | } |
| 80 | formData.append("user", this.state.USER_ID); | 80 | formData.append("user", this.state.USER_ID); |
| @@ -111,7 +111,7 @@ export default class Mine extends Component { | @@ -111,7 +111,7 @@ export default class Mine extends Component { | ||
| 111 | let that = this, | 111 | let that = this, |
| 112 | formData = new FormData(); | 112 | formData = new FormData(); |
| 113 | if (that.state.IS_LOGIN != "yes") { | 113 | if (that.state.IS_LOGIN != "yes") { |
| 114 | - alert("请先登录账号"); | 114 | + Alert.alert("请先登录账号"); |
| 115 | return false; | 115 | return false; |
| 116 | } | 116 | } |
| 117 | formData.append("user", this.state.USER_ID); | 117 | formData.append("user", this.state.USER_ID); |
| @@ -134,7 +134,7 @@ export default class Mine extends Component { | @@ -134,7 +134,7 @@ export default class Mine extends Component { | ||
| 134 | }) | 134 | }) |
| 135 | .then(respJson => { | 135 | .then(respJson => { |
| 136 | if (respJson.enmsg != "ok") { | 136 | if (respJson.enmsg != "ok") { |
| 137 | - alert(respJson.cnmsg); | 137 | + Alert.alert(respJson.cnmsg); |
| 138 | } else { | 138 | } else { |
| 139 | AsyncStorage.setItem("PROFESSION",d).then(() => { | 139 | AsyncStorage.setItem("PROFESSION",d).then(() => { |
| 140 | console.log("保存修改成功"); | 140 | console.log("保存修改成功"); |
-
Please register or login to post a comment