|
|
@ -104,7 +104,7 @@ public class OrderVerificationResultActivity extends AppCompatActivity { |
|
|
|
tvCountdown = new TextView(this); |
|
|
|
tvCountdown.setTextSize(16); |
|
|
|
// tvCountdown.setTextColor(getResources().getColor(android.R.color.primary_text_light)); |
|
|
|
tvCountdown.setTextColor(getResources().getColor(R.color.finance_white)); |
|
|
|
tvCountdown.setTextColor(getResources().getColor(R.color.finance_d3d3d3)); |
|
|
|
tvCountdown.setGravity(android.view.Gravity.CENTER); |
|
|
|
tvCountdown.setPadding(0, 20, 0, 20); |
|
|
|
} |
|
|
@ -242,9 +242,11 @@ public class OrderVerificationResultActivity extends AppCompatActivity { |
|
|
|
// 根据核销状态设置不同的UI样式 |
|
|
|
if (status != null) { |
|
|
|
if (status.contains("成功")) { |
|
|
|
tvStatus.setTextColor(getResources().getColor(android.R.color.holo_green_dark)); |
|
|
|
// tvStatus.setTextColor(getResources().getColor(android.R.color.holo_green_dark)); |
|
|
|
tvStatus.setTextColor(getResources().getColor(R.color.finance_buttonColor)); |
|
|
|
tvStatus.setTextColor(getResources().getColor(R.color.primary_color)); |
|
|
|
} else if (status.contains("失败") || status.contains("异常")) { |
|
|
|
tvStatus.setTextColor(getResources().getColor(android.R.color.holo_red_dark)); |
|
|
|
tvStatus.setTextColor(getResources().getColor(R.color.error_color)); |
|
|
|
} else { |
|
|
|
tvStatus.setTextColor(getResources().getColor(android.R.color.black)); |
|
|
|
} |
|
|
@ -384,16 +386,30 @@ public class OrderVerificationResultActivity extends AppCompatActivity { |
|
|
|
* 构建年月卡内容 |
|
|
|
*/ |
|
|
|
private void buildCardContent() { |
|
|
|
// 年月卡:显示验证码、名称、卡号、核销方式、核销时间 |
|
|
|
// 从verifyResult中获取验证码,而不是使用verificationCode变量 |
|
|
|
String displayVerificationCode = verificationCode; |
|
|
|
if (verifyResult != null && verifyResult.getVCode() != null && !verifyResult.getVCode().isEmpty()) { |
|
|
|
displayVerificationCode = verifyResult.getVCode().get(0); |
|
|
|
} |
|
|
|
addInfoRow("验证码", formatVerificationCode(displayVerificationCode)); |
|
|
|
// 年月卡:显示订单编号、卡号、名称、核销方式、核销时间 |
|
|
|
addInfoRow("订单编号", orderNo); |
|
|
|
addInfoRow("名称", project != null ? project : "-"); |
|
|
|
|
|
|
|
if (orderInfo != null && orderInfo.isJsonObject()) { |
|
|
|
// 首先尝试从verifyResult获取信息(成功情况) |
|
|
|
if (verifyResult != null) { |
|
|
|
// 从verifyResult中获取卡号信息 |
|
|
|
String cardNo = verifyResult.getCardNoFromInfo(); |
|
|
|
if (cardNo != null && !cardNo.isEmpty()) { |
|
|
|
addInfoRow("卡号", "NO." + cardNo); |
|
|
|
} |
|
|
|
|
|
|
|
// 从verifyResult中获取其他信息 |
|
|
|
if (verifyResult.getInfo() != null && verifyResult.getInfo().isJsonObject()) { |
|
|
|
JsonObject cardInfo = verifyResult.getInfo().getAsJsonObject(); |
|
|
|
String verifyDesc = getJsonString(cardInfo, "verify_desc", "-"); |
|
|
|
String verifyTime = getJsonString(cardInfo, "verify_time", "-"); |
|
|
|
|
|
|
|
addInfoRow("核销方式", verifyDesc); |
|
|
|
addInfoRow("核销时间", verifyTime); |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果verifyResult中没有信息,尝试从原始订单数据获取(失败情况) |
|
|
|
else if (orderInfo != null && orderInfo.isJsonObject()) { |
|
|
|
JsonObject cardInfo = orderInfo.getAsJsonObject(); |
|
|
|
String cardNo = getJsonString(cardInfo, "card_no", "-"); |
|
|
|
String verifyDesc = getJsonString(cardInfo, "verify_desc", "-"); |
|
|
@ -403,6 +419,17 @@ public class OrderVerificationResultActivity extends AppCompatActivity { |
|
|
|
addInfoRow("核销方式", verifyDesc); |
|
|
|
addInfoRow("核销时间", verifyTime); |
|
|
|
} |
|
|
|
// 如果都没有,至少显示卡号(从intent中获取) |
|
|
|
else if (cardNo != null && !cardNo.isEmpty()) { |
|
|
|
addInfoRow("卡号", "NO." + cardNo); |
|
|
|
} |
|
|
|
// 如果cardNo也为空,但orderInfo是字符串类型(可能包含卡号信息) |
|
|
|
else if (orderInfo != null && orderInfo.isJsonPrimitive()) { |
|
|
|
String infoStr = orderInfo.getAsString(); |
|
|
|
if (infoStr != null && !infoStr.isEmpty()) { |
|
|
|
addInfoRow("信息", infoStr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|