Commit 9c2dae3d by zhonghao

订单详情页优化

parent 87c48f38
......@@ -186,7 +186,7 @@ class OrderDetailMini extends Component {
<View style={styles.line} />
<View style={styles.realPay}>
<View style={styles.total}>
<Text style={styles.totalText}>实付金额</Text>
<Text style={styles.totalText}>实付</Text>
<Text style={styles.totalText}>
{NP.round(totalPrice, 2).toFixed(2)}
</Text>
......@@ -206,6 +206,9 @@ class OrderDetailMini extends Component {
</View>
)}
</View>
<View style={styles.loading}>
<Image source={require('../assets/loading.gif')} />
</View>
</View>
</Modal>
);
......@@ -214,6 +217,7 @@ class OrderDetailMini extends Component {
const styles = {
modalBackgroundStyle: {
position: 'relative',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
......@@ -320,6 +324,7 @@ const styles = {
paddingBottom: scaleSize(14),
paddingLeft: scaleSize(6),
paddingRight: scaleSize(50),
marginRight: scaleSize(-15),
},
TdText: {
fontSize: setSpText(45),
......@@ -357,8 +362,19 @@ const styles = {
backgroundColor: '#FFF',
marginLeft: '10%',
marginRight: '10%',
marginBottom: scaleSize(50),
justifyContent: 'center',
},
loading: {
position: 'absolute',
top: 850,
// bottom: 0,
left: 0,
right: 0,
width: scaleSize(1150),
height: scaleSize(1150),
resizeMode: 'contain',
},
};
export default OrderDetailMini;
......@@ -42,7 +42,7 @@ class FacePage extends Component {
tipsModal: false,
faceType: 'wxpay',
// 屏保模式
sleep: true,
// sleep: true,
loadingModal: false,
qrCode: '',
goTipsModal: false,
......@@ -53,9 +53,13 @@ class FacePage extends Component {
phone = ''; // 监听用户输入手机
// 设备类型
// sense = true; // 测试即拿刷脸设备
sense = true; // 测试即拿刷脸设备
async componentWillMount() {
this.goodsCounterInter = setInterval(() => {
this.getOrderDetailMiniCounter();
}, 3000);
this.orderDetailMiniPop(true);
this.storeKey = await AsyncStorage.getItem('KEY');
let contact = await AsyncStorage.getItem('CONTACT');
let storeName = await AsyncStorage.getItem('NAME');
......@@ -186,12 +190,20 @@ class FacePage extends Component {
* 拉取数据,同步至state
*/
getOrderDetailMiniCounter = async () => {
const {data} = await this.props.dispatch({
type: 'goods/getOrderCounter',
});
this.setState({
goodsArr: data,
});
try {
const {data} = await this.props.dispatch({
type: 'goods/getOrderCounter',
});
if (data.length !== 0) {
this.setState({
goodsArr: data,
});
} else {
Toast.show('数据异常');
}
} catch (error) {
Toast.show('当前网络存在异常');
}
};
listen = async () => {
......@@ -384,7 +396,7 @@ class FacePage extends Component {
this.setState({tip: tipText, tipsModal: true, loadingModal: false});
} else if (this.sense) {
this.setState({loadingModal: false});
if ((ret.action = 'enter')) {
if (ret.action === 'enter') {
this.goodsCounterInter = setInterval(() => {
this.getOrderDetailMiniCounter();
}, 3000);
......@@ -944,6 +956,7 @@ class FacePage extends Component {
const styles = {
content: {
position: 'relative',
flex: 1,
alignItems: 'center',
backgroundColor: '#fff',
......
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