|
|
@@ -73,7 +73,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
private int withdrawCount;
|
|
|
private float balanceAmount;//余额
|
|
|
|
|
|
- private UserEntity userEntity;
|
|
|
+ private String fromToken;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
|
@@ -87,6 +87,10 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
|
|
|
@Override
|
|
|
public void initView() {
|
|
|
+ fromToken = getIntent().getStringExtra("fromToken");
|
|
|
+ if(TextUtils.isEmpty(fromToken)){
|
|
|
+ fromToken = SpUtils.getToken(this);
|
|
|
+ }
|
|
|
activity = this;
|
|
|
TitleBarUtils
|
|
|
.getInstance()
|
|
|
@@ -120,8 +124,8 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
}
|
|
|
});
|
|
|
showProgress();
|
|
|
- presenter.getCanWithdrawAmount();
|
|
|
- presenter.getWithdrawAmountOption();
|
|
|
+ presenter.getCanWithdrawAmount(fromToken);
|
|
|
+ presenter.getWithdrawAmountOption(fromToken);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -148,18 +152,19 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
}
|
|
|
|
|
|
public void mInitData() {
|
|
|
- userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
- if (userEntity != null) {
|
|
|
- ViewUtil.setText(weixin_name_tv, userEntity.getWx_nickname());
|
|
|
- }
|
|
|
- setBalanceAmount();
|
|
|
+ CommonUtil.getInstance().getUserInfo(fromToken, entity->{
|
|
|
+ if (entity != null) {
|
|
|
+ ViewUtil.setText(weixin_name_tv, entity.getWx_nickname());
|
|
|
+ }
|
|
|
+ setBalanceAmount();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@OnClick({R.id.withdrawal_sure})
|
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
|
|
case R.id.withdrawal_sure:
|
|
|
- ActPayPassword.verifyPwd(this, SpUtils.getToken(this), "",(ret)->{
|
|
|
+ ActPayPassword.verifyPwd(this, fromToken, "",(ret)->{
|
|
|
if(!ret){
|
|
|
doWithdrawal();
|
|
|
}
|
|
|
@@ -182,7 +187,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
jsonObject.put("amount", Float.valueOf(amount));
|
|
|
jsonObject.put("type", 1);
|
|
|
showProgress();
|
|
|
- presenter.goWithdrawal(jsonObject);
|
|
|
+ presenter.goWithdrawal(fromToken, jsonObject);
|
|
|
} else {
|
|
|
G.showToast(R.string.loading_data);
|
|
|
}
|
|
|
@@ -207,7 +212,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
|
|
|
public void updateView(Object o) {
|
|
|
hideProgress();
|
|
|
CommonUtil.getInstance().updateUserInfo(null);
|
|
|
- presenter.getCanWithdrawAmount();
|
|
|
+ presenter.getCanWithdrawAmount(fromToken);
|
|
|
Jump2View.getInstance().goWithdrawalResultview(activity, NumberFormatUtils.parseFloat(amount));
|
|
|
}
|
|
|
|