Commit 93e08908 by hank

fix loading bug

parent 2e39ae0f
...@@ -160,8 +160,10 @@ class Bluetooth { ...@@ -160,8 +160,10 @@ class Bluetooth {
if (state === 'CONNECTING') { if (state === 'CONNECTING') {
Taro.showLoading({ title: '连接中...' }) Taro.showLoading({ title: '连接中...' })
} else if (state === 'SUCCESS') { } else if (state === 'SUCCESS') {
Taro.hideLoading()
showMyToast({ title: '连接成功~' }) showMyToast({ title: '连接成功~' })
} else { } else {
Taro.hideLoading()
showMyToast({ title: '连接失败~' }) showMyToast({ title: '连接失败~' })
} }
} }
......
...@@ -94,6 +94,15 @@ class Login extends Component { ...@@ -94,6 +94,15 @@ class Login extends Component {
} }
} }
componentWillMount() {
Taro.login().then(res => {
if (res.code) {
console.log(res)
} else {
console.log(' Taro.login err')
}
})
}
login = async () => { login = async () => {
const { userPhone, checkCode } = this.state const { userPhone, checkCode } = this.state
try { try {
...@@ -119,6 +128,8 @@ class Login extends Component { ...@@ -119,6 +128,8 @@ class Login extends Component {
} }
} }
getPhoneNumber() {}
shouldComponentUpdate(_nextProps, _nextState) { shouldComponentUpdate(_nextProps, _nextState) {
const { userPhone, checkCode, checked, getCodeTime } = _nextState const { userPhone, checkCode, checked, getCodeTime } = _nextState
const { userPhone: UP, checkCode: CC, checked: CK, getCodeTime: GT } = this.state const { userPhone: UP, checkCode: CC, checked: CK, getCodeTime: GT } = this.state
......
...@@ -165,10 +165,11 @@ class WifiList extends Component { ...@@ -165,10 +165,11 @@ class WifiList extends Component {
try { try {
Taro.showLoading({ title: '连接中...' }) Taro.showLoading({ title: '连接中...' })
await Ble.postWifiPassword(id, password, deviceId) await Ble.postWifiPassword(id, password, deviceId)
// Taro.hideLoading()
} catch (error) { } catch (error) {
console.error(error) console.error(error)
// Taro.hideLoading()
} }
Taro.hideLoading()
} }
cancelModal() { cancelModal() {
this.setState({ openModal: false }) this.setState({ openModal: false })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment