Commit c6ebdb49 by 修福龙

收银台界面

parent b305ec79
...@@ -151,14 +151,6 @@ class FacePage extends Component { ...@@ -151,14 +151,6 @@ class FacePage extends Component {
}); });
}; };
// 判断传感器上没人
noPerson = async () => {
const data = await this.props.dispatch({
type: 'store/scaleData',
});
return data && data.stableWeight === 0;
};
// device 代表当前打开的门 // device 代表当前打开的门
handleScaleChange = ({count}) => { handleScaleChange = ({count}) => {
if (count === -1) { if (count === -1) {
...@@ -166,12 +158,12 @@ class FacePage extends Component { ...@@ -166,12 +158,12 @@ class FacePage extends Component {
this.wechatFace(); this.wechatFace();
} else if (count === 0) { } else if (count === 0) {
// 重力感应归零 // 重力感应归零
clearInterval(this.noTalkCall);
this.setState({orderDetailsModal: false, current: 1}); this.setState({orderDetailsModal: false, current: 1});
} }
}; };
handleDoorLogin = async ret => { handleDoorLogin = async ret => {
// console.warn(ret);
if (ret) { if (ret) {
if (ret.code < 0 || ret.code === 401) { if (ret.code < 0 || ret.code === 401) {
// 未授权,提示用户扫码验证 // 未授权,提示用户扫码验证
...@@ -183,11 +175,12 @@ class FacePage extends Component { ...@@ -183,11 +175,12 @@ class FacePage extends Component {
this.setState({phoneModal: true}); this.setState({phoneModal: true});
} else { } else {
let goodsArr = []; let goodsArr = [];
ret.orders.map(v1 => { ret.orders &&
v1.goods.map(v2 => { ret.orders.map(v1 => {
goodsArr.push(v2); v1.goods.map(v2 => {
goodsArr.push(v2);
});
}); });
});
this.setState({ this.setState({
orderDetailsModal: true, orderDetailsModal: true,
goodsArr, goodsArr,
...@@ -195,6 +188,10 @@ class FacePage extends Component { ...@@ -195,6 +188,10 @@ class FacePage extends Component {
current: 1, current: 1,
}); });
} }
} else if (ret.msg) {
let tipText = ret.msg.replace(/扫码/g, '人脸识别');
Speech.speak(tipText);
this.setState({tip: tipText});
} }
} else { } else {
Speech.speak('正在重新识别,请靠中间站稳'); Speech.speak('正在重新识别,请靠中间站稳');
...@@ -212,9 +209,9 @@ class FacePage extends Component { ...@@ -212,9 +209,9 @@ class FacePage extends Component {
// 微信人脸身份识别 // 微信人脸身份识别
wechatFace = async () => { wechatFace = async () => {
// if (this.state.qrcode) { if (this.state.orderDetailsModal) {
// return; return;
// } // 出现二维码,不做人脸识别 } // 出现订单弹窗,不做人脸识别
const tipText = '正在人脸识别,请看向屏幕,靠中间站稳'; const tipText = '正在人脸识别,请看向屏幕,靠中间站稳';
Speech.speak(tipText); Speech.speak(tipText);
this.setState({tip: tipText}); this.setState({tip: tipText});
...@@ -234,13 +231,7 @@ class FacePage extends Component { ...@@ -234,13 +231,7 @@ class FacePage extends Component {
face_authtype: 'FACEID-ONCE', face_authtype: 'FACEID-ONCE',
ask_unionid: 1, ask_unionid: 1,
}; };
let res = {}; let res = (await WxFacepay.faceinfo(params)) || {};
while (
!res.openid &&
!(await this.noPerson()) // 没识别到人脸,重新识别
) {
res = await WxFacepay.faceinfo(params);
}
if (window.socket) { if (window.socket) {
window.socket.connect(); window.socket.connect();
} // 返回结果,立即重新连接socket } // 返回结果,立即重新连接socket
......
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