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


package com.shizhuang.duapp.modules.aftersale.trace.view;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.util.AttributeSet;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelLazy;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.module.AbsModuleView;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuScaleType;
import com.shizhuang.duapp.modules.aftersale.trace.OtViewModel;
import com.shizhuang.duapp.modules.aftersale.trace.model.LogisticsTraceExtraInfo;
import com.shizhuang.duapp.modules.aftersale.trace.model.OtModel;
import com.shizhuang.duapp.modules.aftersale.trace.model.OtTopMergeViewWidgetModel;
import com.shizhuang.duapp.modules.du_mall_common.widget.DuIconsTextView;
import fi.b;
import i60.a;
import java.util.HashMap;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Reflection;
import m60.k;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {}, d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u001a\u001a\u00020\u0019\u0012\n\b\u0002\u0010\u001c\u001a\u0004\u0018\u00010\u001b\u0012\b\b\u0002\u0010\u001d\u001a\u00020\u0003¢\u0006\u0004\b\u001e\u0010\u001fJ\b\u0010\u0004\u001a\u00020\u0003H\u0016R\u001b\u0010\n\u001a\u00020\u00058BX‚„\u0002¢\u0006\f\n\u0004\b\u0006\u0010\u0007\u001a\u0004\b\b\u0010\tR\u001b\u0010\u000f\u001a\u00020\u000b8BX‚„\u0002¢\u0006\f\n\u0004\b\f\u0010\u0007\u001a\u0004\b\r\u0010\u000eR*\u0010\u0018\u001a\n\u0012\u0004\u0012\u00020\u0011\u0018\u00010\u00108\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u0012\u0010\u0013\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017¨\u0006 "}, d2 = {"Lcom/shizhuang/duapp/modules/aftersale/trace/view/OtTopMergeView;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lcom/shizhuang/duapp/modules/aftersale/trace/model/OtTopMergeViewWidgetModel;", "", "getLayoutId", "Lm60/k;", "b", "Lkotlin/Lazy;", "getViewExposureHelper", "()Lm60/k;", "viewExposureHelper", "Lcom/shizhuang/duapp/modules/aftersale/trace/OtViewModel;", "c", "getViewModel", "()Lcom/shizhuang/duapp/modules/aftersale/trace/OtViewModel;", "viewModel", "Lkotlin/Function0;", "", "d", "Lkotlin/jvm/functions/Function0;", "getShowIdentifyBlock", "()Lkotlin/jvm/functions/Function0;", "setShowIdentifyBlock", "(Lkotlin/jvm/functions/Function0;)V", "showIdentifyBlock", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_order_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: OtTopMergeView.kt */
public final class OtTopMergeView extends AbsModuleView<OtTopMergeViewWidgetModel> {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final Lazy b;

    /* renamed from: c  reason: collision with root package name */
    public final Lazy f10926c;
    @Nullable
    public Function0<Unit> d;
    public HashMap e;

    @JvmOverloads
    public OtTopMergeView(@NotNull Context context) {
        this(context, null, 0, 6);
    }

