导航菜单

页面标题

页面副标题

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

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

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


package com.yuxianghua.ui.activitys;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.base.commonlibrary.BaseApplication;
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.baseview.BaseDialogFragment;
import com.base.commonlibrary.baseview.recyclerview.MultiItemTypeAdapter;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import com.base.commonlibrary.utils.MD5Utils;
import com.base.commonlibrary.utils.RSAUtils;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
import com.base.commonlibrary.utils.ToastUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.yuxianghua.mjyp.BMAG01ACT;
import com.yuxianghua.mjyp.adapters.ChoosePayAdapter;
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.mjyp.app.fragment.LoginPwdDialog;
import com.yuxianghua.ui.activitys.MTT0Act;
import com.yuxianghua.ui.bean.EncForm;
import com.yuxianghua.ui.bean.MyBorrowBean;
import com.yuxianghua.ui.bean.OrederPayBean;
import com.yuxianghua.ui.bean.PostponeBean;
import com.yuxianghua.ui.bean.Result;
import com.yuxianghua.ui.bean.VerifyCodeBean;
import com.yuxianghua.ui.views.SureAndCancelDialog;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import rx.Subscriber;
import yhgjgdf.ijnhjfyd.ikbujfjfnjkif.R;

public class MTT0Act extends BaseBindActivity {
    private int TYPE;
    ChoosePayAdapter choosePayAdapter;
    private List<OrederPayBean.ResultBean> datas = new ArrayList();
    int id;
    private MyBorrowBean myBorrow;
    private String orderNo;
    private PostponeBean postponeBean;

    @BindView(R.id.recycleView)
    RecyclerView recycleView;

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

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

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

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

    @Override
    public void initPresenter() {
    }

    @Override
    protected void loadMore() {
    }

    @Override
    protected void refresh() {
    }

    @Override
    public void initView(Bundle bundle) {
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            this.TYPE = extras.getInt("TYPE", 1);
            this.id = extras.getInt("id", 1);
            if (this.TYPE == 1) {
                MyBorrowBean myBorrowBean = (MyBorrowBean) extras.getSerializable("myBorrow");
                this.myBorrow = myBorrowBean;
                this.orderNo = myBorrowBean.getOrderNo();
            } else {
                PostponeBean postponeBean = (PostponeBean) extras.getSerializable("myBorrow");
                this.postponeBean = postponeBean;
                this.orderNo = postponeBean.getOrderNo();
            }
        }
        this.choosePayAdapter = new ChoosePayAdapter(this.mContext, R.layout.item_choose_pay, this.datas);
        this.recycleView.setLayoutManager(new LinearLayoutManager(this.mContext));
        this.recycleView.setAdapter(this.choosePayAdapter);
        this.choosePayAdapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
            @Override
            public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
                return false;
            }

            @Override
            public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
                if (i < 0 || i >= MTT0Act.this.datas.size()) {
                    return;
                }
                MTT0Act.this.onClick((OrederPayBean.ResultBean) MTT0Act.this.datas.get(i));
            }
        });
        loadData(this.id, true);
    }

    private void loadData(int i, boolean z) {
        this.mRxManager.add(Api.getDefault().payTypeList(i).compose(RxHelper.handleResult()).subscribe((Subscriber<? super R>) new RxSubscriber<List<OrederPayBean.ResultBean>>(this.mContext, z) {
            @Override
            public void _onNext(List<OrederPayBean.ResultBean> list) {
                if (list != null) {
                    MTT0Act.this.datas.clear();
                    MTT0Act.this.choosePayAdapter.addAll(list);
                    MTT0Act.this.choosePayAdapter.notifyDataSetChanged();
                    MTT0Act.this.stopLoading();
                }
            }

            @Override
            protected void _onError(String str) {
                MTT0Act.this.showShortToast(str);
            }
        }));
    }

    protected void onClick(OrederPayBean.ResultBean resultBean) {
        resultBean.getId();
        if (this.TYPE == 1) {
            repaymentOrder(resultBean);
        } else {
            xQData(resultBean);
        }
    }

    protected void repaymentOrder(final OrederPayBean.ResultBean resultBean) {
        if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
            MyBorrowBean myBorrowBean = this.myBorrow;
            if (myBorrowBean != null) {
                myBorrowBean.setPayType(resultBean.getId());
                String json = new Gson().toJson(this.myBorrow);
                long currentTimeMillis = System.currentTimeMillis();
                String uuid = UUID.randomUUID().toString();
                String str = json + "@" + uuid + "@" + currentTimeMillis;
                String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, AppConfig.md5key));
                StringBuilder sb = new StringBuilder();
                sb.append(currentTimeMillis);
                sb.append("");
                this.mRxManager.add(Api.getDefault().repaymentOrderEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult<Result>>(this.mContext, true) {
                    @Override
                    public void _onNext(BaseResult<Result> baseResult) {
                        if (baseResult.getCode() == 3039) {
                            MTT0Act.this.showShortToast(baseResult.getMessage());
                            MTT0Act.this.startActivity(MTG0ACT.class);
                            return;
                        }
                        if (baseResult.getCode() == 200) {
                            String message = baseResult.getMessage();
                            String payUrl = baseResult.getResult().getPayUrl();
                            Bundle bundle = new Bundle();
                            bundle.putString("title", MTT0Act.this.getResources().getString(R.string.pay));
                            bundle.putString("url", payUrl);
                            bundle.putSerializable("myBorrow", MTT0Act.this.myBorrow);
                            Intent intent = new Intent("android.intent.action.VIEW");
                            if (resultBean.getJumpBorr() == 0 && intent.resolveActivity(BaseApplication.getContext().getPackageManager()) != null) {
                                intent.setData(Uri.parse(payUrl));
                                MTT0Act.this.startActivity(intent);
                                return;
                            } else {
                                MTT0Act.this.showShortToast(message);
                                MTT0Act.this.startActivity(MT7ACT.class, bundle);
                                MTT0Act.this.finish();
                                return;
                            }
                        }
                        if (baseResult.getCode() == 2022) {
                            Bundle bundle2 = new Bundle();
                            bundle2.putInt(NotificationCompat.CATEGORY_STATUS, 2);
                            bundle2.putString(NotificationCompat.CATEGORY_MESSAGE, MTT0Act.this.myBorrow.getRepaymentAmount() + "");
                            bundle2.putSerializable("myBorrow", MTT0Act.this.myBorrow);
                            MTT0Act.this.startActivity(MT1ACT.class, bundle2);
                            return;
                        }
                        if (baseResult.getCode() == 202) {
                            MTT0Act.this.showSmsDialog();
                            return;
                        }
                        Bundle bundle3 = new Bundle();
                        bundle3.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                        bundle3.putSerializable("myBorrow", MTT0Act.this.myBorrow);
                        bundle3.putString(NotificationCompat.CATEGORY_MESSAGE, baseResult.getMessage());
                        MTT0Act.this.startActivity(MT1ACT.class, bundle3);
                    }

                    @Override
                    protected void _onError(String str2) {
                        Bundle bundle = new Bundle();
                        bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                        bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
                        MTT0Act.this.startActivity(MT1ACT.class, bundle);
                    }
                }));
                return;
            }
            showShortToast(getResources().getString(R.string.net_error));
        }
    }

    public void showSmsDialog() {
        final LoginPwdDialog newInstance = LoginPwdDialog.newInstance((String) SPUtils.getData(AppConfig.CACHE.PHONE, ""));
        newInstance.setOnButtonOkClickListener(new BaseDialogFragment.OnButtonOkClickListener() {
            @Override
            public void onClick(View view, String str) {
                if (RegexUtil.isEmpty(str)) {
                    return;
                }
                MTT0Act.this.deductVerifyCode(str);
                newInstance.dismiss();
            }
        });
        getSupportFragmentManager().beginTransaction().add(newInstance, "LoginPwdDialog").commitAllowingStateLoss();
    }

    private void xQData(final OrederPayBean.ResultBean resultBean) {
        PostponeBean postponeBean = this.postponeBean;
        if (postponeBean != null) {
            postponeBean.setPayType(resultBean.getId());
            String json = new Gson().toJson(this.postponeBean);
            long currentTimeMillis = System.currentTimeMillis();
            String uuid = UUID.randomUUID().toString();
            String str = json + "@" + uuid + "@" + currentTimeMillis;
            String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, AppConfig.md5key));
            StringBuilder sb = new StringBuilder();
            sb.append(currentTimeMillis);
            sb.append("");
            this.mRxManager.add(Api.getDefault().postponeCreateEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult<PostponeBean>>(this.mContext, true) {
                @Override
                public void _onNext(BaseResult<PostponeBean> baseResult) {
                    if (baseResult.getCode() == 202) {
                        MTT0Act.this.showSmsDialog();
                        return;
                    }
                    if (baseResult.getCode() == 2029) {
                        MTT0Act.this.showShortToast(baseResult.getMessage());
                        return;
                    }
                    if (baseResult.getCode() == 1112) {
                        MTT0Act.this.showShortToast(baseResult.getMessage());
                        return;
                    }
                    PostponeBean result = baseResult.getResult();
                    if (result == null) {
                        return;
                    }
                    String payUrl = result.getPayUrl();
                    Bundle bundle = new Bundle();
                    bundle.putString("title", MTT0Act.this.getResources().getString(R.string.renewal));
                    bundle.putString("url", payUrl);
                    bundle.putSerializable("myBorrow", result);
                    Intent intent = new Intent("android.intent.action.VIEW");
                    if (resultBean.getJumpBorr() == 0 && intent.resolveActivity(BaseApplication.getContext().getPackageManager()) != null) {
                        intent.setData(Uri.parse(payUrl));
                        MTT0Act.this.startActivity(intent);
                    } else {
                        MTT0Act.this.startActivity(MT7ACT.class, bundle);
                        MTT0Act.this.finish();
                    }
                }

                @Override
                protected void _onError(String str2) {
                    MTT0Act.this.showShortToast(str2);
                    Bundle bundle = new Bundle();
                    bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                    bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
                    bundle.putString(AppConfig.ORDERID, MTT0Act.this.orderNo);
                    MTT0Act.this.startActivity(MT2ACT.class, bundle);
                }
            }));
        }
    }

    protected void deductVerifyCode(String str) {
        VerifyCodeBean verifyCodeBean = new VerifyCodeBean();
        verifyCodeBean.verifyCode = str;
        Api.getDefault().deductVerifyCode(verifyCodeBean).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new AnonymousClass6(this, false));
    }

    class AnonymousClass6 extends RxSubscriber<BaseResult> {
        AnonymousClass6(Context context, boolean z) {
            super(context, z);
        }

        @Override
        public void _onNext(final BaseResult baseResult) {
            final SureAndCancelDialog sureAndCancelDialog = new SureAndCancelDialog(MTT0Act.this.mContext, R.layout.dialog_tip);
            ((TextView) sureAndCancelDialog.getView(R.id.content)).setText(baseResult.getMessage());
            sureAndCancelDialog.setOnClickCancel(new SureAndCancelDialog.onClickCancel() {
                @Override
                public final void onClickCancel() {
                    SureAndCancelDialog.this.dismiss();
                }
            });
            sureAndCancelDialog.setOnClickSure(new SureAndCancelDialog.onClickSure() {
                @Override
                public final void onClickSure() {
                    MTT0Act.AnonymousClass6.lambda$_onNext$1(SureAndCancelDialog.this, baseResult);
                }
            });
            sureAndCancelDialog.show();
        }

        static void lambda$_onNext$1(SureAndCancelDialog sureAndCancelDialog, BaseResult baseResult) {
            sureAndCancelDialog.dismiss();
            if (baseResult.getCode() == 200) {
                ((BMAG01ACT) AppActivityManager.getAppManager().getActivity(BMAG01ACT.class)).onCheckPosition(0);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
            } else {
                ((BMAG01ACT) AppActivityManager.getAppManager().getActivity(BMAG01ACT.class)).onCheckPosition(1);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
            }
        }

        @Override
        protected void _onError(String str) {
            new ToastUtil().showShort(MTT0Act.this, str);
        }
    }
}