From 55b196ea2e28a8d859c85326f2147a4f7b7196de Mon Sep 17 00:00:00 2001
From: zuojincheng <lf_zuo@163.com>
Date: 星期四, 10 四月 2025 10:58:32 +0800
Subject: [PATCH] feat(general): 新增开卡信息保存功能并优化界面布局- 新增 CardRegistrationBean 数据模型用于保存开卡信息 - 在数据库中添加 card_registration 表用于存储开卡记录 - 优化 NewCard2Activity 界面布局,调整样式和间距 - 添加协程支持,实现异步保存开卡信息到数据库 - 更新颜色配置,统一使用新加的 base_blue_bg 和 base_green_bg颜色
---
generallibrary/src/main/res/layout/activity_new_card_1_ge.xml | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 354 insertions(+), 4 deletions(-)
diff --git a/generallibrary/src/main/res/layout/activity_new_card_1_ge.xml b/generallibrary/src/main/res/layout/activity_new_card_1_ge.xml
index 86e7d76..adba47f 100644
--- a/generallibrary/src/main/res/layout/activity_new_card_1_ge.xml
+++ b/generallibrary/src/main/res/layout/activity_new_card_1_ge.xml
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto">
+ android:background="@color/base_list_bg">
+
<com.dayu.baselibrary.view.TitleBar
android:id="@+id/titleBar"
android:layout_width="match_parent"
@@ -14,7 +16,6 @@
app:leftImage="@mipmap/icon_back"
tools:ignore="MissingConstraints" />
-
<androidx.cardview.widget.CardView
android:id="@+id/nfcContainer"
android:layout_width="match_parent"
@@ -23,6 +24,7 @@
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="24dp"
+ android:visibility="gone"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="12dp"
app:cardElevation="4dp"
@@ -43,8 +45,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
- android:text="璇峰皢鏂板崱璐村湪璁惧涓婅繘琛屽啓鍗�"
+ android:text="璇峰皢鏂板崱璐村湪璁惧涓婅繘琛岃鍗�"
android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:text="锛堝皢鑾峰彇鐗╃悊鍗″崱鍙凤級"
+ android:textColor="#999999"
android:textSize="18sp"
android:textStyle="bold" />
@@ -61,12 +72,351 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
- android:text="璇蜂繚鎸佹墜鏈哄拰鍗$墖涓嶈绉诲姩"
+ android:text="璇蜂繚鎸佹墜鎸佹満鍜屽崱鐗囦笉瑕佺Щ鍔�"
android:textColor="#666666"
android:textSize="14sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
+ <ScrollView
+ android:id="@+id/center_scroll"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:fillViewport="true"
+ android:scrollbars="none"
+ android:visibility="visible"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/titleBar">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingBottom="16dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:paddingTop="10dp">
+
+ <androidx.cardview.widget.CardView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ app:cardCornerRadius="8dp"
+ app:cardElevation="2dp">
+
+ <LinearLayout
+ android:id="@+id/center_data"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="16dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="鍩烘湰淇℃伅"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="6dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="鍗″彿锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:id="@+id/newCard_arerNumber"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="6dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="濮撳悕锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:id="@+id/newCard_userName"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="6dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="韬唤璇佸彿锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:id="@+id/newCard_idCard"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="鍐滄埛缂栧彿锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:id="@+id/newCard_farmerCode"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ 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="10dp"
+ 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="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="璐圭敤淇℃伅"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="12dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="宸ユ湰璐癸細"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FFFFFF"
+ android:orientation="vertical">
+
+ <EditText
+ android:id="@+id/newCard_rechargeAmount"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:hint="璇疯緭鍏ュ伐鏈垂(閫夊~)"
+ android:inputType="numberDecimal"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="12dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="鍏呭�奸噾棰濓細"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FFFFFF"
+ android:orientation="vertical">
+
+ <EditText
+ android:id="@+id/newCard_cardFee"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:hint="璇疯緭鍏ュ厖鍊奸噾棰�(閫夊~)"
+ android:inputType="numberDecimal"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+ </LinearLayout>
+
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="澶囨敞锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#FFFFFF"
+ android:orientation="vertical">
+
+ <EditText
+ android:id="@+id/newCard_remark"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:hint="璇疯緭鍏ュ娉�(閫夊~)"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+ </LinearLayout>
+ </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="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="鏀粯鏂瑰紡"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <RadioGroup
+ android:id="@+id/newCard_paymentMethod"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <RadioButton
+ android:id="@+id/newCard_cashPayment"
+ android:layout_width="0dp"
+ android:layout_height="40dp"
+ android:layout_marginRight="15dp"
+ android:layout_weight="1"
+ android:background="@drawable/radio_selector"
+ android:button="@null"
+ android:checked="true"
+ android:gravity="center"
+
+ android:text="鐜伴噾"
+ android:textColor="@color/radio_button_text_color"
+ android:textSize="@dimen/new_card_size" />
+
+ <RadioButton
+ android:id="@+id/newCard_posPayment"
+ android:layout_width="0dp"
+ android:layout_height="40dp"
+ android:layout_marginRight="15dp"
+ android:layout_weight="1"
+ android:background="@drawable/radio_selector"
+ android:button="@null"
+ android:gravity="center"
+
+ android:text="POS鏈�"
+ android:textColor="@color/radio_button_text_color"
+ android:textSize="@dimen/new_card_size" />
+
+ <RadioButton
+ android:id="@+id/newCard_bankTransfer"
+ android:layout_width="0dp"
+ android:layout_height="40dp"
+ android:layout_weight="1"
+ android:background="@drawable/radio_selector"
+ android:button="@null"
+ android:gravity="center"
+
+ android:text="閾惰杞处"
+ android:textColor="@color/radio_button_text_color"
+ android:textSize="@dimen/new_card_size" />
+ </RadioGroup>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+ <TextView
+ android:id="@+id/newCard_registBtn"
+ android:layout_width="match_parent"
+ android:layout_height="56dp"
+ android:layout_marginTop="15dp"
+ android:background="@color/bottom_color"
+ android:visibility="visible"
+ android:gravity="center"
+ android:text="纭寮�鍗�"
+ android:textColor="#FFFFFF"
+ android:textSize="16sp" />
+ </LinearLayout>
+ </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
--
Gitblit v1.8.0