Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
93e08908
authored
Sep 03, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix loading bug
parent
2e39ae0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
+15
-1
src/common/bluetooth.ts
+2
-0
src/pages/login/index.tsx
+11
-0
src/pages/system/wifi_list/index.tsx
+2
-1
No files found.
src/common/bluetooth.ts
View file @
93e08908
...
@@ -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
:
'连接失败~'
})
}
}
}
}
...
...
src/pages/login/index.tsx
View file @
93e08908
...
@@ -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
...
...
src/pages/system/wifi_list/index.tsx
View file @
93e08908
...
@@ -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
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment