|
@@ -8,8 +8,9 @@ import apiWallet from '../../api/apiWallet';
|
|
|
import BadgeSelectItem from '../../components/BadgeSelectItem';
|
|
import BadgeSelectItem from '../../components/BadgeSelectItem';
|
|
|
import Button, { ElevationObject } from '../../components/Button';
|
|
import Button, { ElevationObject } from '../../components/Button';
|
|
|
import Dialog from '../../components/Dialog';
|
|
import Dialog from '../../components/Dialog';
|
|
|
|
|
+import { PaymentDefault } from '../payment/PaymentConfig';
|
|
|
import { PageList } from '../Router';
|
|
import { PageList } from '../Router';
|
|
|
-import { Balance, PaymentDefault } from './Payment';
|
|
|
|
|
|
|
+import { Balance } from './Payment';
|
|
|
import TopupPaythod from './TopupPaythod';
|
|
import TopupPaythod from './TopupPaythod';
|
|
|
|
|
|
|
|
export default class TopupNew extends Component {
|
|
export default class TopupNew extends Component {
|
|
@@ -37,7 +38,8 @@ export default class TopupNew extends Component {
|
|
|
|
|
|
|
|
getTopupList() {
|
|
getTopupList() {
|
|
|
Dialog.showProgressDialog();
|
|
Dialog.showProgressDialog();
|
|
|
- apiWallet.getTopUpAmountList().then(res => {
|
|
|
|
|
|
|
+ // apiWallet.getTopUpAmountList()
|
|
|
|
|
+ apiWallet.getTopUpAmountListV2().then(res => {
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
|
this.setState({
|
|
this.setState({
|
|
@@ -45,6 +47,11 @@ export default class TopupNew extends Component {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
|
|
+ toastShort(err)
|
|
|
|
|
+ const data = apiWallet.getTempAmountListV2();
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ topupList: data
|
|
|
|
|
+ });
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -53,8 +60,10 @@ export default class TopupNew extends Component {
|
|
|
* 2C2P充值
|
|
* 2C2P充值
|
|
|
*/
|
|
*/
|
|
|
topup2() {
|
|
topup2() {
|
|
|
|
|
+ const topup = this.state.topupList[this.state.selectIndex]
|
|
|
const params = {
|
|
const params = {
|
|
|
- payAmount: this.state.topupList[this.state.selectIndex]?.key,
|
|
|
|
|
|
|
+ currency: topup?.currency,
|
|
|
|
|
+ payAmount: topup?.amount
|
|
|
}
|
|
}
|
|
|
apiWallet.doPaymentV2(params).then(res => {
|
|
apiWallet.doPaymentV2(params).then(res => {
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
@@ -73,8 +82,10 @@ export default class TopupNew extends Component {
|
|
|
* FOMO充值
|
|
* FOMO充值
|
|
|
*/
|
|
*/
|
|
|
topup() {
|
|
topup() {
|
|
|
|
|
+ const topup = this.state.topupList[this.state.selectIndex]
|
|
|
const params = {
|
|
const params = {
|
|
|
- payAmount: this.state.topupList[this.state.selectIndex]?.key,
|
|
|
|
|
|
|
+ currency: topup?.currency,
|
|
|
|
|
+ payAmount: topup?.amount,
|
|
|
fomoPayType: this.state.payType.fomoPayType
|
|
fomoPayType: this.state.payType.fomoPayType
|
|
|
}
|
|
}
|
|
|
//console.log('params',params);
|
|
//console.log('params',params);
|
|
@@ -108,11 +119,11 @@ export default class TopupNew extends Component {
|
|
|
return (
|
|
return (
|
|
|
<View style={styles.container}>
|
|
<View style={styles.container}>
|
|
|
<View style={styles.headerView}>
|
|
<View style={styles.headerView}>
|
|
|
- <Balance balance={this.state.balance}/>
|
|
|
|
|
|
|
+ <Balance balanceText={this.state.balance}/>
|
|
|
</View>
|
|
</View>
|
|
|
<View style={styles.contentView}>
|
|
<View style={styles.contentView}>
|
|
|
<View style={styles.topupView}>
|
|
<View style={styles.topupView}>
|
|
|
- <WalletTitle>Choose Credit Value</WalletTitle>
|
|
|
|
|
|
|
+ <WalletTitle>{$t('wallet.titleChooseCreditValue')}</WalletTitle>
|
|
|
<View style={styles.topupItems}>
|
|
<View style={styles.topupItems}>
|
|
|
{ this.state.topupList.map((item, index) => {
|
|
{ this.state.topupList.map((item, index) => {
|
|
|
return (
|
|
return (
|
|
@@ -125,8 +136,12 @@ export default class TopupNew extends Component {
|
|
|
selectIndex: index
|
|
selectIndex: index
|
|
|
})
|
|
})
|
|
|
}}>
|
|
}}>
|
|
|
- <Text style={[styles.topupText, index == this.state.selectIndex && {color: colorAccent}]}>{currency}{item.key}</Text>
|
|
|
|
|
|
|
+ <Text style={[styles.topupText, index == this.state.selectIndex && {color: colorAccent}]}>
|
|
|
|
|
+ {item.amount}
|
|
|
|
|
+ <Text style={{fontSize: 16}}> {item.currency}</Text>
|
|
|
|
|
+ </Text>
|
|
|
</BadgeSelectItem>
|
|
</BadgeSelectItem>
|
|
|
|
|
+
|
|
|
);
|
|
);
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -134,7 +149,7 @@ export default class TopupNew extends Component {
|
|
|
</View>
|
|
</View>
|
|
|
{ !PaymentDefault.is2c2p &&
|
|
{ !PaymentDefault.is2c2p &&
|
|
|
<View style={styles.topupView}>
|
|
<View style={styles.topupView}>
|
|
|
- <WalletTitle>Choose Payment Type</WalletTitle>
|
|
|
|
|
|
|
+ <WalletTitle>{$t('wallet.titleChoosePaymentType')}</WalletTitle>
|
|
|
<TopupPaythod
|
|
<TopupPaythod
|
|
|
onChange={type => {
|
|
onChange={type => {
|
|
|
this.setState({
|
|
this.setState({
|
|
@@ -147,7 +162,7 @@ export default class TopupNew extends Component {
|
|
|
<View style={ui.flex1}></View>
|
|
<View style={ui.flex1}></View>
|
|
|
<View style={styles.buttonView}>
|
|
<View style={styles.buttonView}>
|
|
|
<Button
|
|
<Button
|
|
|
- text='Purchase'
|
|
|
|
|
|
|
+ text={$t('wallet.btnPurchase')}
|
|
|
elevation={1.5}
|
|
elevation={1.5}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
PaymentDefault.is2c2p
|
|
PaymentDefault.is2c2p
|
|
@@ -233,10 +248,9 @@ const styles = StyleSheet.create({
|
|
|
...ElevationObject(5)
|
|
...ElevationObject(5)
|
|
|
},
|
|
},
|
|
|
topupText: {
|
|
topupText: {
|
|
|
- height: 60,
|
|
|
|
|
fontSize: 18,
|
|
fontSize: 18,
|
|
|
- lineHeight: 60,
|
|
|
|
|
- color: textPrimary
|
|
|
|
|
|
|
+ color: textPrimary,
|
|
|
|
|
+ ...$padding(20, 0)
|
|
|
},
|
|
},
|
|
|
right: {
|
|
right: {
|
|
|
marginLeft: 16
|
|
marginLeft: 16
|