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
d5decbce
Commit
d5decbce
authored
Dec 04, 2020
by
yemin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!14
parents
7f24f218
307ed3f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
EquipmentTest.js
src/containers/Equipment/EquipmentTest.js
+3
-1
index.js
src/containers/TestWater/index.js
+28
-3
No files found.
src/containers/Equipment/EquipmentTest.js
View file @
d5decbce
...
@@ -65,8 +65,10 @@ class EquipmentTest extends Component {
...
@@ -65,8 +65,10 @@ class EquipmentTest extends Component {
scanType
:
[
'qrCode'
,
'barCode'
],
// 可以指定扫二维码还是一维码,默认二者都有
scanType
:
[
'qrCode'
,
'barCode'
],
// 可以指定扫二维码还是一维码,默认二者都有
success
:
res
=>
{
success
:
res
=>
{
const
result
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
const
result
=
res
.
resultStr
;
// 当needResult 为 1 时,扫码返回的结果
var
bar
=
result
.
indexOf
(
"https://www.dcrym.com"
)
!==-
1
?
result
.
slice
(
29
):
result
;
bar
=
bar
.
length
>
8
?
bar
.
substring
(
0
,
8
):
bar
;
this
.
setState
({
this
.
setState
({
deviceCode
:
result
,
deviceCode
:
bar
,
});
});
},
},
fail
:
err
=>
{
fail
:
err
=>
{
...
...
src/containers/TestWater/index.js
View file @
d5decbce
...
@@ -43,12 +43,33 @@ export class Index extends React.Component {
...
@@ -43,12 +43,33 @@ export class Index extends React.Component {
showBig
:
!
showBig
,
showBig
:
!
showBig
,
});
});
};
};
startTest
=
()
=>
{
startTest
0
=
()
=>
{
Toast
.
loading
(
''
,
20
);
Toast
.
loading
(
''
,
20
);
console
.
log
(
this
.
props
.
match
.
params
);
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
console
.
log
(
deviceCode
);
// const { quantity } = this.state;
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
0
};
console
.
log
(
side
);
testWater
({
testWater
({
deviceCode
,
deviceCode
,
side
,
}).
then
(
res
=>
{
console
.
log
(
res
);
Toast
.
success
(
res
.
msg
||
'设置成功!'
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
Toast
.
fail
(
err
.
msg
||
'请求失败'
);
});
};
startTest1
=
()
=>
{
Toast
.
loading
(
''
,
20
);
const
{
deviceCode
}
=
this
.
props
.
match
.
params
;
// const { quantity } = this.state;
const
{
side
}
=
{
"side"
:
1
};
testWater
({
deviceCode
,
side
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
Toast
.
success
(
res
.
msg
||
'设置成功!'
);
Toast
.
success
(
res
.
msg
||
'设置成功!'
);
...
@@ -80,8 +101,12 @@ export class Index extends React.Component {
...
@@ -80,8 +101,12 @@ export class Index extends React.Component {
{
deviceCode
}
{
deviceCode
}
<
/span
>
<
/span
>
<
/div
>
<
/div
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest
}
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest0
}
>
点击测试
测试左边
<
/Button
>
<
br
><
/br
>
<
Button
type
=
'primary'
className
=
{
styles
.
btn
}
onClick
=
{
this
.
startTest1
}
>
测试右边
<
/Button
>
<
/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