Commit 93e08908 by hank

fix loading bug

parent 2e39ae0f
......@@ -160,8 +160,10 @@ class Bluetooth {
if (state === 'CONNECTING') {
Taro.showLoading({ title: '连接中...' })
} else if (state === 'SUCCESS') {
Taro.hideLoading()
showMyToast({ title: '连接成功~' })
} else {
Taro.hideLoading()
showMyToast({ title: '连接失败~' })
}
}
......
......@@ -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 () => {
const { userPhone, checkCode } = this.state
try {
......@@ -119,6 +128,8 @@ class Login extends Component {
}
}
getPhoneNumber() {}
shouldComponentUpdate(_nextProps, _nextState) {
const { userPhone, checkCode, checked, getCodeTime } = _nextState
const { userPhone: UP, checkCode: CC, checked: CK, getCodeTime: GT } = this.state
......
......@@ -165,10 +165,11 @@ class WifiList extends Component {
try {
Taro.showLoading({ title: '连接中...' })
await Ble.postWifiPassword(id, password, deviceId)
// Taro.hideLoading()
} catch (error) {
console.error(error)
// Taro.hideLoading()
}
Taro.hideLoading()
}
cancelModal() {
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