导航菜单

页面标题

页面副标题

⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 - MT1ACT.java 源代码

正在查看: ⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 应用的 MT1ACT.java JAVA 源代码文件

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


package com.yuxianghua.ui.activitys;

import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import butterknife.BindView;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
import com.base.commonlibrary.views.TitleLayout;
import com.yuxianghua.mjyp.BMAG01ACT;
import com.yuxianghua.mjyp.app.api.Api;
import com.yuxianghua.mjyp.app.api.AppConfig;
import com.yuxianghua.mjyp.app.base.BaseBindActivity;
import com.yuxianghua.mjyp.app.base.RxSubscriber;
import com.yuxianghua.ui.bean.ConfigBean;
import com.yuxianghua.ui.bean.MyBorrowBean;
import java.text.SimpleDateFormat;
import java.util.Date;
import rx.Subscriber;
import yhgjgdf.ijnhjfyd.ikbujfjfnjkif.R;

public class MT1ACT extends BaseBindActivity {

    @BindView(R.id.btn_ok)
    Button btnOk;
    private CountDownTimer countDownTimer;

    @BindView(R.id.fail_reason)
    TextView failReason;

    @BindView(R.id.img_status)
    ImageView imgStatus;

    @BindView(R.id.kef_tel)
    TextView kefTel;

    @BindView(R.id.kef_time)
    TextView kefTime;

    @BindView(R.id.kef_qq)
    TextView kef_qq;

    @BindView(R.id.kef_wx)
    TextView kef_wx;
    private String money;
    private String msg;
    private MyBorrowBean myBorrow;

    @BindView(R.id.time)
    TextView time;

    @BindView(R.id.tip)
    TextView tip;

    @BindView(R.id.tip_fail)
    TextView tipFail;

    @BindView(R.id.tip_time)
    TextView tipTime;

    @BindView(R.id.title)
    TitleLayout title;

    @BindView(R.id.tv_status)
    TextView tvStatus;

    @Override
    protected boolean canLoadMore() {
        return false;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_refund_status;
    }

    @Override
    protected void loadMore() {
    }

    @Override
    protected void refresh() {
    }

    protected void startCountDown() {
        if (this.countDownTimer == null) {
            this.countDownTimer = new CountDownTimer(10000L, 1000L) {
                @Override
                public void onTick(long j) {
                    if (j == 25000) {
                        MT1ACT.this.repaymentOrder(false);
                    }
                }

                @Override
                public void onFinish() {
                    MT1ACT.this.repaymentOrder(false);
                }
            };
        }
        this.countDownTimer.start();
    }

