Commit 9c2dae3d by zhonghao

订单详情页优化

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