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
56ca3932
Commit
56ca3932
authored
Dec 03, 2020
by
yemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信端主动触发测试吹风
parent
b50e5b48
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
index.js
src/containers/TestWater/index.js
+20
-1
No files found.
src/containers/TestWater/index.js
View file @
56ca3932
import
React
from
'react'
;
import
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
'./style.scss'
;
import
{
Button
,
Toast
}
from
'antd-mobile'
;
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
UserInfoContext
from
'../../context/userinfo-context'
;
import
UserInfoContext
from
'../../context/userinfo-context'
;
import
JsBarcode
from
'jsbarcode'
;
import
JsBarcode
from
'jsbarcode'
;
...
@@ -41,6 +43,20 @@ export class Index extends React.Component {
...
@@ -41,6 +43,20 @@ export class Index extends React.Component {
showBig
:
!
showBig
,
showBig
:
!
showBig
,
});
});
};
};
startTest
=
()
=>
{
Toast
.
loading
(
''
,
20
);
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
// const { quantity } = this.state;
testWater
({
deviceCode
,
}).
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
;
...
@@ -64,6 +80,9 @@ export class Index extends React.Component {
...
@@ -64,6 +80,9 @@ export class Index extends React.Component {
{
deviceCode
}
{
deviceCode
}
<
/span
>
<
/span
>
<
/div
>
<
/div
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest
}
>
点击测试
<
/Button
>
<
/div
>
<
/div
>
);
);
}
}
...
...
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