예제 #1
0
 // 查询新品上线
 private void searchGoods() {
   HashMap<String, String> paramMap = CommonDataUtil.getCommonParams(getActivity());
   HttpParam httpParam =
       new HttpParam(ReleaseConfigure.HOMEPAGE_VALUE_PRODUCT_LIST_TYPE_NEW, false); // GET
   searchGoodsHttpTask = new HttpTask(getActivity(), this);
   httpParam.setParams(paramMap);
   searchGoodsHttpTask.execute(httpParam);
   commonProgressDialog.loadDialog();
 }
예제 #2
0
 // 查询商品分类二级
 private void searchTwo(int typeid, int orderid) {
   HashMap<String, String> paramMap = CommonDataUtil.getCommonParams(getActivity());
   paramMap.put(Constants.TYPEID, String.valueOf(typeid));
   paramMap.put(Constants.ORDERID, String.valueOf(orderid));
   HttpParam httpParam = new HttpParam(ReleaseConfigure.HOMEPAGE_VALUE_TWO_GOODS, false); // GET
   searchGoodsHttpTask = new HttpTask(getActivity(), this);
   httpParam.setParams(paramMap);
   searchGoodsHttpTask.execute(httpParam);
   commonProgressDialog.loadDialog();
 }
예제 #3
0
  @Override
  public void onLoadFinish(HttpTask task, HttpResult result) {
    Log.e(TAG, result.getData());
    commonProgressDialog.removeDialog();
    if (result != null
        && !StringUtil.isEmpty(result.getData())
        && StringUtil.isGoodJson(result.getData())
        && getActivity() != null
        && !getActivity().isFinishing()) {
      CommonResult commonResult = JSON.parseObject(result.getData(), CommonResult.class);
      if (null != commonResult) {
        if (task == searchAllTypeHttpTask) {
          if (commonResult.validate()) {
            JSONArray jsonArray = JSON.parseArray(commonResult.getData());
            if (jsonArray != null && jsonArray.size() > 0) {
              initAllType(jsonArray);
            }
          } else {
            //						ToastUtil.toast(getActivity(),commonResult.getErrMsg());
          }
        }

        if (task == searchGoodsHttpTask) {
          if (commonResult.validate()) {
            JSONArray jsonArray = JSON.parseArray(commonResult.getData());
            if (jsonArray != null && jsonArray.size() > 0) {
              initGoods(jsonArray);
            } else {
              homePageListAdapter.resetData(null);
            }
          } else {
            homePageListAdapter.resetData(null);
            //						ToastUtil.toast(getActivity(),commonResult.getErrMsg());
          }
        }
      }
    }
  }
예제 #4
0
 @Override
 public void onLoadFailed(HttpTask task, HttpResult result) {
   commonProgressDialog.removeDialog();
 }
예제 #5
0
 @Override
 public void noData(HttpTask task, HttpResult result) {
   commonProgressDialog.removeDialog();
 }
예제 #6
0
 @Override
 public void noNet(HttpTask task) {
   commonProgressDialog.removeDialog();
 }