中建乐购 v3.2.2版本的 MD5 值为:0553721e6bc6ba8dd67004696a555b81
以下内容为反编译后的 aq.java 源代码,内容仅作参考
package com.shopex.westore.activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.qianseit.westore.ui.CircleImageView;
import com.qianseit.westore.ui.FlowRadioGroup;
import com.qianseit.westore.ui.NotifyChangedScrollView;
import com.qianseit.westore.ui.RushBuyCountDownTimerView;
import com.qianseit.westore.ui.ShareView;
import com.shopex.westore.AgentApplication;
import com.shopex.westore.DoActivity;
import com.umeng.analytics.pro.dq;
import com.zjsjtz.ecstore.R;
import fj.c;
import ge.d;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Stack;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class aq extends com.shopex.westore.b implements NotifyChangedScrollView.a, ShareView.a, d.a {
private static final int f9120d = 1;
private LinearLayout A;
private ShareView B;
private ViewGroup C;
private JSONObject D;
private JSONObject E;
private JSONObject F;
private JSONObject G;
private JSONArray H;
private Dialog U;
private LinearLayout V;
private GridView W;
private NotifyChangedScrollView X;
private String Y;
private ArrayList<Boolean> Z;
private String f9122aa;
private String f9123ab;
private i f9129ah;
private ArrayList<Integer> f9130ai;
private ge.d f9131aj;
private boolean f9137e;
private com.shopex.westore.h f9138f;
private String f9139g;
private String f9141i;
private LayoutInflater f9142j;
private Resources f9143k;
private String f9144l;
private String f9145m;
private String f9146n;
private int f9148p;
private JSONObject f9149q;
private TextView f9150r;
private TextView f9151s;
private LinearLayout f9152t;
private LayoutInflater f9153u;
private ViewGroup f9154v;
private boolean f9157y;
private LinearLayout f9158z;
public final int f9121a = 0;
public final int f9135b = 1;
public final int f9136c = 2;
private int f9140h = 0;
private int f9147o = 1;
private boolean f9155w = false;
private int f9156x = -1;
private HashMap<String, JSONObject> I = new HashMap<>();
private HashMap<String, JSONObject> J = new HashMap<>();
private HashMap<String, JSONObject> K = new HashMap<>();
private ArrayList<JSONObject> L = new ArrayList<>();
private ArrayList<JSONObject> M = new ArrayList<>();
private ArrayList<JSONObject> N = new ArrayList<>();
private ArrayList<JSONObject> O = new ArrayList<>();
private ArrayList<String> P = new ArrayList<>();
private HashMap<String, Integer> Q = new HashMap<>();
private String[] R = {"周一", "周二", "周三", "周四", "周五", "周六", "周日"};
private int[] S = {1, 2, 4, 8, 16, 32, 64};
private int T = -1;
private String f9124ac = "0.0";
private int f9125ad = 1;
private ArrayList<Integer> f9126ae = new ArrayList<>();
private int f9127af = 0;
private int f9128ag = 0;
private View.OnClickListener f9132ak = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (view.getId() != R.id.custom_ok) {
return;
}
if (aq.this.U != null && aq.this.U.isShowing()) {
aq.this.U.dismiss();
}
FlowRadioGroup flowRadioGroup = (FlowRadioGroup) view.getTag(R.id.tag_object);
int i2 = -1;
String str = "";
for (int i3 = 0; i3 < aq.this.Z.size(); i3++) {
if (((Boolean) aq.this.Z.get(i3)).booleanValue()) {
str = str + aq.this.R[i3] + " ";
i2 += aq.this.S[i3];
}
}
aq.this.T = i2;
TextView textView = (TextView) view.getTag();
if ("".equals(str)) {
textView.setVisibility(8);
} else {
textView.setText(aq.this.mActivity.getString(R.string.custom) + ":" + str);
textView.setVisibility(0);
}
flowRadioGroup.clearCheck();
}
};
private View.OnClickListener f9133al = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (view instanceof RadioButton) {
((RadioButton) view).setChecked(true);
} else if (view instanceof LinearLayout) {
RadioGroup radioGroup = (RadioGroup) view.getParent();
int childCount = radioGroup.getChildCount();
for (int i2 = 0; i2 < childCount; i2++) {
LinearLayout linearLayout = (LinearLayout) radioGroup.getChildAt(i2);
TextView textView = (TextView) linearLayout.getChildAt(1);
CircleImageView circleImageView = (CircleImageView) linearLayout.getChildAt(0);
if (view.getId() == linearLayout.getId()) {
textView.setTextColor(aq.this.getResources().getColor(R.color.goods_detail_pink_textcolor));
circleImageView.setBorderWidth(1);
} else {
textView.setTextColor(aq.this.getResources().getColor(R.color.goods_detail_primary_textcolor));
circleImageView.setBorderWidth(0);
}
}
}
if (view.getTag(R.id.tag_spec_id) == null || view.getTag(R.id.tag_spec_jsonobject) == null) {
return;
}
JSONObject jSONObject = (JSONObject) view.getTag(R.id.tag_spec_jsonobject);
aq.this.I.put((String) view.getTag(R.id.tag_spec_id), jSONObject);
if ("配送频次".equals((String) view.getTag(R.id.confirm_alias))) {
aq.this.f9125ad = jSONObject.optInt("spec_alias");
aq.this.Z = null;
if (aq.this.f9129ah != null) {
aq.this.f9129ah.notifyDataSetChanged();
}
}
if (jSONObject.has("spec_goods_images") && !TextUtils.isEmpty(jSONObject.optString("spec_goods_images")) && (view instanceof LinearLayout)) {
CircleImageView circleImageView2 = (CircleImageView) aq.this.findViewById(R.id.goods_detail_buy_thumb);
circleImageView2.setBorderColor(aq.this.getActivity().getResources().getColor(R.color.red));
circleImageView2.setBorderWidth(1);
bo.c.a(jSONObject.optString("spec_goods_images"), circleImageView2);
}
if (aq.this.I.size() >= aq.this.M.size()) {
Object[] array = aq.this.I.keySet().toArray();
Arrays.sort(array, new Comparator<Object>() {
@Override
public int compare(Object obj, Object obj2) {
return Integer.parseInt(obj.toString()) - Integer.parseInt(obj2.toString());
}
});
String str = "";
for (Object obj : array) {
JSONObject jSONObject2 = (JSONObject) aq.this.I.get(obj);
Object[] objArr = new Object[3];
objArr[0] = str;
objArr[1] = str.isEmpty() ? "" : ";";
objArr[2] = jSONObject2.optString("properties");
str = com.shopex.westore.k.a(objArr);
}
JSONObject jSONObject3 = (JSONObject) aq.this.J.get(str);
if (jSONObject3 != null) {
aq.this.c(jSONObject3);
}
}
}
};
private c.a f9134am = new c.a() {
@Override
public void task_response(String str) {
if (aq.this.f9148p == R.id.goods_detail_justbuy) {
com.shopex.westore.k.a(new fj.d(), new n());
return;
}
com.shopex.westore.k.b((Context) aq.this.mActivity, (int) R.string.add_to_shoping_car_success);
com.shopex.westore.k.a(new fj.d(), new d());
}
};
@Override
public void onScrollChanged(int i2, int i3, int i4, int i5) {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f9143k = this.mActivity.getResources();
this.f9142j = this.mActivity.getLayoutInflater();
Intent intent = this.mActivity.getIntent();
this.f9140h = intent.getIntExtra(com.shopex.westore.k.f10184g, 0);
this.f9144l = intent.getStringExtra(com.shopex.westore.k.f10186i);
this.f9145m = intent.getStringExtra(com.shopex.westore.k.f10196s);
this.f9146n = intent.getStringExtra(com.shopex.westore.k.f10190m);
this.f9141i = intent.getStringExtra(com.shopex.westore.k.f10199v);
this.mActionBar.setShowTitleBar(false);
}
@Override
public void init(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
super.init(layoutInflater, viewGroup, bundle);
this.f9153u = this.mActivity.getLayoutInflater();
this.rootView = layoutInflater.inflate(R.layout.test_detail_goods, (ViewGroup) null);
this.f9131aj = new ge.d(this.rootView, this.mActivity);
this.f9131aj.a(this);
this.X = (NotifyChangedScrollView) this.rootView.findViewById(R.id.goods_detail_scollview);
this.X.setOnScrollChangedListener(this);
this.f9158z = (LinearLayout) findViewById(R.id.ll_add_count_view);
this.A = (LinearLayout) findViewById(R.id.ll_parent_container);
findViewById(R.id.goods_detail_addto_shopcar).setOnClickListener(this);
findViewById(R.id.goods_detail_justbuy).setOnClickListener(this);
findViewById(R.id.rel_brand_view).setOnClickListener(this);
this.rootView.findViewById(R.id.goods_detail_topbar_shoppingcar).setOnClickListener(this);
this.f9152t = (LinearLayout) this.rootView.findViewById(R.id.fragment_goods_detail_select_layout);
this.rootView.findViewById(R.id.fragment_goods_detail_comfirm).setOnClickListener(this);
this.rootView.findViewById(R.id.fragment_goods_detail_cancel).setOnClickListener(this);
findViewById(R.id.goods_detail_buy_qminus).setOnClickListener(this);
findViewById(R.id.goods_detail_buy_qplus).setOnClickListener(this);
findViewById(R.id.goods_detail_search).setOnClickListener(this);
findViewById(R.id.goods_detail_button_category).setOnClickListener(this);
findViewById(R.id.goods_detail_buy_confirm).setOnClickListener(this);
findViewById(R.id.goods_detail_buy_cancel).setOnClickListener(this);
this.f9150r = (TextView) findViewById(R.id.goods_detail_buy_quantity);
this.f9150r.setOnClickListener(this);
this.f9151s = (TextView) findViewById(R.id.goods_detail_topbar_shoppingcar_count);
findViewById(R.id.goods_detail_radio_onsale).setOnClickListener(this);
findViewById(R.id.goods_detail_order_onsale).setOnClickListener(this);
this.f9131aj.f18974k.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i2) {
}
@Override
public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
if (i4 < 3 || !aq.this.f9157y || i4 - (i2 + i3) > 3) {
return;
}
aq.this.f9131aj.f18975l.a(aq.this.f9144l);
}
});
this.C = (ViewGroup) findViewById(R.id.good_detail_recommend_comtain);
this.f9154v = (ViewGroup) findViewById(R.id.goods_detail_point_area);
this.f9154v.setLayoutParams(new AbsListView.LayoutParams(-1, -2));
com.shopex.westore.k.a((View) this.f9154v);
this.f9138f = AgentApplication.c(getActivity());
this.f9139g = this.f9138f.K();
if (this.f9140h == 1) {
this.rootView.findViewById(R.id.goods_detail_addto_shopcar).setVisibility(4);
}
if (!TextUtils.isEmpty(this.f9145m)) {
this.rootView.findViewById(R.id.goods_detail_addto_shopcar).setVisibility(4);
}
if (!TextUtils.isEmpty(this.f9141i)) {
com.shopex.westore.k.a(new fj.d(), new e());
return;
}
if (TextUtils.isEmpty(this.f9144l)) {
com.shopex.westore.k.a(new fj.d(), new f());
} else if (TextUtils.isEmpty(this.f9145m)) {
com.shopex.westore.k.a(new fj.d(), new h(this.f9140h));
findViewById(R.id.goods_detail_shoppingcar).setVisibility(0);
findViewById(R.id.goods_detail_addto_shopcar).setVisibility(0);
} else {
com.shopex.westore.k.a(new fj.d(), new f());
}
this.f9131aj.f18975l.a(this.f9144l);
}
@Override
public void onResume() {
super.onResume();
this.T = 0;
if (AgentApplication.c(this.mActivity).c()) {
com.shopex.westore.k.a(new fj.d(), new d());
}
this.f9131aj.d();
}
@Override
public void onPause() {
super.onPause();
this.f9131aj.c();
}
@Override
public void onDestroy() {
super.onDestroy();
this.f9131aj = null;
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.rel_brand_view) {
if (view.getTag() == null) {
return;
}
JSONObject jSONObject = (JSONObject) view.getTag();
this.mActivity.startActivity(AgentActivity.a(this.mActivity, 353).putExtra(com.shopex.westore.k.f10191n, jSONObject.optString("brand_name")).putExtra(com.shopex.westore.k.f10200w, jSONObject.optString("brand_id")));
} else if (view.getId() == R.id.goods_detail_like) {
if (TextUtils.isEmpty(this.f9144l)) {
if (this.E == null) {
return;
}
this.f9144l = this.E.optString("iid");
}
if (this.f9137e) {
com.shopex.westore.k.a(new fj.d(), new l(this.f9144l));
} else {
com.shopex.westore.k.a(new fj.d(), new b(this.f9144l));
}
} else if (view.getId() == R.id.goods_detail_radio_images || view.getId() == R.id.goods_detail_radio_props || view.getId() == R.id.goods_detail_radio_comments) {
if (this.E == null) {
return;
}
startActivity(AgentActivity.a(this.mActivity, (int) AgentActivity.L).putExtra(com.shopex.westore.k.f10190m, view.getId()).putExtra(com.shopex.westore.k.f10186i, this.f9144l).putExtra("com.shopex.westore.EXTRA_DATA", this.E.toString()));
} else if (view.getId() == R.id.goods_detail_topbar_shoppingcar) {
Intent intent = new Intent(getActivity(), MainTabFragmentActivity.class);
intent.putExtra(com.shopex.westore.k.f10185h, 3);
intent.setFlags(67108864);
startActivity(intent);
} else if (view.getId() == R.id.goods_detail_buy_cancel) {
final View findViewById = findViewById(R.id.goods_detail_buy_parent);
Animation loadAnimation = AnimationUtils.loadAnimation(this.mActivity, R.anim.push_down_out);
loadAnimation.setAnimationListener(new com.shopex.westore.l() {
@Override
public void onAnimationEnd(Animation animation) {
aq.this.findViewById(R.id.translucent).setVisibility(8);
findViewById.setVisibility(8);
}
});
findViewById.startAnimation(loadAnimation);
} else if (view.getId() == R.id.goods_detail_buy_qminus) {
if (this.f9147o <= 1) {
return;
}
this.f9147o--;
this.f9150r.setText(String.valueOf(this.f9147o));
} else if (view.getId() == R.id.goods_detail_buy_qplus) {
if (this.f9156x > 0) {
if (this.f9147o < this.f9156x) {
this.f9147o++;
this.f9150r.setText(String.valueOf(this.f9147o));
return;
}
return;
}
this.f9147o++;
this.f9150r.setText(String.valueOf(this.f9147o));
} else if (view.getId() == R.id.goods_detail_addto_shopcar || view.getId() == R.id.goods_detail_justbuy) {
if (this.f9149q == null && this.L.size() == 1) {
this.f9149q = this.L.get(0);
}
if (this.f9149q == null) {
com.shopex.westore.k.b((Context) this.mActivity, (int) R.string.please_choose_goods_properties);
return;
}
e();
if ("1".equals(this.f9122aa)) {
if (this.T == 0) {
com.shopex.westore.k.b((Context) this.mActivity, (int) R.string.choose_combo_time);
return;
} else if (this.f9130ai.size() < this.f9125ad) {
com.shopex.westore.k.b((Context) this.mActivity, (int) R.string.choose_combo_time);
return;
}
}
this.f9148p = view.getId();
if (this.f9149q != null) {
String optString = this.f9149q.optString("sku_id");
com.shopex.westore.k.a(new fj.d(), this.f9140h == 1 ? new j(optString, this.f9147o) : new a((DoActivity) this.mActivity, this.f9134am, optString, this.f9147o, this.f9148p == R.id.goods_detail_justbuy ? "is_fastbuy" : "", this.T));
}
} else if (view.getId() == R.id.goods_detail_radio_onsale) {
if (this.D != null) {
ViewGroup viewGroup = (ViewGroup) findViewById(R.id.goods_detail_promotion);
if (viewGroup.getVisibility() == 0) {
viewGroup.setVisibility(8);
} else if (viewGroup.getChildCount() < 1) {
JSONArray optJSONArray = this.D.optJSONArray("goods");
int length = optJSONArray == null ? 0 : optJSONArray.length();
for (int i2 = 0; i2 < length; i2++) {
View inflate = this.f9153u.inflate(R.layout.item_detail_promotion_view, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.item_detail_promotion_tag)).setText(optJSONArray.optJSONObject(i2).optString("tag"));
((TextView) inflate.findViewById(R.id.item_detail_promotion_name)).setText(optJSONArray.optJSONObject(i2).optString(ca.c.f4821e));
viewGroup.addView(inflate);
}
viewGroup.setVisibility(length > 0 ? 0 : 8);
} else {
viewGroup.setVisibility(0);
}
}
} else if (view.getId() == R.id.goods_detail_search) {
startActivity(AgentActivity.a(this.mActivity, (int) AgentActivity.f8578h));
} else if (view.getId() == R.id.goods_detail_button_category) {
Intent intent2 = new Intent(this.mActivity, MainTabFragmentActivity.class);
intent2.addFlags(67108864);
MainTabFragmentActivity.f8616c.a(1);
startActivity(intent2);
} else if (view != this.f9150r) {
if (view.getId() == R.id.fragment_goods_detail_cancel) {
Animation loadAnimation2 = AnimationUtils.loadAnimation(this.mActivity, R.anim.push_down_out);
loadAnimation2.setAnimationListener(new com.shopex.westore.l() {
@Override
public void onAnimationEnd(Animation animation) {
aq.this.f9152t.setVisibility(8);
}
});
this.f9152t.startAnimation(loadAnimation2);
} else if (view.getId() == R.id.fragment_goods_detail_comfirm) {
this.f9150r.setText(String.valueOf(this.f9147o));
Animation loadAnimation3 = AnimationUtils.loadAnimation(this.mActivity, R.anim.push_down_out);
loadAnimation3.setAnimationListener(new com.shopex.westore.l() {
@Override
public void onAnimationEnd(Animation animation) {
aq.this.f9152t.setVisibility(8);
}
});
this.f9152t.startAnimation(loadAnimation3);
} else if (view.getId() == R.id.goods_detail_order_onsale) {
if (this.D != null) {
ViewGroup viewGroup2 = (ViewGroup) findViewById(R.id.goods_detail_order_promotion);
if (viewGroup2.getVisibility() == 0) {
viewGroup2.setVisibility(8);
} else if (viewGroup2.getChildCount() < 1) {
JSONArray optJSONArray2 = this.D.optJSONArray("order");
int length2 = optJSONArray2 == null ? 0 : optJSONArray2.length();
for (int i3 = 0; i3 < length2; i3++) {
View inflate2 = this.f9153u.inflate(R.layout.item_detail_promotion_view, (ViewGroup) null);
((TextView) inflate2.findViewById(R.id.item_detail_promotion_tag)).setText(optJSONArray2.optJSONObject(i3).optString("tag"));
((TextView) inflate2.findViewById(R.id.item_detail_promotion_name)).setText(optJSONArray2.optJSONObject(i3).optString(ca.c.f4821e));
viewGroup2.addView(inflate2);
}
viewGroup2.setVisibility(length2 > 0 ? 0 : 8);
} else {
viewGroup2.setVisibility(0);
}
}
} else if (view.getId() == R.id.custom_button) {
this.U = new Dialog(this.mActivity, R.style.my_dialog);
this.V = (LinearLayout) LayoutInflater.from(this.mActivity).inflate(R.layout.custom_dialog_time, (ViewGroup) null);
this.W = (GridView) this.V.findViewById(R.id.custon_gv);
this.W.setAdapter((ListAdapter) new i());
this.U.setContentView(this.V);
this.V.findViewById(R.id.custom_ok).setTag(R.id.tag_object, (FlowRadioGroup) view.getTag(R.id.tag_first));
this.V.findViewById(R.id.custom_ok).setTag(view.getTag());
this.V.findViewById(R.id.custom_ok).setOnClickListener(this.f9132ak);
Window window = this.U.getWindow();
window.setGravity(80);
window.setWindowAnimations(R.style.my_dialog_style);
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.x = 0;
attributes.y = -20;
attributes.width = getResources().getDisplayMetrics().widthPixels;
this.V.measure(0, 0);
attributes.height = this.V.getMeasuredHeight();
attributes.alpha = 9.0f;
window.setAttributes(attributes);
this.U.setCanceledOnTouchOutside(true);
this.U.show();
} else {
super.onClick(view);
}
}
}
public void e() {
if (this.Z != null) {
this.f9130ai = new ArrayList<>();
for (int i2 = 0; i2 < this.Z.size(); i2++) {
if (this.Z.get(i2).booleanValue()) {
this.f9130ai.add(Integer.valueOf(i2));
}
}
Iterator<Integer> it = this.f9130ai.iterator();
while (it.hasNext()) {
this.T += this.S[it.next().intValue()];
}
}
}
@Override
public void onCollectionOfGoods(View view) {
if (TextUtils.isEmpty(this.f9144l)) {
if (this.E == null) {
return;
}
this.f9144l = this.E.optString("iid");
}
if (this.f9137e) {
com.shopex.westore.k.a(new fj.d(), new l(this.f9144l));
} else {
com.shopex.westore.k.a(new fj.d(), new b(this.f9144l));
}
}
@Override
public void onShareGoods(View view) {
if (TextUtils.isEmpty(a()) || TextUtils.isEmpty(c())) {
return;
}
com.qianseit.westore.ui.l lVar = new com.qianseit.westore.ui.l(this.mActivity);
lVar.a(this);
lVar.a(this.mActionBar.getRightImageButton());
}
@Override
public void onExpansionUpdate(float f2, int i2) {
if (i2 == 3) {
hideLoadingDialog_mt();
}
}
public class i extends BaseAdapter {
private CheckBox f9189b;
private String f9190c;
@Override
public long getItemId(int i2) {
return i2;
}
private i() {
}
@Override
public int getCount() {
return aq.this.R.length;
}
@Override
public String getItem(int i2) {
return aq.this.R[i2];
}
@Override
public View getView(final int i2, View view, ViewGroup viewGroup) {
View inflate = aq.this.f9153u.inflate(R.layout.custom_gridview_item, (ViewGroup) null);
this.f9189b = (CheckBox) inflate.findViewById(R.id.custom_cb);
String item = getItem(i2);
this.f9189b.setTag(Integer.valueOf(i2));
if (aq.this.Z == null) {
aq.this.Z = new ArrayList();
for (int i3 = 0; i3 < aq.this.R.length; i3++) {
aq.this.Z.add(i3, false);
}
}
aq.this.a(((Boolean) aq.this.Z.get(i2)).booleanValue(), this.f9189b);
this.f9189b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
aq.this.f9127af = i2;
switch (aq.this.f9125ad) {
case 1:
aq.this.f();
return;
case 2:
aq.this.f();
return;
case 3:
aq.this.f();
return;
default:
return;
}
}
});
this.f9189b.setText(item);
return inflate;
}
}
public void f() {
if (this.Z.get(this.f9127af).booleanValue()) {
this.Z.set(this.f9127af, false);
} else if (!a(this.f9125ad - 1)) {
this.Z.set(this.f9127af, Boolean.valueOf(!this.Z.get(this.f9127af).booleanValue()));
}
this.f9128ag = this.f9127af;
this.f9129ah.notifyDataSetChanged();
}
public boolean a(int i2) {
int i3 = -1;
for (int i4 = 0; i4 < this.Z.size(); i4++) {
if (this.Z.get(i4).booleanValue()) {
i3++;
}
}
return i3 == i2;
}
public void a(boolean z2, View view) {
if (z2) {
CheckBox checkBox = (CheckBox) view;
checkBox.setBackgroundDrawable(getResources().getDrawable(R.drawable.radiobuttontrue));
checkBox.setTextColor(getResources().getColor(R.color.white));
return;
}
CheckBox checkBox2 = (CheckBox) view;
checkBox2.setBackgroundDrawable(getResources().getDrawable(R.drawable.radiobuttonfalse));
checkBox2.setTextColor(getResources().getColor(R.color.text_textcolor_gray1));
}
public void a(JSONObject jSONObject) {
this.E = jSONObject;
this.f9144l = this.E.optString("iid");
com.shopex.westore.k.a(new fj.d(), new g(this.f9144l));
this.M.clear();
this.J.clear();
if (jSONObject.optString("spec_time") != null && !"null".equals(jSONObject.optString("spec_time"))) {
String optString = jSONObject.optString("spec_time");
if (optString.length() > 0) {
this.P = a(optString);
}
} else {
this.T = 0;
}
this.f9137e = this.E.optBoolean("is_faved", false);
this.f9131aj.c(this.f9137e);
this.f9156x = jSONObject.optInt("buy_limit");
this.Y = jSONObject.optString("share_url");
this.D = jSONObject.optJSONObject("promotion");
ViewGroup viewGroup = (ViewGroup) findViewById(R.id.goods_detail_promotion);
viewGroup.removeAllViews();
JSONArray optJSONArray = this.D.optJSONArray("goods");
int length = optJSONArray == null ? 0 : optJSONArray.length();
for (int i2 = 0; i2 < length; i2++) {
View inflate = this.f9153u.inflate(R.layout.item_detail_promotion_view, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.item_detail_promotion_tag)).setText(optJSONArray.optJSONObject(i2).optString("tag"));
((TextView) inflate.findViewById(R.id.item_detail_promotion_name)).setText(optJSONArray.optJSONObject(i2).optString(ca.c.f4821e));
viewGroup.addView(inflate);
}
viewGroup.setVisibility(length > 0 ? 0 : 8);
ViewGroup viewGroup2 = (ViewGroup) findViewById(R.id.goods_detail_order_promotion);
viewGroup2.removeAllViews();
JSONArray optJSONArray2 = this.D.optJSONArray("order");
int length2 = optJSONArray2 == null ? 0 : optJSONArray2.length();
for (int i3 = 0; i3 < length2; i3++) {
View inflate2 = this.f9153u.inflate(R.layout.item_detail_promotion_view, (ViewGroup) null);
((TextView) inflate2.findViewById(R.id.item_detail_promotion_tag)).setText(optJSONArray2.optJSONObject(i3).optString("tag"));
((TextView) inflate2.findViewById(R.id.item_detail_promotion_name)).setText(optJSONArray2.optJSONObject(i3).optString(ca.c.f4821e));
viewGroup2.addView(inflate2);
}
viewGroup2.setVisibility(length2 > 0 ? 0 : 8);
JSONArray optJSONArray3 = jSONObject.optJSONArray("skus");
if (optJSONArray3 != null && optJSONArray3.length() > 0) {
int length3 = optJSONArray3.length();
for (int i4 = 0; i4 < length3; i4++) {
try {
JSONObject jSONObject2 = optJSONArray3.getJSONObject(i4);
this.J.put(jSONObject2.optString("properties"), jSONObject2);
this.K.put(jSONObject2.optString("sku_id"), jSONObject2);
this.L.add(jSONObject2);
} catch (Exception unused) {
}
}
}
JSONArray optJSONArray4 = jSONObject.optJSONArray("props_values");
int length4 = optJSONArray4 == null ? 0 : optJSONArray4.length();
for (int i5 = 0; i5 < length4; i5++) {
try {
this.N.add(optJSONArray4.getJSONObject(i5));
} catch (Exception unused2) {
}
}
JSONArray optJSONArray5 = jSONObject.optJSONArray("spec_info");
if (optJSONArray5 != null && optJSONArray5.length() > 0) {
int length5 = optJSONArray5.length();
for (int i6 = 0; i6 < length5; i6++) {
try {
this.M.add(optJSONArray5.getJSONObject(i6));
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
Collections.sort(this.M, new Comparator<JSONObject>() {
@Override
public int compare(JSONObject jSONObject3, JSONObject jSONObject4) {
return jSONObject3.optString("spec_id").compareTo(jSONObject4.optString("spec_id"));
}
});
d(this.E);
b(this.E);
}
public ArrayList<String> a(String str) {
ArrayList<String> arrayList = new ArrayList<>();
for (String str2 : str.split(bl.d.f4534d)) {
int intValue = Integer.valueOf(str2).intValue();
String b2 = b(intValue);
arrayList.add(b2);
this.Q.put(b2, Integer.valueOf(intValue));
}
return arrayList;
}
public String b(int i2) {
String str = "";
Stack stack = new Stack();
while (i2 != 0) {
stack.push(Integer.valueOf(i2 % 2));
i2 /= 2;
}
while (!stack.empty()) {
str = str + stack.pop();
}
return b(str);
}
private String b(String str) {
StringBuffer stringBuffer = new StringBuffer(str);
String str2 = "";
int length = str.length();
int i2 = 0;
while (i2 < (length / 2) + 1) {
char charAt = str.charAt(i2);
int i3 = length - i2;
int i4 = i3 - 1;
int i5 = i2 + 1;
stringBuffer.replace(i2, i5, String.valueOf(str.charAt(i4)));
stringBuffer.replace(i4, i3, String.valueOf(charAt));
i2 = i5;
}
String str3 = new String(stringBuffer);
for (int i6 = 0; i6 < str3.length(); i6++) {
if (String.valueOf(str3.charAt(i6)).equals("1")) {
str2 = str2 + this.R[i6] + " ";
}
}
return str2;
}
private void b(JSONObject jSONObject) {
boolean z2;
Exception exc;
View view;
JSONObject jSONObject2;
View inflate;
LinearLayout linearLayout;
CircleImageView circleImageView;
this.A.removeView(this.f9158z);
((TextView) findViewById(R.id.goods_detail_buy_title)).setText(jSONObject.optString(cv.c.J));
boolean z3 = true;
if (this.f9140h == 1) {
c(this.K.get(this.F.optJSONObject("product").optString("product_id")));
return;
}
ViewGroup viewGroup = (ViewGroup) findViewById(R.id.goods_detail_buy_specinfos);
int i2 = 0;
int i3 = 0;
while (true) {
ViewGroup viewGroup2 = null;
if (i3 >= this.M.size()) {
break;
}
JSONObject jSONObject3 = this.M.get(i3);
try {
View inflate2 = this.f9153u.inflate(R.layout.fragment_goods_detail_buy_specs, (ViewGroup) null);
((TextView) inflate2.findViewById(R.id.goods_detai_buy_specs_title)).setText(jSONObject3.optString("spec_name"));
FlowRadioGroup flowRadioGroup = (FlowRadioGroup) inflate2.findViewById(R.id.goods_detai_buy_specs_container);
JSONArray optJSONArray = jSONObject3.optJSONArray("spec_values");
if (!TextUtils.equals(jSONObject3.optString("spec_type"), "image")) {
if (optJSONArray != null) {
try {
if (optJSONArray.length() > 0) {
int length = optJSONArray.length();
for (int i4 = 0; i4 < length; i4++) {
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(-2, -2);
layoutParams.rightMargin = 30;
layoutParams.bottomMargin = 30;
JSONObject jSONObject4 = optJSONArray.getJSONObject(i4);
RadioButton radioButton = new RadioButton(this.mActivity, null, R.attr.goodsDetailBuySpecTextStyle);
radioButton.setLayoutParams(layoutParams);
radioButton.setPadding(40, 20, 40, 20);
radioButton.setText(jSONObject4.optString("spec_value"));
radioButton.setOnClickListener(this.f9133al);
radioButton.setTag(R.id.tag_spec_jsonobject, jSONObject4);
radioButton.setTag(R.id.tag_spec_id, jSONObject3.optString("spec_id"));
radioButton.setTag(R.id.confirm_alias, jSONObject3.optString("confirm_alias"));
flowRadioGroup.addView(radioButton);
}
i2 = 0;
try {
this.f9133al.onClick(flowRadioGroup.getChildAt(0));
viewGroup.addView(inflate2);
view = new View(this.mActivity);
view.setBackgroundResource(R.color.goods_detail_secondary_textcolor);
z2 = true;
} catch (Exception e2) {
e = e2;
z2 = true;
exc = e;
exc.printStackTrace();
i3++;
z3 = z2;
}
try {
view.setLayoutParams(new ViewGroup.LayoutParams(-1, 1));
viewGroup.addView(view);
} catch (Exception e3) {
e = e3;
exc = e;
exc.printStackTrace();
i3++;
z3 = z2;
}
}
} catch (Exception e4) {
e = e4;
i2 = 0;
}
}
i2 = 0;
z2 = true;
} else if (optJSONArray == null || optJSONArray.length() <= 0) {
z2 = z3;
} else {
int length2 = optJSONArray.length();
int i5 = i2;
while (i5 < length2) {
try {
jSONObject2 = optJSONArray.getJSONObject(i5);
inflate = this.f9153u.inflate(R.layout.item_specs_group, viewGroup2);
linearLayout = (LinearLayout) inflate.findViewById(R.id.ll_container);
linearLayout.setPadding(i2, i2, 10, i2);
circleImageView = (CircleImageView) inflate.findViewById(R.id.goods_detail_buy_specs);
} catch (Exception e5) {
exc = e5;
}
try {
circleImageView.setBorderColor(this.mActivity.getResources().getColor(R.color.red));
bo.c.a(jSONObject2.optString("spec_goods_images"), circleImageView);
((TextView) inflate.findViewById(R.id.tv_color_name)).setText(jSONObject2.optString("spec_value"));
linearLayout.setOnClickListener(this.f9133al);
linearLayout.setTag(R.id.tag_spec_jsonobject, jSONObject2);
linearLayout.setId(i5);
linearLayout.setTag(R.id.tag_spec_id, jSONObject3.optString("spec_id"));
flowRadioGroup.addView(inflate);
if (i5 == 0) {
this.f9133al.onClick(linearLayout);
}
i5++;
i2 = 0;
viewGroup2 = null;
} catch (Exception e6) {
exc = e6;
i2 = 0;
z2 = true;
exc.printStackTrace();
i3++;
z3 = z2;
}
}
viewGroup.addView(inflate2);
View view2 = new View(this.mActivity);
view2.setBackgroundResource(R.color.goods_detail_secondary_textcolor);
try {
view2.setLayoutParams(new ViewGroup.LayoutParams(-1, 1));
viewGroup.addView(view2);
i2 = 0;
z2 = true;
} catch (Exception e7) {
exc = e7;
z2 = true;
i2 = 0;
exc.printStackTrace();
i3++;
z3 = z2;
}
}
} catch (Exception e8) {
e = e8;
z2 = z3;
}
i3++;
z3 = z2;
}
View inflate3 = this.f9153u.inflate(R.layout.weeks_choose_layout, (ViewGroup) null);
this.W = (GridView) inflate3.findViewById(R.id.week_gv);
this.f9129ah = new i();
this.W.setAdapter((ListAdapter) this.f9129ah);
if (g()) {
viewGroup.addView(inflate3);
}
if (this.P.size() > 0) {
View inflate4 = this.f9153u.inflate(R.layout.fragment_goods_detail_buy_specs, (ViewGroup) null);
((TextView) inflate4.findViewById(R.id.goods_detai_buy_specs_title)).setText(this.mActivity.getString(R.string.spec_time));
FlowRadioGroup flowRadioGroup2 = (FlowRadioGroup) inflate4.findViewById(R.id.goods_detai_buy_specs_container);
View.OnClickListener kVar = new k();
while (i2 < this.P.size()) {
RadioGroup.LayoutParams layoutParams2 = new RadioGroup.LayoutParams(-2, -2);
layoutParams2.rightMargin = 30;
layoutParams2.bottomMargin = 30;
RadioButton radioButton2 = new RadioButton(this.mActivity, null, R.attr.goodsDetailBuySpecTextStyle);
radioButton2.setId(i2);
radioButton2.setLayoutParams(layoutParams2);
radioButton2.setPadding(40, 20, 40, 20);
radioButton2.setText(this.P.get(i2));
radioButton2.setOnClickListener(kVar);
radioButton2.setTag(Integer.valueOf(i2));
radioButton2.setTag(R.id.tag_spec_jsonobject, this.P.get(i2));
flowRadioGroup2.addView(radioButton2);
if (this.T == this.Q.get(this.P.get(i2)).intValue()) {
kVar.onClick(radioButton2);
}
i2++;
}
viewGroup.addView(inflate4);
}
viewGroup.addView(this.f9158z);
View view3 = new View(this.mActivity);
view3.setBackgroundResource(R.color.goods_line_color);
view3.setLayoutParams(new ViewGroup.LayoutParams(-1, com.shopex.westore.k.a((Context) this.mActivity, 5.0f)));
viewGroup.addView(view3);
}
public boolean g() {
Iterator<JSONObject> it = this.M.iterator();
boolean z2 = false;
while (it.hasNext()) {
if (it.next().optString("confirm_alias").contains("配送频次")) {
z2 = true;
}
}
return z2;
}
public void c(JSONObject jSONObject) {
String string = getString(R.string.tao_can_hui_yuan_jia, jSONObject.optString(com.shopex.westore.k.L));
if ("1".equals(this.f9122aa) && "1".equals(this.f9123ab)) {
ge.d dVar = this.f9131aj;
TextView textView = this.f9131aj.f18967d;
Object[] objArr = new Object[2];
objArr[0] = jSONObject.optString("price");
if (TextUtils.isEmpty(string)) {
string = "";
}
objArr[1] = string;
dVar.a(textView, com.shopex.westore.k.a(objArr));
} else {
this.f9131aj.a(this.f9131aj.f18967d, com.shopex.westore.k.a(jSONObject.optString("price")));
}
((TextView) findViewById(R.id.goods_detail_buy_stock)).setText(this.mActivity.getString(R.string.goods_detail_buy_stock, new Object[]{jSONObject.optString("quantity")}));
this.f9149q = jSONObject;
}
public class k implements View.OnClickListener {
k() {
}
@Override
public void onClick(View view) {
if (view instanceof RadioButton) {
((RadioButton) view).setChecked(true);
}
if (view.getTag(R.id.tag_spec_jsonobject) == null) {
return;
}
aq.this.T = ((Integer) aq.this.Q.get((String) view.getTag(R.id.tag_spec_jsonobject))).intValue();
}
}
private void d(JSONObject jSONObject) {
int i2;
int i3;
this.f9122aa = jSONObject.optString("is_package");
this.f9123ab = jSONObject.optString("package_member");
this.f9124ac = jSONObject.optString("discount");
this.f9131aj.f18971h.setText(jSONObject.optString("brief"));
this.f9131aj.f18970g.setNumColumns(2);
this.f9131aj.f18970g.setAdapter((ListAdapter) new m(jSONObject.optJSONObject("tip").optJSONArray("tip_text")));
this.f9131aj.f18969f.setVisibility("subscribe".equals(jSONObject.optString("feature")) ? 8 : 0);
findViewById(R.id.goods_detail_add_shoppingcart_ll).setVisibility("subscribe".equals(jSONObject.optString("feature")) ? 4 : 0);
this.f9158z.setVisibility("subscribe".equals(jSONObject.optString("feature")) ? 8 : 0);
if (jSONObject.optJSONObject("brand") != null) {
((TextView) findViewById(R.id.detail_brand_name)).setText("品牌:" + jSONObject.optJSONObject("brand").optString("brand_name"));
findViewById(R.id.rel_brand_view).setTag(jSONObject.optJSONObject("brand"));
bo.c.a(jSONObject.optJSONObject("brand").optString("logo_src"), (ImageView) findViewById(R.id.img_brand_logo));
} else {
((TextView) findViewById(R.id.detail_brand_name)).setText("品牌:未知");
}
if (this.f9140h == 1) {
this.mHandler.sendEmptyMessage(0);
JSONObject jSONObject2 = this.F;
View findViewById = findViewById(R.id.goods_detail_title);
LinearLayout linearLayout = (LinearLayout) findViewById.getParent();
linearLayout.removeView(findViewById);
linearLayout.addView(findViewById, 1);
((TextView) findViewById(R.id.goods_detail_oldprice)).setText(com.shopex.westore.k.a("¥", jSONObject2.optString("old_price")));
this.f9131aj.a(this.f9131aj.f18967d, jSONObject2.optString("price"));
} else {
String str = "";
if (this.G != null) {
this.f9156x = this.G.optInt("buy_limit");
if (this.f9156x > 0) {
((TextView) this.rootView.findViewById(R.id.goods_detail_limit_quantity)).setText(this.mActivity.getString(R.string.activity_limit_quantity, new Object[]{1}));
}
str = this.G.optString("price");
}
JSONArray optJSONArray = jSONObject.optJSONArray("skus");
if (optJSONArray != null && optJSONArray.length() > 0) {
JSONObject optJSONObject = optJSONArray.optJSONObject(0);
if (optJSONObject.optBoolean("is_starbuy", false)) {
JSONObject optJSONObject2 = optJSONObject.optJSONObject("starbuy_info");
findViewById(R.id.goods_detail_layout).setVisibility(0);
if (optJSONObject2 != null) {
str = optJSONObject2.optString("promotion_price");
}
long optLong = optJSONObject2.optLong(dq.X) - jSONObject.optLong("system_time");
long optLong2 = jSONObject.optLong("system_time");
int i4 = (int) optLong;
if (i4 > 60) {
i2 = i4 / 60;
i4 %= 60;
} else {
i2 = 0;
}
if (optLong2 > 60) {
i3 = i2 / 60;
i2 %= 60;
} else {
i3 = 0;
}
((RushBuyCountDownTimerView) findViewById(R.id.goods_detail_time)).a(i3, i2, i4);
((RushBuyCountDownTimerView) findViewById(R.id.goods_detail_time)).a();
((TextView) findViewById(R.id.goods_detail_oldprice)).setText(com.shopex.westore.k.a("¥", jSONObject.optString("market_price")));
}
if (TextUtils.isEmpty(str)) {
str = jSONObject.optString("price");
}
this.f9131aj.a(this.f9131aj.f18967d, str);
}
}
this.f9131aj.f18966c.setText(jSONObject.optString(cv.c.J));
this.f9131aj.a(jSONObject.optString("subtitle"));
int color = this.f9143k.getColor(R.color.westore_dark_textcolor);
String optString = jSONObject.optString("buy_count");
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(optString);
spannableStringBuilder.setSpan(new ForegroundColorSpan(color), 0, optString.length(), 33);
spannableStringBuilder.insert(0, (CharSequence) this.mActivity.getString(R.string.total_sales));
spannableStringBuilder.append((CharSequence) this.mActivity.getString(R.string.total_sales_unit));
((TextView) findViewById(R.id.goods_detail_total_sales)).setText(spannableStringBuilder);
String optString2 = jSONObject.optString("comments_count");
SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(optString2);
spannableStringBuilder2.setSpan(new ForegroundColorSpan(color), 0, optString2.length(), 33);
spannableStringBuilder2.insert(0, (CharSequence) this.mActivity.getString(R.string.total_rates));
spannableStringBuilder2.append((CharSequence) this.mActivity.getString(R.string.total_rates_unit));
((TextView) findViewById(R.id.goods_detail_total_rate)).setText(spannableStringBuilder2);
((TextView) findViewById(R.id.goods_detail_oldprice)).getPaint().setFlags(16);
this.f9150r.setText(String.valueOf(this.f9147o));
JSONArray jSONArray = null;
try {
jSONArray = new JSONArray(jSONObject.optString("item_imgs"));
} catch (Exception e2) {
e2.printStackTrace();
}
if (jSONArray != null && jSONArray.length() > 0) {
int length = jSONArray.length();
ArrayList arrayList = new ArrayList();
for (int i5 = 0; i5 < length; i5++) {
arrayList.add(jSONArray.optJSONObject(i5).optString("big_url"));
}
this.f9131aj.a(arrayList);
for (int i6 = 0; i6 < length; i6++) {
this.O.add(jSONArray.optJSONObject(i6));
}
}
showCancelableLoadingDialog();
this.f9131aj.a(this.E);
}
public void e(JSONObject jSONObject) {
try {
JSONArray jSONArray = jSONObject.getJSONArray("data");
if (jSONArray != null && jSONArray.length() > 0) {
c cVar = new c(jSONArray);
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
this.C.addView(cVar.getView(i2, null, null));
}
return;
}
findViewById(R.id.good_detail_recommend_title).setVisibility(4);
} catch (Exception e2) {
e2.printStackTrace();
findViewById(R.id.good_detail_recommend_title).setVisibility(4);
}
}
public class c extends BaseAdapter implements View.OnClickListener {
private JSONArray f9179b;
@Override
public Object getItem(int i2) {
return null;
}
@Override
public long getItemId(int i2) {
return 0L;
}
public c(JSONArray jSONArray) {
this.f9179b = jSONArray;
}
@Override
public int getCount() {
if (this.f9179b == null) {
return 0;
}
return this.f9179b.length();
}
@Override
public View getView(int i2, View view, ViewGroup viewGroup) {
if (view == null) {
view = aq.this.f9153u.inflate(R.layout.fragment_detail_recomend_item, (ViewGroup) null);
}
JSONObject optJSONObject = this.f9179b.optJSONObject(i2);
bo.c.a(optJSONObject.optString("image_default"), (ImageView) view.findViewById(R.id.item_recomend_img1));
((TextView) view.findViewById(R.id.item_recomend_title)).setText(optJSONObject.optString(ca.c.f4821e));
((TextView) view.findViewById(R.id.item_recomend_price1)).setText("¥" + optJSONObject.optString("price"));
view.setTag(optJSONObject);
view.setOnClickListener(this);
return view;
}
@Override
public void onClick(View view) {
if (view.getTag() != null) {
aq.this.startActivity(AgentActivity.a(aq.this.mActivity, (int) AgentActivity.f8577g).putExtra(com.shopex.westore.k.f10186i, ((JSONObject) view.getTag()).optString("goods_id")));
}
}
}
public class m extends BaseAdapter {
private JSONArray f9200b;
@Override
public Object getItem(int i2) {
return null;
}
@Override
public long getItemId(int i2) {
return 0L;
}
public m(JSONArray jSONArray) {
this.f9200b = jSONArray;
}
@Override
public int getCount() {
if (this.f9200b == null) {
return 0;
}
return this.f9200b.length();
}
@Override
public View getView(int i2, View view, ViewGroup viewGroup) {
View inflate = aq.this.f9153u.inflate(R.layout.item_shopping_tip, (ViewGroup) null);
TextView textView = (TextView) inflate.findViewById(R.id.tv_tip_name);
ImageView imageView = (ImageView) inflate.findViewById(R.id.iv_tip_image);
try {
textView.setText("null".equals(this.f9200b.getString(i2)) ? "" : this.f9200b.getString(i2));
imageView.setVisibility("null".equals(this.f9200b.getString(i2)) ? 8 : 0);
} catch (JSONException e2) {
e2.printStackTrace();
}
return inflate;
}
}
public class j implements fj.e {
private String f9194b;
private int f9195c;
public j(String str, int i2) {
this.f9194b = str;
this.f9195c = i2;
}
@Override
public fj.c task_request() {
aq.this.showCancelableLoadingDialog();
return new fj.c("groupactivity.index.buy").a("product_id", this.f9194b).a("num", String.valueOf(this.f9195c));
}
@Override
public void task_response(String str) {
aq.this.hideLoadingDialog_mt();
try {
if (com.shopex.westore.k.a((Context) aq.this.mActivity, new JSONObject(str))) {
aq.this.onClick(aq.this.findViewById(R.id.goods_detail_buy_cancel));
com.shopex.westore.k.a(new fj.d(), new n("group"));
}
} catch (Exception unused) {
}
}
}
public class l implements fj.e {
private String f9198b;
public l(String str) {
this.f9198b = str;
}
@Override
public void task_response(String str) {
aq.this.hideLoadingDialog_mt();
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject.optString("data"));
aq.this.f9137e = false;
aq.this.f9131aj.f18965b.setImageResource(R.drawable.goods_collection_ordinary);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
@Override
public fj.c task_request() {
aq.this.showCancelableLoadingDialog();
fj.c cVar = new fj.c("mobileapi.member.del_fav");
cVar.a("gid", this.f9198b);
return cVar;
}
}
public class a implements fj.e {
private c.a f9170b;
private DoActivity f9171c;
private String f9172d;
private int f9173e;
private int f9174f;
private String f9175g;
public a(DoActivity doActivity, c.a aVar, String str, int i2, String str2, int i3) {
this.f9170b = aVar;
this.f9171c = doActivity;
this.f9172d = str;
this.f9173e = i2;
this.f9175g = str2;
this.f9174f = i3;
}
@Override
public fj.c task_request() {
fj.c a2;
this.f9171c.f();
if (this.f9174f == 0) {
a2 = new fj.c("mobileapi.cart.add").a("product_id", this.f9172d).a("num", String.valueOf(this.f9173e));
} else {
a2 = new fj.c("mobileapi.cart.add").a("product_id", this.f9172d).a("num", String.valueOf(this.f9173e)).a("spec_time", String.valueOf(this.f9174f));
}
if (!TextUtils.isEmpty(this.f9175g)) {
a2.a("btype", this.f9175g);
}
return a2;
}
@Override
public void task_response(String str) {
this.f9171c.h();
try {
if (!com.shopex.westore.k.a((Context) this.f9171c, new JSONObject(str)) || this.f9170b == null) {
return;
}
this.f9170b.task_response(str);
} catch (Exception unused) {
}
}
}
public class b implements fj.e {
private String f9177b;
public b(String str) {
this.f9177b = str;
}
@Override
public fj.c task_request() {
aq.this.showCancelableLoadingDialog();
return new fj.c("mobileapi.member.add_fav").a("gid", this.f9177b);
}
@Override
public void task_response(String str) {
aq.this.hideLoadingDialog_mt();
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject.optString("data"));
aq.this.f9137e = true;
aq.this.f9131aj.f18965b.setImageResource(R.drawable.goods_collection_select);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
private class d implements fj.e {
private d() {
}
@Override
public void task_response(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
com.shopex.westore.k.f10182e = jSONObject.optJSONObject("data").optInt("goods_subtotal");
aq.this.f9151s.setVisibility(com.shopex.westore.k.f10182e > 0 ? 0 : 4);
aq.this.f9151s.setText(String.valueOf(com.shopex.westore.k.f10182e));
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
@Override
public fj.c task_request() {
return new fj.c("mobileapi.cart.get_list_group_by_tip");
}
}
private class n implements fj.e {
private String f9202b;
public n() {
this.f9202b = "true";
}
public n(String str) {
this.f9202b = "true";
this.f9202b = str;
}
@Override
public fj.c task_request() {
aq.this.showCancelableLoadingDialog();
return new fj.c("mobileapi.cart.checkout").a("isfastbuy", this.f9202b);
}
@Override
public void task_response(String str) {
aq.this.hideLoadingDialog_mt();
try {
JSONObject jSONObject = new JSONObject(str);
if (!com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject) || jSONObject.isNull("data")) {
return;
}
JSONObject optJSONObject = jSONObject.optJSONObject("data");
String jSONArray = optJSONObject.optJSONArray("coupon_lists") != null ? optJSONObject.optJSONArray("coupon_lists").toString() : "";
if (aq.this.H != null) {
aq.this.startActivity(AgentActivity.a(aq.this.mActivity, (int) AgentActivity.f8593w).putExtra("com.shopex.westore.EXTRA_DATA", optJSONObject.toString()).putExtra(com.shopex.westore.k.f10190m, this.f9202b).putExtra(com.shopex.westore.k.f10197t, aq.this.H.toString()).putExtra(com.shopex.westore.k.f10198u, jSONArray));
} else {
aq.this.startActivityForResult(AgentActivity.a(aq.this.mActivity, (int) AgentActivity.f8593w).putExtra("com.shopex.westore.EXTRA_DATA", optJSONObject.toString()).putExtra(com.shopex.westore.k.f10190m, this.f9202b).putExtra(com.shopex.westore.k.f10198u, jSONArray).putExtra(com.shopex.westore.k.G, aq.this.f9122aa), 1);
}
} catch (Exception unused) {
}
}
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
if (i3 == -1 && "1".equals(this.f9122aa) && intent.getBooleanExtra("paystate", false)) {
Intent intent2 = new Intent(getActivity(), MainTabFragmentActivity.class);
intent2.putExtra(com.shopex.westore.k.f10185h, 4);
intent2.setFlags(67108864);
startActivity(intent2);
}
}
public class g implements fj.e {
private String f9184b;
public g(String str) {
this.f9184b = str;
}
@Override
public void task_response(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
aq.this.e(jSONObject);
} else {
aq.this.findViewById(R.id.good_detail_recommend_title).setVisibility(8);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
@Override
public fj.c task_request() {
fj.c cVar = new fj.c("mobileapi.goods.goodslink");
cVar.a("iid", this.f9184b);
return cVar;
}
}
private class h implements fj.e {
private int f9186b;
private boolean f9187c;
public h(int i2) {
this.f9186b = 0;
this.f9187c = true;
this.f9186b = i2;
}
public h(int i2, boolean z2) {
this.f9186b = 0;
this.f9187c = true;
this.f9186b = i2;
this.f9187c = z2;
}
@Override
public fj.c task_request() {
if (this.f9187c) {
aq.this.showCancelableLoadingDialog();
}
if (this.f9186b == 1) {
return new fj.c("groupactivity.index.get_detail").a("act_id", aq.this.f9146n);
}
return new fj.c("mobileapi.goods.get_item").a("iid", aq.this.f9144l).a("son_object", "json").a("brand_detail", "1");
}
@Override
public void task_response(String str) {
aq.this.hideLoadingDialog_mt();
aq.this.rootView.setVisibility(0);
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (this.f9186b == 1) {
if (optJSONObject != null && !optJSONObject.isNull("data")) {
aq.this.F = optJSONObject.optJSONObject("data");
com.shopex.westore.k.a(new fj.d(), new h(0));
}
} else if (optJSONObject != null && !optJSONObject.isNull("item")) {
aq.this.a(optJSONObject.optJSONObject("item"));
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
private class f implements fj.e {
private f() {
}
@Override
public void task_response(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
aq.this.hideLoadingDialog_mt();
aq.this.rootView.setVisibility(0);
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject != null) {
if (!optJSONObject.isNull("from_extract")) {
aq.this.H = optJSONObject.optJSONArray("from_extract");
}
if (!optJSONObject.isNull("info")) {
aq.this.G = optJSONObject.optJSONObject("info");
}
if (optJSONObject.isNull("goods")) {
return;
}
aq.this.a(optJSONObject.optJSONObject("goods"));
return;
}
return;
}
aq.this.findViewById(R.id.goods_detail_shoppingcar).setVisibility(0);
aq.this.findViewById(R.id.goods_detail_addto_shopcar).setVisibility(0);
com.shopex.westore.k.a(new fj.d(), new h(aq.this.f9140h, false));
} catch (Exception e2) {
e2.printStackTrace();
}
}
@Override
public fj.c task_request() {
aq.this.showCancelableLoadingDialog();
fj.c cVar = new fj.c("starbuy.index.getDetail");
cVar.a("product_id", aq.this.f9145m);
cVar.a("son_object", "json");
return cVar;
}
}
private class e implements fj.e {
private e() {
}
@Override
public void task_response(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) aq.this.mActivity, jSONObject)) {
aq.this.f9144l = jSONObject.optString("data");
com.shopex.westore.k.a(new fj.d(), new h(aq.this.f9140h));
aq.this.findViewById(R.id.goods_detail_shoppingcar).setVisibility(0);
aq.this.findViewById(R.id.goods_detail_addto_shopcar).setVisibility(0);
}
} catch (JSONException e2) {
e2.printStackTrace();
}
}
@Override
public fj.c task_request() {
fj.c cVar = new fj.c("mobileapi.goods.get_gid");
cVar.a("pid", aq.this.f9141i);
return cVar;
}
}
@Override
public String b() {
String c2 = c();
if (TextUtils.isEmpty(c2)) {
return null;
}
return com.shopex.westore.util.b.b(c2);
}
@Override
public String c() {
if (this.O.isEmpty()) {
return null;
}
return this.O.get(0).optString("big_url");
}
@Override
public String a() {
if (this.E != null) {
return this.E.optString(cv.c.J) + "-" + this.E.optString("brief");
}
return null;
}
@Override
public String d() {
return "https://www.zjsjtz.com/wap/product-" + this.f9144l + ".html";
}
}