得物.apk(点击下载) / PaySelectorDialog.java


package com.shizhuang.duapp.modules.pay.ui;

import a40.j;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.core.view.ViewKt;
import androidx.fragment.app.FragmentActivity;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.sensorsdata.analytics.android.sdk.SensorsDataAPI;
import com.shizhuang.duapp.common.base.inter.IDialogViewControllerV2;
import com.shizhuang.duapp.common.dialog.BaseViewControlDialog;
import com.shizhuang.duapp.common.event.SCEvent;
import com.shizhuang.duapp.common.utils.StringUtils;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.common.widget.font.IconFontTextView;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.dulogger.Printer;
import com.shizhuang.duapp.modules.du_mall_common.dialog.BottomTransactionPwdDialog;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.BankCardInfo;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.BindBankCardResult;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.CashierModel;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.ConfirmPayModel;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.PayMethod;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.PayMethodActivityTagModel;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.PayResult;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.PaySendModel;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.UserBankCardInfo;
import com.shizhuang.duapp.modules.du_mall_common.model.pay.WeixinPayInfo;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.MallScrollStateExposureHelper;
import com.shizhuang.duapp.modules.du_mall_common.widget.scrollview.ScrollStateView;
import com.shizhuang.duapp.modules.pay.R$color;
import com.shizhuang.duapp.modules.pay.R$id;
import com.shizhuang.duapp.modules.pay.R$layout;
import com.shizhuang.duapp.modules.pay.R$string;
import com.shizhuang.duapp.modules.pay.R$style;
import com.shizhuang.duapp.modules.pay.ccv2.PayMethodEnum;
import com.shizhuang.duapp.modules.pay.exception.PayFailedException;
import com.shizhuang.duapp.modules.pay.model.SelectPayBankCardEvent;
import com.shizhuang.duapp.modules.pay.view.PayItemView;
import com.shizhuang.duapp.modules.router.service.IPayService;
import com.shizhuang.model.event.MessageEvent;
import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.opensdk.modelpay.PayResp;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import df.q;
import dy0.i0;
import dy0.j0;
import dy0.l0;
import dy0.m0;
import gg0.n;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import rd.l;
import td.o;
import td.p;

