Commit 4539274a by yemin

Merge branch 'develop' into 'test'

设备测试增加停止按钮 See merge request !21
parents 109e2829 5453a34c
......@@ -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`,
......
......@@ -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>
);
}
......
......@@ -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%;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment