导航菜单

页面标题

页面副标题

新暖心缘 v8.1.1 - WithDrawActivity.java 源代码

正在查看: 新暖心缘 v8.1.1 应用的 WithDrawActivity.java JAVA 源代码文件

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


package com.luanxingyuan.app.activity;

import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import com.luanxingyuan.app.base.BaseActivity;
import com.luanxingyuan.app.base.BaseListResponse;
import com.luanxingyuan.app.base.BaseResponse;
import com.luanxingyuan.app.bean.AccountBean;
import com.luanxingyuan.app.bean.ChargeListBean;
import com.luanxingyuan.app.bean.WithDrawBean;
import com.luanxingyuan.app.util.ParamUtil;
import com.luanxingyuan.app.util.ToastUtil;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import k6.w0;
import x8.c0;

public class WithDrawActivity extends BaseActivity {
    private w0 mAdapter;
    private AccountBean mAlipayData;

    @BindView
    ImageView mAlipayIv;

    @BindView
    View mAlipayV;

    @BindView
    RecyclerView mContentRv;

    @BindView
    TextView mGoldTv;
    private int mMyGold;

    @BindView
    TextView mNeedGoldTv;

    @BindView
    TextView mNickNameTv;

    @BindView
    TextView mNoAccountTv;

    @BindView
    TextView mRealNameTv;
    private AccountBean mWeChatData;

    @BindView
    ImageView mWeChatIv;

    @BindView
    View mWeChatV;
    private final int ALIPAY = -1;
    private final int WECHAT = -2;
    private final int USDT = -99;
    private int mSelectAccountType = 0;
    private String mWeChatNickName = "";
    private String mWeChatRealName = "";
    private String mAlipayAccountNumber = "";
    private String mAlipayRealName = "";

    class a extends r6.a<BaseResponse<WithDrawBean<AccountBean>>> {
        a() {
        }

        public void onResponse(BaseResponse<WithDrawBean<AccountBean>> baseResponse, int i8) {
            WithDrawBean<AccountBean> withDrawBean;
            if (WithDrawActivity.this.isFinishing() || baseResponse == null || baseResponse.m_istatus != 1 || (withDrawBean = baseResponse.m_object) == null) {
                return;
            }
            WithDrawActivity.this.mMyGold = withDrawBean.totalMoney;
            if (WithDrawActivity.this.mMyGold >= 0) {
                WithDrawActivity withDrawActivity = WithDrawActivity.this;
                withDrawActivity.mGoldTv.setText(String.valueOf(withDrawActivity.mMyGold));
            }
            List<AccountBean> list = withDrawBean.data;
            if (list == null || list.size() <= 0) {
                return;
            }
            boolean z7 = false;
            boolean z8 = false;
            boolean z9 = false;
            for (AccountBean accountBean : list) {
                int i9 = accountBean.t_type;
                if (i9 == 0) {
                    WithDrawActivity.this.mAlipayData = accountBean;
                    WithDrawActivity.this.mAlipayAccountNumber = accountBean.t_account_number;
                    WithDrawActivity.this.mAlipayRealName = accountBean.t_real_name;
                    z7 = true;
                } else if (i9 == 1) {
                    WithDrawActivity.this.mWeChatData = accountBean;
                    WithDrawActivity.this.mWeChatNickName = accountBean.t_account_number;
                    WithDrawActivity.this.mWeChatRealName = accountBean.t_real_name;
                    z8 = true;
                } else if (i9 == 99) {
                    WithDrawActivity.this.mWeChatData = accountBean;
                    WithDrawActivity.this.mWeChatNickName = accountBean.t_account_number;
                    WithDrawActivity.this.mWeChatRealName = accountBean.t_real_name;
                    z9 = true;
                }
            }
            if (z7) {
                WithDrawActivity.this.mAlipayIv.setSelected(false);
                WithDrawActivity.this.mAlipayV.setSelected(false);
                WithDrawActivity.this.setSelectOption(-1);
            } else if (z8) {
                WithDrawActivity.this.mWeChatIv.setSelected(false);
                WithDrawActivity.this.mWeChatV.setSelected(false);
            } else if (z9) {
                WithDrawActivity.this.mWeChatIv.setSelected(false);
                WithDrawActivity.this.mWeChatV.setSelected(false);
            }
        }
    }

    class b extends r6.a<BaseListResponse<ChargeListBean>> {

        final int f7372a;

        class a implements Comparator<ChargeListBean> {
            a() {
            }

            @Override
            public int compare(ChargeListBean chargeListBean, ChargeListBean chargeListBean2) {
                try {
                    return Double.compare(Double.parseDouble(chargeListBean.t_gold), Double.parseDouble(chargeListBean2.t_gold));
                } catch (NumberFormatException unused) {
                    return 0;
                }
            }
        }

        b(int i8) {
            this.f7372a = i8;
        }

