From b42c3ab03b37218d7d59e6f92b02802f6d454160 Mon Sep 17 00:00:00 2001 From: 杜方 Date: Mon, 10 Nov 2025 18:21:31 +0800 Subject: [PATCH] 畅游通核销app4.0 1.修改剩余x份的数组字段 --- src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java b/src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java index 989ef7c..c9e852c 100644 --- a/src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java +++ b/src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java @@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean; /** * @author dengchen - * Created by 2016/8/5. + * Created by 2016/8/5. */ public class ReportExpandableListAdapter extends AnimatedExpandableListView.AnimatedExpandableListAdapter { @@ -63,7 +63,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim private final int screenWidth; private int type; - public ReportExpandableListAdapter(ListOnclickCallback callback, Context context, List orderInfos,int type) { + public ReportExpandableListAdapter(ListOnclickCallback callback, Context context, List orderInfos, int type) { this.callback = callback; this.context = context; this.orderInfos = orderInfos; @@ -78,7 +78,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim screenWidth = display.getWidth(); devtype = SharedPreferences2Obj.getInstance(context) .setName("MachineType").getObject("type", Integer.class); - LogUtil.d("ReportExpandableListAdapter","Select = "+Select); + LogUtil.d("ReportExpandableListAdapter", "Select = " + Select); } /** @@ -266,21 +266,21 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim // int type = getItemViewType(groupPosition); holder.ticket_print.setTag("" + groupPosition); - LogUtil.d("ReportExpandableListAdapter","type = "+type); + LogUtil.d("ReportExpandableListAdapter", "type = " + type); switch (type) { case VALUE_NOT_PART: // 这种情况下是没有部分检票的 holder.part.setVisibility(View.GONE); break; case VALUE_PART: String status = orderInfos.get(groupPosition).getOrderStatus(); - if (status != null && OrderStutas.PRINTSUCCESS.getValue().equals(status) ) { + if (status != null && OrderStutas.PRINTSUCCESS.getValue().equals(status)) { if (Select == 1) { holder.part.setVisibility(View.VISIBLE); - }else { + } else { holder.part.setVisibility(View.GONE); } - } else if (status != null && OrderStutas.CONSUMED.getValue().equals(status) ) { - holder.part.setVisibility(View.GONE); + } else if (status != null && OrderStutas.CONSUMED.getValue().equals(status)) { + holder.part.setVisibility(View.GONE); } if (Select == 1 && holder.part != null) { // holder.part.setClickable(false); @@ -366,12 +366,14 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim } base.time_item.setText(orderInfos.get(position).getContactorName() + " |"); base.id_number.setText(credentials); - }else { + } else { base.time_item.setText(orderInfos.get(position).getContactorName()); base.id_number.setText(" "); } - base.total_num.setText("剩余 " + orderInfos.get(position).getOrderAmount() + " 份"); +// base.total_num.setText("剩余 " + orderInfos.get(position).getOrderAmount() + " 份"); + LogUtil.d("ReportExpandableListAdapter", "Quantity = " + orderInfos.get(position).getProducts().get(position).getQuantity()); + base.total_num.setText("剩余 " + orderInfos.get(position).getProducts().get(position).getQuantity() + " 份"); String status = orderInfos.get(position).getOrderStatus(); String paystatus = orderInfos.get(position).getPaymentWay(); @@ -405,16 +407,16 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim } else if (Select == 3) { base.ticket_print.setVisibility(View.GONE); } - } else if (paystatus!=null&&paystatus.equals("CASHPAY")){ + } else if (paystatus != null && paystatus.equals("CASHPAY")) { base.style_item.setText("到付订单"); if (base.part != null) { base.part.setVisibility(View.GONE); } - }else if (status != null + } else if (status != null && OrderStutas.NOTPAYED.getValue().equals(status)) { - base.style_item.setText(R.string.notpayed); - base.ticket_print.setVisibility(View.GONE); + base.style_item.setText(R.string.notpayed); + base.ticket_print.setVisibility(View.GONE); if (base.part != null) { base.part.setVisibility(View.GONE); @@ -426,7 +428,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim } if (Select == 1) { - if (paystatus!=null&&paystatus.equals("CASHPAY")&&status != null + if (paystatus != null && paystatus.equals("CASHPAY") && status != null && OrderStutas.NOTPAYED.getValue().equals(status)) { base.ticket_print.setText("收费确认"); base.ticket_print.setVisibility(View.VISIBLE); @@ -623,7 +625,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim Display display = manager.getDefaultDisplay(); int width = display.getWidth(); - lp.width = DenstityUtils.dp2px(activity,300); + lp.width = DenstityUtils.dp2px(activity, 300); lp.height = ActionBar.LayoutParams.WRAP_CONTENT; dialog.getWindow().setAttributes(lp); @@ -758,7 +760,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim } }); - if (dialog.isShowing()){ + if (dialog.isShowing()) { dialog.dismiss(); } -- libgit2 0.21.4