Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app-public
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-public
Commits
a38c3b9b
Commit
a38c3b9b
authored
Mar 17, 2020
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改ws发送信息
parent
b3c10c3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
connect.tsx
src/pages/connect/connect.tsx
+15
-15
No files found.
src/pages/connect/connect.tsx
View file @
a38c3b9b
...
...
@@ -121,7 +121,6 @@ class Connect extends Component {
lastMessage
:
''
,
canPay
:
false
,
};
this
.
checkBluetoothAndWs
();
}
componentWillMount
()
{
...
...
@@ -132,6 +131,7 @@ class Connect extends Component {
payId
:
prepayConfig
[
0
].
id
,
});
}
this
.
checkBluetoothAndWs
();
}
componentWillUnmount
()
{
...
...
@@ -259,22 +259,22 @@ class Connect extends Component {
sendDeviceCode
()
{
const
{
sockedDone
,
deviceDone
}
=
this
.
state
;
const
{
device
}
=
this
.
props
;
//
const { device } = this.props;
console
.
log
(
'socket状态:'
,
sockedDone
,
'蓝牙状态:'
,
deviceDone
);
if
(
sockedDone
&&
socketTask
&&
deviceDone
)
{
let
deviceData
=
'{<'
+
device
.
code
+
'>}'
;
console
.
log
(
'<---发送设备编号:'
,
deviceData
);
socketTask
.
send
({
data
:
str2ab
(
deviceData
),
success
:
msg
=>
{
console
.
log
(
'发送设备编号:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送设备编号:'
,
err
,
'--->'
);
},
});
}
//
if (sockedDone && socketTask && deviceDone) {
//
let deviceData = '{<' + device.code + '>}';
//
console.log('<---发送设备编号:', deviceData);
//
socketTask.send({
//
data: str2ab(deviceData),
//
success: msg => {
//
console.log('发送设备编号:', msg, '--->');
//
},
//
fail: err => {
//
console.log('发送设备编号:', err, '--->');
//
},
//
});
//
}
}
closeDeviceSocket
()
{
...
...
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