        public void onResponse(BaseListResponse<ChargeListBean> baseListResponse, int i8) {
            List<ChargeListBean> list;
            if (WithDrawActivity.this.isFinishing() || baseListResponse == null || baseListResponse.m_istatus != 1 || (list = baseListResponse.m_object) == null) {
                return;
            }
            Collections.sort(list, new a());
            if (list.size() > 1) {
                list.get(1).isSelected = true;
            }
            WithDrawActivity.this.mAdapter.d(list, this.f7372a);
        }
    }

    class c implements w0.c {
        c() {
        }

        @Override
        public void a(ChargeListBean chargeListBean) {
            if (chargeListBean == null || !chargeListBean.isSelected) {
                return;
            }
            WithDrawActivity.this.mNeedGoldTv.setText(String.valueOf(chargeListBean.t_gold));
        }
    }

    class d extends r6.a<BaseResponse> {
        d() {
        }

        public void onAfter(int i8) {
            super.onAfter(i8);
            WithDrawActivity.this.dismissLoadingDialog();
        }

        public void onBefore(c0 c0Var, int i8) {
            super.onBefore(c0Var, i8);
            WithDrawActivity.this.showLoadingDialog();
        }

        @Override
        public void onError(x8.e eVar, Exception exc, int i8) {
            super.onError(eVar, exc, i8);
            ToastUtil.showToast(WithDrawActivity.this.getApplicationContext(), 2131821363);
        }

        public void onResponse(BaseResponse baseResponse, int i8) {
            if (baseResponse != null && baseResponse.m_istatus == 1) {
                ToastUtil.showToast(WithDrawActivity.this.getApplicationContext(), 2131820632);
                WithDrawActivity.this.finish();
            } else if (baseResponse == null || TextUtils.isEmpty(baseResponse.m_strMessage)) {
                ToastUtil.showToast(WithDrawActivity.this.getApplicationContext(), 2131821457);
            } else {
                ToastUtil.showToast(WithDrawActivity.this.getApplicationContext(), baseResponse.m_strMessage);
            }
        }
    }

    private void applyWithDraw(int i8) {
        String valueOf = this.mSelectAccountType == -1 ? String.valueOf(this.mAlipayData.t_id) : String.valueOf(this.mWeChatData.t_id);
        HashMap hashMap = new HashMap();
        hashMap.put("userId", getUserId());
        hashMap.put("putForwardId", valueOf);
        hashMap.put("dataId", String.valueOf(i8));
        x7.a.h().c(m6.a.i()).e("param", ParamUtil.getParam(hashMap)).f().c(new d());
    }

    private void getMyGold() {
        HashMap hashMap = new HashMap();
        hashMap.put("userId", getUserId());
        x7.a.h().c(m6.a.y0()).e("param", ParamUtil.getParam(hashMap)).f().c(new a());
    }

    private void getWithDraw(int i8) {
        HashMap hashMap = new HashMap();
        hashMap.put("t_end_type", String.valueOf(i8));
        hashMap.put("userId", getUserId());
        x7.a.h().c(m6.a.j0()).e("param", ParamUtil.getParam(hashMap)).f().c(new b(i8));
    }

