Exemple #1
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.act_fill_order_submit_order:
        invoice = mInvoiceEdit.getText().toString();
        if (mDispatchMode.equals(PS) && doValidate()) {
          new SubmitOrderTask().execute();
        } else if (mDispatchMode.equals(ZT)) {
          if (Utils.isEmpty(mArayacakId)) {
            showToast("请选择自提点");
          } else new SubmitOrderTask().execute();
        }
        break;

      default:
        break;
    }
  }
Exemple #2
0
  public void createCommodityView(ShopCartModel scm) {
    View v =
        getLayoutInflater().inflate(R.layout.include_fill_order_commodity, mCommodityArea, false);
    TextView count = (TextView) v.findViewById(R.id.include_fill_order_commodity_count);
    ImageView img = (ImageView) v.findViewById(R.id.include_fill_order_commodity_img);
    TextView taste = (TextView) v.findViewById(R.id.include_fill_order_commodity_taste);
    TextView name = (TextView) v.findViewById(R.id.include_fill_order_commodity_name);
    TextView price = (TextView) v.findViewById(R.id.include_fill_order_commodity_price);
    TextView weight = (TextView) v.findViewById(R.id.include_fill_order_commodity_weight);
    count.setText("x" + scm.number);
    ImageLoader.getInstance().displayImage(scm.image, img, options);
    if (Utils.isEmpty(scm.selectedTaste)) {
      taste.setVisibility(View.GONE);
    } else {
      taste.setText(scm.selectedTaste);
    }
    name.setText(scm.name);
    price.setText(scm.price);
    weight.setText(scm.weight);

    mCommodityArea.addView(v);
  }