Commit d729545c by 钟昊

没有经过测试的订单详情弹窗

parent 1285c7f2
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,6 +34,7 @@ axios.interceptors.request.use(config => {
if (window.auth) {
// 门店Token
config.headers.common.Authorization = `Bearer ${window.auth.token}`;
// console.log("Token", `Bearer ${window.auth.token}`)
}
return config;
});
......
......@@ -96,5 +96,8 @@ export default {
*balancePay(action, {call}) {
return yield call(api.balancePay, action);
},
*getOrderCounter(action, {call}) {
return yield call(api.getOrderCounter, action);
},
},
};
......@@ -8,6 +8,7 @@ import PhoneModal from '../components/PhoneModal';
import VerifyCodeModal from '../components/VerifyCodeModal';
import QRCode from 'react-native-qrcode-svg';
import OrderDetailsModal from '../components/OrderDetailsModal';
import OrderDetailMini from '../components/OrderDetailMini';
import TipsModal from '../components/TipsModal';
import LoadingModal from '../components/LoadingModal';
import delay from '../utils/delay';
......@@ -30,6 +31,7 @@ class FacePage extends Component {
phoneModal: false, // 显示输入电话号码弹窗
verifyCodeModal: false, // 显示输入验证码弹窗
orderDetailsModal: false, // 显示订单详情弹窗
orderDetailMini: false,
goodsArr: [],
talkCall: 2, // 0请求通话,1通话中,2,已挂断通话,待机状态
contact: '',
......@@ -39,6 +41,7 @@ class FacePage extends Component {
tip: '',
tipsModal: false,
faceType: 'wxpay',
// 屏保模式
sleep: true,
loadingModal: false,
qrCode: '',
......@@ -49,6 +52,7 @@ class FacePage extends Component {
};
phone = ''; // 监听用户输入手机
// 设备类型
// sense = true; // 测试即拿刷脸设备
async componentWillMount() {
......@@ -150,6 +154,31 @@ class FacePage extends Component {
orderDetailsModal: false,
});
};
/**
* @param {String} timeoutt 超时时间
*/
orderDetailMiniPop = timeoutt => {
this.setState({
orderDetailMini: true,
});
// 没有清空计时器的操作,可能造成内存溢出
setTimeout(() => {
this.setState({
orderDetailMini: false,
});
}, timeoutt);
};
/**
* 拉取数据,同步至state
*/
getOrderDetailMiniCounter = async () => {
const {data} = await this.props.dispatch({
type: 'goods/getOrderCounter',
});
this.setState({
goodsArr: data,
});
};
listen = async () => {
try {
......@@ -195,7 +224,9 @@ class FacePage extends Component {
else if (this.action === 'leave') {
// 出门身份识别提示
Speech.speak('正在进行安全检查');
this.loading(true, 30000);
this.getOrderDetailMiniCounter();
this.orderDetailMiniPop(30000);
// this.loading(true, 30000);
}
}
};
......@@ -282,6 +313,11 @@ class FacePage extends Component {
code: ret.code,
});
if (ret) {
if (ret.code === 1 && ret.action === 'leave') {
this.setState({
orderDetailMini: false,
});
}
if (ret.code < 0 || ret.code === 401) {
// 未授权,提示用户扫码验证
let tipText = ret.msg;
......@@ -652,6 +688,7 @@ class FacePage extends Component {
verifyCodeModal,
phoneModal,
orderDetailsModal,
orderDetailMini,
goodsArr,
talkCall,
storeName,
......@@ -717,6 +754,14 @@ class FacePage extends Component {
current={current}
faceType={faceType}
/>
<OrderDetailMini
visible={orderDetailMini}
transparent
onRequestClose={this.handleOrderClose}
goodsArr={goodsArr}
dispatch={dispatch}
faceType={faceType}
/>
<TipsModal
visible={tipsModal}
transparent
......
......@@ -74,3 +74,7 @@ export function payscoreinfo() {
export function balancePay(action) {
return axios.post('/store/goods/balancePay', qs.stringify(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.166:7001';
: 'http://192.168.88.88: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