Ejemplo n.º 1
0
  private void getOrderData(JSONObject response) throws JSONException {
    ArrayList<ImageItem> mImageItems = new ArrayList<AlbumHelper.ImageItem>();
    if (!response.isNull("traceInfo")) {

      String traceid = null, actmemo = null, actmemoinner = null;
      JSONObject jsonObject = response.getJSONObject("traceInfo");
      Log.e(TAG, mNewOrder.toString());
      if (!jsonObject.isNull("traceid")) traceid = jsonObject.getString("traceid");
      // mNewOrder.setActidx(traceid);
      if (!jsonObject.isNull("actmemo")) actmemo = jsonObject.getString("actmemo");
      mNewOrder.setActmemo(actmemo);
      if (!jsonObject.isNull("actmemoinner")) actmemoinner = jsonObject.getString("actmemoinner");
      mNewOrder.setActmemoinner(actmemoinner);
      Log.e(TAG, "" + traceid + "<" + actmemo + "<" + actmemoinner);
      if (jsonObject.isNull("pics")) return;
      JSONArray jsonArray = jsonObject.getJSONArray("pics");
      for (int i = 0; i < jsonArray.length(); i++) {
        JSONObject object = jsonArray.getJSONObject(i);
        ImageItem imageItem = new ImageItem();
        String picid = object.getString("picid");
        String smallimg = object.getString("smallimg");
        String bigimg = object.getString("bigimg");
        imageItem.thumbnailPath = smallimg;
        imageItem.imagePath = bigimg;
        mImageItems.add(imageItem);
      }
      mNewOrder.setImageItems(mImageItems);
    }
    Log.e(TAG, mNewOrder.toString());
    startOrderExecute();
  }
Ejemplo n.º 2
0
 private void startOrderExecute() {
   // 跳转到订单执行提交页面
   Log.i(TAG, scanList + "<" + scanList.get(0));
   mNewOrder.setActidx(UtilsCommon.list2Strs(scanList));
   Intent data = new Intent(this, OrderExecuteActivity.class);
   data.putExtra(Constants.Feild.KEY_ACTION, mNewOrder);
   data.putExtra(OrderExecuteActivity.FROM_WHERE, this.getClass().getSimpleName());
   startActivityForResult(data, OrderExecuteActivity.REQUEST_CODE_EXECUTE_ORDER);
 }
Ejemplo n.º 3
0
  private void requestIsUpdate() {
    // mNewOrder.setActidx(scanList.get(0));
    Log.d(TAG, "request update=" + scanList.get(0) + "," + mNewOrder.getAction() + "," + mNewOrder);
    AsyncHttpService.requestIsUpdate(
        scanList.get(0),
        mNewOrder.getAction(),
        new JsonHttpResponseHandler() {
          @Override
          public void onStart() {
            super.onStart();
            showLoadDialog();
            mDialogLoading.setCancelable(false);
          }

          @Override
          public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
            super.onSuccess(statusCode, headers, response);
            Log.e(TAG, response.toString());
            try {
              if (!UtilsError.isErrorCode(CaptureActivity.this, response)) {
                getOrderData(response);
              }

            } catch (JSONException e) {
              e.printStackTrace();
            } catch (Exception e) {
              e.printStackTrace();
            } finally {
              dismissLoadDialog();
            }
          }

          @Override
          public void onFailure(
              int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
            super.onFailure(statusCode, headers, throwable, errorResponse);
            dismissLoadDialog();
          }
        },
        this);
  }