269 lines
11 KiB
Java
269 lines
11 KiB
Java
package com.ubt.jimu.shop;
|
|
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.view.View;
|
|
import android.widget.ImageView;
|
|
import com.ubt.jimu.R;
|
|
import com.ubt.jimu.base.SuperActivity;
|
|
import com.ubt.jimu.base.entities.Constant;
|
|
import com.ubt.jimu.base.entities.ShopBean;
|
|
import com.ubt.jimu.base.http.ApiClient;
|
|
import com.ubt.jimu.base.http.cache.CacheKey;
|
|
import com.ubt.jimu.base.http.cache.CacheSubscriber;
|
|
import com.ubt.jimu.base.http.service.ShopHttpService;
|
|
import com.ubt.jimu.utils.LogUtils;
|
|
import com.ubt.jimu.utils.NetWorkUtil;
|
|
import com.ubt.jimu.widgets.ShopPopupWindow;
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
import io.reactivex.disposables.Disposable;
|
|
import io.reactivex.schedulers.Schedulers;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ShopActivity extends SuperActivity implements View.OnClickListener, ShopPopupWindow.PopupWindowOnClickLinsenter {
|
|
private List<String> a = new ArrayList();
|
|
private View b;
|
|
private ShopPopupWindow c;
|
|
ImageView im_shop_apple;
|
|
ImageView im_shop_tmall;
|
|
ImageView im_shop_ubtech;
|
|
|
|
private void D0() {
|
|
if (NetWorkUtil.b(this)) {
|
|
((ShopHttpService) ApiClient.getService(ShopHttpService.class)).getCourses().subscribeOn(Schedulers.b()).observeOn(AndroidSchedulers.a()).subscribe(new CacheSubscriber<ShopBean>() { // from class: com.ubt.jimu.shop.ShopActivity.1
|
|
@Override // com.ubt.jimu.base.http.cache.CacheSubscriber
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onSucceed(ShopBean shopBean) {
|
|
if (shopBean != null && shopBean.isStatus()) {
|
|
ShopActivity.this.a.addAll(shopBean.getModels());
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.http.cache.CacheSubscriber
|
|
@CacheKey(Key = Constant.Cache.SHOP_DATE_KEY, Time = 86400000)
|
|
/* renamed from: b, reason: merged with bridge method [inline-methods] */
|
|
public void showCacheData(ShopBean shopBean) {
|
|
if (shopBean != null && shopBean.isStatus()) {
|
|
ShopActivity.this.a.addAll(shopBean.getModels());
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.http.cache.CacheSubscriber
|
|
public void onFailure(Throwable th) {
|
|
LogUtils.c("失败");
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.http.cache.CacheSubscriber
|
|
public void onStart(Disposable disposable) {
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:13:0x0066, code lost:
|
|
|
|
if (android.text.TextUtils.isEmpty(r0) == false) goto L14;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
private void E0() {
|
|
/*
|
|
r4 = this;
|
|
java.lang.String r0 = "com.tmall.wireless"
|
|
boolean r0 = com.ubt.jimu.utils.SystemUtils.a(r4, r0)
|
|
r1 = 0
|
|
r2 = 2131821378(0x7f110342, float:1.9275497E38)
|
|
r3 = 1
|
|
if (r0 == 0) goto L2b
|
|
java.lang.String r0 = r4.getString(r2)
|
|
java.lang.Object[] r2 = new java.lang.Object[r3]
|
|
r3 = 2131821698(0x7f110482, float:1.9276147E38)
|
|
java.lang.String r3 = r4.getString(r3)
|
|
r2[r1] = r3
|
|
java.lang.String r0 = java.lang.String.format(r0, r2)
|
|
com.ubt.jimu.widgets.ShopPopupWindow r1 = r4.c
|
|
r1.a(r0)
|
|
com.ubt.jimu.widgets.ShopPopupWindow r0 = r4.c
|
|
r0.b()
|
|
goto L7f
|
|
L2b:
|
|
java.lang.String r0 = "com.taobao.taobao"
|
|
boolean r0 = com.ubt.jimu.utils.SystemUtils.a(r4, r0)
|
|
if (r0 == 0) goto L51
|
|
java.lang.String r0 = r4.getString(r2)
|
|
java.lang.Object[] r2 = new java.lang.Object[r3]
|
|
r3 = 2131821625(0x7f110439, float:1.9275998E38)
|
|
java.lang.String r3 = r4.getString(r3)
|
|
r2[r1] = r3
|
|
java.lang.String r0 = java.lang.String.format(r0, r2)
|
|
com.ubt.jimu.widgets.ShopPopupWindow r1 = r4.c
|
|
r1.a(r0)
|
|
com.ubt.jimu.widgets.ShopPopupWindow r0 = r4.c
|
|
r0.b()
|
|
goto L7f
|
|
L51:
|
|
java.util.List<java.lang.String> r0 = r4.a
|
|
int r0 = r0.size()
|
|
r1 = 2
|
|
if (r0 < r1) goto L69
|
|
java.util.List<java.lang.String> r0 = r4.a
|
|
java.lang.Object r0 = r0.get(r3)
|
|
java.lang.String r0 = (java.lang.String) r0
|
|
boolean r1 = android.text.TextUtils.isEmpty(r0)
|
|
if (r1 != 0) goto L69
|
|
goto L6b
|
|
L69:
|
|
java.lang.String r0 = "https://ubtech.tmall.com/category-1266476937.htm?spm=a1z10.1-b-s.w12055762-15612338374.4.kAMl3o&search=y&catName=Jimu%BB%FD%C4%BE%BB%FA%C6%F7%C8%CB&scene=taobao_shop"
|
|
L6b:
|
|
android.content.Intent r1 = new android.content.Intent
|
|
r1.<init>()
|
|
java.lang.String r2 = "android.intent.action.VIEW"
|
|
r1.setAction(r2)
|
|
android.net.Uri r0 = android.net.Uri.parse(r0)
|
|
r1.setData(r0)
|
|
r4.startActivity(r1)
|
|
L7f:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.shop.ShopActivity.E0():void");
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:4:0x0016, code lost:
|
|
|
|
if (android.text.TextUtils.isEmpty(r0) == false) goto L8;
|
|
*/
|
|
@Override // com.ubt.jimu.widgets.ShopPopupWindow.PopupWindowOnClickLinsenter
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public void C0() {
|
|
/*
|
|
r3 = this;
|
|
java.util.List<java.lang.String> r0 = r3.a
|
|
int r0 = r0.size()
|
|
r1 = 2
|
|
if (r0 < r1) goto L19
|
|
java.util.List<java.lang.String> r0 = r3.a
|
|
r1 = 1
|
|
java.lang.Object r0 = r0.get(r1)
|
|
java.lang.String r0 = (java.lang.String) r0
|
|
boolean r1 = android.text.TextUtils.isEmpty(r0)
|
|
if (r1 != 0) goto L19
|
|
goto L1b
|
|
L19:
|
|
java.lang.String r0 = "https://ubtech.tmall.com/category-1266476937.htm?spm=a1z10.1-b-s.w12055762-15612338374.4.kAMl3o&search=y&catName=Jimu%BB%FD%C4%BE%BB%FA%C6%F7%C8%CB&scene=taobao_shop"
|
|
L1b:
|
|
android.content.Intent r1 = new android.content.Intent
|
|
r1.<init>()
|
|
java.lang.String r2 = "android.intent.action.VIEW"
|
|
r1.setAction(r2)
|
|
android.net.Uri r0 = android.net.Uri.parse(r0)
|
|
r1.setData(r0)
|
|
r3.startActivity(r1)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.shop.ShopActivity.C0():void");
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
protected void initData() {
|
|
D0();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
protected void initEvent() {
|
|
this.im_shop_apple.setOnClickListener(this);
|
|
this.im_shop_tmall.setOnClickListener(this);
|
|
this.im_shop_ubtech.setOnClickListener(this);
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
public View initView() {
|
|
this.b = View.inflate(this, R.layout.activity_shop_layout, null);
|
|
this.c = new ShopPopupWindow(this, this.b);
|
|
this.c.a(this);
|
|
return this.b;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
switch (view.getId()) {
|
|
case R.id.im_shop_apple /* 2131296804 */:
|
|
Intent intent = new Intent();
|
|
intent.setAction("android.intent.action.VIEW");
|
|
intent.setData(Uri.parse(Constant.Shop.APPLE_URL));
|
|
startActivity(intent);
|
|
break;
|
|
case R.id.im_shop_tmall /* 2131296805 */:
|
|
E0();
|
|
break;
|
|
case R.id.im_shop_ubtech /* 2131296806 */:
|
|
Intent intent2 = new Intent();
|
|
intent2.setAction("android.intent.action.VIEW");
|
|
List<String> list = this.a;
|
|
intent2.setData((list == null || list.size() <= 2) ? Uri.parse(Constant.Shop.UBTECH_URL) : Uri.parse(this.a.get(2)));
|
|
try {
|
|
startActivity(intent2);
|
|
break;
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:6:0x0020, code lost:
|
|
|
|
if (android.text.TextUtils.isEmpty(r0) == false) goto L10;
|
|
*/
|
|
@Override // com.ubt.jimu.widgets.ShopPopupWindow.PopupWindowOnClickLinsenter
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public void q0() {
|
|
/*
|
|
r3 = this;
|
|
java.lang.String r0 = "com.tmall.wireless"
|
|
boolean r0 = com.ubt.jimu.utils.SystemUtils.a(r3, r0)
|
|
java.lang.String r1 = "android.intent.action.VIEW"
|
|
if (r0 == 0) goto L32
|
|
java.util.List<java.lang.String> r0 = r3.a
|
|
int r0 = r0.size()
|
|
r2 = 4
|
|
if (r0 < r2) goto L23
|
|
java.util.List<java.lang.String> r0 = r3.a
|
|
r2 = 3
|
|
java.lang.Object r0 = r0.get(r2)
|
|
java.lang.String r0 = (java.lang.String) r0
|
|
boolean r2 = android.text.TextUtils.isEmpty(r0)
|
|
if (r2 != 0) goto L23
|
|
goto L25
|
|
L23:
|
|
java.lang.String r0 = "tmall://tmallclient/?{\"action\":\"internal:url=https://ubtech.m.tmall.com/shop/shop_auction_search.htm?suid=&scid=1266476937&sort=default\"}"
|
|
L25:
|
|
android.content.Intent r2 = new android.content.Intent
|
|
android.net.Uri r0 = android.net.Uri.parse(r0)
|
|
r2.<init>(r1, r0)
|
|
r3.startActivity(r2)
|
|
return
|
|
L32:
|
|
android.content.Intent r0 = new android.content.Intent
|
|
r0.<init>()
|
|
r0.setAction(r1)
|
|
java.lang.String r1 = "taobao://shop.m.taobao.com/shop/shop_index.htm?shop_id=170700776&spm=a230r.7195193.1997079397.8.Pp3ZMM&point"
|
|
android.net.Uri r1 = android.net.Uri.parse(r1)
|
|
r0.setData(r1)
|
|
r3.startActivity(r0)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.shop.ShopActivity.q0():void");
|
|
}
|
|
}
|