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


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

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.exposure.DuExposureHelper;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.widget.shapeview.ShapeConstraintLayout;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuScaleType;
import com.shizhuang.duapp.modules.aftersale.refund.model.BuyerRefundDetailInfoModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.IRefundTopView;
import com.shizhuang.duapp.modules.aftersale.refund.model.NewRefundRecallOrderInfoModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.OrderRefundTimelineModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.ProcessNodeModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.RefundProcessModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.RefundStatusDetailModel;
import com.shizhuang.duapp.modules.aftersale.refund.model.ReturnProcessModel;
import com.shizhuang.duapp.modules.common.model.StepNodeModel;
import com.shizhuang.duapp.modules.common.model.StepStatus;
import com.shizhuang.duapp.modules.du_mall_common.model.TextHyperlinkModel;
import com.shizhuang.duapp.modules.du_mall_common.widget.DuIconsTextView;
import fi.b;
import j60.d0;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.JvmOverloads;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {}, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010 \n\u0002\u0010$\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B'\b\u0007\u0012\u0006\u0010\u000b\u001a\u00020\n\u0012\n\b\u0002\u0010\r\u001a\u0004\u0018\u00010\f\u0012\b\b\u0002\u0010\u000e\u001a\u00020\u0004¢\u0006\u0004\b\u000f\u0010\u0010J\b\u0010\u0005\u001a\u00020\u0004H\u0016J\u001c\u0010\t\u001a\u0016\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u00020\b0\u0007\u0018\u00010\u0006H\u0002¨\u0006\u0011"}, d2 = {"Lcom/shizhuang/duapp/modules/aftersale/refund/view/RefundProcessView;", "Lcom/shizhuang/duapp/modules/aftersale/refund/view/RdBaseView;", "Lcom/shizhuang/duapp/modules/aftersale/refund/model/RefundProcessModel;", "Lcom/shizhuang/duapp/modules/aftersale/refund/model/IRefundTopView;", "", "getLayoutId", "", "", "", "getTrackContentInfoList", "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: RefundProcessView.kt */
public final class RefundProcessView extends RdBaseView<RefundProcessModel> implements IRefundTopView {
    public static ChangeQuickRedirect changeQuickRedirect;
    public HashMap e;

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

    @JvmOverloads
    public RefundProcessView(@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 */ RefundProcessView(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }

    public View _$_findCachedViewById(int i) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 63677, 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;
    }

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

