导航菜单

页面标题

页面副标题

用信花 v1.1.3 - RepaymentDetailsActivity.java 源代码

正在查看: 用信花 v1.1.3 应用的 RepaymentDetailsActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.duoshan.loan.ui.repayment.activity;

import android.view.View;
import androidx.lifecycle.Observer;
import com.duoshan.loan.base.BaseActivity;
import com.duoshan.loan.databinding.ActivityRepaymentDetailBinding;
import com.duoshan.loan.dialog.EarlyRepayDialog;
import com.duoshan.loan.dialog.EarlySettleDialog;
import com.duoshan.loan.dialog.SendCodeDialog;
import com.duoshan.loan.ui.auth.bean.NeedAuthCode;
import com.duoshan.loan.ui.repayment.activity.RepaymentDetailsActivity;
import com.duoshan.loan.ui.repayment.bean.RepayStatusBean;
import com.duoshan.loan.ui.repayment.bean.RepayTrialBean;
import com.duoshan.loan.ui.repayment.bean.RepaymentDetailBean;
import com.duoshan.loan.ui.repayment.vm.RepaymentViewModel;
import e2.f;
import e2.m0;
import h4.k;
import java.util.HashMap;
import m4.c;

public class RepaymentDetailsActivity extends BaseActivity<ActivityRepaymentDetailBinding, RepaymentViewModel> {

    public String f2904e;

    public String f2905f;

    public String f2906g;

    public String f2907h;

    public final int f2908i = 60;

    public SendCodeDialog f2909j;

    public long f2910k;

    public class a implements SendCodeDialog.b {

        public final int f2911a;

        public final String f2912b;

        public a(int i4, String str) {
            this.f2911a = i4;
            this.f2912b = str;
        }

        @Override
        public void a(String str) {
            RepaymentDetailsActivity.this.P(this.f2911a, str, this.f2912b);
            m0.b(RepaymentDetailsActivity.this);
        }

        @Override
        public void b(long j4) {
            RepaymentDetailsActivity.this.f2910k = j4;
            RepaymentDetailsActivity.this.D(this.f2911a);
        }
    }

    public void E(View view) {
        e2.a.g(this, this.f2904e, this.f2905f);
    }

    public void F(View view) {
        e2.a.g(this, this.f2904e, this.f2905f);
    }

