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
3ac4e7eb
Commit
3ac4e7eb
authored
Jul 30, 2021
by
yemin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!22
parents
d4e2a1c2
4539274a
Hide 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 @
3ac4e7eb
...
...
@@ -30,6 +30,13 @@ export const testWater = entity =>
data
:
entity
,
});
export
const
quickTest
=
entity
=>
fetch
({
url
:
`/devices/
${
entity
.
deviceCode
}
/
${
entity
.
side
}
/stop`
,
method
:
'post'
,
data
:
entity
,
});
export
const
checkWater
=
entity
=>
fetch
({
url
:
`/devices/
${
entity
.
deviceCode
}
/waterVerification`
,
...
...
src/containers/TestWater/index.js
View file @
3ac4e7eb
...
...
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import
{
Button
,
Toast
}
from
'antd-mobile'
;
import
styles
from
'./style.scss'
;
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
JsBarcode
from
'jsbarcode'
;
...
...
@@ -50,7 +50,6 @@ export class Index extends React.Component {
console
.
log
(
deviceCode
);
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
0
};
console
.
log
(
side
);
testWater
({
deviceCode
,
side
,
...
...
@@ -78,7 +77,38 @@ export class Index extends React.Component {
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
()
{
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
const
{
showBig
}
=
this
.
state
;
...
...
@@ -101,13 +131,21 @@ export class Index extends React.Component {
{
deviceCode
}
<
/span
>
<
/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
>
<
/div
>
<
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
>
<
/div
>
<
/div
>
);
}
...
...
src/containers/TestWater/style.scss
View file @
3ac4e7eb
...
...
@@ -29,12 +29,23 @@
font-size
:
30px
;
color
:
#444
;
}
.flex_box
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-around
;
}
.btn
{
// 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
;
background-color
:
#ff0000
;
}
.BarCodeBox
{
position
:
relative
;
width
:
100%
;
...
...
yarn.lock
View file @
3ac4e7eb
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