From 98994189864f045551f7d06f78017b5df70e1be3 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 19 六月 2025 11:03:52 +0800
Subject: [PATCH] feat(card): 添加补扣功能并优化卡片操作界面
---
generallibrary/src/main/res/layout/activity_card_cancel.xml | 269 +++++++++++++++++++++++++++++++----------------------
1 files changed, 158 insertions(+), 111 deletions(-)
diff --git a/generallibrary/src/main/res/layout/activity_card_cancel.xml b/generallibrary/src/main/res/layout/activity_card_cancel.xml
index 31345af..ad95c59 100644
--- a/generallibrary/src/main/res/layout/activity_card_cancel.xml
+++ b/generallibrary/src/main/res/layout/activity_card_cancel.xml
@@ -14,11 +14,14 @@
app:centerText="閿�鍗�"
app:leftImage="@mipmap/icon_back" />
+ <!-- 璇诲崱鎻愮ず鍖哄煙 - 鍏ㄥ睆鏄剧ず -->
<ScrollView
+ android:id="@+id/scroll_read_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/titleBar"
- android:fillViewport="true">
+ android:fillViewport="true"
+ android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
@@ -26,14 +29,12 @@
android:orientation="vertical"
android:padding="16dp">
- <!-- 璇诲崱鎻愮ず鍖哄煙 -->
<LinearLayout
android:id="@+id/card_read_LL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
- android:orientation="vertical"
- android:visibility="visible">
+ android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
@@ -42,26 +43,28 @@
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center"
- android:orientation="vertical"
android:padding="16dp">
<TextView
+ android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ 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="璇峰皢闇�瑕侀攢鍗$殑鍗$墖璐村湪璁惧涓婅繘琛岃鍙�"
@@ -70,38 +73,59 @@
android:textStyle="bold" />
<ImageView
+ android:id="@+id/iv_nfc"
android:layout_width="120dp"
android:layout_height="120dp"
- android:layout_gravity="center"
+ 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" />
- </LinearLayout>
+ </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:id="@+id/card_info_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:visibility="gone">
+ android:orientation="vertical">
- <!-- 鍗″唴鏁版嵁鍖哄煙 -->
+ <!-- 鍗$墖淇℃伅鍖哄煙 -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="12dp"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
@@ -109,34 +133,34 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="16dp">
+ android:padding="12dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="12dp"
- android:gravity="center"
+ android:layout_marginBottom="8dp"
+ android:gravity=""
android:text="鍗$墖淇℃伅"
android:textColor="@color/base_blue_bg"
- android:textSize="@dimen/big_text_size"
+ android:textSize="16sp"
android:textStyle="bold" />
<!-- 鎸佸崱浜� -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dp"
+ android:layout_marginBottom="1dp"
android:background="#F8F9FA"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:padding="12dp">
+ android:padding="8dp">
<TextView
- android:layout_width="105dp"
+ android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="鎸佸崱浜猴細"
android:textColor="#333333"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
<TextView
android:id="@+id/tv_user_name"
@@ -145,25 +169,25 @@
android:layout_weight="1"
android:text="--"
android:textColor="#666666"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
</LinearLayout>
<!-- 鍗″彿 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dp"
+ android:layout_marginBottom="1dp"
android:background="#FFFFFF"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:padding="12dp">
+ android:padding="8dp">
<TextView
- android:layout_width="105dp"
+ android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="鍗″湴鍧�锛�"
android:textColor="#333333"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
<TextView
android:id="@+id/tv_card_number"
@@ -172,25 +196,25 @@
android:layout_weight="1"
android:text="--"
android:textColor="#666666"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
</LinearLayout>
<!-- 鍗$墖鐘舵�� -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dp"
+ android:layout_marginBottom="1dp"
android:background="#F8F9FA"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:padding="12dp">
+ android:padding="8dp">
<TextView
- android:layout_width="105dp"
+ android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="鍗$墖鐘舵�侊細"
android:textColor="#333333"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
<TextView
android:id="@+id/tv_card_status"
@@ -199,25 +223,25 @@
android:layout_weight="1"
android:text="姝e父"
android:textColor="#4CAF50"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
</LinearLayout>
<!-- 鍗″唴浣欓 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dp"
+ android:layout_marginBottom="1dp"
android:background="#FFFFFF"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:padding="12dp">
+ android:padding="8dp">
<TextView
- android:layout_width="105dp"
+ android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="鍗′綑棰濓細"
android:textColor="#333333"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
<TextView
android:id="@+id/tv_card_balance"
@@ -226,7 +250,7 @@
android:layout_weight="1"
android:text="0.00鍏�"
android:textColor="#FF6B35"
- android:textSize="@dimen/text_size"
+ android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
@@ -234,18 +258,17 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dp"
android:background="#F8F9FA"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:padding="12dp">
+ android:padding="8dp">
<TextView
- android:layout_width="105dp"
+ android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="鎵嬫満鍙凤細"
android:textColor="#333333"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
<TextView
android:id="@+id/tv_phone"
@@ -254,7 +277,7 @@
android:layout_weight="1"
android:text="--"
android:textColor="#666666"
- android:textSize="@dimen/text_size" />
+ android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
@@ -264,7 +287,6 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
@@ -272,94 +294,119 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="16dp">
+ android:padding="12dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:gravity="center"
+ android:layout_marginBottom="12dp"
+ android:gravity=""
android:text="閿�鍗℃搷浣�"
android:textColor="@color/base_blue_bg"
- android:textSize="@dimen/big_text_size"
+ android:textSize="16sp"
android:textStyle="bold" />
- <!-- 閫�娆鹃噾棰濊緭鍏� -->
+ <!-- 閫�娆鹃噾棰濆拰澶囨敞骞舵帓鏄剧ず -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
android:orientation="vertical">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
- android:text="閫�娆鹃噾棰濓紙鍏冿級:"
- android:textColor="#333333"
- android:textSize="@dimen/text_size"
- android:textStyle="bold" />
-
- <EditText
- android:id="@+id/et_refund_amount"
+ <!-- 閫�娆鹃噾棰濊緭鍏� -->
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="48dp"
- android:background="@drawable/edit_text_bg"
- android:hint="璇疯緭鍏ラ��娆鹃噾棰�"
- android:inputType="numberDecimal"
- android:padding="12dp"
- android:textColor="#333333"
- android:textColorHint="#999999"
- android:textSize="@dimen/text_size" />
- </LinearLayout>
-
- <!-- 澶囨敞杈撳叆 -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="24dp"
- android:orientation="vertical">
-
- <TextView
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
- android:text="澶囨敞:"
- android:textColor="#333333"
- android:textSize="@dimen/text_size"
- android:textStyle="bold" />
+ android:layout_marginEnd="6dp"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <EditText
- android:id="@+id/et_remarks"
+ <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_refund_amount"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:layout_marginTop="5dp"
+ android:background="@drawable/edit_text_bg"
+ android:hint="璇疯緭鍏ラ��娆鹃噾棰�"
+ android:inputType="numberDecimal"
+ android:padding="8dp"
+ android:textColor="#333333"
+ android:textColorHint="#999999"
+ android:textSize="14sp" />
+ </LinearLayout>
+
+ <!-- 澶囨敞杈撳叆 -->
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="80dp"
- android:background="@drawable/edit_text_bg"
- android:gravity="top|start"
- android:hint="璇疯緭鍏ラ攢鍗″娉ㄤ俊鎭�"
- android:inputType="textMultiLine"
- android:padding="12dp"
- android:textColor="#333333"
- android:textColorHint="#999999"
- android:textSize="@dimen/text_size" />
- </LinearLayout>
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <!-- 閿�鍗℃寜閽� -->
- <Button
- android:id="@+id/btn_cancel_card"
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:background="@drawable/button_red_bg"
- android:text="纭閿�鍗�"
- android:textColor="#FFFFFF"
- android:textSize="@dimen/big_text_size"
- android:textStyle="bold" />
+ <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_remarks"
+ android:layout_width="match_parent"
+ android:layout_height="80dp"
+ android:layout_marginTop="5dp"
+ android:background="@drawable/edit_text_bg"
+ android:hint="璇疯緭鍏ラ攢鍗″娉�"
+ android:inputType="text"
+ android:minLines="2"
+ android:padding="8dp"
+ android:textColor="#333333"
+ android:textColorHint="#999999"
+ android:textSize="14sp" />
+ </LinearLayout>
+
+ </LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
+ </ScrollView>
+ </LinearLayout>
- </LinearLayout>
- </ScrollView>
+ <!-- 搴曢儴鎸夐挳鍖哄煙 -->
+ <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">
+
+ <!-- 閿�鍗℃寜閽� -->
+ <Button
+ android:id="@+id/btn_cancel_card"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:background="@drawable/button_red_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