    public void G(RepaymentDetailBean repaymentDetailBean) {
        if (repaymentDetailBean != null) {
            ((ActivityRepaymentDetailBinding) this.f2431a).tvRepayAmount.setText(repaymentDetailBean.getAmount());
            ((ActivityRepaymentDetailBinding) this.f2431a).tvRepayNo.setText("第" + repaymentDetailBean.getLoanPeriod() + "期");
            ((ActivityRepaymentDetailBinding) this.f2431a).ivOverdue.setVisibility(repaymentDetailBean.getRepayPlanStatus() == 4 ? 0 : 8);
            if (repaymentDetailBean.isNeedRebindBankCard()) {
                ((ActivityRepaymentDetailBinding) this.f2431a).llAbnormalBank.setVisibility(0);
                ((ActivityRepaymentDetailBinding) this.f2431a).llNormalBank.setVisibility(8);
                ((ActivityRepaymentDetailBinding) this.f2431a).stvBindAgain.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        RepaymentDetailsActivity.this.E(view);
                    }
                });
            } else {
                ((ActivityRepaymentDetailBinding) this.f2431a).llAbnormalBank.setVisibility(8);
                ((ActivityRepaymentDetailBinding) this.f2431a).llNormalBank.setVisibility(0);
                ((ActivityRepaymentDetailBinding) this.f2431a).tvBank.setText(repaymentDetailBean.getBankName());
                ((ActivityRepaymentDetailBinding) this.f2431a).ivBankLogo.setImageResource(f.c().b(repaymentDetailBean.getBankName()));
                ((ActivityRepaymentDetailBinding) this.f2431a).llNormalBank.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        RepaymentDetailsActivity.this.F(view);
                    }
                });
            }
            ((ActivityRepaymentDetailBinding) this.f2431a).stvEarlySettle.setVisibility(repaymentDetailBean.isShowEarlySettlementButton() ? 0 : 8);
            ((ActivityRepaymentDetailBinding) this.f2431a).stvRepay.setText(repaymentDetailBean.isShowAdvanceRepaymentButton() ? "提前还款" : "确认还款");
            this.f2907h = repaymentDetailBean.getUserProductBankCardId();
        }
    }

    public void H(RepayTrialBean repayTrialBean) {
        if (repayTrialBean != null) {
            if (repayTrialBean.getRepaymentType() == 1) {
                R(repayTrialBean);
            } else if (repayTrialBean.getRepaymentType() == 2) {
                S(repayTrialBean);
            }
        }
    }

    public void I(NeedAuthCode needAuthCode) {
        if (needAuthCode == null) {
            return;
        }
        if (needAuthCode.getNeedAuthCode() == 1) {
            T(needAuthCode.getRepaymentType(), needAuthCode.getAuthId());
        } else {
            ((RepaymentViewModel) this.f2433c).i(this.f2906g);
        }
    }

    public void J(Boolean bool) {
        if (bool.booleanValue()) {
            ((RepaymentViewModel) this.f2433c).i(this.f2906g);
        }
    }

    public void K(RepayStatusBean repayStatusBean) {
        int repayStatus = repayStatusBean.getRepayStatus();
        if (repayStatus == 0) {
            k.u("待还款");
            return;
        }
        if (repayStatus == 1) {
            e2.a.A(this, this.f2906g);
            finish();
            return;
        }
        if (repayStatus == 2) {
            e2.a.D(this);
            finish();
        } else if (repayStatus == 3) {
            e2.a.z(this, "");
            finish();
        } else {
            if (repayStatus != 4) {
                return;
            }
            k.u("逾期中");
        }
    }

    public void L(View view) {
        Q(2);
    }

    public void M(View view) {
        String charSequence = ((ActivityRepaymentDetailBinding) this.f2431a).stvRepay.getText().toString();
        charSequence.hashCode();
        if (charSequence.equals("提前还款")) {
            Q(1);
        } else if (charSequence.equals("确认还款")) {
            D(0);
        }
    }

    public void N(View view) {
        D(1);
    }

    public void O(View view) {
        D(2);
    }

    public final void D(int i4) {
        HashMap hashMap = new HashMap();
        hashMap.put("userProductRepayId", this.f2905f);
        hashMap.put("userProductRepayPlanId", this.f2906g);
        hashMap.put("userProductBankCardId", this.f2907h);
        hashMap.put("repaymentTypeEnum", Integer.valueOf(i4));
        ((RepaymentViewModel) this.f2433c).e(hashMap, i4);
    }

    public final void P(int i4, String str, String str2) {
        HashMap hashMap = new HashMap();
        hashMap.put("userProductRepayId", this.f2905f);
        hashMap.put("userProductRepayPlanId", this.f2906g);
        hashMap.put("repaymentTypeEnum", Integer.valueOf(i4));
        hashMap.put("authCode", str);
        hashMap.put("authId", str2);
        ((RepaymentViewModel) this.f2433c).k(hashMap);
    }

    public final void Q(int i4) {
        HashMap hashMap = new HashMap();
        hashMap.put("userProductRepayId", this.f2905f);
        hashMap.put("userProductRepayPlanId", this.f2906g);
        hashMap.put("repaymentTypeEnum", Integer.valueOf(i4));
        ((RepaymentViewModel) this.f2433c).l(hashMap, i4);
    }

    public final void R(RepayTrialBean repayTrialBean) {
        new c.b(this).r(new EarlyRepayDialog(this, repayTrialBean, new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                RepaymentDetailsActivity.this.N(view);
            }
        })).J();
    }

    public final void S(RepayTrialBean repayTrialBean) {
        new c.b(this).r(new EarlySettleDialog(this, repayTrialBean, new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                RepaymentDetailsActivity.this.O(view);
            }
        })).J();
    }

    public final void T(int i4, String str) {
        SendCodeDialog sendCodeDialog = this.f2909j;
        if (sendCodeDialog == null) {
            this.f2909j = new SendCodeDialog(this, "短信校验", "还款前需要进行短信校验", new a(i4, str));
        } else {
            sendCodeDialog.setCodeTime(60);
        }
        new c.b(this).r(this.f2909j).J();
    }

    @Override
    public void g() {
        this.f2904e = getIntent().getStringExtra("userProductLoanId");
        this.f2905f = getIntent().getStringExtra("userProductRepayId");
        this.f2906g = getIntent().getStringExtra("userProductRepayPlanId");
    }

    @Override
    public void i() {
        ((RepaymentViewModel) this.f2433c).f2924g.observe(this, new Observer() {
            @Override
            public final void onChanged(Object obj) {
                RepaymentDetailsActivity.this.G((RepaymentDetailBean) obj);
            }
        });
        ((RepaymentViewModel) this.f2433c).f2925h.observe(this, new Observer() {
            @Override
            public final void onChanged(Object obj) {
                RepaymentDetailsActivity.this.H((RepayTrialBean) obj);
            }
        });
        ((RepaymentViewModel) this.f2433c).f2926i.observe(this, new Observer() {
            @Override
            public final void onChanged(Object obj) {
                RepaymentDetailsActivity.this.I((NeedAuthCode) obj);
            }
        });
        ((RepaymentViewModel) this.f2433c).f2927j.observe(this, new Observer() {
            @Override
            public final void onChanged(Object obj) {
                RepaymentDetailsActivity.this.J((Boolean) obj);
            }
        });
        ((RepaymentViewModel) this.f2433c).f2928k.observe(this, new Observer() {
            @Override
            public final void onChanged(Object obj) {
                RepaymentDetailsActivity.this.K((RepayStatusBean) obj);
            }
        });
    }

    @Override
    public void initView() {
        n("还款详情");
        ((ActivityRepaymentDetailBinding) this.f2431a).stvEarlySettle.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                RepaymentDetailsActivity.this.L(view);
            }
        });
        ((ActivityRepaymentDetailBinding) this.f2431a).stvRepay.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                RepaymentDetailsActivity.this.M(view);
            }
        });
    }

    @Override
    public void onResume() {
        super.onResume();
        ((RepaymentViewModel) this.f2433c).g(this.f2906g);
    }
}