    public final List<Map<String, String>> getTrackContentInfoList() {
        Map map;
        ReturnProcessModel returnProcessDTO;
        ProcessNodeModel tinyNode;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 63676, new Class[0], List.class);
        if (proxy.isSupported) {
            return (List) proxy.result;
        }
        RefundProcessModel refundProcessModel = (RefundProcessModel) getData();
        String str = null;
        if (refundProcessModel == null) {
            return null;
        }
        String str2 = "";
        if (refundProcessModel.getRefundProcessType() == 2) {
            Pair[] pairArr = new Pair[2];
            RefundStatusDetailModel statusDetail = refundProcessModel.getStatusDetail();
            String statusDesc = statusDetail != null ? statusDetail.getStatusDesc() : null;
            if (statusDesc == null) {
                statusDesc = str2;
            }
            pairArr[0] = TuplesKt.to("text", statusDesc);
            BuyerRefundDetailInfoModel model = getViewModel().getModel();
            if (!(model == null || (returnProcessDTO = model.getReturnProcessDTO()) == null || (tinyNode = returnProcessDTO.getTinyNode()) == null)) {
                str = tinyNode.getNodeTitle();
            }
            if (str != null) {
                str2 = str;
            }
            pairArr[1] = TuplesKt.to("conctenttext", str2);
            map = MapsKt__MapsKt.mapOf(pairArr);
        } else {
            Pair[] pairArr2 = new Pair[2];
            RefundStatusDetailModel statusDetail2 = refundProcessModel.getStatusDetail();
            String statusTitle = statusDetail2 != null ? statusDetail2.getStatusTitle() : null;
            if (statusTitle == null) {
                statusTitle = str2;
            }
            pairArr2[0] = TuplesKt.to(PushConstants.TITLE, statusTitle);
            RefundStatusDetailModel statusDetail3 = refundProcessModel.getStatusDetail();
            if (statusDetail3 != null) {
                str = statusDetail3.getStatusDesc();
            }
            if (str != null) {
                str2 = str;
            }
            pairArr2[1] = TuplesKt.to("text", str2);
            map = MapsKt__MapsKt.mapOf(pairArr2);
        }
        return CollectionsKt__CollectionsJVMKt.listOf(map);
    }

    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public void onChanged(Object obj) {
        RefundProcessModel refundProcessModel = (RefundProcessModel) obj;
        if (!PatchProxy.proxy(new Object[]{refundProcessModel}, this, changeQuickRedirect, false, 63674, new Class[]{RefundProcessModel.class}, Void.TYPE).isSupported) {
            super.onChanged(refundProcessModel);
            RefundStatusDetailModel statusDetail = refundProcessModel.getStatusDetail();
            if (refundProcessModel.getRefundProcessType() == 2) {
                ((TextView) _$_findCachedViewById(R.id.tvTitle)).setVisibility(8);
                ((LinearLayout) _$_findCachedViewById(R.id.viewSpeedRefundTitle)).setVisibility(0);
                DuIconsTextView duIconsTextView = (DuIconsTextView) _$_findCachedViewById(R.id.ivSpeedRefundInfo);
                String speedUrl = refundProcessModel.getSpeedUrl();
                duIconsTextView.setVisibility((speedUrl == null || speedUrl.length() == 0) ^ true ? 0 : 8);
                ViewExtensionKt.j((DuIconsTextView) _$_findCachedViewById(R.id.ivSpeedRefundInfo), 0, new RefundProcessView$onChanged$1(this, refundProcessModel), 1);
            } else {
                ((TextView) _$_findCachedViewById(R.id.tvTitle)).setVisibility(0);
                ((LinearLayout) _$_findCachedViewById(R.id.viewSpeedRefundTitle)).setVisibility(8);
                ((TextView) _$_findCachedViewById(R.id.tvTitle)).setText(statusDetail != null ? statusDetail.getStatusTitle() : null);
            }
            List<TextHyperlinkModel> hyperlink = statusDetail != null ? statusDetail.getHyperlink() : null;
            if (hyperlink == null) {
                hyperlink = CollectionsKt__CollectionsKt.emptyList();
            }
            ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(hyperlink, 10));
            Iterator<T> it2 = hyperlink.iterator();
            while (it2.hasNext()) {
                arrayList.add(TextHyperlinkModel.copy$default(it2.next(), 0, 0, null, null, "#00FEFF", null, 47, null));
            }
            d0.f34187a.c((TextView) _$_findCachedViewById(R.id.tvDesc), statusDetail != null ? statusDetail.getStatusDesc() : null, arrayList, null);
            List<ProcessNodeModel> nodeList = refundProcessModel.getNodeList();
            if (nodeList == null) {
                nodeList = CollectionsKt__CollectionsKt.emptyList();
            }
            if (!(!nodeList.isEmpty()) || nodeList.size() <= 1) {
                ((OrderStepView) _$_findCachedViewById(R.id.stepView)).setVisibility(8);
            } else {
                OrderStepView orderStepView = (OrderStepView) _$_findCachedViewById(R.id.stepView);
                ArrayList arrayList2 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(nodeList, 10));
                for (T t : nodeList) {
                    Integer nodeState = t.getNodeState();
                    arrayList2.add(new StepNodeModel(nodeState != null ? nodeState.intValue() : StepStatus.WILL_DO.getValue(), t.getNodeTitle(), t.getNodeSeq()));
                }
                orderStepView.setStepNodes(arrayList2);
                ((OrderStepView) _$_findCachedViewById(R.id.stepView)).setVisibility(0);
            }
            ((DuIconsTextView) _$_findCachedViewById(R.id.viewAll)).setVisibility(refundProcessModel.getRefundTimelineInfoDTO() != null ? 0 : 8);
            DuIconsTextView duIconsTextView2 = (DuIconsTextView) _$_findCachedViewById(R.id.viewAll);
            OrderRefundTimelineModel refundTimelineInfoDTO = refundProcessModel.getRefundTimelineInfoDTO();
            duIconsTextView2.setText(refundTimelineInfoDTO != null ? refundTimelineInfoDTO.getTitle() : null);
            ViewExtensionKt.j(this, 0, new RefundProcessView$onChanged$3(this, refundProcessModel), 1);
            NewRefundRecallOrderInfoModel recallOrderInfo = refundProcessModel.getRecallOrderInfo();
            TextView textView = (TextView) _$_findCachedViewById(R.id.tvPay);
            String buttonTitle = recallOrderInfo != null ? recallOrderInfo.getButtonTitle() : null;
            textView.setVisibility(buttonTitle == null || buttonTitle.length() == 0 ? 8 : 0);
            if (recallOrderInfo != null) {
                ((TextView) _$_findCachedViewById(R.id.tvPay)).setText(recallOrderInfo.getButtonTitle());
                ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvPay), 0, new RefundProcessView$onChanged$$inlined$let$lambda$1(recallOrderInfo, this), 1);
            }
            int b = b.b(refundProcessModel.isSpeedRefund() ? (float) 16 : (float) 0);
            int b2 = b.b(refundProcessModel.isSpeedRefund() ? (float) 8 : (float) 0);
            ((FrameLayout) _$_findCachedViewById(R.id.flRoot)).setPadding(b, b2, b, b2);
            if (refundProcessModel.isSpeedRefund()) {
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBackground)).setVisibility(0);
                if (refundProcessModel.getRefundProcessType() == 2) {
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBackground)).i("https://cdn.poizon.com/node-common/ede878cb-0d8b-e08d-25df-444797fd14c0-1029-537.png").p0(DuScaleType.CENTER_CROP).l0(new ColorDrawable(268435455)).x();
                } else {
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBackground)).f(new ColorDrawable(268435455));
                }
            } else {
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBackground)).setVisibility(8);
            }
            int b5 = b.b(refundProcessModel.getRefundProcessType() == 3 ? (float) 16 : (float) 20);
            float f = (float) 12;
            int b12 = b.b(f);
            if (!refundProcessModel.isSpeedRefund()) {
                f = (float) 10;
            }
            ((ShapeConstraintLayout) _$_findCachedViewById(R.id.clBlock)).setPadding(b5, b12, b5, b.b(f));
        }
    }

    @Override // com.shizhuang.duapp.common.component.module.IModuleExposureObserver, com.shizhuang.duapp.modules.aftersale.refund.view.RdBaseView
    public void onExposure(@Nullable DuExposureHelper.State state) {
        if (!PatchProxy.proxy(new Object[]{state}, this, changeQuickRedirect, false, 63675, new Class[]{DuExposureHelper.State.class}, Void.TYPE).isSupported) {
            super.onExposure(state);
            d(getTrackContentInfoList());
        }
    }

    @JvmOverloads
    public RefundProcessView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }
}