Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
wx-school-app
Commits
0f69b4fe
Commit
0f69b4fe
authored
Jul 02, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改洗浴连接逻辑
parent
696da627
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Shower.tsx
src/pages/Shower/Shower.tsx
+14
-6
No files found.
src/pages/Shower/Shower.tsx
View file @
0f69b4fe
...
...
@@ -28,6 +28,7 @@ import { PayOrderState } from '@/store/rootReducers/orderState';
enum
BlueToothError
{
BlueToothNotOpen
=
'BlueToothNotOpen'
,
DeviceNotFound
=
'DeviceNotFound'
,
}
type
DeviceInfo
=
{
...
...
@@ -364,16 +365,14 @@ class Shower extends Component {
.
then
(()
=>
{
const
{
code
,
isOnlyBluetooth
}
=
this
.
props
.
bluetoothDevice
;
let
timer
:
NodeJS
.
Timeout
|
null
=
null
;
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
,
reject
)
=>
{
if
(
isOnlyBluetooth
)
{
timer
=
setTimeout
(()
=>
{
Taro
.
stopBluetoothDevicesDiscovery
();
this
.
sendStartShower
();
reject
({
msg
:
BlueToothError
.
DeviceNotFound
});
},
10000
);
}
else
{
timer
=
setTimeout
(()
=>
{
Taro
.
stopBluetoothDevicesDiscovery
();
this
.
sendStartShower
();
reject
({
msg
:
BlueToothError
.
DeviceNotFound
});
},
5000
);
}
Taro
.
onBluetoothDeviceFound
(
res
=>
{
...
...
@@ -394,9 +393,18 @@ class Shower extends Component {
})
.
catch
(
err
=>
{
// Taro.stopBluetoothDevicesDiscovery();
if
(
timer
)
{
clearInterval
(
timer
);
}
Taro
.
hideLoading
();
console
.
error
(
'startBluetoothDevicesDiscovery: '
,
err
);
this
.
warnBluetoothOpen
();
// if (err.msg === BlueToothError.DeviceNotFound) {
Taro
.
stopBluetoothDevicesDiscovery
();
this
.
sendStartShower
();
throw
err
;
// } else {
// return this.warnBluetoothOpen();
// }
});
}
else
{
Taro
.
hideLoading
();
...
...
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