コード例 #1
0
 @Override
 public void onJsonObjectSuccess(BaseBean o, NetworkParams paramsCode) {
   // 首次进来获取数据
   if (paramsCode == NetworkParams.CUPCAKE) { // 获取全局数据
     OrderDetailBean orderDetailBean = (OrderDetailBean) o;
     final OrderDetailBean.DataEntity data = orderDetailBean.getData();
     fillProductList(orderDetailBean, data);
     fillGuideList(data);
     orderDetailLayout.setDetail(data);
   } else if (paramsCode == NetworkParams.DONUT) { // 预约签到的返回
     AppTools.showNormalSnackBar(parentView, getString(R.string.order_detail_already_sign_in));
     networkModel.orderDetail(orderId, "1", NetworkParams.CUPCAKE);
   } else if (paramsCode == NetworkParams.ICECREAMSANDWICH) {
     orderDetailLayout.llytEvaluate.setVisibility(View.GONE);
     orderDetailLayout.llytEvaluation.setVisibility(View.VISIBLE);
     AppTools.sendBroadcast(null, AppKeyMap.WAITING_COST_ACTION);
     Intent intent =
         new Intent()
             .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP)
             .setClass(this, MainActivity.class);
     startActivity(intent);
     AppTools.sendBroadcast(new Bundle(), AppKeyMap.REFRESH_AND_JUMPTO_SERVICED_PAGE); // 意在刷新
   } else if (paramsCode == NetworkParams.LOLLIPOP) {
     start(MainActivity.class);
     AppTools.sendBroadcast(new Bundle(), AppKeyMap.REFRESH_AND_JUMPTO_SERVICED_PAGE); // 意在刷新
   } else if (paramsCode == NetworkParams.HONEYCOMB) { // 未读清除成功
     AppTools.sendBroadcast(new Bundle(), AppKeyMap.REFRESH_AND_JUMPTO_SERVICED_PAGE); // 意在刷新
   }
 }
コード例 #2
0
 private void fillProductList(OrderDetailBean orderDetailBean, OrderDetailBean.DataEntity data) {
   boolean isSignIn = data.isSignIn(); // 是否已签到
   boolean isAllRepair = data.isAllRepair(); // 是否全部产品维修完毕
   // 该工单是否全部完毕,并且已完成提交
   boolean isAllComplete = data.getIs_submit_complete();
   // 如果已经完结工单,则隐藏菜单栏上的bgaTextView
   if (bgaBadgeTextView != null) {
     bgaBadgeTextView.setVisibility(isAllComplete ? View.GONE : View.VISIBLE);
   }
   List<OrderDetailBean.ListEntity> listEntities = orderDetailBean.getList();
   boolean isTimeOut = data.getIs_sign_in().equals("3") || data.getIs_sign_in().equals("2");
   changeButtonState(isSignIn, isAllRepair, isAllComplete, isTimeOut);
   notifyAdapter(listEntities);
 }