Commit 3ac4e7eb by yemin

Merge branch 'test' into 'master'

Test See merge request !22
parents d4e2a1c2 4539274a
...@@ -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`,
......
...@@ -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,13 +131,21 @@ export class Index extends React.Component { ...@@ -101,13 +131,21 @@ 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>
); );
} }
......
...@@ -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%;
......
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