    @JvmOverloads
    public OtTopMergeView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0, 4);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ OtTopMergeView(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }

    private final k getViewExposureHelper() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65234, new Class[0], k.class);
        return (k) (proxy.isSupported ? proxy.result : this.b.getValue());
    }

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

    /* renamed from: a */
    public void update(@NotNull OtTopMergeViewWidgetModel otTopMergeViewWidgetModel) {
        if (!PatchProxy.proxy(new Object[]{otTopMergeViewWidgetModel}, this, changeQuickRedirect, false, 65239, new Class[]{OtTopMergeViewWidgetModel.class}, Void.TYPE).isSupported) {
            super.update(otTopMergeViewWidgetModel);
            getViewExposureHelper().startAttachExposure(true);
        }
    }

    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public int getLayoutId() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65238, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.layout_ot_top_certificate_and_identify;
    }

    @Nullable
    public final Function0<Unit> getShowIdentifyBlock() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65236, new Class[0], Function0.class);
        return proxy.isSupported ? (Function0) proxy.result : this.d;
    }

    public final OtViewModel getViewModel() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65235, new Class[0], OtViewModel.class);
        return (OtViewModel) (proxy.isSupported ? proxy.result : this.f10926c.getValue());
    }

    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public void onChanged(OtTopMergeViewWidgetModel otTopMergeViewWidgetModel) {
        OtTopMergeViewWidgetModel otTopMergeViewWidgetModel2 = otTopMergeViewWidgetModel;
        if (!PatchProxy.proxy(new Object[]{otTopMergeViewWidgetModel2}, this, changeQuickRedirect, false, 65240, new Class[]{OtTopMergeViewWidgetModel.class}, Void.TYPE).isSupported) {
            super.onChanged(otTopMergeViewWidgetModel2);
            LogisticsTraceExtraInfo certificateInfo = otTopMergeViewWidgetModel2.getCertificateInfo();
            if (!PatchProxy.proxy(new Object[]{certificateInfo}, this, changeQuickRedirect, false, 65242, new Class[]{LogisticsTraceExtraInfo.class}, Void.TYPE).isSupported) {
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivCertificateImage)).i("https://cdn.dewu.com/node-common/471590fd-51d4-0339-2a84-3fba975bb36a-180-117.png").l0(new ColorDrawable(-1)).p0(DuScaleType.CENTER_CROP).x();
                ViewExtensionKt.j((DuIconsTextView) _$_findCachedViewById(R.id.tvShowCertificate), 0, new OtTopMergeView$renderCertificate$1(this, certificateInfo), 1);
            }
            LogisticsTraceExtraInfo identifyInfo = otTopMergeViewWidgetModel2.getIdentifyInfo();
            if (!PatchProxy.proxy(new Object[]{identifyInfo}, this, changeQuickRedirect, false, 65241, new Class[]{LogisticsTraceExtraInfo.class}, Void.TYPE).isSupported) {
                DuImageLoaderView duImageLoaderView = (DuImageLoaderView) _$_findCachedViewById(R.id.ivIdentifyImage);
                String picUrl = identifyInfo.getPicUrl();
                String str = "";
                if (picUrl == null) {
                    picUrl = str;
                }
                duImageLoaderView.i(picUrl).l0(new ColorDrawable(-1)).p0(DuScaleType.CENTER_CROP).Y((float) b.b((float) 2)).X(-1).x();
                DuImageLoaderView duImageLoaderView2 = (DuImageLoaderView) _$_findCachedViewById(R.id.ivIdentifySubImage);
                String subPicUrl = identifyInfo.getSubPicUrl();
                if (subPicUrl != null) {
                    str = subPicUrl;
                }
                duImageLoaderView2.i(str).x();
                ((DuIconsTextView) _$_findCachedViewById(R.id.tvIdentifySubContent)).setText(identifyInfo.getSubContent());
                ViewExtensionKt.j((DuIconsTextView) _$_findCachedViewById(R.id.tvIdentifySubContent), 0, new OtTopMergeView$renderIdentify$1(this, identifyInfo), 1);
            }
        }
    }

    public final void setShowIdentifyBlock(@Nullable Function0<Unit> function0) {
        if (!PatchProxy.proxy(new Object[]{function0}, this, changeQuickRedirect, false, 65237, new Class[]{Function0.class}, Void.TYPE).isSupported) {
            this.d = function0;
        }
    }

    @JvmOverloads
    public OtTopMergeView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.b = LazyKt__LazyJVMKt.lazy(new OtTopMergeView$viewExposureHelper$2(this));
        AppCompatActivity g3 = ViewExtensionKt.g(this);
        this.f10926c = new ViewModelLazy(Reflection.getOrCreateKotlinClass(OtViewModel.class), new OtTopMergeView$$special$$inlined$activityViewModels$2(g3), new OtTopMergeView$$special$$inlined$activityViewModels$1(g3));
        getViewExposureHelper().setExposureCallback(new Function1<List<? extends Integer>, Unit>(this) {
            /* class com.shizhuang.duapp.modules.aftersale.trace.view.OtTopMergeView.AnonymousClass1 */
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ OtTopMergeView this$0;

            {
                this.this$0 = r1;
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            @Override // kotlin.jvm.functions.Function1
            public /* bridge */ /* synthetic */ Unit invoke(List<? extends Integer> list) {
                invoke((List<Integer>) list);
                return Unit.INSTANCE;
            }

            public final void invoke(@NotNull List<Integer> list) {
                OtModel e;
                LogisticsTraceExtraInfo extraIdentifyInfo;
                if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 65248, new Class[]{List.class}, Void.TYPE).isSupported) {
                    OtTopMergeView otTopMergeView = this.this$0;
                    if (!PatchProxy.proxy(new Object[0], otTopMergeView, OtTopMergeView.changeQuickRedirect, false, 65243, new Class[0], Void.TYPE).isSupported && (e = otTopMergeView.getViewModel().e()) != null && (extraIdentifyInfo = e.getExtraIdentifyInfo()) != null) {
                        a aVar = a.f33292a;
                        String subContent = extraIdentifyInfo.getSubContent();
                        if (subContent == null) {
                            subContent = "";
                        }
                        aVar.r1(subContent, otTopMergeView.getViewModel().getOrderNo(), 1);
                        aVar.o1(otTopMergeView.getViewModel().getOrderNo(), 1);
                    }
                }
            }
        });
    }
}