From 0faae97cd2523f840c426da68464e577e01dfa80 Mon Sep 17 00:00:00 2001 From: zuojincheng <lf_zuo@163.com> Date: 星期一, 23 六月 2025 20:35:08 +0800 Subject: [PATCH] refactor(CardReplaceActivity): 重构补卡流程并优化界面显示- 重新设计卡片信息展示布局,增加新卡卡地址、客户编号等字段 - 优化补卡逻辑,支持通过卡号或客户编号获取卡片信息 -调整工本费和返回金额输入框位置 - 更新API调用路径,使用新的卡片查询接口 --- generallibrary/src/main/java/com/dayu/general/net/NetConstans.kt | 4 generallibrary/src/main/res/layout/activity_card_replace.xml | 310 ++++++++++++++++++++-------------- generallibrary/src/main/java/com/dayu/general/activity/CardReplaceActivity.kt | 178 +++++-------------- generallibrary/src/main/java/com/dayu/general/activity/CardUnlossActivity.kt | 2 4 files changed, 236 insertions(+), 258 deletions(-) diff --git a/generallibrary/src/main/java/com/dayu/general/activity/CardReplaceActivity.kt b/generallibrary/src/main/java/com/dayu/general/activity/CardReplaceActivity.kt index f7c6dc0..e20cec0 100644 --- a/generallibrary/src/main/java/com/dayu/general/activity/CardReplaceActivity.kt +++ b/generallibrary/src/main/java/com/dayu/general/activity/CardReplaceActivity.kt @@ -38,7 +38,7 @@ private var cardInfo: CardInfoResult? = null private var cardInfoByClient: CardInfoByClientResult? = null private var userCard: UserCard? = null - private var clientNum: String? = null + private var cardNum: String? = null private var newCardNumber: String? = null // 鏂板崱鍗″彿 // 鏀粯鏂瑰紡鐩稿叧灞炴�� @@ -50,11 +50,9 @@ /** * 鍚姩琛ュ崱Activity */ - fun start(context: Context, clientNum: String? = null) { + fun start(context: Context, clientNum: String) { val intent = Intent(context, CardReplaceActivity::class.java) - clientNum?.let { - intent.putExtra("clientNum", it) - } + intent.putExtra("cardNum", clientNum) context.startActivity(intent) } } @@ -65,12 +63,12 @@ setContentView(binding.root) // 鑾峰彇浼犻�掔殑clientNum鍙傛暟 - clientNum = intent.getStringExtra("clientNum") + cardNum = intent.getStringExtra("cardNum") initView() // 鑾峰彇鏀粯鏂瑰紡 getPaymentMethods() - + // 鏃犺鏄惁鏈塩lientNum锛岄兘鍏堟樉绀鸿鍗$晫闈紝绛夊緟鐢ㄦ埛鍒锋柊鍗� resetToReadingState() } @@ -194,7 +192,7 @@ cardInfoByClient = null newCardNumber = null binding.etCardCost.setText("") - binding.etReturnAmount.setText("0") + binding.etReturnAmount.setText("") } /** @@ -244,7 +242,7 @@ } val readCardNumber = parts[0] val cardType = parts[1] - + if (readCardNumber.isBlank()) { showConfirmDialog("鍗″彿涓虹┖锛屾棤娉曡繘琛屾搷浣滐紝璇烽噸鏂板埛鍗�") { } @@ -254,27 +252,33 @@ // 淇濆瓨鏂板崱鍗″彿 this.newCardNumber = readCardNumber - // 鏍规嵁鏄惁鏈塩lientNum鍙傛暟鍐冲畾鑾峰彇鍗′俊鎭殑鏂瑰紡 - if (clientNum != null) { - // 濡傛灉鏈塩lientNum锛屼娇鐢╟lientNum鑾峰彇鍗′俊鎭� - getCardInfoByClientNum(clientNum!!) - } else { - // 濡傛灉娌℃湁clientNum锛屾牴鎹崱鐗囩被鍨嬭繘琛屽鐞� - when (cardType) { - CardCommon.USER_CARD_TYPE_1, - CardCommon.USER_CARD_TYPE_2, - CardCommon.USER_CARD_TYPE_3 -> { - // 鐢ㄦ埛鍗★細瑙f瀽鍗″唴鏁版嵁骞惰皟鐢ㄦ帴鍙� - showConfirmDialog("璇ュ崱鐗囩被鍨嬩笉鏀寔琛ュ崱鎿嶄綔") { + when (cardType) { + "00" -> { + // 鐧藉崱鎵嶅彲浠ヨˉ鍗� + if (cardNum != null) { + // 濡傛灉鏈塩lientNum锛屼娇鐢╟lientNum鑾峰彇鍗′俊鎭� + getCardInfoByClientNum(cardNum!!) + } else { + showConfirmDialog("鑾峰彇鏃у崱淇℃伅鏁版嵁澶辫触") { resetToReadingState() } } - else -> { - // 绠$悊绫诲崱涓嶆敮鎸佽ˉ鍗� - handleUserCard(readCardNumber, cardType, nfcAdapter) + } + + CardCommon.USER_CARD_TYPE_1, + CardCommon.USER_CARD_TYPE_2, + CardCommon.USER_CARD_TYPE_3 -> { + // 鐢ㄦ埛鍗★細瑙f瀽鍗″唴鏁版嵁骞惰皟鐢ㄦ帴鍙� + showConfirmDialog("鐢ㄦ埛鍗′笉鏀寔琛ュ崱") { + resetToReadingState() } } + + else -> { + + } } + } catch (e: Exception) { showConfirmDialog("璇诲崱寮傚父锛�${e.message}") { } @@ -282,102 +286,6 @@ } } - /** - * 澶勭悊鐢ㄦ埛鍗� - */ - private fun handleUserCard(cardNumber: String, cardType: String, nfcAdapter: NfcReadHelper) { - // 瑙f瀽鐢ㄦ埛鍗℃暟鎹� - val userCard = nfcAdapter.getUserCardData() - if (userCard == null) { - showConfirmDialog("瑙f瀽鍗$墖鏁版嵁澶辫触锛岃閲嶆柊鍒峰崱") { - } - return - } - - // 杈撳嚭鐢ㄦ埛鍗″唴鎵�鏈変俊鎭埌鏃ュ織 - android.util.Log.d("CardReplaceActivity", "=== 鐢ㄦ埛鍗′俊鎭� ===") - android.util.Log.d("CardReplaceActivity", "鍗″彿: $cardNumber") - android.util.Log.d("CardReplaceActivity", "鍗$墖绫诲瀷: $cardType") - android.util.Log.d("CardReplaceActivity", "鍗″唴浣欓: ${userCard.balance}") - android.util.Log.d("CardReplaceActivity", "==================") - this.userCard = userCard - // 鏍规嵁鍗″彿鑾峰彇鍗$墖璇︾粏淇℃伅 - getCardInfo(cardNumber, cardType, userCard) - } - - /** - * 鑾峰彇鍗$墖璇︾粏淇℃伅锛堢敤鎴峰崱涓撶敤锛� - */ - private fun getCardInfo(cardNumber: String, cardType: String, userCard: UserCard) { - val map = mutableMapOf<String, Any>() - map["cardAddr"] = cardNumber - ApiManager.getInstance().requestGetLoading( - this, - "terminal/card/readCard", - CardInfoResult::class.java, - map, - object : SubscriberListener<BaseResponse<CardInfoResult>>() { - override fun onNext(t: BaseResponse<CardInfoResult>) { - if (t.success) { - // 璇诲崱鎴愬姛锛屾樉绀虹敤鎴峰崱璇︾粏淇℃伅 - showUserCardInfo(t.content, cardNumber, cardType, userCard) - } else { - // 澶勭悊鑾峰彇澶辫触鐨勬儏鍐� - handleCardInfoError(t.code, t.msg) - } - } - - override fun onError(e: Throwable?) { - super.onError(e) - showConfirmDialog("鑾峰彇鍗′俊鎭け璐�: ${e?.message ?: "缃戠粶寮傚父锛岃妫�鏌ョ綉缁滆繛鎺�"}") { - } - } - } - ) - } - - /** - * 鏄剧ず鐢ㄦ埛鍗$墖淇℃伅锛堝寘鍚崱鍐呮暟鎹拰鎺ュ彛杩斿洖鏁版嵁锛� - */ - private fun showUserCardInfo( - cardInfo: CardInfoResult?, - cardNumber: String, - cardType: String, - userCard: UserCard - ) { - // 闅愯棌璇诲崱鎻愮ず锛屾樉绀轰俊鎭尯鍩熷拰搴曢儴鎸夐挳 - binding.scrollReadCard.visibility = android.view.View.GONE - binding.cardInfoContainer.visibility = android.view.View.VISIBLE - binding.bottomButtonContainer.visibility = android.view.View.VISIBLE - - this.cardInfo = cardInfo - this.cardNumber = cardNumber - - // 鏄剧ず鏂板崱鍗″彿 - binding.tvCurrentCardAddress.text = newCardNumber ?: cardNumber - - // 鏄剧ず鏈嶅姟鍣ㄦ暟鎹� - cardInfo?.let { info -> - binding.tvUserName.text = info.userName ?: "鏈煡" - binding.tvPhone.text = info.phone ?: "鏈粦瀹�" - - // 鏍规嵁state瀛楁鏄剧ず鐘舵�� - val (statusText, statusColor) = when (info.state) { - 1 -> Pair("姝e父", android.graphics.Color.parseColor("#4CAF50")) // 缁胯壊 - 2 -> Pair("宸叉敞閿�", android.graphics.Color.parseColor("#FF5722")) // 娣辨鑹� - 3 -> Pair("宸叉寕澶�", android.graphics.Color.parseColor("#FF9800")) // 姗欒壊 - 4 -> Pair("鏃犳晥鍗$墖", android.graphics.Color.parseColor("#F44336")) // 绾㈣壊 - else -> Pair("鏈煡鐘舵��", android.graphics.Color.parseColor("#9E9E9E")) // 鐏拌壊 - } - binding.tvCardStatus.text = statusText - binding.tvCardStatus.setTextColor(statusColor) - } - - userCard.let { card -> - // 浣欓杞崲涓哄厓锛堝師濮嬫暟鎹彲鑳芥槸鍒嗭級 - binding.tvCardBalance.text = MornyUtil.changeF2Y(card.balance) + "鍏�" - } - } /** * 澶勭悊鍗′俊鎭幏鍙栭敊璇� @@ -463,7 +371,7 @@ val map = mutableMapOf<String, Any>() map["cardAddr"] = newCardNumber!! // 浣跨敤鏂板崱鍗″彿 - + // 鏍规嵁鏁版嵁婧愰�夋嫨cardNum鍙傛暟 val cardNum = when { cardInfo != null -> cardInfo!!.cardNum.toString() @@ -471,7 +379,7 @@ else -> cardNumber ?: newCardNumber!! } map["cardNum"] = cardNum - + map["cardCost"] = cardCost map["returnAmount"] = returnAmount // 浣跨敤杩斿洖閲戦 map["paymentId"] = paymentId // 浣跨敤閫変腑鐨勬敮浠樻柟寮廔D @@ -488,7 +396,12 @@ override fun onNext(t: BaseResponse<CardReplaceResult>) { if (t.success && t.content != null) { // 琛ュ崱鎴愬姛锛岃烦杞埌鍐欏崱鐣岄潰 - startWriteCardActivity(t.content!!, cardCost, returnAmount, createUserCardFromData()) + startWriteCardActivity( + t.content!!, + cardCost, + returnAmount, + createUserCardFromData() + ) } else { // 琛ュ崱澶辫触 val errorMsg = if (t.msg.isNullOrBlank()) "琛ュ崱澶辫触锛岃閲嶈瘯" else t.msg @@ -520,6 +433,7 @@ phoneNumber = cardInfoByClient!!.phone.toString() } } + else -> UserCard() // 杩斿洖绌虹殑UserCard瀵硅薄 } } @@ -568,13 +482,13 @@ /** * 鏍规嵁瀹㈡埛缂栧彿鑾峰彇鍗′俊鎭� */ - private fun getCardInfoByClientNum(clientNum: String) { + private fun getCardInfoByClientNum(cardNum: String) { val map = mutableMapOf<String, Any>() - map["clientNum"] = clientNum + map["cardNum"] = cardNum ApiManager.getInstance().requestGetLoading( this, - "terminal/card/getcardbyclientnum", + "terminal/card/getcardbycardnum", CardInfoByClientResult::class.java, map, object : SubscriberListener<BaseResponse<CardInfoByClientResult>>() { @@ -610,11 +524,17 @@ binding.bottomButtonContainer.visibility = android.view.View.VISIBLE // 鏄剧ず鏂板崱鍗″彿锛堝鏋滃凡璇诲彇鍒版柊鍗★級 - binding.tvCurrentCardAddress.text = newCardNumber ?: cardInfo.cardNum - + binding.tvCurrentCardAddress.text = newCardNumber ?: "" + // 鏄剧ず鍗′俊鎭� binding.tvUserName.text = cardInfo.clientName binding.tvPhone.text = cardInfo.phone.toString() + + // 鏄剧ず鍗″彿 + binding.tvCardNumber.text = cardInfo.cardNum ?: "--" + + // 鏄剧ず瀹㈡埛缂栧彿 + binding.tvCustomerId.text = cardInfo.clientNum ?: "--" // 鏍规嵁cardState瀛楁鏄剧ず鐘舵�� val (statusText, statusColor) = when (cardInfo.cardState) { @@ -629,7 +549,7 @@ // 鏄剧ず浣欓 binding.tvCardBalance.text = "${cardInfo.money}鍏�" - + // 璁剧疆cardNumber鐢ㄤ簬鍚庣画API璋冪敤 cardNumber = cardInfo.cardNum } diff --git a/generallibrary/src/main/java/com/dayu/general/activity/CardUnlossActivity.kt b/generallibrary/src/main/java/com/dayu/general/activity/CardUnlossActivity.kt index 34effe8..07f15b3 100644 --- a/generallibrary/src/main/java/com/dayu/general/activity/CardUnlossActivity.kt +++ b/generallibrary/src/main/java/com/dayu/general/activity/CardUnlossActivity.kt @@ -99,7 +99,7 @@ // 璁剧疆琛ュ崱鎸夐挳鐐瑰嚮浜嬩欢 cardAdapter?.setOnReplaceClickListener { card -> - CardReplaceActivity.start(this, card.clientNum) + card.cardNum?.let { CardReplaceActivity.start(this, it) } } } diff --git a/generallibrary/src/main/java/com/dayu/general/net/NetConstans.kt b/generallibrary/src/main/java/com/dayu/general/net/NetConstans.kt index 177a96d..0873964 100644 --- a/generallibrary/src/main/java/com/dayu/general/net/NetConstans.kt +++ b/generallibrary/src/main/java/com/dayu/general/net/NetConstans.kt @@ -8,8 +8,8 @@ class NetConstans { companion object { // const val BASE_URL: String = "https://no253541tf71.vicp.fun/" -// const val BASE_URL: String = "http://192.168.40.166:54321/" - const val BASE_URL: String = "http://192.168.10.87:54321/" + const val BASE_URL: String = "http://192.168.40.166:54321/" +// const val BASE_URL: String = "http://192.168.10.87:54321/" const val TOKEN_INVALID: String = "0000" } diff --git a/generallibrary/src/main/res/layout/activity_card_replace.xml b/generallibrary/src/main/res/layout/activity_card_replace.xml index 3d468ed..10741cf 100644 --- a/generallibrary/src/main/res/layout/activity_card_replace.xml +++ b/generallibrary/src/main/res/layout/activity_card_replace.xml @@ -21,7 +21,7 @@ android:layout_height="match_parent" android:layout_below="@+id/titleBar" android:fillViewport="true" - android:visibility="visible"> + android:visibility="gone"> <LinearLayout android:layout_width="match_parent" @@ -107,7 +107,7 @@ android:layout_above="@+id/bottom_button_container" android:layout_below="@+id/titleBar" android:orientation="vertical" - android:visibility="gone"> + android:visibility="visible"> <ScrollView android:layout_width="match_parent" @@ -121,66 +121,29 @@ 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"> + app:cardCornerRadius="6dp" + app:cardElevation="1dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:padding="16dp"> + android:padding="14dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="12dp" - android:text="鍗″彿" + android:layout_marginBottom="10dp" + android:text="鍗$墖淇℃伅" android:textColor="@color/base_blue_bg" - android:textSize="18sp" + android:textSize="17sp" 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" @@ -188,27 +151,123 @@ android:background="#F8F9FA" android:gravity="center_vertical" android:orientation="horizontal" - android:padding="12dp"> + android:padding="8dp"> <TextView - android:layout_width="100dp" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="鎸佸崱浜猴細" + android:text="鏂板崱鍗″湴鍧�锛�" android:textColor="#333333" - android:textSize="16sp" + android:textSize="15sp" android:textStyle="bold" /> <TextView - android:id="@+id/tv_user_name" + android:id="@+id/tv_current_card_address" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="#F5F5F5" + android:padding="8dp" + android:text="--" + android:textColor="#333333" + android:textSize="15sp" + android:textIsSelectable="true" /> + </LinearLayout> + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginTop="2dp" + android:background="@color/base_blue_bg" /> + <!-- 鎸佸崱浜哄拰鍗$墖鐘舵�� - 鍚屼竴琛屾樉绀� --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="2dp" + android:layout_marginBottom="1dp" + android:background="#FFFFFF" + android:orientation="horizontal" + android:padding="10dp"> + + <!-- 鎸佸崱浜� --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="鎸佸崱浜�" + android:textColor="#333333" + android:textSize="13sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tv_user_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="3dp" + android:text="--" + android:textColor="#666666" + android:textSize="15sp" /> + </LinearLayout> + + <!-- 鍗$墖鐘舵�� --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="鍗$墖鐘舵��" + android:textColor="#333333" + android:textSize="13sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tv_card_status" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="3dp" + android:text="姝e父" + android:textColor="#4CAF50" + android:textSize="15sp" /> + </LinearLayout> + </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="8dp"> + + <TextView + android:layout_width="80dp" + android:layout_height="wrap_content" + android:text="鍗″彿锛�" + android:textColor="#333333" + android:textSize="14sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tv_card_number" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="--" android:textColor="#666666" - android:textSize="16sp" /> + android:textSize="14sp" /> </LinearLayout> - <!-- 鍗$墖鐘舵�� --> + <!-- 瀹㈡埛缂栧彿 --> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -216,53 +275,24 @@ android:background="#FFFFFF" android:gravity="center_vertical" android:orientation="horizontal" - android:padding="12dp"> + android:padding="8dp"> <TextView - android:layout_width="100dp" + android:layout_width="80dp" android:layout_height="wrap_content" - android:text="鍗$墖鐘舵�侊細" + android:text="瀹㈡埛缂栧彿锛�" android:textColor="#333333" - android:textSize="16sp" + android:textSize="14sp" android:textStyle="bold" /> <TextView - android:id="@+id/tv_card_status" + android:id="@+id/tv_customer_id" 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" /> + android:text="--" + android:textColor="#666666" + android:textSize="14sp" /> </LinearLayout> <!-- 鎵嬫満鍙� --> @@ -272,14 +302,14 @@ android:background="#FFFFFF" android:gravity="center_vertical" android:orientation="horizontal" - android:padding="12dp"> + android:padding="8dp"> <TextView - android:layout_width="100dp" + android:layout_width="80dp" android:layout_height="wrap_content" android:text="鎵嬫満鍙凤細" android:textColor="#333333" - android:textSize="16sp" + android:textSize="14sp" android:textStyle="bold" /> <TextView @@ -289,7 +319,35 @@ android:layout_weight="1" android:text="--" android:textColor="#666666" - android:textSize="16sp" /> + android:textSize="14sp" /> + </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="8dp"> + + <TextView + android:layout_width="80dp" + android:layout_height="wrap_content" + android:text="鍗″唴浣欓锛�" + android:textColor="#333333" + android:textSize="14sp" + 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="14sp" + android:textStyle="bold" /> </LinearLayout> </LinearLayout> @@ -309,7 +367,7 @@ android:elevation="4dp" android:orientation="vertical" android:padding="16dp" - android:visibility="gone"> + android:visibility="visible"> <!-- 鏀粯鏂瑰紡閫夋嫨鍖哄煙 --> <LinearLayout @@ -343,6 +401,36 @@ 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_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="" + android:textColor="#333333" + android:textColorHint="#999999" + android:textSize="16sp" /> + </LinearLayout> <!-- 宸ユ湰璐硅緭鍏� --> <LinearLayout @@ -375,36 +463,6 @@ 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> -- Gitblit v1.8.0