From a8751388c9a86ae95714a15279994d8aa426a26d Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期五, 13 六月 2025 14:59:02 +0800
Subject: [PATCH] feat(generallibrary): 优化充值功能并添加水价获取- 在 activity_recharge_detail.xml 中移除了不必要的 bold 样式- 在 EditText 中添加了金额输入限制(数字和小数点)- 在 BaseApplication 中添加了水价信息存储 - 在 MainActivity 中实现了延时获取水价的功能- 优化了 RechargeDetailActivity 中的水价检查和使用逻辑 - 在 README.md 中添加了金额格式化和水价获取的最佳实践指南
---
qiheonlinelibrary/src/main/res/layout/activity_recharge_detail_qhl.xml | 63 ++++++++++++++++++++++++++-----
1 files changed, 52 insertions(+), 11 deletions(-)
diff --git a/qiheonlinelibrary/src/main/res/layout/activity_recharge_detail_qhl.xml b/qiheonlinelibrary/src/main/res/layout/activity_recharge_detail_qhl.xml
index 4799161..262a752 100644
--- a/qiheonlinelibrary/src/main/res/layout/activity_recharge_detail_qhl.xml
+++ b/qiheonlinelibrary/src/main/res/layout/activity_recharge_detail_qhl.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -16,14 +16,15 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_above="@id/read_btn"
android:orientation="vertical"
+ android:layout_below="@id/titleBar"
android:padding="30dp">
<TextView
android:id="@+id/red_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
-
android:text="鐢ㄦ埛濮撳悕锛�"
android:textSize="@dimen/text_size" />
@@ -37,35 +38,64 @@
android:textSize="@dimen/text_size" />
<TextView
+ android:id="@+id/red_userCode"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:text="褰撳墠鍗″彿锛�"
+ android:textSize="@dimen/text_size" />
+
+ <TextView
android:id="@+id/red_remainder_morny"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="鍏呭�奸噾棰濓細"
android:textSize="@dimen/text_size" />
+
<TextView
- android:id="@+id/red_recharge_water"
+ android:id="@+id/red_deductionMorny"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:text="鍏呭�兼按閲忥細"
+ android:text="鍏呭�奸噾棰濓細"
android:textSize="@dimen/text_size" />
+
+ <TextView
+ android:id="@+id/red_recharge_balance"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:text="鍓╀綑閲戦锛�"
+ android:textSize="@dimen/text_size" />
+
<TextView
android:id="@+id/red_remainder_blance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="鍓╀綑閲戦锛�"
- android:visibility="gone"
- android:textSize="@dimen/text_size" />
+ android:textSize="@dimen/text_size"
+ android:visibility="gone" />
+
<TextView
- android:id="@+id/red_surplusWater"
+ android:id="@+id/red_rechargeElectric"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:text="鍓╀綑姘撮噺锛�"
- android:visibility="gone"
- android:textSize="@dimen/text_size" />
+ android:text="鍏呭�肩數閲忥細"
+ android:textSize="@dimen/text_size"
+ android:visibility="visible" />
+
+ <TextView
+ android:id="@+id/red_surplusElectric"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:text="鍓╀綑鐢甸噺锛�"
+ android:textSize="@dimen/text_size"
+ android:visibility="visible" />
+
<TextView
android:id="@+id/red_rechargeDate"
android:layout_width="match_parent"
@@ -103,4 +133,15 @@
android:textSize="@dimen/text_size" />
</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+ <TextView
+ android:id="@+id/read_btn"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:layout_alignParentBottom="true"
+ android:background="@color/title_bg"
+ android:gravity="center"
+ android:text="鍐嶆鎵撳嵃鍑潯"
+ android:textColor="#000000"
+ android:textSize="@dimen/new_card_size"
+ android:visibility="invisible" />
+</RelativeLayout>
\ No newline at end of file
--
Gitblit v1.8.0