    @Override
    public void initPresenter() {
        this.btnOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String charSequence = MT1ACT.this.btnOk.getText().toString();
                if (MT1ACT.this.getResources().getString(R.string.continue_pay).equals(charSequence)) {
                    MT1ACT.this.finish();
                    return;
                }
                if (MT1ACT.this.getResources().getString(R.string.refresh_see_result).equals(charSequence)) {
                    MT1ACT.this.repaymentOrder(true);
                    return;
                }
                BMAG01ACT bmag01act = (BMAG01ACT) AppActivityManager.getAppManager().getActivity(BMAG01ACT.class);
                MT1ACT.this.mRxManager.post(AppConfig.Status, "登录");
                bmag01act.onCheckPosition(0);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                MT1ACT.this.finish();
            }
        });
    }

    @Override
    public void initView(Bundle bundle) {
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            int i = extras.getInt(NotificationCompat.CATEGORY_STATUS, 0);
            this.msg = extras.getString(NotificationCompat.CATEGORY_MESSAGE, "");
            this.myBorrow = (MyBorrowBean) extras.getSerializable("myBorrow");
            this.money = this.myBorrow.getRepTotalAmount() + "";
            setDataView(i);
        }
        config();
        repaymentOrder(true);
        startCountDown();
    }

    public void setDataView(int i) {
        this.time.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
        if (i == 1) {
            this.tvStatus.setText(getResources().getString(R.string.payment_successful));
            this.mRxManager.post(AppConfig.Status, "登录");
            this.imgStatus.setImageResource(R.mipmap.refund_success);
            this.tipTime.setText(getResources().getString(R.string.payment_time));
            this.tipFail.setText(getResources().getString(R.string.reimbursement_amount));
            this.failReason.setText(getString(R.string.money_fh) + this.money);
            this.btnOk.setText(getResources().getString(R.string.continue_apply2));
            this.tip.setText(getResources().getString(R.string.credit_improved));
            return;
        }
        if (i == 2) {
            this.tvStatus.setText(getResources().getString(R.string.repayment_process_wait));
            this.mRxManager.post(AppConfig.Status, "登录");
            this.imgStatus.setImageResource(R.mipmap.reing);
            this.tipTime.setText(getResources().getString(R.string.payment_time));
            this.tipFail.setText(getResources().getString(R.string.reimbursement_amount));
            this.failReason.setText(getString(R.string.money_fh) + this.money);
            this.btnOk.setText(getResources().getString(R.string.refresh_see_result));
            this.tip.setText(getResources().getString(R.string.wait_for_bank));
            return;
        }
        this.tvStatus.setText(getResources().getString(R.string.repay_failure));
        this.tipTime.setText(getResources().getString(R.string.operate_time));
        this.tipFail.setText(getResources().getString(R.string.faliure_reason));
        this.failReason.setText(this.msg);
        this.btnOk.setText(getResources().getString(R.string.continue_pay));
        this.tip.setText(getResources().getString(R.string.value_your_credit));
    }

    protected void repaymentOrder(boolean z) {
        if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
            MyBorrowBean myBorrowBean = this.myBorrow;
            if (myBorrowBean != null) {
                this.mRxManager.add(Api.getDefault().checkRepaymentStatus(myBorrowBean.getOrderNo()).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult>(this.mContext, z) {
                    @Override
                    public void _onNext(BaseResult baseResult) {
                        if (baseResult.getCode() == 2023) {
                            MT1ACT.this.setDataView(1);
                            return;
                        }
                        if (baseResult.getCode() == 2022) {
                            MT1ACT.this.setDataView(2);
                            return;
                        }
                        if (baseResult.getCode() == 2005) {
                            MT1ACT.this.msg = baseResult.getMessage();
                            MT1ACT.this.setDataView(0);
                        } else {
                            if (baseResult.getCode() == 200) {
                                MT1ACT.this.setDataView(1);
                                return;
                            }
                            MT1ACT.this.msg = baseResult.getMessage();
                            MT1ACT.this.setDataView(0);
                        }
                    }

                    @Override
                    protected void _onError(String str) {
                        MT1ACT.this.showShortToast(str);
                    }
                }));
            } else {
                showShortToast(getResources().getString(R.string.net_error));
            }
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        stopCountDown();
    }

    private void stopCountDown() {
        CountDownTimer countDownTimer = this.countDownTimer;
        if (countDownTimer != null) {
            countDownTimer.cancel();
            this.countDownTimer = null;
        }
    }

    protected void config() {
        this.mRxManager.add(Api.getDefault().getServiceConfig().compose(RxHelper.handleResult()).subscribe((Subscriber<? super R>) new RxSubscriber<ConfigBean>(this.mContext, false) {
            @Override
            protected void _onError(String str) {
            }

            @Override
            public void _onNext(ConfigBean configBean) {
                String tel = configBean.getTel();
                String time = configBean.getTime();
                SPUtils.putData(AppConfig.CACHE.TEL, tel);
                String qq = configBean.getQq();
                String wx = configBean.getWx();
                if (!RegexUtil.isEmpty(tel)) {
                    MT1ACT.this.kefTel.setText(MT1ACT.this.getResources().getString(R.string.custom_service_tel) + tel);
                }
                if (!RegexUtil.isEmpty(time)) {
                    MT1ACT.this.kefTime.setText(MT1ACT.this.getResources().getString(R.string.service_time) + time);
                }
                if (!RegexUtil.isEmpty(wx)) {
                    MT1ACT.this.kef_wx.setText(MT1ACT.this.getResources().getString(R.string.custom_wx) + wx);
                }
                if (RegexUtil.isEmpty(qq)) {
                    return;
                }
                MT1ACT.this.kef_qq.setText(MT1ACT.this.getResources().getString(R.string.customm_service_qq) + qq);
            }
        }));
    }
}