Commit c6ebdb49 by 修福龙

收银台界面

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