public void loadMoreData() { if (!NetUtility.isNetworkAvailable(NewLimitbuyActivity.this)) { CommonUtility.showMiddleToast( NewLimitbuyActivity.this, "", getString(R.string.can_not_conntect_network_please_check_network_settings)); return; } if (asyncTask != null) { return; } asyncTask = new AsyncTask<Object, Void, ArrayList<LimitBuy>>() { @Override protected ArrayList<LimitBuy> doInBackground(Object... params) { String request = LimitBuyResult.createRequestLimitBuyListJson("1"); // 明日预告 BDebug.e(Tag, request); // String response = // "{\"isSuccess\":\"Y\",\"rushBuyGroupList\":[{\"rushBuyBeginTime\":\"10:00\",\"rushBuyGoodsList\":[{\"skuID\" : \"1000039537\",\"goodsNo\" : \"9100016292\",\"skuNo\" : \"10000001654\",\"skuName\" : \"联合康森(Lahecs)RF-618电子冰箱除味器1\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"60\",\"rushBuyState\":\"1\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器2\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"30\",\"rushBuyState\":\"0\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器3\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"2\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器4\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"3\"}]},{\"rushBuyBeginTime\":\"10:00\",\"rushBuyGoodsList\":[{\"skuID\" : \"1000039537\",\"goodsNo\" : \"9100016292\",\"skuNo\" : \"10000001654\",\"skuName\" : \"联合康森(Lahecs)RF-618电子冰箱除味器5\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"1\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器6\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"0\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"2\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"3\"}]}]}"; String response = NetUtility.sendHttpRequestByPost(Constants.URL_RUSHBUY_GOODS_LIST, request); if (NetUtility.NO_CONN.equals(response)) { return null; } return LimitBuyResult.parseLimitBuyList(response); } @Override protected void onCancelled() { asyncTask = null; } @Override protected void onPostExecute(final ArrayList<LimitBuy> result) { if (isCancelled()) { return; } if (result == null) { CommonUtility.showMiddleToast( NewLimitbuyActivity.this, "", getString(R.string.data_load_fail_exception)); return; } listView.setHasMore(false); GlobalApplication.limitLastRefresh = System.currentTimeMillis(); ArrayList<LimitBuyGoods> limitbuyList = new ArrayList<LimitBuyResult.LimitBuyGoods>(); for (int i = 0, size = result.size(); i < size; i++) { limitbuyList.addAll(result.get(i).getRushBuyGoodsList()); } limitbuyAdapter.addList(limitbuyList); asyncTask = null; } }; asyncTask.execute(); }
public void floatTitleButtonClick(int position, Button btn) { LimitBuyGoods limitbuy = limitbuyList.get(position); if (!CommonUtility.isOrNoZero(limitbuy.getSkuRushBuyPrice(), false)) { if (!TextUtils.isEmpty(limitbuy.getRushBuyState()) && Integer.valueOf(limitbuy.getRushBuyState()) == 1) { if (GlobalConfig.isLogin) { if (limitbuy != null) { isGoShoppingOrder(limitbuy, limitbuy.getRushBuyItemId()); } } else { Intent intent = new Intent(); intent.setClass(context.getApplicationContext(), LoginActivity.class); intent.setAction(this.getClass().getName()); context.startActivity(intent); } } } }
// 初次加载 private void setData(final boolean isTimerStart, final boolean is24Judge) { if (!NetUtility.isNetworkAvailable(NewLimitbuyActivity.this)) { CommonUtility.showMiddleToast( NewLimitbuyActivity.this, "", getString(R.string.can_not_conntect_network_please_check_network_settings)); no_net_layout.setVisibility(View.VISIBLE); return; } no_net_layout.setVisibility(View.GONE); new AsyncTask<Object, Void, ArrayList<LimitBuy>>() { LoadingDialog loadingDialog = null; @Override protected void onPreExecute() { if (!isTimerStart) { loadingDialog = CommonUtility.showLoadingDialog( NewLimitbuyActivity.this, getString(R.string.loading), true, new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { cancel(true); } }); } } @Override protected ArrayList<LimitBuy> doInBackground(Object... params) { Intent intent = getIntent(); if ("PromtionActivitiesActivity".equals(intent.getAction()) || "HomeActivity".equals(intent.getAction()) || "pushSertvice".equals(intent.getAction())) { String activityId = intent.getStringExtra(JsonInterface.JK_ACTIVITY_ID); String activityType = intent.getStringExtra(JsonInterface.JK_ACTIVITY_TYPE); String activityHtmlurl = intent.getStringExtra(JsonInterface.JK_ACTIVITY_HTML_URL); String request = LimitBuyResult.createRequestLimitBuyPrmListJson( activityId, activityType, activityHtmlurl); String response = ""; if ("HomeActivity".equals(intent.getAction()) || "pushSertvice".equals(intent.getAction())) { response = NetUtility.sendHttpRequestByPost( Constants.URL_PROMOTION_BUSHBUY_ACTIVITY_GOODS, request); } else if ("PromtionActivitiesActivity".equals(intent.getAction()) || "push_PromtionActivitiesActivity".equals(action)) { response = NetUtility.sendHttpRequestByPost( Constants.URL_ACTIVITIES_BUSHBUY_ACTIVITY_GOODS, request); } if (NetUtility.NO_CONN.equals(response)) { return null; } return LimitBuyResult.parseLimitBuyPromList(response); } else { rushBuyID = intent.getStringExtra(HomeActivity.RUSH_BUY_ITEM_ID); String request = LimitBuyResult.createRequestLimitBuyListJson(rushBuyDateType); BDebug.e(Tag, request); // String response = // "{\"isSuccess\":\"Y\",\"rushBuyGroupList\":[{\"rushBuyBeginTime\":\"10:00\",\"rushBuyGoodsList\":[{\"skuID\" : \"1000039537\",\"goodsNo\" : \"9100016292\",\"skuNo\" : \"10000001654\",\"skuName\" : \"联合康森(Lahecs)RF-618电子冰箱除味器1\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"60\",\"rushBuyState\":\"1\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器2\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"30\",\"rushBuyState\":\"0\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器3\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"2\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器4\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"3\"}]},{\"rushBuyBeginTime\":\"10:00\",\"rushBuyGoodsList\":[{\"skuID\" : \"1000039537\",\"goodsNo\" : \"9100016292\",\"skuNo\" : \"10000001654\",\"skuName\" : \"联合康森(Lahecs)RF-618电子冰箱除味器5\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"1\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器6\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"0\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"2\"},{\"skuID\":\"1000039537\",\"goodsNo\":\"9100016292\",\"skuNo\":\"10000001654\",\"skuName\":\"联合康森(Lahecs)RF-618电子冰箱除味器\",\"rushBuyItemId\":\"19700005\",\"skuThumbImgUrl\":\"http://img1.gome.com.cn/adfsdf_60.jpg\",\"skuOriginalPrice\":\"3998.00\",\"skuRushBuyPrice\":\"3500.00\",\"limitNum\":\"200\",\"remainNum\":\"174\",\"delayTime\":\"360000\",\"rushBuyState\":\"3\"}]}]}"; String response = NetUtility.sendHttpRequestByPost(Constants.URL_RUSHBUY_GOODS_LIST, request); BDebug.e(Tag, response); if (NetUtility.NO_CONN.equals(response)) { return null; } return LimitBuyResult.parseLimitBuyList(response); } } @Override protected void onPostExecute(ArrayList<LimitBuy> result) { if (isCancelled()) { return; } if (loadingDialog != null) { loadingDialog.dismiss(); } if (result == null) { if (is24Judge) { if ("HomeActivity".equals(NewLimitbuyActivity.this.getIntent().getAction()) || "PromtionActivitiesActivity" .equals(NewLimitbuyActivity.this.getIntent().getAction())) { finish(); // 关闭当前页 } } else { CommonUtility.showMiddleToast( NewLimitbuyActivity.this, "", getString(R.string.data_load_fail_exception)); tvEmpty.setText(R.string.empty); listView.setEmptyView(tvEmpty); } return; } // 设置标题(消息推送过来时用到) if ("pushSertvice".equals(getIntent().getAction())) { if (TextUtils.isEmpty(LimitBuyResult.PUSH_ACTIVE_NAME)) { tvTitle.setText(R.string.limitbuy_title); } else { tvTitle.setText(LimitBuyResult.PUSH_ACTIVE_NAME); } } listView.setHasMore(true); listView.setVisibility(View.VISIBLE); // 时间计时器开始倒计时 if (!isTimerStart) { time.schedule(timerTask, 0, 1000); } GlobalApplication.limitLastRefresh = System.currentTimeMillis(); ArrayList<LimitBuyGoods> limitbuyList = new ArrayList<LimitBuyResult.LimitBuyGoods>(); for (int i = 0, size = result.size(); i < size; i++) { // TODO zhouxm 活动专区中 不支持 预售商品,判断是否为空 防止程序崩溃 ArrayList<LimitBuyGoods> ll = result.get(i).getRushBuyGoodsList(); if (ll == null || ll.size() == 0) { tvEmpty.setText(R.string.empty); listView.setEmptyView(tvEmpty); return; } limitbuyList.addAll(ll); } if (limitbuyAdapter == null) { limitbuyAdapter = new LimitbuyAdapter(NewLimitbuyActivity.this, limitbuyList); limitbuyAdapter.setBigPictureOrLittlePicture(1); listView.setAdapter(limitbuyAdapter); /* * listView.setTitle(LayoutInflater.from(NewLimitbuyActivity.this).inflate( * R.layout.limitbuy_float_title, listView, false)); */ tvEmpty.setText(R.string.empty); listView.setEmptyView(tvEmpty); listView.setOnItemClickListener(NewLimitbuyActivity.this); listView.setOnRefreshListener(NewLimitbuyActivity.this); common_title_btn_right.setOnClickListener(NewLimitbuyActivity.this); int selection = 0; int position = 1; for (int i = 0, size = result.size(); i < size; i++) { for (int j = 0, size2 = result.get(i).getRushBuyGoodsList().size(); j < size2; j++) { if (result.get(i).getRushBuyGoodsList().get(j).getRushBuyItemId().equals(rushBuyID)) { selection = position; break; } position++; } } listView.setSelection(selection); rushBuyID = ""; } else { limitbuyAdapter.updateList(limitbuyList); } listView.onRefreshComplete(); } }.execute(); }
protected void gotoFlashPurchase(final LimitBuyGoods rushBuy) { if (!NetUtility.isNetworkAvailable(context)) { CommonUtility.showMiddleToast( context, "", context.getString(R.string.can_not_conntect_network_please_check_network_settings)); return; } new AsyncTask<Object, Void, ShoppingCart_Recently>() { LoadingDialog progressDialog; protected void onPreExecute() { progressDialog = CommonUtility.showLoadingDialog( context, context.getString(R.string.loading), true, new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { cancel(true); } }); }; protected ShoppingCart_Recently doInBackground(Object... params) { // BDebug.d(TAG, json); String request = ShoppingCart.createRequestLimitOrderListJson( rushBuy.getSkuID(), rushBuy.getGoodsNo(), rushBuy.getRushBuyItemId(), ""); String result = NetUtility.sendHttpRequestByPost( Constants.URL_RUSHBUY_CART_RUSHBUY_FLASHBUYCHECKOUTDETAIL, request); if (NetUtility.NO_CONN.equals(result)) { ShoppingCart.setErrorMessage(context.getString(R.string.data_load_fail_exception)); return null; } return ShoppingCart.paserResponseGroupLimitShoppingCart_Recently(result); }; protected void onPostExecute(ShoppingCart_Recently shoppingCart_recently) { progressDialog.dismiss(); if (isCancelled()) { return; } if (shoppingCart_recently == null) { CommonUtility.showMiddleToast(context, "", ShoppingCart.getErrorMessage()); return; } sbString = new StringBuffer(); sbString.append(";"); sbString.append(rushBuy.getSkuID()); sbString.append(";"); sbString.append("1"); sbString.append(";"); sbString.append(rushBuy.getSkuRushBuyPrice()); sbString.append(","); ArrayList<Goods> limitGoodsList = new ArrayList<Goods>(); Goods goods = new Goods(); goods.setSkuID(rushBuy.getSkuID()); goods.setSkuName(rushBuy.getSkuName()); goods.setGoodsNo(rushBuy.getGoodsNo()); goods.setCommerceItemID(rushBuy.getRushBuyItemId()); goods.setSkuRushBuyPrice(rushBuy.getSkuRushBuyPrice()); limitGoodsList.add(goods); if ("Y".equals(shoppingCart_recently.getHasAllowance())) { Intent intent = new Intent(); intent.putExtra( ShoppingCart.JK_SHOPPINGCART_ALLOWANCEINFO, shoppingCart_recently.getWanceInfo()); intent.putExtra("limitgoods", limitGoodsList); intent.putExtra("orderMark", ""); if (!TextUtils.isEmpty(sbString)) intent.putExtra("shoppingCartOctree", sbString.toString()); intent.setClass(context, LimitFlashWanceInfoActivity.class); context.startActivity(intent); } else { Intent intent = new Intent(); intent.putExtra("limitgoods", limitGoodsList); intent.putExtra("orderMark", ""); if (!TextUtils.isEmpty(sbString)) intent.putExtra("shoppingCartOctree", sbString.toString()); intent.setClass(context, LimitFlashConfirmActivity.class); context.startActivity(intent); } }; }.execute(); }
private void isGoShoppingOrder(final LimitBuyGoods limitbuy, final String rushBuyItemId) { if (!NetUtility.isNetworkAvailable(context)) { CommonUtility.showMiddleToast( context, "", context.getString(R.string.can_not_conntect_network_please_check_network_settings)); return; } new AsyncTask<Object, Void, ShoppingGo>() { LoadingDialog progressDialog; protected void onPreExecute() { progressDialog = CommonUtility.showLoadingDialog( context, context.getString(R.string.loading), true, new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { cancel(true); } }); }; protected ShoppingGo doInBackground(Object... params) { // BDebug.d(TAG, json); String request = GBProduct.createRequestLimitBuyCheckJson( limitbuy.getSkuID(), limitbuy.getGoodsNo(), limitbuy.getRushBuyItemId()); String result = NetUtility.sendHttpRequestByPost(Constants.URL_RUSHBUY_RUSHBUYCHECK, request); if (NetUtility.NO_CONN.equals(result)) { ShoppingCart.setErrorMessage(context.getString(R.string.data_load_fail_exception)); return null; } return ShoppingCart.go_ShoppingOrder(result); }; protected void onPostExecute(ShoppingGo shoppingGo) { progressDialog.dismiss(); if (isCancelled()) { return; } if (shoppingGo == null) return; if (shoppingGo.isSuccess()) { Intent grouplimitIntent = new Intent(); if (limitbuy != null) { if (shoppingGo.isFinishedFlashBuyConfig()) { gotoFlashPurchase(limitbuy); } else { grouplimitIntent.putExtra( GroupLimitOrderActivity.GroupLimitOrderActivitySKUID, limitbuy.getSkuID()); grouplimitIntent.putExtra( GroupLimitOrderActivity.GroupLimitOrderActivityGoodsNo, limitbuy.getGoodsNo()); grouplimitIntent.putExtra( GroupLimitOrderActivity.GroupLimitOrderActivityRushbuyitemId, limitbuy.getRushBuyItemId()); GlobalConfig.getInstance().setGroupLimitType(GroupLimitOrderActivity.LimitType); grouplimitIntent.setClass( context.getApplicationContext(), GroupLimitOrderActivity.class); ((NewLimitbuyActivity) context).startActivityForResult(grouplimitIntent, 0); } } return; } else if (!shoppingGo.isSuccess() && !shoppingGo.isActivated()) { // 跳转激活界面 Intent intent = new Intent(); // intent.putExtra(ShoppingGo.SHOPPING_GO, shoppingGo); intent.putExtra(JsonInterface.JK_MOBILE, shoppingGo.getMobile()); intent.setClass(context, ActivateAccountActivity.class); ((NewLimitbuyActivity) context).startActivityForResult(intent, 0); } else if (!shoppingGo.isSuccess() && shoppingGo.isSessionExpired()) { // 服务器返回登录超时 Intent intent = new Intent(); intent.setClass(context.getApplicationContext(), LoginActivity.class); intent.setAction(this.getClass().getName()); context.startActivity(intent); } else if (!shoppingGo.isSuccess()) { CommonUtility.showMiddleToast(context, "", ShoppingCart.getErrorMessage()); getRushEndInfo(rushBuyItemId); return; } }; }.execute(); }
private void bingBigpictureData(LimitBuyGoods limitbuy, ViewHolder holder, ViewGroup parent) { if (limitbuy != null) { holder.title.setText(toDBC(limitbuy.getSkuName())); if (!CommonUtility.isOrNoZero(limitbuy.getSkuRushBuyPrice(), false)) { holder.limitPriceUnittext.setText("¥"); holder.limitPricetext.setVisibility(View.VISIBLE); holder.limitPriceFloattext.setVisibility(View.VISIBLE); holder.limitPricetext.setText(limitbuy.getSkuRushBuyPrice().split("\\.")[0].toString()); holder.limitPriceFloattext.setText( "." + limitbuy.getSkuRushBuyPrice().split("\\.")[1].toString()); holder.discounttext.setText(limitbuy.getDiscountRate()); } else { holder.limitPriceUnittext.setText(context.getString(R.string.now_not_have_price)); holder.limitPricetext.setVisibility(View.GONE); holder.limitPriceFloattext.setVisibility(View.GONE); } holder.gomePricetext.setText("¥" + limitbuy.getSkuOriginalPrice()); holder.gomePricetext.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG); try { int progress = (int) (Integer.valueOf(limitbuy.getRemainNum()) * 100 / Integer.valueOf(limitbuy.getLimitNum())); holder.progessBar.setProgress(progress); } catch (Exception e) { e.printStackTrace(); } if (!TextUtils.isEmpty(limitbuy.getDelayTime())) { long timeSecound = 0; try { timeSecound = Long.valueOf(limitbuy.getDelayTime()); } catch (Exception e) { e.printStackTrace(); } String hourMinSecond = FileUtils.limitSecToTime(timeSecound); String[] hmsStrs = hourMinSecond.split(":"); if (hmsStrs != null && hmsStrs.length == 3) { holder.hourtext.setText(hmsStrs[0].substring(0, 1)); holder.mintext.setText(hmsStrs[1].substring(0, 1)); holder.secondtext.setText(hmsStrs[2].substring(0, 1)); holder.hourUnitText.setText(hmsStrs[0].substring(1, 2)); holder.minUnitText.setText(hmsStrs[1].substring(1, 2)); holder.secondUnitText.setText(hmsStrs[2].substring(1, 2)); } } if (!TextUtils.isEmpty(limitbuy.getRushBuyState())) { switch (Integer.valueOf(limitbuy.getRushBuyState())) { case 0: { holder.limitnumtext.setText(R.string.limitbuy_limitnum); holder.tagImageView.setBackgroundResource(R.drawable.limit_buy_item_two_icon); holder.limitbuy_disend.setText(R.string.limitbuy_disstart); holder.remainnumtextdata.setText(limitbuy.getRemainNum()); } break; case 1: { holder.limitnumtext.setText(R.string.limitbuy_remainnum); holder.tagImageView.setBackgroundResource(R.drawable.limit_buy_item_one_icon); holder.limitbuy_disend.setText(R.string.limitbuy_disend); holder.remainnumtextdata.setText(limitbuy.getRemainNum()); } break; case 2: { holder.limitnumtext.setText(R.string.limitbuy_remainnum); holder.tagImageView.setBackgroundResource(R.drawable.limit_buy_item_three_icon); holder.remainnumtextdata.setText(limitbuy.getRemainNum()); } break; case 3: { holder.limitnumtext.setText(R.string.limitbuy_remainnum); holder.tagImageView.setBackgroundResource(R.drawable.limit_buy_item_four_icon); holder.remainnumtextdata.setText(limitbuy.getRemainNum()); } break; } } } if (!GlobalConfig.getInstance().isNeedLoadImage() && !limitbuy.isLoadImg()) { // 不需要加载图片 holder.imageView1.setImageResource(R.drawable.category_product_tapload_bg); holder.imageView1.setOnLongClickListener( new MyOnLongClickListener(limitbuy, holder.imageView1, parent)); } else { // 需要加载图片 asyncLoadImage(limitbuy, holder.imageView1, parent); } }