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


package yr0;

import android.annotation.SuppressLint;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.shizhuang.duapp.common.base.inter.IViewController;
import com.shizhuang.duapp.libs.safety.ISafety;
import com.shizhuang.duapp.modules.du_mall_common.constant.MallABTest;
import com.shizhuang.duapp.modules.mall_home.api.ProductFacadeV2;
import com.shizhuang.duapp.modules.mall_home.api.ProductService;
import com.shizhuang.duapp.modules.mall_home.event.MHRecommendSnapType;
import com.shizhuang.duapp.modules.mall_home.helper.AppBackEventHelperV2;
import com.shizhuang.duapp.modules.mall_home.model.MallComponentListModel;
import com.shizhuang.duapp.modules.mall_home.ui.fragment.MallBaseListFragment;
import com.shizhuang.duapp.modules.mall_home.ui.fragment.MallListFragmentV3;
import com.shizhuang.duapp.modules.mall_home.ui.fragment.MallListFragmentV3$fetchData$2$onSuccess$1;
import com.shizhuang.duapp.modules.mall_home.ui.fragment.MallListFragmentV3$getMallListCdn$1;
import df.d0;
import df.q;
import fo.a;
import kotlin.NoWhenBranchMatchedException;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.Nullable;
import rd.l;
import td.j;
import td.s;
import wr0.f;

/* compiled from: MallListFragmentV3.kt */
public final class e extends MallBaseListFragment.b<MallComponentListModel> {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final /* synthetic */ MallListFragmentV3 b;

    /* renamed from: c  reason: collision with root package name */
    public final /* synthetic */ boolean f40477c;
    public final /* synthetic */ boolean d;
    public final /* synthetic */ int e;
    public final /* synthetic */ MHRecommendSnapType f;

    /* renamed from: g  reason: collision with root package name */
    public final /* synthetic */ long f40478g;

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public e(MallListFragmentV3 mallListFragmentV3, boolean z, boolean z4, int i, MHRecommendSnapType mHRecommendSnapType, long j, ISafety iSafety, IViewController iViewController) {
        super(iSafety, iViewController, false, 4);
        this.b = mallListFragmentV3;
        this.f40477c = z;
        this.d = z4;
        this.e = i;
        this.f = mHRecommendSnapType;
        this.f40478g = j;
    }

