From 20952db304d0f71e1ce25f3b82114bbadff1ad4a Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期五, 20 六月 2025 16:51:54 +0800
Subject: [PATCH] feat(generallibrary): 补充补卡功能

---
 generallibrary/src/main/res/layout/activity_card_replace.xml |  429 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 402 insertions(+), 27 deletions(-)

diff --git a/generallibrary/src/main/res/layout/activity_card_replace.xml b/generallibrary/src/main/res/layout/activity_card_replace.xml
index 9d31abe..8146c65 100644
--- a/generallibrary/src/main/res/layout/activity_card_replace.xml
+++ b/generallibrary/src/main/res/layout/activity_card_replace.xml
@@ -1,49 +1,424 @@
 <?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"
-    android:background="@color/white"
-    android:orientation="vertical">
+    android:background="@color/base_green_bg">
 
     <com.dayu.baselibrary.view.TitleBar
         android:id="@+id/titleBar"
         android:layout_width="match_parent"
         android:layout_height="@dimen/dimen_title_height"
-        app:centerText="琛ュ崱" />
+        android:background="@color/title_bar_bg"
+        android:elevation="4dp"
+        app:centerText="琛ュ崱"
+        app:leftImage="@mipmap/icon_back" />
 
-
-
-    <FrameLayout
+    <!-- 璇诲崱鎻愮ず鍖哄煙 - 鍏ㄥ睆鏄剧ず -->
+    <ScrollView
+        android:id="@+id/scroll_read_card"
         android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1">
+        android:layout_height="match_parent"
+        android:layout_below="@+id/titleBar"
+        android:fillViewport="true"
+        android:visibility="visible">
 
-        <com.scwang.smart.refresh.layout.SmartRefreshLayout
-            android:id="@+id/refreshLayout"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_below="@+id/titleBar">
+            android:orientation="vertical"
+            android:padding="16dp">
 
-            <com.scwang.smart.refresh.header.ClassicsHeader
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
-
-            <androidx.recyclerview.widget.RecyclerView
-                android:id="@+id/recyclerView"
+            <LinearLayout
+                android:id="@+id/card_read_LL"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:background="@color/base_list_bg"
-                android:overScrollMode="never"
-                android:padding="10dp" />
+                android:gravity="center"
+                android:orientation="vertical">
 
-            <com.scwang.smart.refresh.footer.ClassicsFooter
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="16dp"
+                    app:cardCornerRadius="8dp"
+                    app:cardElevation="2dp">
+
+                    <RelativeLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:padding="16dp">
+
+                        <TextView
+                            android:id="@+id/tv_title"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginBottom="100dp"
+                            android:gravity="center"
+                            android:text="琛ュ崱鎿嶄綔"
+                            android:layout_marginTop="20dp"
+                            android:textColor="@color/base_blue_bg"
+                            android:textSize="@dimen/big_text_size"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/tv_subtitle"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_below="@+id/tv_title"
+                            android:layout_marginBottom="20dp"
+                            android:gravity="center"
+                            android:text="璇峰皢闇�瑕佽ˉ鍔炵殑鍗$墖璐村湪璁惧涓婅繘琛岃鍙�"
+                            android:textColor="#333333"
+                            android:textSize="@dimen/text_size"
+                            android:textStyle="bold" />
+
+                        <ImageView
+                            android:id="@+id/iv_nfc"
+                            android:layout_width="120dp"
+                            android:layout_height="120dp"
+                            android:layout_below="@+id/tv_subtitle"
+                            android:layout_centerHorizontal="true"
+                            android:layout_marginBottom="20dp"
+                            android:scaleType="fitCenter"
+                            android:src="@mipmap/nfc_write" />
+
+                        <TextView
+                            android:id="@+id/tv_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_below="@+id/iv_nfc"
+                            android:gravity="center"
+                            android:text="璇蜂繚鎸佹墜鎸佹満鍜屽崱鐗囦笉瑕佺Щ鍔�"
+                            android:textColor="#666666"
+                            android:textSize="@dimen/new_card_size" />
+
+                    </RelativeLayout>
+                </androidx.cardview.widget.CardView>
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+
+    <!-- 鍗$墖淇℃伅鏄剧ず鍖哄煙 - 甯﹀浐瀹氬簳閮ㄦ寜閽� -->
+    <LinearLayout
+        android:id="@+id/card_info_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@+id/bottom_button_container"
+        android:layout_below="@+id/titleBar"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:fillViewport="true"
+            android:padding="12dp">
+
+            <LinearLayout
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
-        </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
 
+                <!-- 褰撳墠鍗″湴鍧�鏄剧ず鍖哄煙 -->
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="12dp"
+                    app:cardCornerRadius="8dp"
+                    app:cardElevation="2dp">
 
-    </FrameLayout>
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:padding="16dp">
 