    public void setSelectOption(int i8) {
        if (i8 == -99) {
            if (this.mWeChatV.isSelected()) {
                return;
            }
            this.mWeChatIv.setSelected(true);
            this.mWeChatV.setSelected(true);
            this.mWeChatV.setVisibility(0);
            this.mAlipayIv.setSelected(false);
            this.mAlipayV.setSelected(false);
            this.mAlipayV.setVisibility(4);
            this.mSelectAccountType = -99;
            if (TextUtils.isEmpty(this.mWeChatNickName) && TextUtils.isEmpty(this.mWeChatRealName)) {
                this.mNoAccountTv.setVisibility(0);
            } else {
                this.mNoAccountTv.setVisibility(8);
            }
            if (TextUtils.isEmpty(this.mWeChatNickName)) {
                this.mNickNameTv.setText((CharSequence) null);
            } else {
                this.mNickNameTv.setText(this.mWeChatNickName);
                this.mNickNameTv.setTextSize(2, 10.0f);
            }
            this.mRealNameTv.setVisibility(8);
            if (TextUtils.isEmpty(this.mWeChatRealName)) {
                this.mRealNameTv.setText((CharSequence) null);
            } else {
                this.mRealNameTv.setText(this.mWeChatRealName);
                this.mRealNameTv.setTextSize(2, 10.0f);
            }
            getWithDraw(-99);
            return;
        }
        if (i8 == -2) {
            if (this.mWeChatV.isSelected()) {
                return;
            }
            this.mWeChatIv.setSelected(true);
            this.mWeChatV.setSelected(true);
            this.mWeChatV.setVisibility(0);
            this.mAlipayIv.setSelected(false);
            this.mAlipayV.setSelected(false);
            this.mAlipayV.setVisibility(4);
            this.mSelectAccountType = -2;
            if (TextUtils.isEmpty(this.mWeChatNickName) && TextUtils.isEmpty(this.mWeChatRealName)) {
                this.mNoAccountTv.setVisibility(0);
            } else {
                this.mNoAccountTv.setVisibility(8);
            }
            if (TextUtils.isEmpty(this.mWeChatNickName)) {
                this.mNickNameTv.setText((CharSequence) null);
            } else {
                this.mNickNameTv.setText(this.mWeChatNickName);
                this.mNickNameTv.setTextSize(2, 15.0f);
            }
            this.mRealNameTv.setVisibility(0);
            if (TextUtils.isEmpty(this.mWeChatRealName)) {
                this.mRealNameTv.setText((CharSequence) null);
            } else {
                this.mRealNameTv.setText(this.mWeChatRealName);
                this.mRealNameTv.setTextSize(2, 15.0f);
            }
            getWithDraw(-2);
            return;
        }
        if (i8 == -1 && !this.mAlipayV.isSelected()) {
            this.mAlipayIv.setSelected(true);
            this.mAlipayV.setSelected(true);
            this.mAlipayV.setVisibility(0);
            this.mWeChatIv.setSelected(false);
            this.mWeChatV.setSelected(false);
            this.mWeChatV.setVisibility(4);
            this.mSelectAccountType = -1;
            if (TextUtils.isEmpty(this.mAlipayAccountNumber) && TextUtils.isEmpty(this.mAlipayRealName)) {
                this.mNoAccountTv.setVisibility(0);
            } else {
                this.mNoAccountTv.setVisibility(8);
            }
            if (TextUtils.isEmpty(this.mAlipayAccountNumber)) {
                this.mNickNameTv.setText((CharSequence) null);
            } else {
                this.mNickNameTv.setText(this.mAlipayAccountNumber);
                this.mNickNameTv.setTextSize(2, 15.0f);
            }
            this.mRealNameTv.setVisibility(0);
            if (TextUtils.isEmpty(this.mAlipayRealName)) {
                this.mRealNameTv.setText((CharSequence) null);
            } else {
                this.mRealNameTv.setText(this.mAlipayRealName);
                this.mRealNameTv.setTextSize(2, 15.0f);
            }
            getWithDraw(-1);
        }
    }

    private void setView() {
        setRightText(2131821450);
        this.mRightTv.setTextColor(getResources().getColor(2131099689));
        this.mContentRv.setLayoutManager(new GridLayoutManager(getApplicationContext(), 3));
        w0 w0Var = new w0(this);
        this.mAdapter = w0Var;
        this.mContentRv.setAdapter(w0Var);
        this.mAdapter.e(new c());
    }

    @Override
    protected View getContentView() {
        return inflate(2131492988);
    }

    @OnClick
    public void onClick(View view) {
        switch (view.getId()) {
            case 2131296357:
                setSelectOption(-1);
                break;
            case 2131296402:
                int i8 = this.mSelectAccountType;
                if (i8 != -1) {
                    if (i8 != -2) {
                        startActivity(new Intent(getApplicationContext(), (Class<?>) UsdtAccountActivity.class));
                        break;
                    } else {
                        startActivity(new Intent(getApplicationContext(), (Class<?>) WeChatAccountActivity.class));
                        break;
                    }
                } else {
                    startActivity(new Intent(getApplicationContext(), (Class<?>) AlipayAccountActivity.class));
                    break;
                }
            case 2131297170:
                startActivity(new Intent(getApplicationContext(), (Class<?>) WithDrawDetailActivity.class));
                break;
            case 2131297470:
                setSelectOption(-99);
                break;
            case 2131297483:
                ChargeListBean c8 = this.mAdapter.c();
                if (c8 != null) {
                    if (Double.parseDouble(c8.t_gold) <= this.mMyGold) {
                        int i9 = this.mSelectAccountType;
                        if (i9 != -1 && i9 != -2 && i9 != -99) {
                            ToastUtil.showToast(getApplicationContext(), 2131821207);
                            break;
                        } else if (i9 != -1 || this.mAlipayData != null) {
                            if (i9 != -2 || this.mWeChatData != null) {
                                if (i9 != -99 || this.mWeChatData != null) {
                                    applyWithDraw(c8.t_id);
                                    break;
                                } else {
                                    ToastUtil.showToast(getApplicationContext(), 2131821163);
                                    break;
                                }
                            } else {
                                ToastUtil.showToast(getApplicationContext(), 2131821164);
                                break;
                            }
                        } else {
                            ToastUtil.showToast(getApplicationContext(), 2131821158);
                            break;
                        }
                    } else {
                        ToastUtil.showToast(getApplicationContext(), 2131820895);
                        break;
                    }
                } else {
                    ToastUtil.showToast(getApplicationContext(), 2131821452);
                    break;
                }
                break;
        }
    }

    @Override
    protected void onContentAdded() {
        setTitle(2131821455);
        setView();
        setSelectOption(-1);
        getWithDraw(-1);
    }

    @Override
    protected void onResume() {
        super.onResume();
        getMyGold();
    }
}