    @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
    public void onBzError(@Nullable l<MallComponentListModel> lVar) {
        if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 215439, new Class[]{l.class}, Void.TYPE).isSupported) {
            if (!this.f40477c || !(!this.b.l.getItems().isEmpty())) {
                MallListFragmentV3 mallListFragmentV3 = this.b;
                boolean z = this.f40477c;
                long j = this.f40478g;
                MHRecommendSnapType mHRecommendSnapType = this.f;
                if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0), new Long(j), mHRecommendSnapType}, mallListFragmentV3, MallListFragmentV3.changeQuickRedirect, false, 215398, new Class[]{Boolean.TYPE, Long.TYPE, MHRecommendSnapType.class}, Void.TYPE).isSupported) {
                    a.m(mallListFragmentV3.TAG + " getMallListCdn isRefresh:" + z + ", requestStartTime: " + j + ", lastId: " + mallListFragmentV3.o, new Object[0]);
                    ProductFacadeV2 productFacadeV2 = ProductFacadeV2.f19440a;
                    MallListFragmentV3$getMallListCdn$1 mallListFragmentV3$getMallListCdn$1 = new MallListFragmentV3$getMallListCdn$1(mallListFragmentV3, z);
                    String str = mallListFragmentV3.o;
                    String str2 = str.length() == 0 ? "0" : str;
                    s withoutToast = new f(mallListFragmentV3, z, mHRecommendSnapType, j, mallListFragmentV3.u(), mallListFragmentV3).withoutToast();
                    if (!PatchProxy.proxy(new Object[]{"0", str2, mallListFragmentV3$getMallListCdn$1, withoutToast}, productFacadeV2, ProductFacadeV2.changeQuickRedirect, false, 212572, new Class[]{String.class, String.class, Function1.class, s.class}, Void.TYPE).isSupported) {
                        ProductService s = productFacadeV2.s();
                        j.doRequest(s.getMallShoppingDataCdn("https://spucdn.dewu.com/dewu/commodity/homepage/" + "0" + '-' + str2 + ".json").map(new pr0.a(mallListFragmentV3$getMallListCdn$1)), withoutToast, MallComponentListModel.class);
                        return;
                    }
                    return;
                }
                return;
            }
            super.onBzError(lVar);
            if (!d0.i.e()) {
                q.n("请检查网络后重试");
            }
            a.w(this.b.TAG + " onBzError isRefresh:" + this.f40477c + ", lastId:" + this.b.o, new Object[0]);
            MallListFragmentV3 mallListFragmentV32 = this.b;
            mallListFragmentV32.C(this.f40477c, mallListFragmentV32.o);
            this.b.E.c(lVar);
        }
    }

    @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
    @SuppressLint({"MissingSuperCall"})
    public void onFailed(@Nullable l<Object> lVar) {
        boolean z = PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 215440, new Class[]{l.class}, Void.TYPE).isSupported;
    }

    @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
    public void onFinish() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 215441, new Class[0], Void.TYPE).isSupported) {
            super.onFinish();
            this.b.L();
            a.w(this.b.TAG + " onFinish isRefresh:" + this.f40477c + ", lastId:" + this.b.o, new Object[0]);
            if (this.f40477c) {
                this.b.f19547u = false;
            } else {
                this.b.f19548v = false;
            }
        }
    }

    @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
    public void onLoadCacheSuccess(Object obj) {
        MallComponentListModel mallComponentListModel = (MallComponentListModel) obj;
        if (!PatchProxy.proxy(new Object[]{mallComponentListModel}, this, changeQuickRedirect, false, 215437, new Class[]{MallComponentListModel.class}, Void.TYPE).isSupported) {
            super.onLoadCacheSuccess(mallComponentListModel);
            a.m(this.b.TAG + " onLoadCacheSuccess isRefresh:" + this.f40477c + ", lastId:" + mallComponentListModel.getLastId(), new Object[0]);
            MallListFragmentV3 mallListFragmentV3 = this.b;
            mallListFragmentV3.E.f(mallListFragmentV3.t(), 1, MapsKt__MapsJVMKt.mapOf(TuplesKt.to("requestType", "1")));
            this.b.showDataView();
            this.b.hideSkeletonView();
            this.b.U(mallComponentListModel, true, true);
        }
    }

    @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 215436, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
            a.w(this.b.TAG + " onStart isRefresh:" + this.f40477c + ", lastId:" + this.b.o, new Object[0]);
            if (this.d) {
                this.b.showLoadingView();
            }
        }
    }

    @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
    public void onSuccess(Object obj) {
        MallComponentListModel mallComponentListModel = (MallComponentListModel) obj;
        int i = 0;
        if (!PatchProxy.proxy(new Object[]{mallComponentListModel}, this, changeQuickRedirect, false, 215438, new Class[]{MallComponentListModel.class}, Void.TYPE).isSupported) {
            StringBuilder sb2 = new StringBuilder();
            sb2.append(this.b.TAG);
            sb2.append(" onSuccess isRefresh:");
            sb2.append(this.f40477c);
            sb2.append(", lastId:");
            sb2.append(mallComponentListModel != null ? mallComponentListModel.getLastId() : null);
            sb2.append(". fetchRandomId: ");
            sb2.append(this.b.O());
            sb2.append(". newFetchId: ");
            a.m(g.a.l(sb2, this.e, '.'), new Object[0]);
            if (!MallABTest.f13351a.r() || this.f40477c || this.b.O() == this.e) {
                super.onSuccess(mallComponentListModel);
                MallListFragmentV3 mallListFragmentV3 = this.b;
                mallListFragmentV3.E.f(mallListFragmentV3.t(), 0, MapsKt__MapsJVMKt.mapOf(TuplesKt.to("requestType", PushConstants.PUSH_TYPE_UPLOAD_LOG)));
                this.b.showDataView();
                this.b.hideSkeletonView();
                this.b.W(mallComponentListModel, this.f40477c);
                if (this.f40477c) {
                    int i3 = d.f40476a[this.f.ordinal()];
                    if (i3 == 1) {
                        i = -1;
                    } else if (i3 != 2) {
                        if (i3 == 3) {
                            i = this.b.l.indexOf((Function1<Object, Boolean>) MallListFragmentV3$fetchData$2$onSuccess$1.INSTANCE);
                        } else {
                            throw new NoWhenBranchMatchedException();
                        }
                    }
                    if (i < 0) {
                        return;
                    }
                    if (AppBackEventHelperV2.i.a() == 0 || i <= 0) {
                        f.f39733a.b(this.b.t().getLayoutManager(), i);
                    } else {
                        f.f39733a.a(this.b.Q(), this.b.t().getLayoutManager(), i);
                    }
                } else {
                    this.b.Z(this.f40478g);
                }
            }
        }
    }
}