-</LinearLayout> 
\ No newline at end of file
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginBottom="12dp"
+                            android:text="褰撳墠鍗″湴鍧�"
+                            android:textColor="@color/base_blue_bg"
+                            android:textSize="18sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/tv_current_card_address"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="#F5F5F5"
+                            android:padding="12dp"
+                            android:text="--"
+                            android:textColor="#333333"
+                            android:textSize="16sp"
+                            android:textIsSelectable="true" />
+
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+
+                <!-- 鏃у崱淇℃伅鍖哄煙 -->
+                <androidx.cardview.widget.CardView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    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="@color/base_blue_bg"
+                            android:textSize="18sp"
+                            android:textStyle="bold" />
+
+                        <!-- 鎸佸崱浜� -->
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginBottom="1dp"
+                            android:background="#F8F9FA"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="12dp">
+
+                            <TextView
+                                android:layout_width="100dp"
+                                android:layout_height="wrap_content"
+                                android:text="鎸佸崱浜猴細"
+                                android:textColor="#333333"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+                            <TextView
+                                android:id="@+id/tv_user_name"
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="--"
+                                android:textColor="#666666"
+                                android:textSize="16sp" />
+                        </LinearLayout>
+
+                        <!-- 鍗$墖鐘舵�� -->
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginBottom="1dp"
+                            android:background="#FFFFFF"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="12dp">
+
+                            <TextView
+                                android:layout_width="100dp"
+                                android:layout_height="wrap_content"
+                                android:text="鍗$墖鐘舵�侊細"
+                                android:textColor="#333333"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+                            <TextView
+                                android:id="@+id/tv_card_status"
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="姝e父"
+                                android:textColor="#4CAF50"
+                                android:textSize="16sp" />
+                        </LinearLayout>
+
+                        <!-- 鍗″唴浣欓 -->
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginBottom="1dp"
+                            android:background="#F8F9FA"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="12dp">
+
+                            <TextView
+                                android:layout_width="100dp"
+                                android:layout_height="wrap_content"
+                                android:text="鍗″唴浣欓锛�"
+                                android:textColor="#333333"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+                            <TextView
+                                android:id="@+id/tv_card_balance"
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="0.00鍏�"
+                                android:textColor="#FF6B35"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+                        </LinearLayout>
+
+                        <!-- 鎵嬫満鍙� -->
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:background="#FFFFFF"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="12dp">
+
+                            <TextView
+                                android:layout_width="100dp"
+                                android:layout_height="wrap_content"
+                                android:text="鎵嬫満鍙凤細"
+                                android:textColor="#333333"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+                            <TextView
+                                android:id="@+id/tv_phone"
+                                android:layout_width="0dp"
+                                android:layout_height="wrap_content"
+                                android:layout_weight="1"
+                                android:text="--"
+                                android:textColor="#666666"
+                                android:textSize="16sp" />
+                        </LinearLayout>
+
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+
+            </LinearLayout>
+        </ScrollView>
+    </LinearLayout>
+
+    <!-- 搴曢儴鎿嶄綔鍖哄煙 -->
+    <LinearLayout
+        android:id="@+id/bottom_button_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:background="#FFFFFF"
+        android:elevation="4dp"
+        android:orientation="vertical"
+        android:padding="16dp"
+        android:visibility="gone">
+
+        <!-- 鏀粯鏂瑰紡閫夋嫨鍖哄煙 -->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_marginBottom="16dp">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="8dp"
+                android:text="鏀粯鏂瑰紡"
+                android:textColor="#333333"
+                android:textSize="16sp"
+                android:textStyle="bold" />
+
+            <RadioGroup
+                android:id="@+id/payment_method_group"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+                <!-- 鏀粯鏂瑰紡RadioButton灏嗗姩鎬佹坊鍔� -->
+            </RadioGroup>
+
+        </LinearLayout>
+
+        <!-- 宸ユ湰璐瑰拰杩斿洖閲戦杈撳叆鍖哄煙 -->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:layout_marginBottom="16dp">
+
+            <!-- 宸ユ湰璐硅緭鍏� -->
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:layout_marginEnd="8dp"
+                android:orientation="vertical">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="6dp"
+                    android:text="宸ユ湰璐癸紙鍏冿級"
+                    android:textColor="#333333"
+                    android:textSize="14sp"
+                    android:textStyle="bold" />
+
+                <EditText
+                    android:id="@+id/et_card_cost"
+                    android:layout_width="match_parent"
+                    android:layout_height="48dp"
+                    android:background="@drawable/edit_text_bg"
+                    android:hint="宸ユ湰璐�"
+                    android:inputType="numberDecimal"
+                    android:padding="12dp"
+                    android:text=""
+                    android:textColor="#333333"
+                    android:textColorHint="#999999"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+            <!-- 杩斿洖閲戦杈撳叆 -->
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:layout_marginStart="8dp"
+                android:orientation="vertical">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="6dp"
+                    android:text="杩斿洖閲戦锛堝厓锛�"
+                    android:textColor="#333333"
+                    android:textSize="14sp"
+                    android:textStyle="bold" />
+
+                <EditText
+                    android:id="@+id/et_return_amount"
+                    android:layout_width="match_parent"
+                    android:layout_height="48dp"
+                    android:background="@drawable/edit_text_bg"
+                    android:hint="杩斿洖閲戦"
+                    android:inputType="numberDecimal"
+                    android:padding="12dp"
+                    android:text="0"
+                    android:textColor="#333333"
+                    android:textColorHint="#999999"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <!-- 琛ュ崱鎸夐挳 -->
+        <Button
+            android:id="@+id/btn_replace"
+            android:layout_width="match_parent"
+            android:layout_height="48dp"
+            android:background="@drawable/button_blue_bg"
+            android:text="纭琛ュ崱"
+            android:textColor="#FFFFFF"
+            android:textSize="@dimen/big_text_size"
+            android:textStyle="bold" />
+
+    </LinearLayout>
+
+</RelativeLayout> 
\ No newline at end of file

--
Gitblit v1.8.0