From 2fece6551faab0402e7ed53658a60d2256e7a5be Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 12 六月 2025 14:58:56 +0800
Subject: [PATCH] feat(generallibrary): 新增挂失功能并优化相关界面- 新增 LossCardActivity 和 CardWriteSuccessActivity - 实现卡片挂失功能和写卡成功页面 - 优化充值界面布局- 调整卡片信息显示逻辑 - 修复部分 UI样式问题

---
 generallibrary/src/main/res/layout/fragment_recharge.xml |  419 +++++++----------------------------------------------------
 1 files changed, 52 insertions(+), 367 deletions(-)

diff --git a/generallibrary/src/main/res/layout/fragment_recharge.xml b/generallibrary/src/main/res/layout/fragment_recharge.xml
index 197c37a..0edf2a1 100644
--- a/generallibrary/src/main/res/layout/fragment_recharge.xml
+++ b/generallibrary/src/main/res/layout/fragment_recharge.xml
@@ -3,398 +3,83 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="#F5F5F5">
-
-    <RelativeLayout
-        android:id="@+id/header_layout"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/dimen_title_height"
-        android:background="@color/bottom_color"
-        android:elevation="4dp">
-
-        <TextView
-            android:id="@+id/titleBar"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerInParent="true"
-            android:text="鍏呭��"
-            android:textColor="@color/white"
-            android:textSize="@dimen/title_text_size"
-            android:textStyle="bold" />
-    </RelativeLayout>
+    android:background="@color/base_green_bg">
 
     <LinearLayout
         android:id="@+id/recharge_read_LL"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_below="@+id/header_layout"
+        android:gravity="center"
         android:orientation="vertical"
         android:visibility="visible">
 
         <androidx.cardview.widget.CardView
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:layout_margin="16dp"
             app:cardCornerRadius="8dp"
             app:cardElevation="2dp">
 
-            <LinearLayout
+            <RelativeLayout
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
+                android:layout_height="match_parent"
                 android:padding="16dp">
 
                 <TextView
+                    android:id="@+id/text1"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:layout_alignParentTop="true"
+                    android:layout_marginTop="10dp"
                     android:layout_marginBottom="16dp"
                     android:gravity="center"
-                    android:text="璇峰皢鍗¤创鍦ㄨ澶囦笂杩涜璇诲崱"
-                    android:textColor="#333333"
-                    android:textSize="@dimen/text_size"
+                    android:text="鍏呭�艰鍗�"
+                    android:textColor="@color/base_blue_bg"
+                    android:textSize="@dimen/big_text_size"
                     android:textStyle="bold" />
 
-                <ImageView
-                    android:layout_width="200dp"
-                    android:layout_height="200dp"
-                    android:layout_gravity="center"
-                    android:scaleType="fitCenter"
-                    android:src="@mipmap/nfc_write" />
-            </LinearLayout>
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:orientation="vertical">
+
+                    <TextView
+                        android:id="@+id/textView2"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_centerVertical="true"
+                        android:layout_marginBottom="40dp"
+                        android:gravity="center"
+                        android:text="璇峰皢鍗¤创鍦ㄨ澶囦笂杩涜璇诲崱"
+                        android:textColor="#333333"
+                        android:textSize="@dimen/text_size"
+                        android:textStyle="bold" />
+
+                    <ImageView
+                        android:layout_width="200dp"
+                        android:layout_height="200dp"
+                        android:layout_below="@+id/textView2"
+                        android:layout_centerHorizontal="true"
+                        android:layout_gravity="center"
+                        android:scaleType="fitCenter"
+                        android:src="@mipmap/nfc_write" />
+
+                    <!-- 鏄剧ず璇诲埌鐨勫崱鍙� -->
+                    <TextView
+                        android:id="@+id/red_initCode"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="20dp"
+                        android:gravity="center"
+                        android:text=""
+                        android:textColor="#333333"
+                        android:textSize="@dimen/new_card_size"
+                        android:textStyle="bold" />
+                </LinearLayout>
+
+            </RelativeLayout>
         </androidx.cardview.widget.CardView>
     </LinearLayout>
 
