|
@@ -16,11 +16,13 @@ import TopupPaythod from './TopupPaythod';
|
|
|
import app from '../../../app.json';
|
|
import app from '../../../app.json';
|
|
|
import utils from '../../utils/utils';
|
|
import utils from '../../utils/utils';
|
|
|
import CheckBox from '../../components/CheckBox';
|
|
import CheckBox from '../../components/CheckBox';
|
|
|
|
|
+import VbeSkeleton from '../../components/VbeSkeleton';
|
|
|
|
|
|
|
|
export default class TopupNew extends Component {
|
|
export default class TopupNew extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
this.state = {
|
|
this.state = {
|
|
|
|
|
+ loading: true,
|
|
|
isAuto: false,
|
|
isAuto: false,
|
|
|
topupList: [],
|
|
topupList: [],
|
|
|
selectIndex: 0,
|
|
selectIndex: 0,
|
|
@@ -37,10 +39,11 @@ export default class TopupNew extends Component {
|
|
|
getUserInfo(info => {
|
|
getUserInfo(info => {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
balance: info?.creditStr
|
|
balance: info?.creditStr
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.getTopupList();
|
|
|
})
|
|
})
|
|
|
}, true);
|
|
}, true);
|
|
|
});
|
|
});
|
|
|
- this.getTopupList();
|
|
|
|
|
/*this.stateListener = AppState.addEventListener("change", state => {
|
|
/*this.stateListener = AppState.addEventListener("change", state => {
|
|
|
if (state == 'active' && this.state.isCallback) {
|
|
if (state == 'active' && this.state.isCallback) {
|
|
|
this.setState({
|
|
this.setState({
|
|
@@ -58,7 +61,6 @@ export default class TopupNew extends Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getTopupList() {
|
|
getTopupList() {
|
|
|
- Dialog.showProgressDialog();
|
|
|
|
|
// apiWallet.getTopUpAmountList()
|
|
// apiWallet.getTopUpAmountList()
|
|
|
apiWallet.getTopUpAmountListV2().then(res => {
|
|
apiWallet.getTopUpAmountListV2().then(res => {
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
@@ -73,7 +75,10 @@ export default class TopupNew extends Component {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
topupList: data
|
|
topupList: data
|
|
|
});
|
|
});
|
|
|
- Dialog.dismissLoading();
|
|
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ loading: false
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -93,7 +98,7 @@ export default class TopupNew extends Component {
|
|
|
//console.log('充值请求参数', params);
|
|
//console.log('充值请求参数', params);
|
|
|
apiWallet.doPaymentV2(params).then(res => {
|
|
apiWallet.doPaymentV2(params).then(res => {
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
|
- if (app.v3.anzPayment) {
|
|
|
|
|
|
|
+ if (app.charge.anzPayment) {
|
|
|
if (res.data.qr) {
|
|
if (res.data.qr) {
|
|
|
startPage(PageList.paynow, { info: res.data.qr, type: 'Topup' });
|
|
startPage(PageList.paynow, { info: res.data.qr, type: 'Topup' });
|
|
|
} else if (res.data.webPaymentUrl) {
|
|
} else if (res.data.webPaymentUrl) {
|
|
@@ -162,6 +167,28 @@ export default class TopupNew extends Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
|
|
+ if (this.state.loading) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <View style={styles.container}>
|
|
|
|
|
+ <View style={styles.loadingItem}>
|
|
|
|
|
+ <VbeSkeleton
|
|
|
|
|
+ style={ui.flex1}
|
|
|
|
|
+ layout={[
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10},
|
|
|
|
|
+ {width: '40%', height: 18, marginTop: 32},
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10, marginTop: 16},
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10, marginTop: 16},
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10, marginTop: 16},
|
|
|
|
|
+ {width: '40%', height: 18, marginTop: 32},
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10, marginTop: 16},
|
|
|
|
|
+ {width: '100%', height: 56, borderRadius: 10, marginTop: 16}
|
|
|
|
|
+ ]}
|
|
|
|
|
+ animationDirection={"horizontalRight"}
|
|
|
|
|
+ />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
return (
|
|
return (
|
|
|
<View style={styles.container}>
|
|
<View style={styles.container}>
|
|
|
<ScrollView style={ui.flex1}>
|
|
<ScrollView style={ui.flex1}>
|
|
@@ -394,5 +421,9 @@ const styles = StyleSheet.create({
|
|
|
paddingTop: 4,
|
|
paddingTop: 4,
|
|
|
paddingBottom: 4,
|
|
paddingBottom: 4,
|
|
|
textDecorationLine: 'underline'
|
|
textDecorationLine: 'underline'
|
|
|
|
|
+ },
|
|
|
|
|
+ loadingItem: {
|
|
|
|
|
+ padding: 16,
|
|
|
|
|
+ flexDirection: 'row'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|