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


package com.shizhuang.duapp.modules.du_mall_common.express;

import a.f;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.CallSuper;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
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.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.event.SCEvent;
import com.shizhuang.duapp.common.ui.BaseLeftBackActivity;
import com.shizhuang.duapp.common.utils.StringUtils;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.views.MallDeliverAttentionView;
import com.shizhuang.duapp.modules.du_mall_common.views.MallExpressSelectView;
import com.shizhuang.model.ScanOriginType;
import com.shizhuang.model.event.MessageEvent;
import mh.k;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import u91.e;

public abstract class MallDeliverActivity extends BaseLeftBackActivity implements View.OnClickListener {
    public static ChangeQuickRedirect changeQuickRedirect;

    /* renamed from: c  reason: collision with root package name */
    public TextView f13404c;
    public DuImageLoaderView d;
    public TextView e;
    public View f;

    /* renamed from: g  reason: collision with root package name */
    public MallDeliverAttentionView f13405g;

    /* renamed from: h  reason: collision with root package name */
    public MallExpressSelectView f13406h;
    public MaterialDialog.b i;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void ActivityMethodWeaver_onCreate(@Nullable MallDeliverActivity mallDeliverActivity, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{mallDeliverActivity, bundle}, null, changeQuickRedirect, true, 116459, new Class[]{MallDeliverActivity.class, Bundle.class}, Void.TYPE).isSupported) {
                jn.b bVar = jn.b.f34396a;
                if (!bVar.b()) {
                    bVar.d(true);
                }
                long currentTimeMillis = System.currentTimeMillis();
                MallDeliverActivity.d(mallDeliverActivity, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (mallDeliverActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_mall_common.express.MallDeliverActivity")) {
                    bVar.activityOnCreateMethod(mallDeliverActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void ActivityMethodWeaver_onResume(MallDeliverActivity mallDeliverActivity) {
            if (!PatchProxy.proxy(new Object[]{mallDeliverActivity}, null, changeQuickRedirect, true, 116461, new Class[]{MallDeliverActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                MallDeliverActivity.g(mallDeliverActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (mallDeliverActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_mall_common.express.MallDeliverActivity")) {
                    jn.b.f34396a.activityOnResumeMethod(mallDeliverActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void ActivityMethodWeaver_onStart(MallDeliverActivity mallDeliverActivity) {
            if (!PatchProxy.proxy(new Object[]{mallDeliverActivity}, null, changeQuickRedirect, true, 116460, new Class[]{MallDeliverActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                MallDeliverActivity.f(mallDeliverActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (mallDeliverActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_mall_common.express.MallDeliverActivity")) {
                    jn.b.f34396a.activityOnStartMethod(mallDeliverActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    public class a implements MaterialDialog.SingleButtonCallback {
        public static ChangeQuickRedirect changeQuickRedirect;

        public a() {
        }

        @Override // com.afollestad.materialdialogs.MaterialDialog.SingleButtonCallback
        public void onClick(@NonNull MaterialDialog materialDialog, @NonNull DialogAction dialogAction) {
            if (!PatchProxy.proxy(new Object[]{materialDialog, dialogAction}, this, changeQuickRedirect, false, 116455, new Class[]{MaterialDialog.class, DialogAction.class}, Void.TYPE).isSupported) {
                MallDeliverActivity.super.onBackPressed();
            }
        }
    }

    public class b implements MaterialDialog.SingleButtonCallback {
        public static ChangeQuickRedirect changeQuickRedirect;

        public b() {
        }

        @Override // com.afollestad.materialdialogs.MaterialDialog.SingleButtonCallback
        public void onClick(@NonNull MaterialDialog materialDialog, @NonNull DialogAction dialogAction) {
            if (!PatchProxy.proxy(new Object[]{materialDialog, dialogAction}, this, changeQuickRedirect, false, 116456, new Class[]{MaterialDialog.class, DialogAction.class}, Void.TYPE).isSupported) {
                MallDeliverActivity.this.l();
            }
        }
    }

    public static void d(MallDeliverActivity mallDeliverActivity, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, mallDeliverActivity, changeQuickRedirect, false, 116450, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void f(MallDeliverActivity mallDeliverActivity) {
        if (!PatchProxy.proxy(new Object[0], mallDeliverActivity, changeQuickRedirect, false, 116452, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

    public static void g(MallDeliverActivity mallDeliverActivity) {
        if (!PatchProxy.proxy(new Object[0], mallDeliverActivity, changeQuickRedirect, false, 116454, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
        }
    }

    public void affirmSubmit(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 116443, new Class[]{View.class}, Void.TYPE).isSupported && o()) {
            if (this.i == null) {
                MaterialDialog.b bVar = new MaterialDialog.b(getContext());
                this.i = bVar;
                bVar.n = "取消";
                bVar.l = i();
                this.i.f2882u = new b();
            }
            MaterialDialog.b bVar2 = this.i;
            StringBuilder h12 = f.h("运单号:");
            h12.append(h());
            bVar2.b = h12.toString();
            this.i.b("运单号是平台收货时的唯一凭证\n请确认无误");
            this.i.l();
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public int getLayout() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116429, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.layout_mall_deliver;
    }

    public String h() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116434, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        MallExpressSelectView mallExpressSelectView = this.f13406h;
        if (mallExpressSelectView == null) {
            return "";
        }
        return StringUtils.n(mallExpressSelectView.getExpressNo().trim());
    }

    public String i() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116431, new Class[0], String.class);
        return proxy.isSupported ? (String) proxy.result : "确认发货";
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initData() {
        MallExpressSelectView mallExpressSelectView;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116433, new Class[0], Void.TYPE).isSupported && (mallExpressSelectView = this.f13406h) != null) {
            mallExpressSelectView.b(this);
            this.f13406h.c(new k(this, 3), new i50.a(this));
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    @CallSuper
    public void initView(Bundle bundle) {
        View view;
        View view2;
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 116432, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.initView(bundle);
            this.d = (DuImageLoaderView) this.mContentView.findViewById(R.id.iv_scan_code);
            this.e = (TextView) this.mContentView.findViewById(R.id.tv_affirm_submit);
            this.f13405g = (MallDeliverAttentionView) this.mContentView.findViewById(R.id.v_attention);
            this.f13406h = (MallExpressSelectView) this.mContentView.findViewById(R.id.v_express_select);
            this.f = this.mContentView.findViewById(R.id.ll_tip);
            this.f13404c = (TextView) this.mContentView.findViewById(R.id.tv_top_tip);
            View findViewById = this.mContentView.findViewById(R.id.top_divider);
            if (j() && (view2 = this.f) != null) {
                view2.setVisibility(0);
            }
            if (!(findViewById == null || (view = this.f) == null || view.getVisibility() != 0)) {
                findViewById.setVisibility(8);
            }
            DuImageLoaderView duImageLoaderView = this.d;
            if (duImageLoaderView != null) {
                duImageLoaderView.setOnClickListener(this);
            }
            TextView textView = this.e;
            if (textView != null) {
                textView.setOnClickListener(this);
            }
        }
    }

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

    public void k(String str) {
        TextView textView;
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 116438, new Class[]{String.class}, Void.TYPE).isSupported && (textView = this.f13404c) != null) {
            textView.setText(str);
        }
    }

    public abstract void l();

    public void m(String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 116436, new Class[]{String.class}, Void.TYPE).isSupported) {
            MallExpressSelectView mallExpressSelectView = this.f13406h;
            if (mallExpressSelectView != null) {
                mallExpressSelectView.setExpressName(str);
            }
            if (this.d != null) {
                if ("顺丰速运".equals(str)) {
                    this.d.i("https://apk.poizon.com/duApp/Android_Config/resource/mall/image_online/plugin/ic_scan_seller_deliver.webp").x();
                } else {
                    this.d.i("https://apk.poizon.com/duApp/Android_Config/resource/mall/image_online/plugin/ic_scan_deliver_one_code.webp").x();
                }
            }
        }
    }

    public void n(String str) {
        MallExpressSelectView mallExpressSelectView;
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 116437, new Class[]{String.class}, Void.TYPE).isSupported && (mallExpressSelectView = this.f13406h) != null && this.e != null) {
            mallExpressSelectView.setExpressNo(str);
            if (!TextUtils.isEmpty(str)) {
                this.e.setEnabled(true);
            } else {
                this.e.setEnabled(false);
            }
        }
    }

    public abstract boolean o();

    @Override // androidx.activity.ComponentActivity, androidx.fragment.app.FragmentActivity
    public void onActivityResult(int i3, int i12, @Nullable Intent intent) {
        Object[] objArr = {new Integer(i3), new Integer(i12), intent};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Integer.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 116445, new Class[]{cls, cls, Intent.class}, Void.TYPE).isSupported) {
            super.onActivityResult(i3, i12, intent);
            if (i3 == 1033 && i12 == -1) {
                String stringExtra = intent.getStringExtra(PushConstants.CONTENT);
                n("");
                if (!PatchProxy.proxy(new Object[]{stringExtra}, this, changeQuickRedirect, false, 116446, new Class[]{String.class}, Void.TYPE).isSupported) {
                    b50.a.f1565a.o(stringExtra, new i50.b(this, this).withoutToast());
                }
            }
        }
    }

    @Override // androidx.activity.ComponentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onBackPressed() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116441, new Class[0], Void.TYPE).isSupported) {
            if (h().length() > 0) {
                MaterialDialog.b bVar = new MaterialDialog.b(getContext());
                bVar.b("您还未提交运单号,确认退出?");
                bVar.n = "取消";
                bVar.l = "退出";
                bVar.f2882u = new a();
                bVar.l();
                return;
            }
            super.onBackPressed();
        }
    }

    @SensorsDataInstrumented
    public void onClick(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 116442, new Class[]{View.class}, Void.TYPE).isSupported) {
            int id2 = view.getId();
            if (id2 == R.id.iv_scan_code) {
                scanCode(view);
            } else if (id2 == R.id.tv_affirm_submit) {
                affirmSubmit(view);
            }
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 116449, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEvent(@NotNull SCEvent sCEvent) {
        if (!PatchProxy.proxy(new Object[]{sCEvent}, this, changeQuickRedirect, false, 116440, new Class[]{SCEvent.class}, Void.TYPE).isSupported && (sCEvent instanceof MessageEvent)) {
            MessageEvent messageEvent = (MessageEvent) sCEvent;
            if (messageEvent.getMessage().equals("MSG_SELLER_DELIVER")) {
                n((String) messageEvent.getResult());
            }
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116453, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onResume(this);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 116451, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onStart(this);
        }
    }

    public void scanCode(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 116444, new Class[]{View.class}, Void.TYPE).isSupported) {
            e.d1(this, 1033, false, ScanOriginType.SellerDeliver, false, "请输入运单号");
        }
    }

    public abstract void selectExpress(View view);
}