Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-app-hairDryer
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-app-hairDryer
Commits
5453a34c
Commit
5453a34c
authored
Jul 29, 2021
by
何炳良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备测试增加停止按钮
parent
295b2aac
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
7 deletions
+63
-7
index.js
src/api/index.js
+7
-0
index.js
src/containers/TestWater/index.js
+43
-5
style.scss
src/containers/TestWater/style.scss
+13
-2
yarn.lock
yarn.lock
+0
-0
No files found.
src/api/index.js
View file @
5453a34c
...
@@ -30,6 +30,13 @@ export const testWater = entity =>
...
@@ -30,6 +30,13 @@ export const testWater = entity =>
data
:
entity
,
data
:
entity
,
});
});
export
const
quickTest
=
entity
=>
fetch
({
url
:
`/devices/
${
entity
.
deviceCode
}
/
${
entity
.
side
}
/stop`
,
method
:
'post'
,
data
:
entity
,
});
export
const
checkWater
=
entity
=>
export
const
checkWater
=
entity
=>
fetch
({
fetch
({
url
:
`/devices/
${
entity
.
deviceCode
}
/waterVerification`
,
url
:
`/devices/
${
entity
.
deviceCode
}
/waterVerification`
,
...
...
src/containers/TestWater/index.js
View file @
5453a34c
...
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
...
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import
{
Button
,
Toast
}
from
'antd-mobile'
;
import
{
Button
,
Toast
}
from
'antd-mobile'
;
import
styles
from
'./style.scss'
;
import
styles
from
'./style.scss'
;
import
eqIcon
from
'../../images/Equipment/equip_number_icon@2x.png'
;
import
eqIcon
from
'../../images/Equipment/equip_number_icon@2x.png'
;
import
{
testWater
}
from
'../../api/index'
;
import
{
testWater
,
quickTest
}
from
'../../api/index'
;
import
UserInfoContext
from
'../../context/userinfo-context'
;
import
UserInfoContext
from
'../../context/userinfo-context'
;
import
JsBarcode
from
'jsbarcode'
;
import
JsBarcode
from
'jsbarcode'
;
...
@@ -50,7 +50,6 @@ export class Index extends React.Component {
...
@@ -50,7 +50,6 @@ export class Index extends React.Component {
console
.
log
(
deviceCode
);
console
.
log
(
deviceCode
);
// const { quantity } = this.state;
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
0
};
const
{
side
}
=
{
"side"
:
0
};
console
.
log
(
side
);
testWater
({
testWater
({
deviceCode
,
deviceCode
,
side
,
side
,
...
@@ -78,7 +77,38 @@ export class Index extends React.Component {
...
@@ -78,7 +77,38 @@ export class Index extends React.Component {
Toast
.
fail
(
err
.
msg
||
'请求失败'
);
Toast
.
fail
(
err
.
msg
||
'请求失败'
);
});
});
};
};
quickBlower0
=
()
=>
{
Toast
.
loading
(
''
,
20
);
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
0
};
quickTest
({
deviceCode
,
side
,
}).
then
(
res
=>
{
console
.
log
(
res
);
Toast
.
success
(
res
.
msg
||
'设置成功!'
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
Toast
.
fail
(
err
.
msg
||
'请求失败'
);
});
}
quickBlower1
=
()
=>
{
Toast
.
loading
(
''
,
20
);
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
1
};
quickTest
({
deviceCode
,
side
,
}).
then
(
res
=>
{
console
.
log
(
res
);
Toast
.
success
(
res
.
msg
||
'设置成功!'
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
Toast
.
fail
(
err
.
msg
||
'请求失败'
);
});
};
render
()
{
render
()
{
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
const
{
showBig
}
=
this
.
state
;
const
{
showBig
}
=
this
.
state
;
...
@@ -101,14 +131,22 @@ export class Index extends React.Component {
...
@@ -101,14 +131,22 @@ export class Index extends React.Component {
{
deviceCode
}
{
deviceCode
}
<
/span
>
<
/span
>
<
/div
>
<
/div
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest0
}
>
<
div
className
=
"flex_box"
>
<
Button
type
=
'primary'
className
=
"btn"
onClick
=
{
this
.
startTest0
}
>
测试左边
测试左边
<
/Button><Button type='primary' className="btn1" onClick={this.quickBlower0}
>
退出吹风
<
/Button
>
<
/Button
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest1
}
>
<
div
className
=
"flex_box"
>
<
Button
type
=
'primary'
className
=
"btn"
onClick
=
{
this
.
startTest1
}
>
测试右边
测试右边
<
/Button><Button type='primary' className="btn1" onClick={this.quickBlower1}
>
退出吹风
<
/Button
>
<
/Button
>
<
/div
>
<
/div
>
<
/div
>
);
);
}
}
}
}
...
...
src/containers/TestWater/style.scss
View file @
5453a34c
...
@@ -29,12 +29,23 @@
...
@@ -29,12 +29,23 @@
font-size
:
30px
;
font-size
:
30px
;
color
:
#444
;
color
:
#444
;
}
}
.flex_box
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-around
;
}
.btn
{
.btn
{
// composes: btn from '../BindEquipment/style.css';
// composes: btn from '../BindEquipment/style.css';
width
:
500px
;
width
:
300px
;
margin
:
30px
auto
;
}
.btn1
{
// composes: btn from '../BindEquipment/style.css';
width
:
200px
;
margin
:
30px
auto
;
margin
:
30px
auto
;
background-color
:
#ff0000
;
}
}
.BarCodeBox
{
.BarCodeBox
{
position
:
relative
;
position
:
relative
;
width
:
100%
;
width
:
100%
;
...
...
yarn.lock
View file @
5453a34c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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