Commit 2692704e by 修福龙

订单详情页面

parent 4e11f08f
......@@ -40,6 +40,9 @@ export default {
if (data.data && data.data.contact) {
yield call(AsyncStorage.setItem, 'CONTACT', data.data.contact);
}
if (data.data && data.data.name) {
yield call(AsyncStorage.setItem, 'NAME', data.data.name);
}
if (action.key) {
yield call(AsyncStorage.setItem, 'KEY', action.key);
}
......
......@@ -6,6 +6,7 @@ import {connect} from 'react-redux';
import Touch from '../components/Touch';
import PhoneModal from '../components/PhoneModal';
import VerifyCodeModal from '../components/VerifyCodeModal';
import OrderDetailsModal from '../components/OrderDetailsModal';
import NP from '../utils/np';
import delay from '../utils/delay';
import config from '../utils/config';
......@@ -41,6 +42,8 @@ class FacePage extends Component {
offsetValue: new Animated.Value(0),
phoneModal: false, // 显示输入电话号码弹窗
verifyCodeModal: false, // 显示输入验证码弹窗
orderDetailsModal: false, // 显示订单详情弹窗
goodsArr: [],
};
async componentWillMount() {
......@@ -118,6 +121,12 @@ class FacePage extends Component {
});
};
handleOrderClose = () => {
this.setState({
orderDetailsModal: false,
});
};
listen = async () => {
while (!window.socket) {
await delay(1000);
......@@ -170,6 +179,14 @@ class FacePage extends Component {
if (ret.code === 401) {
// 需要验证手机号
this.setState({phoneModal: true});
} else {
let goodsArr = [];
ret.orders.map(v1 => {
v1.goods.map(v2 => {
goodsArr.push(v2);
});
});
this.setState({orderDetailsModal: true, goodsArr});
}
} else if (ret.msg) {
let tipText = ret.msg.replace(/扫码/g, '人脸识别');
......@@ -320,6 +337,8 @@ class FacePage extends Component {
triggerValue,
offsetValue,
phoneModal,
orderDetailsModal,
goodsArr,
} = this.state;
let {store} = this.props;
return (
......@@ -340,6 +359,14 @@ class FacePage extends Component {
onRequestClose={this.handleCodeClose}
onSubmit={this.onCodeSubmit}
/>
<OrderDetailsModal
visible={orderDetailsModal}
transparent
maskClosable
onClose={this.handleOrderClose}
onRequestClose={this.handleOrderClose}
goodsArr={goodsArr}
/>
<View style={{alignItems: 'center', justifyContent: 'center', flex: 1}}>
<Touch onPress={this.pressQrcode} style={{flex: 1}}>
<Image
......
......@@ -5,6 +5,8 @@ export const host = isProd
: 'http://192.168.1.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/';
export const watermark = '.jpg?x-oss-process=style/zmgo_thumb_watermark';
window.defaultCount = 0;
......@@ -13,4 +15,6 @@ export default {
login,
qrHost,
isProd,
imgUrl,
watermark,
};
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