|
@@ -15,10 +15,13 @@ import com.liaobo.im.bean.CardModel;
|
|
|
import com.liaobo.im.helper.DialogHelper;
|
|
|
import com.liaobo.im.ui.base.BaseActivity;
|
|
|
import com.liaobo.im.ui.me.redpacket.ChangePayPasswordActivity;
|
|
|
+import com.liaobo.im.ui.me.redpacket.PayPasswordVerifyDialog;
|
|
|
import com.liaobo.im.util.EventBusHelper;
|
|
|
+import com.liaobo.im.util.Md5Util;
|
|
|
import com.liaobo.im.util.ToastUtil;
|
|
|
import com.liaobo.im.xuan.xuanhttplibrary.okhttp.HttpUtils;
|
|
|
-import com.liaobo.im.xuan.xuanhttplibrary.okhttp.callback.JsonCallback;
|
|
|
+import com.liaobo.im.xuan.xuanhttplibrary.okhttp.callback.BaseCallback;
|
|
|
+import com.liaobo.im.xuan.xuanhttplibrary.okhttp.result.ObjectResult;
|
|
|
|
|
|
import de.greenrobot.event.Subscribe;
|
|
|
import de.greenrobot.event.ThreadMode;
|
|
@@ -79,6 +82,9 @@ public class BankCardTXActivity extends BaseActivity implements View.OnClickList
|
|
|
});
|
|
|
|
|
|
exit_btn = (Button) findViewById(R.id.exit_btn);
|
|
|
+ exit_btn.setOnClickListener(v -> {
|
|
|
+
|
|
|
+ });
|
|
|
exit_btn.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
@@ -87,7 +93,8 @@ public class BankCardTXActivity extends BaseActivity implements View.OnClickList
|
|
|
ToastUtil.showToast(BankCardTXActivity.this, R.string.input_card_num);
|
|
|
return;
|
|
|
}
|
|
|
- getBindInfo();
|
|
|
+ showPayPassword();
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -95,39 +102,50 @@ public class BankCardTXActivity extends BaseActivity implements View.OnClickList
|
|
|
tv_card = (TextView) findViewById(R.id.tv_card);
|
|
|
|
|
|
}
|
|
|
+ private void showPayPassword(){
|
|
|
+ PayPasswordVerifyDialog dialog = new PayPasswordVerifyDialog(this);
|
|
|
+ dialog.setOnInputFinishListener(password -> {
|
|
|
+ getBindInfo(password);
|
|
|
+ });
|
|
|
+ dialog.show();
|
|
|
+ }
|
|
|
|
|
|
// 获取用户的设置状态
|
|
|
- private void getBindInfo() {
|
|
|
+ private void getBindInfo(String payPassword) {
|
|
|
// 入参 String bankCardId 银行卡id Double amount 金额
|
|
|
+ String md5PayPassword = Md5Util.toMD5(payPassword);
|
|
|
DialogHelper.showDefaulteMessageProgressDialog(this);
|
|
|
HttpUtils.get().url(coreManager.getConfig().TX_CARD)
|
|
|
.params("access_token", coreManager.getSelfStatus().accessToken)
|
|
|
.params("bankCardId", mCard)
|
|
|
.params("amount", amount)
|
|
|
+ .params("payPassword",md5PayPassword)
|
|
|
.build()
|
|
|
- .execute(new JsonCallback() {
|
|
|
-
|
|
|
+ .execute(new BaseCallback<Void>(Void.class) {
|
|
|
@Override
|
|
|
- public void onResponse(String result) {
|
|
|
+ public void onResponse(ObjectResult<Void> result) {
|
|
|
+
|
|
|
DialogHelper.dismissProgressDialog();
|
|
|
- ToastUtil.showToast(BankCardTXActivity.this, "提现成功");
|
|
|
- Intent intent = new Intent(BankCardTXActivity.this, TXDetailActivity.class);
|
|
|
- intent.putExtra("amount", amount);
|
|
|
- intent.putExtra("card", mCard.substring(mCard.length()-4, mCard.length()));
|
|
|
- startActivity(intent);
|
|
|
- finish();
|
|
|
-// JSONObject json = JSONObject.parseObject(result);
|
|
|
-// JSONArray array = json.getJSONArray("data");
|
|
|
-// isBandWx = array != null && array.size() > 0;
|
|
|
-// updateUi();
|
|
|
- }
|
|
|
+ if (result.getResultCode()==1){
|
|
|
+ ToastUtil.showToast(BankCardTXActivity.this, "提现成功");
|
|
|
+ Intent intent = new Intent(BankCardTXActivity.this, TXDetailActivity.class);
|
|
|
+ intent.putExtra("amount", amount);
|
|
|
+ intent.putExtra("card", mCard.substring(mCard.length()-4, mCard.length()));
|
|
|
+ startActivity(intent);
|
|
|
+ finish();
|
|
|
+ }else {
|
|
|
+ ToastUtil.showToast(BankCardTXActivity.this, result.getResultMsg());
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ }
|
|
|
@Override
|
|
|
public void onError(Call call, Exception e) {
|
|
|
DialogHelper.dismissProgressDialog();
|
|
|
// updateUi();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|