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
ec432609
Commit
ec432609
authored
Jun 18, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加发送数据状态打印
parent
e5e07c09
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
index.js
src/constants/index.js
+2
-2
Shower.tsx
src/pages/Shower/Shower.tsx
+35
-5
WaterDispenser.tsx
src/pages/WaterDispenser/WaterDispenser.tsx
+0
-1
No files found.
src/constants/index.js
View file @
ec432609
...
...
@@ -10,7 +10,7 @@ export const CUSTOMER_SERVER_URL =
'https://ex-dev-dcxy-customer-app.168cad.top'
;
export
const
SCHOOL_MAIN_URL
=
'https://internal-dev-school-main.168cad.top'
;
export
const
ANN_LINK_URL
=
'https://ex-dev-wx.168cad.top/announcement/'
;
export
const
SHOWER_APP_URL
=
'http://
192.168.3.55:8888
'
;
export
const
SOCKET_URL
=
'ws://192.168.
3.55:2000
3/ws'
;
export
const
SHOWER_APP_URL
=
'http://
ex-shower-app-server.168cad.top
'
;
export
const
SOCKET_URL
=
'ws://192.168.
1.35:2215
3/ws'
;
export
const
SMPRO_URL
=
'https://ex-dev-dcxy-smapro-app.168cad.top'
;
export
const
GX_URL
=
'http://ex-dev-gx-app-server.168cad.top'
;
src/pages/Shower/Shower.tsx
View file @
ec432609
...
...
@@ -210,9 +210,15 @@ class Shower extends Component {
if
(
sockedDone
&&
task
&&
deviceDone
)
{
let
deviceData
=
'{<'
+
bluetoothDevice
.
code
+
'>}'
;
console
.
log
(
'发送设备编号:'
,
deviceData
);
console
.
log
(
'
<---
发送设备编号:'
,
deviceData
);
task
.
send
({
data
:
str2ab
(
deviceData
),
success
:
msg
=>
{
console
.
log
(
'发送设备编号:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送设备编号:'
,
err
,
'--->'
);
},
});
}
}
...
...
@@ -426,10 +432,16 @@ class Shower extends Component {
datastr
.
substring
(
0
,
1
)
===
'{'
&&
datastr
.
substring
(
datastr
.
length
-
1
,
datastr
.
length
)
===
'}'
)
{
console
.
log
(
'发送完整数据: '
,
datastr
);
console
.
log
(
'
<---
发送完整数据: '
,
datastr
);
if
(
task
)
{
task
.
send
({
data
:
str2ab
(
datastr
),
success
:
msg
=>
{
console
.
log
(
'发送完整数据:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送完整数据:'
,
err
,
'--->'
);
},
});
}
}
else
if
(
datastr
.
substring
(
0
,
1
)
===
'{'
)
{
...
...
@@ -441,10 +453,16 @@ class Shower extends Component {
)
{
abStr
+=
datastr
;
console
.
log
(
'接受尾部数据后: '
,
abStr
);
console
.
log
(
'发送完整数据: '
,
abStr
);
console
.
log
(
'
<---
发送完整数据: '
,
abStr
);
if
(
task
)
{
task
.
send
({
data
:
str2ab
(
abStr
),
success
:
msg
=>
{
console
.
log
(
'发送完整数据:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送完整数据:'
,
err
,
'--->'
);
},
});
}
abStr
=
''
;
...
...
@@ -574,10 +592,16 @@ class Shower extends Component {
msg
.
substring
(
msg
.
length
-
1
,
msg
.
length
)
===
'}'
)
{
const
{
task
}
=
this
.
state
;
console
.
log
(
'发送给socket完整数据: '
,
msg
);
console
.
log
(
'
<---
发送给socket完整数据: '
,
msg
);
task
&&
task
.
send
({
data
:
str2ab
(
msg
),
success
:
msg
=>
{
console
.
log
(
'发送给socket完整数据:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送给socket完整数据:'
,
err
,
'--->'
);
},
});
}
else
if
(
msg
.
substring
(
0
,
1
)
===
'{'
)
{
console
.
log
(
'接受头部数据: '
,
msg
);
...
...
@@ -588,12 +612,18 @@ class Shower extends Component {
)
{
abStr
+=
msg
;
console
.
log
(
'接受尾部数据后: '
,
abStr
);
console
.
log
(
'发送给socket完整数据: '
,
abStr
);
console
.
log
(
'
<---
发送给socket完整数据: '
,
abStr
);
const
{
task
}
=
this
.
state
;
task
&&
task
.
send
({
data
:
str2ab
(
abStr
),
success
:
msg
=>
{
console
.
log
(
'发送给socket完整数据:'
,
msg
,
'--->'
);
},
fail
:
err
=>
{
console
.
log
(
'发送给socket完整数据:'
,
err
,
'--->'
);
},
});
abStr
=
''
;
}
else
{
...
...
src/pages/WaterDispenser/WaterDispenser.tsx
View file @
ec432609
...
...
@@ -225,7 +225,6 @@ class WaterDispenser extends Component {
);
})
.
catch
(
err
=>
{
Taro
.
hideLoading
();
console
.
error
(
'开启失败: '
,
err
);
});
}
...
...
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