-    <ScrollView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_above="@+id/recharge_registBtn"
-        android:layout_below="@+id/header_layout"
-        android:fillViewport="true">
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:padding="16dp">
-
-            <LinearLayout
-                android:id="@+id/recharge_text_LL"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:visibility="gone">
-                <androidx.cardview.widget.CardView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-
-                    app:cardCornerRadius="8dp"
-                    app:cardElevation="2dp">
-
-                    <LinearLayout
-                        android:id="@+id/recharge_LL"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:padding="16dp">
-
-
-
-                        <TextView
-                            android:id="@+id/red_recharge_water"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:text="鍏呭�兼按閲忥細"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="gone" />
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:orientation="vertical">
-
-                            <TextView
-                                android:id="@+id/recharge_tx"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginBottom="8dp"
-                                android:text="鍏呭�奸噾棰濓紙鍏冿級锛�"
-                                android:textColor="@color/red"
-                                android:textSize="@dimen/new_card_size"
-                                android:textStyle="bold" />
-
-                            <EditText
-                                android:id="@+id/recharge_water"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:background="@android:color/white"
-                                android:hint="璇疯緭鍏ュ厖鍊肩殑閲戦"
-                                android:inputType="numberDecimal"
-                                android:padding="12dp"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-                    </LinearLayout>
-                </androidx.cardview.widget.CardView>
-                <androidx.cardview.widget.CardView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="16dp"
-                    android:layout_marginTop="15dp"
-                    app:cardCornerRadius="8dp"
-                    app:cardElevation="2dp">
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:padding="16dp">
-
-                        <TextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="12dp"
-                            android:text="鍗$墖淇℃伅"
-                            android:textColor="#333333"
-                            android:textSize="16sp"
-                            android:textStyle="bold" />
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:orientation="horizontal">
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="鍗$姸鎬侊細"
-                                android:textColor="#666666"
-                                android:textSize="@dimen/text_size" />
-
-                            <TextView
-                                android:id="@+id/red_statu"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:textColor="@color/red"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:orientation="horizontal">
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="濮撳悕锛�"
-                                android:textColor="#666666"
-                                android:textSize="@dimen/new_card_size" />
-
-                            <TextView
-                                android:id="@+id/userName"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:textColor="#333333"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:orientation="horizontal">
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="鍗″彿锛�"
-                                android:textColor="#666666"
-                                android:textSize="@dimen/text_size" />
-
-                            <TextView
-                                android:id="@+id/red_initCode"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:text=""
-                                android:textColor="#333333"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:orientation="horizontal">
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="鐢ㄦ埛缂栧彿锛�"
-                                android:textColor="#666666"
-                                android:textSize="@dimen/text_size" />
-
-                            <TextView
-                                android:id="@+id/red_userCode"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:text=""
-                                android:textColor="#333333"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:orientation="horizontal"
-                            android:visibility="visible">
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="鍏呭�煎悗鍓╀綑閲戦锛�"
-                                android:textColor="#666666"
-                                android:textSize="@dimen/text_size" />
-
-                            <TextView
-                                android:id="@+id/red_remainder_blance"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:textColor="#333333"
-                                android:textSize="@dimen/new_card_size" />
-                        </LinearLayout>
-                    </LinearLayout>
-                </androidx.cardview.widget.CardView>
-
-                <androidx.cardview.widget.CardView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="16dp"
-                    app:cardCornerRadius="8dp"
-                    app:cardElevation="2dp">
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"
-                        android:padding="16dp">
-
-                        <TextView
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="12dp"
-                            android:text="鐢甸噺淇℃伅"
-                            android:textColor="#333333"
-                            android:textSize="16sp"
-                            android:textStyle="bold" />
-
-                        <TextView
-                            android:id="@+id/red_balance_electric"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鍓╀綑鐢甸噺锛�"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="visible" />
-
-                        <TextView
-                            android:id="@+id/red_rechargeDate"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鏈�鍚庤喘姘存棩鏈燂細"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="visible" />
-
-                        <TextView
-                            android:id="@+id/red_rechargeElectric"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鐢甸噺鍗曚环锛�"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="visible" />
-
-                        <TextView
-                            android:id="@+id/red_rechargeNumber"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鍏呭�兼鏁帮細"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="gone" />
-
-                        <TextView
-                            android:id="@+id/red_total_water"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鎬荤敤姘撮噺锛�"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="gone" />
-
-                        <TextView
-                            android:id="@+id/red_total_power"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="8dp"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="鎬荤敤鐢甸噺锛�"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="gone" />
-
-                        <TextView
-                            android:id="@+id/red_waterPrice"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:background="#F9F9F9"
-                            android:padding="12dp"
-                            android:text="姣忕珛鏂圭背姘翠环鏍硷細"
-                            android:textColor="#333333"
-                            android:textSize="@dimen/text_size"
-                            android:visibility="gone" />
-                    </LinearLayout>
-                </androidx.cardview.widget.CardView>
-
-
-            </LinearLayout>
-        </LinearLayout>
-    </ScrollView>
-
-    <Button
-        android:id="@+id/recharge_registBtn"
-        android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:layout_alignParentBottom="true"
-        android:layout_margin="16dp"
-        android:background="@drawable/rounded_button_bg"
-        android:elevation="2dp"
-        android:gravity="center"
-        android:text="鍏呭��"
-        android:textColor="@color/white"
-        android:textSize="@dimen/new_card_size"
-        android:textStyle="bold"
-        android:visibility="gone" />
 </RelativeLayout>
\ No newline at end of file

--
Gitblit v1.8.0