예제 #1
0
 private void submitDingdan() {
   if (adress == null) {
     ToastUtil.showToast("请先选择地址");
     return;
   }
   dialog = DialogUtil.createLoadingDialog(this);
   dialog.show();
   SubmitOrderTask task = new SubmitOrderTask(lists);
   task.setmCallBack(
       new AbstractTaskPostCallBack<RetError>() {
         @Override
         public void taskFinish(RetError result) {
           if (dialog != null) {
             dialog.dismiss();
           }
           if (result != RetError.NONE) {
             return;
           }
           System.out.println("pay_code:::::::::::::" + result.getMessage());
           ToastUtil.showToast("下单成功");
           sendBroadcast(new Intent(Constants.REFUSH_MY_ORDER_LIST));
           startActivity(
               new Intent(FillOrderActivity.this, SelectPayActivity.class)
                   .putExtra("pay_price", pay_price)
                   .putExtra("pay_code", result.getMessage())
                   .putExtra("pay_subject", pay_subject)
                   .putExtra("pay_body", pay_body));
           finishThisActivity();
           Utils.leftOutRightIn(FillOrderActivity.this);
         }
       });
   OrderData order = new OrderData();
   order.setId(adress.getId());
   task.executeParallel(order);
 }
예제 #2
0
 private void refushAddress() {
   adressList = new AdressList(SharedUtils.getIntUid());
   dialog = DialogUtil.createLoadingDialog(this);
   dialog.show();
   GetAddressTask task = new GetAddressTask();
   task.setmCallBack(
       new AbstractTaskPostCallBack<RetError>() {
         @Override
         public void taskFinish(RetError result) {
           if (dialog != null) {
             dialog.dismiss();
           }
           if (result != RetError.NONE) {
             return;
           }
           if (adressList.getLists().size() == 0) {
             return;
           }
           adress = adressList.getLists().get(0);
           setAdressValue();
         }
       });
   task.executeParallel(adressList);
 }