Commit f891ea3b by zeven

Merge remote-tracking branch 'origin/zhonghao'

parents 4bb19fa0 d42ca7dd
......@@ -113,7 +113,11 @@ class OrderDetailMini extends Component {
let totalPrice = 0; // 总价
let totalCount = 0; // 总优惠
let number = 0; // 总数量
goodsArr.map(item => {
let _goodsArr = goodsArr;
if (!goodsArr || goodsArr.code) {
_goodsArr = [];
}
_goodsArr.map(item => {
number += item.num;
if (item.price) {
totalPrice += item.price * item.num;
......@@ -314,8 +318,8 @@ const styles = {
justifyContent: 'center',
paddingTop: scaleSize(14),
paddingBottom: scaleSize(14),
paddingLeft: scaleSize(8),
paddingRight: scaleSize(90),
paddingLeft: scaleSize(6),
paddingRight: scaleSize(50),
},
TdText: {
fontSize: setSpText(45),
......
......@@ -7,7 +7,7 @@ import Touch from '../components/Touch';
import PhoneModal from '../components/PhoneModal';
import VerifyCodeModal from '../components/VerifyCodeModal';
import QRCode from 'react-native-qrcode-svg';
import OrderDetailsModal from '../components/OrderDetailsModal';
// import OrderDetailsModal from '../components/OrderDetailsModal';
import OrderDetailMini from '../components/OrderDetailMini';
import TipsModal from '../components/TipsModal';
import LoadingModal from '../components/LoadingModal';
......@@ -42,7 +42,7 @@ class FacePage extends Component {
tipsModal: false,
faceType: 'wxpay',
// 屏保模式
sleep: true,
// sleep: true,
loadingModal: false,
qrCode: '',
goTipsModal: false,
......@@ -53,7 +53,7 @@ class FacePage extends Component {
phone = ''; // 监听用户输入手机
// 设备类型
// sense = true; // 测试即拿刷脸设备
sense = true; // 测试即拿刷脸设备
async componentWillMount() {
this.storeKey = await AsyncStorage.getItem('KEY');
......@@ -155,14 +155,28 @@ class FacePage extends Component {
});
};
/**
* @param {String} timeoutt 超时时间
* 用于控制订单详情弹窗,当参数为Number时为弹窗显示时间,当参数为boolean时关闭弹窗
* @param {Number} timeoutt 超时时间
* @param {Boolean} timeoutt 当参数为false时会清空定时器
*/
orderDetailMiniPop = timeoutt => {
let timerr = null;
if (timeoutt === false) {
this.setState({
orderDetailMini: false,
});
clearTimeout(timerr);
return;
} else if (timeoutt === true) {
this.setState({
orderDetailMini: true,
});
return;
}
this.setState({
orderDetailMini: true,
});
// 没有清空计时器的操作,可能造成内存溢出
setTimeout(() => {
timerr = setTimeout(() => {
this.setState({
orderDetailMini: false,
});
......@@ -224,9 +238,9 @@ class FacePage extends Component {
else if (this.action === 'leave') {
// 出门身份识别提示
Speech.speak('正在进行安全检查');
this.getOrderDetailMiniCounter();
this.orderDetailMiniPop(30000);
// this.loading(true, 30000);
// this.getOrderDetailMiniCounter();
// this.orderDetailMiniPop(30000);
this.loading(true, 30000);
}
}
};
......@@ -268,6 +282,7 @@ class FacePage extends Component {
};
face = () => {
this.orderDetailMiniPop(false);
const {faceType} = this.state;
if (faceType === 'wxpay') {
if (this.sense) {
......@@ -314,9 +329,7 @@ class FacePage extends Component {
});
if (ret) {
if (ret.code === 1 && ret.action === 'leave') {
this.setState({
orderDetailMini: false,
});
this.orderDetailMiniPop(false);
}
if (ret.code < 0 || ret.code === 401) {
// 未授权,提示用户扫码验证
......@@ -369,7 +382,13 @@ class FacePage extends Component {
Speech.speak(tipText);
if (ret.code !== 1) {
this.setState({tip: tipText, tipsModal: true, loadingModal: false});
} else if (this.sense) this.setState({loadingModal: false});
} else if (this.sense) {
this.setState({loadingModal: false});
if ((ret.action = 'enter')) {
this.getOrderDetailMiniCounter();
this.orderDetailMiniPop(1800000);
}
}
}
} else {
Speech.speak('正在重新识别,请靠中间站稳');
......@@ -687,14 +706,11 @@ class FacePage extends Component {
const {
verifyCodeModal,
phoneModal,
orderDetailsModal,
orderDetailMini,
goodsArr,
talkCall,
storeName,
contact,
customerPhone,
current,
tip,
tipsModal,
sleep,
......@@ -738,7 +754,7 @@ class FacePage extends Component {
onSubmit={this.onCodeSubmit}
faceType={faceType}
/>
<OrderDetailsModal
{/* <OrderDetailsModal
visible={orderDetailsModal}
transparent
maskClosable
......@@ -753,7 +769,7 @@ class FacePage extends Component {
customerPhone={customerPhone}
current={current}
faceType={faceType}
/>
/> */}
<OrderDetailMini
visible={orderDetailMini}
transparent
......
......@@ -77,4 +77,4 @@ export function balancePay(action) {
export function getOrderCounter() {
return axios.get('/store/goods/counter');
}
\ No newline at end of file
}
......@@ -2,7 +2,7 @@ const app = ''; // eg: .25h/.eg
export const isProd = process.env.NODE_ENV === 'production';
export const host = isProd
? `https://api${app}.vs-u.com`
: 'http://192.168.88.88:7001';
: 'http://192.168.88.171:7001';
export const login = `https://m${app}.vs-u.com`;
export const qrHost = login;
export const imgUrl = 'http://barcod.oss-cn-shenzhen.aliyuncs.com/images/';
......
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