@Metadata(bv = {}, d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0016\u0018\u00002\u00020\u0001:\u0001\fB\u0007¢\u0006\u0004\b\n\u0010\u000bJ\b\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0007J\u0010\u0010\t\u001a\u00020\u00022\u0006\u0010\b\u001a\u00020\u0007H\u0007¨\u0006\r"}, d2 = {"Lcom/shizhuang/duapp/modules/pay/ui/PaySelectorDialog;", "Lcom/shizhuang/duapp/common/dialog/BaseViewControlDialog;", "", "onResume", "Lcom/tencent/mm/opensdk/modelpay/PayResp;", "payResp", "onPayEvent", "Lcom/shizhuang/duapp/common/event/SCEvent;", "event", "onEvent", "<init>", "()V", "a", "du_pay_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: PaySelectorDialog.kt */
public class PaySelectorDialog extends BaseViewControlDialog {
    @NotNull
    public static final a T = new a(null);
    public static ChangeQuickRedirect changeQuickRedirect;
    public boolean A;
    public SparseArray<PayItemView> B = new SparseArray<>();
    public List<View> C = new ArrayList();
    public CashierModel D;
    public int E;
    public boolean F;
    public boolean G;
    public boolean H;
    public View I;
    public String J = "";
    public String K = "";
    public String L = "";
    public boolean M;
    public boolean N;
    public final Lazy O = LazyKt__LazyJVMKt.lazy(new PaySelectorDialog$countDownTimer$2(this));
    public boolean P;
    public boolean Q = true;
    @SuppressLint({"HandlerLeak"})
    public final Handler R = new e(this);
    public HashMap S;
    public IPayService.PayResultListener f;

    /* renamed from: g  reason: collision with root package name */
    public IPayService.ToPayListener f21204g;

    /* renamed from: h  reason: collision with root package name */
    public IPayService.CancelListener f21205h;
    public int i;
    public long j;
    public String k = "";
    public String l;
    public BankCardInfo m;
    public BindBankCardResult n;
    public MallScrollStateExposureHelper<View> o;
    public final List<PayMethod> p = new ArrayList();

    /* renamed from: q  reason: collision with root package name */
    public final List<PayMethod> f21206q = new ArrayList();
    public ActivityResultLauncher<Intent> r;
    public ActivityResultLauncher<Intent> s;
    public ActivityResultLauncher<Intent> t;
    @JvmField

    /* renamed from: u  reason: collision with root package name */
    public int f21207u = -1;

    /* renamed from: v  reason: collision with root package name */
    public boolean f21208v = true;
    public String w;
    public String x;
    public boolean y;
    public boolean z = true;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void FragmentMethodWeaver_onCreate(PaySelectorDialog paySelectorDialog, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{paySelectorDialog, bundle}, null, changeQuickRedirect, true, 250926, new Class[]{PaySelectorDialog.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                PaySelectorDialog.x(paySelectorDialog, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (paySelectorDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.pay.ui.PaySelectorDialog")) {
                    jn.b.f34396a.fragmentOnCreateMethod(paySelectorDialog, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreateView")
        @Keep
        public static View FragmentMethodWeaver_onCreateView(@NonNull PaySelectorDialog paySelectorDialog, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{paySelectorDialog, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 250929, new Class[]{PaySelectorDialog.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            long currentTimeMillis = System.currentTimeMillis();
            View A = PaySelectorDialog.A(paySelectorDialog, layoutInflater, viewGroup, bundle);
            long currentTimeMillis2 = System.currentTimeMillis();
            if (paySelectorDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.pay.ui.PaySelectorDialog")) {
                jn.b.f34396a.fragmentOnCreateViewMethod(paySelectorDialog, currentTimeMillis, currentTimeMillis2);
            }
            return A;
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void FragmentMethodWeaver_onResume(PaySelectorDialog paySelectorDialog) {
            if (!PatchProxy.proxy(new Object[]{paySelectorDialog}, null, changeQuickRedirect, true, 250927, new Class[]{PaySelectorDialog.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                PaySelectorDialog.y(paySelectorDialog);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (paySelectorDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.pay.ui.PaySelectorDialog")) {
                    jn.b.f34396a.fragmentOnResumeMethod(paySelectorDialog, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void FragmentMethodWeaver_onStart(PaySelectorDialog paySelectorDialog) {
            if (!PatchProxy.proxy(new Object[]{paySelectorDialog}, null, changeQuickRedirect, true, 250928, new Class[]{PaySelectorDialog.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                PaySelectorDialog.z(paySelectorDialog);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (paySelectorDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.pay.ui.PaySelectorDialog")) {
                    jn.b.f34396a.fragmentOnStartMethod(paySelectorDialog, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onViewCreated")
        @Keep
        public static void FragmentMethodWeaver_onViewCreated(@NonNull PaySelectorDialog paySelectorDialog, @Nullable View view, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{paySelectorDialog, view, bundle}, null, changeQuickRedirect, true, 250930, new Class[]{PaySelectorDialog.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                PaySelectorDialog.B(paySelectorDialog, view, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (paySelectorDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.pay.ui.PaySelectorDialog")) {
                    jn.b.f34396a.fragmentOnViewCreatedMethod(paySelectorDialog, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class a {
        public static ChangeQuickRedirect changeQuickRedirect;

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class b extends p<ConfirmPayModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(PaySelectorDialog paySelectorDialog, FragmentActivity fragmentActivity, Activity activity, boolean z) {
            super(activity, z);
            this.b = paySelectorDialog;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<ConfirmPayModel> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 250936, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                PaySelectorDialog paySelectorDialog = this.b;
                paySelectorDialog.F(true ^ paySelectorDialog.K());
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            ConfirmPayModel confirmPayModel = (ConfirmPayModel) obj;
            if (!PatchProxy.proxy(new Object[]{confirmPayModel}, this, changeQuickRedirect, false, 250935, new Class[]{ConfirmPayModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(confirmPayModel);
                this.b.X();
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class c extends p<String> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ FragmentActivity f21209c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public c(PaySelectorDialog paySelectorDialog, FragmentActivity fragmentActivity, Activity activity, boolean z) {
            super(activity, z);
            this.b = paySelectorDialog;
            this.f21209c = fragmentActivity;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            String str = (String) obj;
            if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 250939, new Class[]{String.class}, Void.TYPE).isSupported) {
                super.onSuccess(str);
                j40.a aVar = j40.a.f34151a;
                PaySelectorDialog paySelectorDialog = this.b;
                CashierModel cashierModel = paySelectorDialog.D;
                String str2 = cashierModel != null ? cashierModel.orderId : null;
                if (str2 == null) {
                    str2 = "";
                }
                aVar.v(str2, Integer.valueOf(paySelectorDialog.i), this.f21209c);
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class d extends o<CashierModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d(PaySelectorDialog paySelectorDialog, IDialogViewControllerV2 iDialogViewControllerV2, boolean z) {
            super(iDialogViewControllerV2, z);
            this.d = paySelectorDialog;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        /* JADX DEBUG: Failed to insert an additional move for type inference into block B:55:0x017e */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r11v13, types: [java.util.Collection] */
        /* JADX WARN: Type inference failed for: r11v33 */
        /* JADX WARNING: Removed duplicated region for block: B:133:0x03b3  */
        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a, td.o
        public void onSuccess(CashierModel cashierModel) {
            int i;
            int I;
            PayItemView payItemView;
            PayItemView payItemView2;
            PayItemView payItemView3;
            View findViewById;
            UserBankCardInfo userBankCardInfo;
            CashierModel cashierModel2 = cashierModel;
            if (!PatchProxy.proxy(new Object[]{cashierModel2}, this, changeQuickRedirect, false, 250947, new Class[]{CashierModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(cashierModel2);
                if (cashierModel2 != null) {
                    PaySelectorDialog paySelectorDialog = this.d;
                    if (!PatchProxy.proxy(new Object[]{cashierModel2}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250848, new Class[]{CashierModel.class}, Void.TYPE).isSupported) {
                        paySelectorDialog.D = cashierModel2;
                        List<PayMethod> list = cashierModel2.supportPayMethods;
                        if (!(list == null || list.isEmpty())) {
                            paySelectorDialog.S();
                            List<PayMethod> list2 = cashierModel2.supportPayMethods;
                            Function2<? super String, ? super PayMethodActivityTagModel, Unit> function2 = null;
                            if (!PatchProxy.proxy(new Object[]{list2}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250850, new Class[]{List.class}, Void.TYPE).isSupported) {
                                if (!(list2 == null || list2.isEmpty())) {
                                    paySelectorDialog.p.clear();
                                    paySelectorDialog.f21206q.clear();
                                    paySelectorDialog.S();
                                    paySelectorDialog.C.clear();
                                    for (PayMethod payMethod : list2) {
                                        if (payMethod != null && !TextUtils.isEmpty(payMethod.methodCode)) {
                                            String str = payMethod.methodCode;
                                            if (Intrinsics.areEqual(str, "alipay")) {
                                                Object inflate = LayoutInflater.from(paySelectorDialog.getContext()).inflate(R$layout.du_pay_item_alipay, (ViewGroup) ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)), false);
                                                if (!(inflate instanceof PayItemView)) {
                                                    inflate = function2;
                                                }
                                                payItemView3 = (PayItemView) inflate;
                                                if (payItemView3 != null) {
                                                    payItemView3.setOnClickListener(new PaySelectorDialog$addPayItemView$$inlined$apply$lambda$1(paySelectorDialog));
                                                    paySelectorDialog.B.put(0, payItemView3);
                                                    payItemView = payItemView3;
                                                    payItemView2 = payItemView3;
                                                    if (!(payItemView2 == null || payItemView == null)) {
                                                        if (payMethod.isNeedFold() || paySelectorDialog.F) {
                                                            payItemView2.setVisibility(0);
                                                            ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)).addView(payItemView2);
                                                            paySelectorDialog.p.add(payMethod);
                                                        } else {
                                                            payItemView2.setVisibility(8);
                                                            paySelectorDialog.C.add(payItemView2);
                                                            paySelectorDialog.f21206q.add(payMethod);
                                                        }
                                                    }
                                                }
                                            } else {
                                                PayMethodEnum payMethodEnum = PayMethodEnum.PAY_METHOD_ENUM_ZHI_MA_AUTH_PAY;
                                                String str2 = "";
                                                if (Intrinsics.areEqual(str, payMethodEnum.getMethodCode())) {
                                                    Object inflate2 = LayoutInflater.from(paySelectorDialog.getContext()).inflate(R$layout.du_pay_item_zhi_ma_auth, (ViewGroup) ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)), false);
                                                    if (!(inflate2 instanceof PayItemView)) {
                                                        inflate2 = function2;
                                                    }
                                                    PayItemView payItemView4 = (PayItemView) inflate2;
                                                    if (payItemView4 != null) {
                                                        payItemView4.setOnClickListener(new PaySelectorDialog$addPayItemView$$inlined$apply$lambda$2(paySelectorDialog));
                                                        paySelectorDialog.B.put(22, payItemView4);
                                                        payItemView3 = payItemView4;
                                                    } else {
                                                        payItemView3 = function2;
                                                    }
                                                    if (!PatchProxy.proxy(new Object[]{payMethod, payItemView3}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250851, new Class[]{PayMethod.class, PayItemView.class}, Void.TYPE).isSupported) {
                                                        if (payMethod.status == 1) {
                                                            if (payItemView3 != null) {
                                                                payItemView3.setEnabled(true);
                                                            }
                                                            if (payItemView3 != null) {
                                                                payItemView3.b(payMethod.contentList, payMethodEnum.getMethodCode(), function2);
                                                            }
                                                        } else {
                                                            if (payItemView3 != null) {
                                                                payItemView3.setEnabled(false);
                                                            }
                                                            if (payItemView3 != null) {
                                                                String str3 = payMethod.disableDesc;
                                                                if (str3 == null) {
                                                                    str3 = str2;
                                                                }
                                                                payItemView3.setSubTitle(str3);
                                                            }
                                                        }
                                                    }
                                                } else if (Intrinsics.areEqual(str, "wxpay")) {
                                                    Object inflate3 = LayoutInflater.from(paySelectorDialog.getContext()).inflate(R$layout.du_pay_dialog_item_wechat, (ViewGroup) ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)), false);
                                                    if (!(inflate3 instanceof PayItemView)) {
                                                        inflate3 = function2;
                                                    }
                                                    payItemView3 = (PayItemView) inflate3;
                                                    if (payItemView3 != null) {
                                                        payItemView3.setOnClickListener(new PaySelectorDialog$addPayItemView$$inlined$apply$lambda$3(paySelectorDialog));
                                                        paySelectorDialog.B.put(1, payItemView3);
                                                        if (!PatchProxy.proxy(new Object[]{payItemView3}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250877, new Class[]{PayItemView.class}, Void.TYPE).isSupported) {
                                                            payItemView3.setEnabled(paySelectorDialog.f21208v);
                                                            payItemView3.setRightSummary("申请超过50件不支持微信支付");
                                                        }
                                                    }
                                                } else if (Intrinsics.areEqual(str, "alipay_signpay")) {
                                                    paySelectorDialog.A = payMethod.firstSign;
                                                    Object inflate4 = LayoutInflater.from(paySelectorDialog.getContext()).inflate(R$layout.du_pay_item_ali_sign_pay, (ViewGroup) ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)), false);
                                                    if (!(inflate4 instanceof PayItemView)) {
                                                        inflate4 = function2;
                                                    }
                                                    payItemView3 = (PayItemView) inflate4;
                                                    if (payItemView3 != null) {
                                                        payItemView3.setOnClickListener(new PaySelectorDialog$addPayItemView$$inlined$apply$lambda$4(paySelectorDialog));
                                                        if (!paySelectorDialog.A) {
                                                            payItemView3.setSubTitle(paySelectorDialog.getString(R$string.pay_selector_can_no_pw_pay));
                                                            payItemView3.setSubTitleColor(R$color.color_gray_aaaabb);
                                                            if (!PatchProxy.proxy(new Object[]{new Integer(1), new Float(12.0f)}, payItemView3, PayItemView.changeQuickRedirect, false, 251431, new Class[]{Integer.TYPE, Float.TYPE}, Void.TYPE).isSupported) {
                                                                ((TextView) payItemView3.a(R$id.itemSubTitle)).setTextSize(1, 12.0f);
                                                            }
                                                        }
                                                        paySelectorDialog.B.put(13, payItemView3);
                                                    }
                                                } else if (Intrinsics.areEqual(str, "bank_card") || Intrinsics.areEqual(str, PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD_SIGNPAY.getMethodCode())) {
                                                    paySelectorDialog.N = Intrinsics.areEqual(payMethod.methodCode, PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD_SIGNPAY.getMethodCode());
                                                    View inflate5 = LayoutInflater.from(paySelectorDialog.getContext()).inflate(R$layout.du_pay_item_bank_card, (ViewGroup) ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)), false);
                                                    payItemView = (PayItemView) inflate5.findViewById(R$id.ptv_bank_card);
                                                    View findViewById2 = inflate5.findViewById(R$id.top_layout_no_bank_card);
                                                    paySelectorDialog.I = inflate5.findViewById(R$id.layout_bank_card_normal);
                                                    CashierModel cashierModel3 = paySelectorDialog.D;
                                                    List<BankCardInfo> cards = (cashierModel3 == null || (userBankCardInfo = cashierModel3.bankCard) == null) ? function2 : userBankCardInfo.getCards();
                                                    if (cards == 0 || cards.isEmpty()) {
                                                        payItemView2 = inflate5;
                                                        if (!PatchProxy.proxy(new Object[]{findViewById2, payMethod}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250856, new Class[]{View.class, PayMethod.class}, Void.TYPE).isSupported) {
                                                            View view = paySelectorDialog.I;
                                                            if (view != null) {
                                                                ViewKt.setVisible(view, false);
                                                            }
                                                            findViewById2.setVisibility(0);
                                                            findViewById2.setOnClickListener(new PaySelectorDialog$setNoBankCardView$1(paySelectorDialog));
                                                            payItemView2 = inflate5;
                                                        }
                                                    } else {
                                                        payItemView2 = inflate5;
                                                        if (!PatchProxy.proxy(new Object[]{findViewById2, payItemView, payMethod}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250853, new Class[]{View.class, PayItemView.class, PayMethod.class}, Void.TYPE).isSupported) {
                                                            findViewById2.setVisibility(8);
                                                            View view2 = paySelectorDialog.I;
                                                            if (view2 != null) {
                                                                ViewKt.setVisible(view2, true);
                                                            }
                                                            if (paySelectorDialog.N) {
                                                                str2 = "(可极速支付)";
                                                            }
                                                            payItemView.setSubTitle(str2);
                                                            payItemView.setOnClickListener(new PaySelectorDialog$setBankCardView$1(paySelectorDialog));
                                                            CashierModel cashierModel4 = paySelectorDialog.D;
                                                            payItemView2 = inflate5;
                                                            if (cashierModel4 != null) {
                                                                UserBankCardInfo userBankCardInfo2 = cashierModel4.bankCard;
                                                                payItemView2 = inflate5;
                                                                if (userBankCardInfo2 != null) {
                                                                    List<BankCardInfo> cards2 = userBankCardInfo2.getCards();
                                                                    payItemView2 = inflate5;
                                                                    if (cards2 != null) {
                                                                        BankCardInfo bankCardInfo = (BankCardInfo) CollectionsKt___CollectionsKt.firstOrNull((List) cards2);
                                                                        payItemView2 = inflate5;
                                                                        if (bankCardInfo != null) {
                                                                            paySelectorDialog.m = bankCardInfo;
                                                                            paySelectorDialog.T(bankCardInfo, payItemView);
                                                                            View view3 = paySelectorDialog.I;
                                                                            if (!(view3 == null || (findViewById = view3.findViewById(R$id.cardClickView)) == null)) {
                                                                                findViewById.setOnClickListener(new PaySelectorDialog$setBankCardView$2(paySelectorDialog));
                                                                            }
                                                                            paySelectorDialog.B.put(6, payItemView);
                                                                            payItemView2 = inflate5;
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (payMethod.isNeedFold()) {
                                                    }
                                                    payItemView2.setVisibility(0);
                                                    ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)).addView(payItemView2);
                                                    paySelectorDialog.p.add(payMethod);
                                                }
                                                payItemView = payItemView3;
                                                payItemView2 = payItemView3;
                                                if (payMethod.isNeedFold()) {
                                                }
                                                payItemView2.setVisibility(0);
                                                ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)).addView(payItemView2);
                                                paySelectorDialog.p.add(payMethod);
                                            }
                                            payItemView3 = null;
                                            payItemView = payItemView3;
                                            payItemView2 = payItemView3;
                                            if (payMethod.isNeedFold()) {
                                            }
                                            payItemView2.setVisibility(0);
                                            ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)).addView(payItemView2);
                                            paySelectorDialog.p.add(payMethod);
                                        }
                                        function2 = null;
                                    }
                                    if (!paySelectorDialog.C.isEmpty()) {
                                        ((FrameLayout) paySelectorDialog._$_findCachedViewById(R$id.flShowOtherPayType)).setVisibility(0);
                                        Iterator<T> it2 = paySelectorDialog.C.iterator();
                                        while (it2.hasNext()) {
                                            ((LinearLayout) paySelectorDialog._$_findCachedViewById(R$id.ll_pay_items)).addView(it2.next());
                                        }
                                        paySelectorDialog.E = 0;
                                        paySelectorDialog.Y();
                                    } else {
                                        ((FrameLayout) paySelectorDialog._$_findCachedViewById(R$id.flShowOtherPayType)).setVisibility(8);
                                    }
                                }
                            }
                            if (!PatchProxy.proxy(new Object[0], paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250867, new Class[0], Void.TYPE).isSupported) {
                                CashierModel cashierModel5 = paySelectorDialog.D;
                                String str4 = cashierModel5 != null ? cashierModel5.defaultPayMethod : null;
                                if (str4 != null) {
                                    paySelectorDialog.f21207u = paySelectorDialog.I(str4);
                                }
                                int i3 = paySelectorDialog.f21207u;
                                if (i3 < 0 || ((i3 == 1 && !paySelectorDialog.f21208v) || (i3 == 22 && !paySelectorDialog.L()))) {
                                    CashierModel cashierModel6 = paySelectorDialog.D;
                                    List<PayMethod> list3 = cashierModel6 != null ? cashierModel6.supportPayMethods : null;
                                    PatchProxyResult proxy = PatchProxy.proxy(new Object[]{list3}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250868, new Class[]{List.class}, Integer.TYPE);
                                    if (proxy.isSupported) {
                                        i = ((Integer) proxy.result).intValue();
                                    } else {
                                        if (list3 != null) {
                                            Iterator<PayMethod> it3 = list3.iterator();
                                            while (true) {
                                                if (!it3.hasNext()) {
                                                    break;
                                                }
                                                I = paySelectorDialog.I(it3.next().methodCode);
                                                if (paySelectorDialog.B.get(I) != null) {
                                                    if (I != 1) {
                                                        if (I != 22 || paySelectorDialog.L()) {
                                                            break;
                                                        }
                                                    } else if (paySelectorDialog.f21208v) {
                                                        break;
                                                    }
                                                }
                                            }
                                            i = I;
                                        }
                                        i = -1;
                                    }
                                    paySelectorDialog.f21207u = i;
                                }
                                int i12 = paySelectorDialog.f21207u;
                                if (i12 < 0) {
                                    paySelectorDialog.U();
                                } else {
                                    paySelectorDialog.O(i12, true);
                                }
                            }
                            MallScrollStateExposureHelper<View> mallScrollStateExposureHelper = paySelectorDialog.o;
                            if (mallScrollStateExposureHelper != null) {
                                mallScrollStateExposureHelper.startAttachExposure(true);
                                return;
                            }
                            return;
                        }
                        paySelectorDialog.U();
                    }
                }
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class e extends Handler {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ PaySelectorDialog f21211a;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public e(PaySelectorDialog paySelectorDialog) {
            this.f21211a = paySelectorDialog;
        }

        public void handleMessage(@NotNull Message message) {
            if (!PatchProxy.proxy(new Object[]{message}, this, changeQuickRedirect, false, 250951, new Class[]{Message.class}, Void.TYPE).isSupported && message.what == 1) {
                PayResult payResult = new PayResult((String) message.obj);
                String resultStatus = payResult.getResultStatus();
                if (TextUtils.equals(resultStatus, "9000")) {
                    if (this.f21211a.i != 24) {
                        q.n("支付成功");
                    }
                    this.f21211a.R(0, payResult.getResult());
                } else if (TextUtils.equals(resultStatus, "8000")) {
                    q.n("支付结果确认中");
                } else {
                    q.n("支付失败");
                    this.f21211a.M(false);
                }
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class f implements Runnable {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog b;

        public f(PaySelectorDialog paySelectorDialog) {
            this.b = paySelectorDialog;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250952, new Class[0], Void.TYPE).isSupported) {
                this.b.V(false);
                PaySelectorDialog paySelectorDialog = this.b;
                paySelectorDialog.F(!paySelectorDialog.K());
                q.r("支付失败,请更换其他支付方式");
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class g extends p<PaySendModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ BindBankCardResult f21212c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g(PaySelectorDialog paySelectorDialog, BindBankCardResult bindBankCardResult, FragmentActivity fragmentActivity, Activity activity, boolean z) {
            super(activity, z);
            this.b = paySelectorDialog;
            this.f21212c = bindBankCardResult;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<PaySendModel> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 250954, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                if ((lVar != null && lVar.a() == 90019) || ((lVar != null && lVar.a() == 1100017) || this.f21212c != null)) {
                    PaySelectorDialog paySelectorDialog = this.b;
                    paySelectorDialog.F(true ^ paySelectorDialog.K());
                }
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            FragmentActivity activity;
            BankCardInfo boundCard;
            PaySendModel paySendModel = (PaySendModel) obj;
            if (!PatchProxy.proxy(new Object[]{paySendModel}, this, changeQuickRedirect, false, 250953, new Class[]{PaySendModel.class}, Void.TYPE).isSupported && paySendModel != null) {
                PaySelectorDialog paySelectorDialog = this.b;
                paySelectorDialog.l = paySendModel.payLogNum;
                if (paySendModel.isNeedPay == 0) {
                    paySelectorDialog.M(true);
                    return;
                }
                int i = paySelectorDialog.f21207u;
                if (i == 0 || i == 22 || (i == 13 && paySelectorDialog.A)) {
                    String str = paySendModel.payParams;
                    if (!PatchProxy.proxy(new Object[]{str}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250884, new Class[]{String.class}, Void.TYPE).isSupported) {
                        if (TextUtils.isEmpty(str)) {
                            q.n("服务器内部错误");
                        } else if (paySelectorDialog.getActivity() != null) {
                            paySelectorDialog.M = true;
                            fd.q.a(new l0(paySelectorDialog, str));
                        }
                    }
                } else {
                    String str2 = "";
                    Long l = null;
                    String str3 = null;
                    String str4 = null;
                    l = null;
                    if (i == 1) {
                        String str5 = paySendModel.payParams;
                        if (!PatchProxy.proxy(new Object[]{str5}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250881, new Class[]{String.class}, Void.TYPE).isSupported) {
                            IWXAPI createWXAPI = WXAPIFactory.createWXAPI(paySelectorDialog.getContext(), "wxa400d319bf4a1695");
                            if (!createWXAPI.isWXAppInstalled()) {
                                q.n("未安装微信");
                                return;
                            }
                            try {
                                WeixinPayInfo weixinPayInfo = (WeixinPayInfo) nd.e.f(str5, WeixinPayInfo.class);
                                PayReq payReq = new PayReq();
                                payReq.appId = weixinPayInfo != null ? weixinPayInfo.appid : null;
                                payReq.partnerId = weixinPayInfo != null ? weixinPayInfo.partnerid : null;
                                payReq.prepayId = weixinPayInfo != null ? weixinPayInfo.prepayid : null;
                                payReq.nonceStr = weixinPayInfo != null ? weixinPayInfo.noncestr : null;
                                StringBuilder sb2 = new StringBuilder();
                                sb2.append(String.valueOf(weixinPayInfo != null ? Integer.valueOf(weixinPayInfo.timestamp) : null));
                                sb2.append(str2);
                                payReq.timeStamp = sb2.toString();
                                payReq.packageValue = "Sign=WXPay";
                                if (weixinPayInfo != null) {
                                    str3 = weixinPayInfo.sign;
                                }
                                payReq.sign = str3;
                                createWXAPI.sendReq(payReq);
                                paySelectorDialog.G = true;
                            } catch (Exception e) {
                                fo.a.u("PaySelectorDialog").bug(new PayFailedException(str5, e), "PaySelectorDialog", new Object[0]);
                                q.n("服务器内部错误");
                            }
                        }
                    } else if (i == 13 && !paySelectorDialog.A) {
                        paySelectorDialog.X();
                    } else if (i != 6) {
                    } else {
                        if (!PatchProxy.proxy(new Object[]{paySendModel}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250891, new Class[]{PaySendModel.class}, Void.TYPE).isSupported && (activity = paySelectorDialog.getActivity()) != null) {
                            int i3 = paySendModel.riskResult;
                            if (i3 == 1) {
                                BindBankCardResult bindBankCardResult = paySelectorDialog.n;
                                if (bindBankCardResult != null) {
                                    String str6 = paySelectorDialog.l;
                                    if (str6 == null) {
                                        str6 = str2;
                                    }
                                    BankCardInfo boundCard2 = bindBankCardResult.getBoundCard();
                                    String c5 = j50.p.c(boundCard2 != null ? Long.valueOf(boundCard2.getCardId()) : null);
                                    BindBankCardResult bindBankCardResult2 = paySelectorDialog.n;
                                    if (bindBankCardResult2 != null) {
                                        str4 = bindBankCardResult2.getBankCardToken();
                                    }
                                    if (str4 == null) {
                                        str4 = str2;
                                    }
                                    if (paySelectorDialog.N) {
                                        yx0.a aVar = yx0.a.f40524a;
                                        String str7 = paySelectorDialog.l;
                                        if (str7 != null) {
                                            str2 = str7;
                                        }
                                        str2 = aVar.a(str2);
                                    }
                                    paySelectorDialog.C(str6, c5, str4, str2);
                                } else if (paySelectorDialog.N) {
                                    String str8 = paySelectorDialog.l;
                                    if (str8 == null) {
                                        str8 = str2;
                                    }
                                    if (!(bindBankCardResult == null || (boundCard = bindBankCardResult.getBoundCard()) == null)) {
                                        l = Long.valueOf(boundCard.getCardId());
                                    }
                                    String c12 = j50.p.c(l);
                                    yx0.a aVar2 = yx0.a.f40524a;
                                    String str9 = paySelectorDialog.l;
                                    if (str9 == null) {
                                        str9 = str2;
                                    }
                                    paySelectorDialog.C(str8, c12, str2, aVar2.a(str9));
                                } else {
                                    paySelectorDialog.W(paySendModel.payLogNum);
                                }
                            } else if (i3 != 2) {
                                if (i3 == 3) {
                                    q.l(R$string.error_please_select_another_pay_method);
                                }
                            } else if (paySendModel.verifyType == 1) {
                                ActivityResultLauncher<Intent> activityResultLauncher = paySelectorDialog.t;
                                if (activityResultLauncher == null) {
                                    Intrinsics.throwUninitializedPropertyAccessException("liveLauncher");
                                }
                                activityResultLauncher.launch(u91.e.h(activity, PushConstants.PUSH_TYPE_UPLOAD_LOG, "1306"));
                            }
                        }
                    }
                }
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class h extends p<String> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ PaySelectorDialog b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public h(PaySelectorDialog paySelectorDialog, FragmentActivity fragmentActivity, Activity activity, boolean z) {
            super(activity, z);
            this.b = paySelectorDialog;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            if (!PatchProxy.proxy(new Object[]{(String) obj}, this, changeQuickRedirect, false, 250955, new Class[]{String.class}, Void.TYPE).isSupported) {
                this.b.M(true);
            }
        }
    }

    /* compiled from: PaySelectorDialog.kt */
    public static final class i implements BottomTransactionPwdDialog.BottomTransactionPwdListener {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ PaySelectorDialog f21213a;
        public final /* synthetic */ String b;

        public i(PaySelectorDialog paySelectorDialog, String str) {
            this.f21213a = paySelectorDialog;
            this.b = str;
        }

        @Override // com.shizhuang.duapp.modules.du_mall_common.dialog.BottomTransactionPwdDialog.BottomTransactionPwdListener
        public void onFinishInput(@NotNull BottomTransactionPwdDialog bottomTransactionPwdDialog, @NotNull String str) {
            if (!PatchProxy.proxy(new Object[]{bottomTransactionPwdDialog, str}, this, changeQuickRedirect, false, 250975, new Class[]{BottomTransactionPwdDialog.class, String.class}, Void.TYPE).isSupported) {
                PaySelectorDialog paySelectorDialog = this.f21213a;
                String str2 = this.b;
                if (str2 == null) {
                    str2 = "";
                }
                if (!PatchProxy.proxy(new Object[]{str2, bottomTransactionPwdDialog, str}, paySelectorDialog, PaySelectorDialog.changeQuickRedirect, false, 250894, new Class[]{String.class, BottomTransactionPwdDialog.class, String.class}, Void.TYPE).isSupported) {
                    rx0.a.confirmPay$default(rx0.a.f37829a, str2, null, a1.a.f(str, "du"), null, null, null, new i0(paySelectorDialog, bottomTransactionPwdDialog, bottomTransactionPwdDialog), 58, null);
                }
            }
        }
    }

    public static View A(PaySelectorDialog paySelectorDialog, LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, paySelectorDialog, changeQuickRedirect, false, 250919, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : super.onCreateView(layoutInflater, viewGroup, bundle);
    }

    public static void B(PaySelectorDialog paySelectorDialog, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, paySelectorDialog, changeQuickRedirect, false, 250921, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

    public static /* synthetic */ void P(PaySelectorDialog paySelectorDialog, int i3, boolean z4, int i12, Object obj) {
        if ((i12 & 2) != 0) {
            z4 = false;
        }
        paySelectorDialog.O(i3, z4);
    }

    public static void x(PaySelectorDialog paySelectorDialog, Bundle bundle) {
        boolean z4 = true;
        if (!PatchProxy.proxy(new Object[]{bundle}, paySelectorDialog, changeQuickRedirect, false, 250873, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
            EventBus.b().k(paySelectorDialog);
            Bundle arguments = paySelectorDialog.getArguments();
            if (arguments != null) {
                paySelectorDialog.i = arguments.getInt("typeId");
                paySelectorDialog.j = arguments.getLong("orderId");
                arguments.getInt("amount");
                paySelectorDialog.f21208v = arguments.getBoolean("enableWeChatPay", true);
                paySelectorDialog.w = arguments.getString(PushConstants.TITLE);
                paySelectorDialog.k = arguments.getString("orderNum", "");
                paySelectorDialog.x = arguments.getString("extras");
            }
            if (!PatchProxy.proxy(new Object[0], paySelectorDialog, changeQuickRedirect, false, 250874, new Class[0], Void.TYPE).isSupported) {
                String str = paySelectorDialog.x;
                if (!(str == null || str.length() == 0)) {
                    z4 = false;
                }
                if (!z4) {
                    Map map = (Map) nd.e.h(paySelectorDialog.x, new m0().getType());
                    if (map != null) {
                        paySelectorDialog.J = (String) map.get("sensorOrderId");
                        paySelectorDialog.K = (String) map.get("prior_page_source_title");
                        paySelectorDialog.L = (String) map.get("prior_page_url");
                    }
                }
            }
        }
    }

    public static void y(PaySelectorDialog paySelectorDialog) {
        String str;
        if (!PatchProxy.proxy(new Object[0], paySelectorDialog, changeQuickRedirect, false, 250876, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            SensorsDataAPI.sharedInstance().trackViewScreen(paySelectorDialog);
            if (paySelectorDialog.y) {
                paySelectorDialog.M(paySelectorDialog.z);
            } else if (!PatchProxy.proxy(new Object[0], paySelectorDialog, changeQuickRedirect, false, 250900, new Class[0], Void.TYPE).isSupported && paySelectorDialog.G) {
                paySelectorDialog.G = false;
                b50.d dVar = b50.d.f1575a;
                String str2 = paySelectorDialog.l;
                if (str2 == null) {
                    str2 = "";
                }
                dVar.k(str2, new j0(paySelectorDialog, paySelectorDialog).withoutToast());
            }
            if (!PatchProxy.proxy(new Object[0], paySelectorDialog, changeQuickRedirect, false, 250905, new Class[0], Void.TYPE).isSupported && !paySelectorDialog.M) {
                i60.a aVar = i60.a.f33292a;
                Integer valueOf = Integer.valueOf(paySelectorDialog.i);
                String H2 = paySelectorDialog.H();
                String str3 = paySelectorDialog.K;
                if (str3 != null) {
                    str = str3;
                } else {
                    str = "";
                }
                String str4 = paySelectorDialog.L;
                if (str4 == null) {
                    str4 = "";
                }
                if (!PatchProxy.proxy(new Object[]{valueOf, H2, str, str4}, aVar, i60.a.changeQuickRedirect, false, 124990, new Class[]{Object.class, Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                    i60.b bVar = i60.b.f33293a;
                    ArrayMap c5 = n.c(8, "prior_source", valueOf, "order_id", H2);
                    c5.put("prior_page_source_title", str);
                    c5.put("prior_page_url", str4);
                    bVar.b("trade_box_pageview", "522", "", c5);
                }
            }
        }
    }

    public static void z(PaySelectorDialog paySelectorDialog) {
        if (!PatchProxy.proxy(new Object[0], paySelectorDialog, changeQuickRedirect, false, 250917, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

    public final void C(String str, String str2, String str3, String str4) {
        if (!PatchProxy.proxy(new Object[]{str, str2, str3, str4}, this, changeQuickRedirect, false, 250893, new Class[]{String.class, String.class, String.class, String.class}, Void.TYPE).isSupported) {
            FragmentActivity activity = getActivity();
            if (activity != null) {
                rx0.a.confirmPay$default(rx0.a.f37829a, str, null, "", str2, str3, str4, new b(this, activity, activity, false), 2, null);
            }
        }
    }

    public final void D() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250901, new Class[0], Void.TYPE).isSupported) {
            G().cancel();
            this.P = false;
            this.Q = true;
        }
    }

    public final void E() {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250859, new Class[0], Void.TYPE).isSupported && (activity = getActivity()) != null) {
            rx0.a.f37829a.p(new c(this, activity, activity, false));
        }
    }

    public final void F(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 250847, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            rx0.a.f37829a.q(TextUtils.isEmpty(this.k) ? String.valueOf(this.j) : this.k, this.i, z4, new d(this, this, true));
        }
    }

    public final CountDownTimer G() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250838, new Class[0], CountDownTimer.class);
        return (CountDownTimer) (proxy.isSupported ? proxy.result : this.O.getValue());
    }

    public final String H() {
        boolean z4 = false;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250909, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        String str = this.J;
        if (!(str == null || str.length() == 0)) {
            String str2 = this.J;
            if (str2 != null) {
                return str2;
            }
            return "";
        }
        if (this.k.length() > 0) {
            z4 = true;
        }
        if (z4) {
            return this.k;
        }
        return String.valueOf(this.j);
    }

    public final int I(String str) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 250869, new Class[]{String.class}, Integer.TYPE);
        if (proxy.isSupported) {
            return ((Integer) proxy.result).intValue();
        }
        if (!TextUtils.isEmpty(str)) {
            if (Intrinsics.areEqual(str, "alipay")) {
                return 0;
            }
            if (Intrinsics.areEqual(str, "wxpay")) {
                return 1;
            }
            if (Intrinsics.areEqual(str, "alipay_signpay")) {
                return 13;
            }
            if (Intrinsics.areEqual(str, PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD.getMethodCode()) || Intrinsics.areEqual(str, PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD_SIGNPAY.getMethodCode())) {
                return 6;
            }
            if (Intrinsics.areEqual(str, PayMethodEnum.PAY_METHOD_ENUM_ZHI_MA_AUTH_PAY.getMethodCode())) {
                return 22;
            }
        }
        return -1;
    }

    public final int J() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250908, new Class[0], Integer.TYPE);
        if (proxy.isSupported) {
            return ((Integer) proxy.result).intValue();
        }
        int i3 = this.f21207u;
        if (i3 == 0) {
            return PayMethodEnum.PAY_METHOD_ENUM_ALIPAY.getStaticsPayType();
        }
        if (i3 == 1) {
            return PayMethodEnum.PAY_METHOD_ENUM_WXPAY.getStaticsPayType();
        }
        if (i3 == 6) {
            return PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD.getStaticsPayType();
        }
        if (i3 == 13) {
            return PayMethodEnum.PAY_METHOD_ENUM_ALIPAY_SIGNPAY.getStaticsPayType();
        }
        if (i3 != 22) {
            return 0;
        }
        return PayMethodEnum.PAY_METHOD_ENUM_ZHI_MA_AUTH_PAY.getStaticsPayType();
    }

    public final boolean K() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250899, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        return this.f21207u == 13;
    }

    public final boolean L() {
        List<PayMethod> list;
        T t4;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250871, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        CashierModel cashierModel = this.D;
        if (cashierModel == null || (list = cashierModel.supportPayMethods) == null) {
            return false;
        }
        Iterator<T> it2 = list.iterator();
        while (true) {
            if (!it2.hasNext()) {
                t4 = null;
                break;
            }
            t4 = it2.next();
            if (Intrinsics.areEqual(t4.methodCode, PayMethodEnum.PAY_METHOD_ENUM_ZHI_MA_AUTH_PAY.getMethodCode())) {
                break;
            }
        }
        T t12 = t4;
        if (t12 == null || t12.status != 1) {
            return false;
        }
        return true;
    }

    public final void M(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 250889, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            if (isResumed()) {
                this.y = false;
                IPayService.PayResultListener payResultListener = this.f;
                if (payResultListener != null) {
                    payResultListener.onPayResult(z4);
                }
                if (z4) {
                    this.H = true;
                }
                dismiss();
                return;
            }
            this.y = true;
            this.z = z4;
        }
    }

    public final void N() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250897, new Class[0], Void.TYPE).isSupported) {
            D();
            FragmentActivity activity = getActivity();
            if (activity != null) {
                activity.runOnUiThread(new f(this));
            }
        }
    }

    public final void O(int i3, boolean z4) {
        PayMethod payMethod;
        List<PayMethod> list;
        boolean z5;
        String str;
        Object[] objArr = {new Integer(i3), new Byte(z4 ? (byte) 1 : 0)};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Integer.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 250860, new Class[]{cls, Boolean.TYPE}, Void.TYPE).isSupported) {
            PayItemView payItemView = this.B.get(i3);
            if (payItemView == null) {
                fo.a.u("PaySelectorDialog").e(j.h("payMethodItemClicked error payTool=", i3), new Object[0]);
            } else if (this.f21207u != i3 || z4) {
                this.f21207u = i3;
                if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 250861, new Class[]{cls}, Void.TYPE).isSupported) {
                    int size = this.B.size();
                    for (int i12 = 0; i12 < size; i12++) {
                        this.B.valueAt(i12).setSelected(this.B.keyAt(i12) == i3);
                    }
                }
                if (!z4 && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250907, new Class[0], Void.TYPE).isSupported) {
                    i60.a aVar = i60.a.f33292a;
                    String H2 = H();
                    Integer valueOf = Integer.valueOf(J());
                    if (!PatchProxy.proxy(new Object[]{H2, valueOf}, aVar, i60.a.changeQuickRedirect, false, 124973, new Class[]{Object.class, Object.class}, Void.TYPE).isSupported) {
                        i60.b.f33293a.b("trade_order_pay_click", "1479", "3387", a.f.b(8, "order_id", H2, "payment_method", valueOf));
                    }
                }
                PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 250863, new Class[]{Integer.TYPE}, PayMethod.class);
                if (proxy.isSupported) {
                    payMethod = (PayMethod) proxy.result;
                } else {
                    CashierModel cashierModel = this.D;
                    PayMethod payMethod2 = null;
                    if (!(cashierModel == null || (list = cashierModel.supportPayMethods) == null)) {
                        Iterator<T> it2 = list.iterator();
                        while (true) {
                            if (!it2.hasNext()) {
                                break;
                            }
                            T next = it2.next();
                            if (I(next.methodCode) == i3) {
                                z5 = true;
                                continue;
                            } else {
                                z5 = false;
                                continue;
                            }
                            if (z5) {
                                payMethod2 = next;
                                break;
                            }
                        }
                        payMethod2 = payMethod2;
                    }
                    payMethod = payMethod2;
                }
                long j12 = payMethod != null ? payMethod.realPayAmount : 0;
                if (!PatchProxy.proxy(new Object[]{new Long(j12)}, this, changeQuickRedirect, false, 250865, new Class[]{Long.TYPE}, Void.TYPE).isSupported) {
                    ((FontText) _$_findCachedViewById(R$id.tv_pay_count)).setText(StringUtils.m(j12));
                }
                if (!PatchProxy.proxy(new Object[]{new Integer(i3), payMethod, payItemView}, this, changeQuickRedirect, false, 250862, new Class[]{Integer.TYPE, PayMethod.class, PayItemView.class}, Void.TYPE).isSupported) {
                    if (i3 == 13 && !this.A) {
                        str = "支付宝免密支付";
                    } else if (i3 != 6 || !this.N) {
                        str = payItemView.getPayMethod();
                    } else {
                        str = "极速支付";
                    }
                    long j13 = payMethod != null ? payMethod.realPayAmount : 0;
                    if ((j13 == 0 && i3 != 22) || TextUtils.isEmpty(str)) {
                        str = getString(R$string.du_pay_confirm_tip);
                    }
                    ((Button) _$_findCachedViewById(R$id.tv_pay_confirm)).setText(getString(R$string.du_pay_confirm_amount, str, Float.valueOf(((float) j13) / 100.0f)));
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:33:0x009c, code lost:
        if (r1 != null) goto L_0x009e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:38:0x00a8, code lost:
        if (r1 != null) goto L_0x009e;
     */
    public final void Q(int i3, int i12, BindBankCardResult bindBankCardResult) {
        FragmentActivity activity;
        String str;
        String str2;
        long j12;
        int i13;
        BankCardInfo bankCardInfo;
        boolean z4 = false;
        Object[] objArr = {new Integer(i3), new Integer(i12), bindBankCardResult};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Integer.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 250890, new Class[]{cls, cls, BindBankCardResult.class}, Void.TYPE).isSupported && cd.l.c(this) && (activity = getActivity()) != null) {
            String str3 = this.k;
            if (str3.length() == 0) {
                z4 = true;
            }
            if (z4) {
                str3 = String.valueOf(this.j);
            }
            this.n = bindBankCardResult;
            long j13 = -1;
            String str4 = "";
            if (this.f21207u == 6) {
                int payToolType = this.N ? PayMethodEnum.PAY_METHOD_ENUM_BANK_CARD_SIGNPAY.getPayToolType() : i12;
                String str5 = null;
                String bankCardToken = bindBankCardResult != null ? bindBankCardResult.getBankCardToken() : null;
                if (bankCardToken == null) {
                    bankCardToken = str4;
                }
                if (bindBankCardResult == null ? (bankCardInfo = this.m) != null : (bankCardInfo = bindBankCardResult.getBoundCard()) != null) {
                    j13 = bankCardInfo.getCardId();
                }
                if (bindBankCardResult != null) {
                    str5 = bindBankCardResult.getBusinessCode();
                } else {
                    BankCardInfo bankCardInfo2 = this.m;
                    if (bankCardInfo2 != null) {
                        str5 = bankCardInfo2.getBusinessCode();
                    }
                }
                str4 = str5;
                i13 = payToolType;
                j12 = j13;
                str = str4;
                str2 = bankCardToken;
            } else {
                j12 = -1;
                str2 = str4;
                str = str2;
                i13 = i12;
            }
            rx0.a.f37829a.t(0, this.i, str3, i3, i13, "0", j12, str2, str, new g(this, bindBankCardResult, activity, activity, false));
        }
    }

    public void R(int i3, @org.jetbrains.annotations.Nullable String str) {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), str}, this, changeQuickRedirect, false, 250888, new Class[]{Integer.TYPE, String.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
            rx0.b.noticeJavaPayResult(i3, str, new h(this, activity, activity, false));
        }
    }

    public final void S() {
        LinearLayout linearLayout;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250864, new Class[0], Void.TYPE).isSupported && (linearLayout = (LinearLayout) _$_findCachedViewById(R$id.ll_pay_items)) != null) {
            linearLayout.removeAllViews();
        }
    }

    public final void T(BankCardInfo bankCardInfo, PayItemView payItemView) {
        TextView textView;
        DuImageLoaderView duImageLoaderView;
        boolean z4 = false;
        if (!PatchProxy.proxy(new Object[]{bankCardInfo, payItemView}, this, changeQuickRedirect, false, 250855, new Class[]{BankCardInfo.class, PayItemView.class}, Void.TYPE).isSupported && bankCardInfo != null) {
            View view = this.I;
            if (!(view == null || (duImageLoaderView = (DuImageLoaderView) view.findViewById(R$id.dilvBank)) == null)) {
                String iconUrl = bankCardInfo.getIconUrl();
                if (iconUrl == null) {
                    iconUrl = "";
                }
                co.c i3 = duImageLoaderView.i(iconUrl);
                if (i3 != null) {
                    i3.d = new PaySelectorDialog$setBankCardPayItemView$1(payItemView, bankCardInfo);
                    i3.f = new PaySelectorDialog$setBankCardPayItemView$2(payItemView, bankCardInfo);
                    i3.x();
                }
            }
            StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
            String format = String.format(getString(R$string.formated_bank_name_and_num), Arrays.copyOf(new Object[]{bankCardInfo.fullBankCardName(), bankCardInfo.getCardNo()}, 2));
            View view2 = this.I;
            if (!(view2 == null || (textView = (TextView) view2.findViewById(R$id.tvCardName)) == null)) {
                textView.setText(format);
            }
            String disableDesc = bankCardInfo.getDisableDesc();
            if (disableDesc == null || disableDesc.length() == 0) {
                z4 = true;
            }
            if (!z4) {
                payItemView.setRightSummary(disableDesc);
            }
        }
    }

    public final void U() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250849, new Class[0], Void.TYPE).isSupported) {
            ((Button) _$_findCachedViewById(R$id.tv_pay_confirm)).setEnabled(false);
        }
    }

    public final void V(boolean z4) {
        int i3 = 0;
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 250898, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            ((LinearLayout) _$_findCachedViewById(R$id.ll_select_pay)).setVisibility(!z4 ? 1 : 0 ? 0 : 8);
            String str = "支付中";
            ((TextView) _$_findCachedViewById(R$id.tv_result_msg)).setText(K() ? "免密支付中" : str);
            ((ConstraintLayout) _$_findCachedViewById(R$id.clPollResult)).setVisibility(z4 ? 0 : 8);
            TextView textView = (TextView) _$_findCachedViewById(R$id.iv_method_title);
            if (!z4) {
                str = "选择支付方式";
            }
            textView.setText(str);
            ImageView imageView = (ImageView) _$_findCachedViewById(R$id.iv_close);
            if (!(!z4)) {
                i3 = 8;
            }
            imageView.setVisibility(i3);
            if (z4) {
                ((DuImageLoaderView) _$_findCachedViewById(R$id.img_polling)).i("https://cdn.poizon.com/node-common/5abf914d8316761d7556da6384193365.gif").x();
            }
        }
    }

    public final void W(String str) {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 250892, new Class[]{String.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
            BottomTransactionPwdDialog.k.a(activity.getSupportFragmentManager()).P(new i(this, str)).H();
        }
    }

    public final void X() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250895, new Class[0], Void.TYPE).isSupported) {
            V(true);
            if (!this.P) {
                G().start();
                this.P = true;
            }
        }
    }

    public final void Y() {
        Dialog dialog;
        Window window;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250845, new Class[0], Void.TYPE).isSupported && (dialog = getDialog()) != null && (window = dialog.getWindow()) != null) {
            WindowManager.LayoutParams attributes = window.getAttributes();
            attributes.gravity = 80;
            attributes.width = fi.b.f32351a;
            attributes.height = fi.b.b(570.0f);
            window.setAttributes(attributes);
        }
    }

    public View _$_findCachedViewById(int i3) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 250910, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.S == null) {
            this.S = new HashMap();
        }
        View view = (View) this.S.get(Integer.valueOf(i3));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i3);
        this.S.put(Integer.valueOf(i3), findViewById);
        return findViewById;
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment
    public void g() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250839, new Class[0], Void.TYPE).isSupported) {
            super.g();
            Y();
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.common.dialog.BaseViewControlDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 250872, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.common.dialog.BaseViewControlDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 250918, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroy() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250903, new Class[0], Void.TYPE).isSupported) {
            super.onDestroy();
            if (EventBus.b().e(this)) {
                EventBus.b().n(this);
            }
            D();
        }
    }

    @Override // androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onDestroyView() {
        HashMap hashMap;
        super.onDestroyView();
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250911, new Class[0], Void.TYPE).isSupported && (hashMap = this.S) != null) {
            hashMap.clear();
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEvent(@NotNull SCEvent sCEvent) {
        UserBankCardInfo userBankCardInfo;
        List<BankCardInfo> cards;
        T t4;
        boolean z4;
        CashierModel cashierModel;
        if (!PatchProxy.proxy(new Object[]{sCEvent}, this, changeQuickRedirect, false, 250883, new Class[]{SCEvent.class}, Void.TYPE).isSupported) {
            if (sCEvent instanceof BindBankCardResult) {
                this.f21207u = 6;
                Q(6, 0, (BindBankCardResult) sCEvent);
            } else if (sCEvent instanceof MessageEvent) {
                if (((MessageEvent) sCEvent).getMessage() == "MSG_UPDATE_WITHDRAW_PWD_SUCCESS" && (cashierModel = this.D) != null) {
                    cashierModel.setHasTradePassword();
                }
            } else if (sCEvent instanceof SelectPayBankCardEvent) {
                long bankCardId = ((SelectPayBankCardEvent) sCEvent).getBankCardId();
                CashierModel cashierModel2 = this.D;
                if (cashierModel2 != null && (userBankCardInfo = cashierModel2.bankCard) != null && (cards = userBankCardInfo.getCards()) != null) {
                    Iterator<T> it2 = cards.iterator();
                    while (true) {
                        if (!it2.hasNext()) {
                            t4 = null;
                            break;
                        }
                        t4 = it2.next();
                        if (t4.getCardId() == bankCardId) {
                            z4 = true;
                            continue;
                        } else {
                            z4 = false;
                            continue;
                        }
                        if (z4) {
                            break;
                        }
                    }
                    T t12 = t4;
                    if (t12 != null) {
                        this.m = t12;
                        PayItemView payItemView = this.B.get(6);
                        if (payItemView != null) {
                            T(this.m, payItemView);
                        }
                    }
                }
            }
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseViewControlDialog, com.shizhuang.duapp.common.base.inter.IDialogViewControllerV2
    public void onNetErrorRetryClick() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250904, new Class[0], Void.TYPE).isSupported) {
            super.onNetErrorRetryClick();
            F(true);
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onPayEvent(@NotNull PayResp payResp) {
        if (!PatchProxy.proxy(new Object[]{payResp}, this, changeQuickRedirect, false, 250882, new Class[]{PayResp.class}, Void.TYPE).isSupported) {
            this.G = false;
            Printer u4 = fo.a.u("PaySelectorDialog");
            StringBuilder h12 = a.f.h("wx pay sdk onPayEvent:errCode:");
            h12.append(payResp.errCode);
            h12.append(" isShowing:");
            h12.append(f());
            u4.i(h12.toString(), new Object[0]);
            if (nq.b.e(this) && payResp.getType() == 5 && payResp.errCode == 0) {
                if (this.i != 24) {
                    q.n("支付成功");
                }
                R(1, payResp.prepayId);
            }
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.common.dialog.BaseViewControlDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250875, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.common.dialog.BaseViewControlDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250916, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.common.dialog.BaseViewControlDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 250920, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public int p() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250846, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R$style.PaySizeBottomDialog;
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public int q() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250840, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R$layout.dialog_pay_selector;
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public void r(@NotNull View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 250841, new Class[]{View.class}, Void.TYPE).isSupported) {
            Dialog dialog = getDialog();
            if (dialog != null) {
                dialog.setCanceledOnTouchOutside(false);
            }
            setCancelable(false);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250842, new Class[0], Void.TYPE).isSupported) {
                MallScrollStateExposureHelper<View> mallScrollStateExposureHelper = new MallScrollStateExposureHelper<>(this, (ScrollStateView) _$_findCachedViewById(R$id.ssvContent), (LinearLayout) _$_findCachedViewById(R$id.ll_pay_items), new PaySelectorDialog$initPayItemViewExposure$1(this));
                this.o = mallScrollStateExposureHelper;
                mallScrollStateExposureHelper.setExposureCallback(new PaySelectorDialog$initPayItemViewExposure$2(this));
                MallScrollStateExposureHelper<View> mallScrollStateExposureHelper2 = this.o;
                if (mallScrollStateExposureHelper2 != null) {
                    mallScrollStateExposureHelper2.startAttachExposure(true);
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250866, new Class[0], Void.TYPE).isSupported) {
                int i3 = this.i;
                if (i3 == 1) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付保证金");
                } else if (i3 == 2) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付认证金额");
                } else if (i3 == 3) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付保证金");
                } else if (i3 == 6) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付保证金");
                } else if (i3 == 8) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("合计付款");
                } else if (i3 == 10 || i3 == 11) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("合计付款");
                } else if (i3 == 12 || i3 == 9 || i3 == 13) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付保证金");
                } else if (i3 == 15) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("支付运费");
                } else if (i3 == 24) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("合计续存费用");
                } else if (i3 == 27) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText("合计充值");
                    ((TextView) _$_findCachedViewById(R$id.iv_method_title)).setText("选择充值方式");
                }
                if (!TextUtils.isEmpty(this.w)) {
                    ((TextView) _$_findCachedViewById(R$id.tv_count_title)).setText(this.w);
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250885, new Class[0], Void.TYPE).isSupported) {
                ((Group) _$_findCachedViewById(R$id.group_time_limit_all)).setVisibility(8);
                ((Group) _$_findCachedViewById(R$id.group_time_limit_time)).setVisibility(8);
                ((Group) _$_findCachedViewById(R$id.group_time_limit_hour)).setVisibility(8);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250870, new Class[0], Void.TYPE).isSupported) {
                _$_findCachedViewById(R$id.divider_cash).setVisibility(8);
                int i12 = R$id.tv_du_cash;
                ((TextView) _$_findCachedViewById(i12)).setVisibility(8);
                ((FontText) _$_findCachedViewById(R$id.tv_du_cash_amount)).setVisibility(8);
                ((TextView) _$_findCachedViewById(i12)).setVisibility(8);
            }
            F(true);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250843, new Class[0], Void.TYPE).isSupported) {
                this.r = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new PaySelectorDialog$registerActivityResult$1(this));
                this.s = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new PaySelectorDialog$registerActivityResult$2(this));
                this.t = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new PaySelectorDialog$registerActivityResult$3(this));
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 250844, new Class[0], Void.TYPE).isSupported) {
                ((ImageView) _$_findCachedViewById(R$id.iv_close)).setOnClickListener(new PaySelectorDialog$setViewOnClickListener$1(this));
                ((IconFontTextView) _$_findCachedViewById(R$id.iv_qa)).setOnClickListener(new PaySelectorDialog$setViewOnClickListener$2(this));
                ((Button) _$_findCachedViewById(R$id.tv_pay_confirm)).setOnClickListener(new PaySelectorDialog$setViewOnClickListener$3(this));
                ((FrameLayout) _$_findCachedViewById(R$id.flShowOtherPayType)).setOnClickListener(new PaySelectorDialog$setViewOnClickListener$$inlined$click$1(this));
            }
        }
    }
}