From ec09d4bcd191496272099c2ab31d097ad630ee78 Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期二, 17 六月 2025 11:55:04 +0800 Subject: [PATCH] feat(card): 添加销卡功能并优化卡片信息展示 --- generallibrary/src/main/res/layout/activity_card_read.xml | 4 generallibrary/src/main/java/com/dayu/general/activity/CardReadActivity.kt | 2 generallibrary/src/main/java/com/dayu/general/activity/RechargeDetailActivity.kt | 6 generallibrary/src/main/AndroidManifest.xml | 12 generallibrary/src/main/java/com/dayu/general/adapter/SearchUserListAdapter.kt | 2 generallibrary/src/main/res/values/strings.xml | 9 generallibrary/src/main/res/drawable/item_bg_selector.xml | 15 + generallibrary/src/main/res/layout/activity_card_cancel.xml | 365 ++++++++++++++++++++++++++++ generallibrary/src/main/java/com/dayu/general/activity/CardCancelActivity.kt | 357 +++++++++++++++++++++++++++ generallibrary/src/main/java/com/dayu/general/bean/net/CardInfoResult.kt | 2 10 files changed, 766 insertions(+), 8 deletions(-) diff --git a/generallibrary/src/main/AndroidManifest.xml b/generallibrary/src/main/AndroidManifest.xml index 910fe6a..d5b9ade 100644 --- a/generallibrary/src/main/AndroidManifest.xml +++ b/generallibrary/src/main/AndroidManifest.xml @@ -105,6 +105,18 @@ </intent-filter> </activity> + <!-- 閿�鍗¢〉闈� --> + <activity + android:name=".activity.CardCancelActivity" + android:exported="false" + android:launchMode="singleTop"> + <intent-filter> + <action android:name="android.nfc.action.ACTION_NDEF_DISCOVERED" /> + <category android:name="android.intent.category.DEFAULT" /> + <data android:mimeType="text/plain" /> + </intent-filter> + </activity> + <meta-data android:name="BUGLY_APP_VERSION" android:value="7.1" /> diff --git a/generallibrary/src/main/java/com/dayu/general/activity/CardCancelActivity.kt b/generallibrary/src/main/java/com/dayu/general/activity/CardCancelActivity.kt new file mode 100644 index 0000000..163990f --- /dev/null +++ b/generallibrary/src/main/java/com/dayu/general/activity/CardCancelActivity.kt @@ -0,0 +1,357 @@ +package com.dayu.general.activity + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.text.TextUtils +import com.dayu.baselibrary.net.subscribers.SubscriberListener +import com.dayu.baselibrary.utils.ToastUtil +import com.dayu.baselibrary.view.TipDialog +import com.dayu.baselibrary.view.TitleBar +import com.dayu.general.bean.net.CardInfoResult +import com.dayu.general.databinding.ActivityCardCancelBinding +import com.dayu.general.net.ApiManager +import com.dayu.general.net.BaseResponse +import com.dayu.general.tool.NfcReadHelper +import com.dayu.general.bean.card.UserCard +import com.dayu.general.tool.CardCommon + +/** + * @author: zuo + * @desc: 閿�鍗ctivity + * @since: 2025/3/6 + */ +class CardCancelActivity : BaseNfcActivity() { + private lateinit var binding: ActivityCardCancelBinding + private var cardNumber: String? = null + private var cardInfo: CardInfoResult? = null + + companion object { + /** + * 鍚姩閿�鍗ctivity + */ + fun start(context: Context) { + val intent = Intent(context, CardCancelActivity::class.java) + context.startActivity(intent) + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityCardCancelBinding.inflate(layoutInflater) + setContentView(binding.root) + + initView() + } + + private fun initView() { + // 璁剧疆TitleBar鐨勮繑鍥炴寜閽偣鍑讳簨浠� + binding.titleBar.setOnItemclickListner(TitleBar.ClickType_LEFT_IMAGE) { + finish() + } + + // 璁剧疆閿�鍗℃寜閽偣鍑讳簨浠� + binding.btnCancelCard.setOnClickListener { + performCardCancel() + } + } + + /** + * 閲嶇疆鍒拌鍗$姸鎬� + */ + private fun resetToReadingState() { + binding.cardReadLL.visibility = android.view.View.VISIBLE + binding.cardInfoContainer.visibility = android.view.View.GONE + cardNumber = null + cardInfo = null + binding.etRefundAmount.setText("") + binding.etRemarks.setText("") + } + + /** + * 鏄剧ず纭瀵硅瘽妗� + */ + private fun showConfirmDialog(message: String, onConfirm: () -> Unit) { + val confirmDialog = TipDialog(this, message) { + onConfirm() + } + confirmDialog.show() + } + + override fun onNfcBack(intent: Intent?) { + intent?.let { + handleNfcIntent(it) + } ?: run { + showConfirmDialog("NFC鏁版嵁寮傚父锛岃閲嶆柊鍒峰崱") { + } + } + } + + /** + * 澶勭悊NFC鍒峰崱淇℃伅 + */ + private fun handleNfcIntent(intent: Intent) { + try { + // 妫�鏌ntent涓槸鍚﹀寘鍚玁FC Tag + if (intent.getParcelableExtra<android.nfc.Tag>(android.nfc.NfcAdapter.EXTRA_TAG) == null) { + showConfirmDialog("鏈娴嬪埌NFC鍗$墖锛岃纭繚鍗$墖宸叉纭斁缃�") { + } + return + } + + val nfcAdapter = NfcReadHelper.getInstance(intent, this) + val cardTypeAndCardNumber = nfcAdapter.getCardTypeAndCardNumber() + if (cardTypeAndCardNumber.isNullOrBlank() || !cardTypeAndCardNumber.contains(",")) { + showConfirmDialog("鍗$墖淇℃伅璇诲彇澶辫触锛岃閲嶆柊鍒峰崱") { + } + return + } + val parts = cardTypeAndCardNumber.split(",") + if (parts.size < 2) { + showConfirmDialog("鍗$墖淇℃伅鏍煎紡寮傚父锛岃閲嶆柊鍒峰崱") { + } + return + } + val cardNumber = parts[0] + val cardType = parts[1] + this.cardNumber = cardNumber + if (cardNumber.isBlank()) { + showConfirmDialog("鍗″彿涓虹┖锛屾棤娉曡繘琛屾搷浣滐紝璇烽噸鏂板埛鍗�") { + } + return + } + + // 鏍规嵁鍗$墖绫诲瀷杩涜涓嶅悓澶勭悊 + when (cardType) { + CardCommon.USER_CARD_TYPE_1, + CardCommon.USER_CARD_TYPE_2, + CardCommon.USER_CARD_TYPE_3 -> { + // 鐢ㄦ埛鍗★細瑙f瀽鍗″唴鏁版嵁骞惰皟鐢ㄦ帴鍙� + handleUserCard(cardNumber, cardType, nfcAdapter) + } + + else -> { + // 绠$悊绫诲崱涓嶆敮鎸侀攢鍗� + showConfirmDialog("璇ュ崱鐗囩被鍨嬩笉鏀寔閿�鍗℃搷浣�") { + resetToReadingState() + } + } + } + } catch (e: Exception) { + showConfirmDialog("璇诲崱寮傚父锛�${e.message}") { + } + e.printStackTrace() + } + } + + /** + * 澶勭悊鐢ㄦ埛鍗� + */ + private fun handleUserCard(cardNumber: String, cardType: String, nfcAdapter: NfcReadHelper) { + // 瑙f瀽鐢ㄦ埛鍗℃暟鎹� + val userCard = nfcAdapter.getUserCardData() + if (userCard == null) { + showConfirmDialog("瑙f瀽鍗$墖鏁版嵁澶辫触锛岃閲嶆柊鍒峰崱") { + } + return + } + + // 杈撳嚭鐢ㄦ埛鍗″唴鎵�鏈変俊鎭埌鏃ュ織 + android.util.Log.d("CardCancelActivity", "=== 鐢ㄦ埛鍗′俊鎭� ===") + android.util.Log.d("CardCancelActivity", "鍗″彿: $cardNumber") + android.util.Log.d("CardCancelActivity", "鍗$墖绫诲瀷: $cardType") + android.util.Log.d("CardCancelActivity", "鍗″唴浣欓: ${userCard.balance}") + android.util.Log.d("CardCancelActivity", "==================") + + // 鏍规嵁鍗″彿鑾峰彇鍗$墖璇︾粏淇℃伅 + 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.cardReadLL.visibility = android.view.View.GONE + binding.cardInfoContainer.visibility = android.view.View.VISIBLE + + this.cardInfo = cardInfo + binding.tvCardNumber.text = cardNumber + + userCard.let { card -> + // 浣欓杞崲涓哄厓锛堝師濮嬫暟鎹彲鑳芥槸鍒嗭級 + val balanceInYuan = if (card.balance > 1000) { + String.format("%.2f", card.balance / 100.0) + } else { + card.balance.toString() + } + binding.tvCardBalance.text = "${balanceInYuan}鍏�" + + // 榛樿閫�娆鹃噾棰濊缃负鍗″唴浣欓 + binding.etRefundAmount.setText(balanceInYuan) + + // 鍗$墖鐘舵�� + binding.tvCardStatus.text = "姝e父" + binding.tvCardStatus.setTextColor(android.graphics.Color.parseColor("#4CAF50")) + } + + // 鏄剧ず鏈嶅姟鍣ㄦ暟鎹� + cardInfo?.let { info -> + binding.tvUserName.text = info.userName ?: "鏈煡" + binding.tvPhone.text = info.phone ?: "鏈粦瀹�" + + // 鏍规嵁status瀛楁鏄剧ず鐘舵�� + val statusText = when (info.state) { + 1 -> "姝e父" + 2 -> "鎸傚け" + 3 -> "閿佸畾" + else -> "鏈煡" + } + } + } + + /** + * 澶勭悊鍗′俊鎭幏鍙栭敊璇� + */ + private fun handleCardInfoError(code: String?, msg: String?) { + val errorMessage: String = when (code) { + "1001" -> { + "璇ュ崱鐗囨湭鍦ㄧ郴缁熶腑娉ㄥ唽锛屾棤娉曡繘琛岄攢鍗℃搷浣溿��" + } + + else -> { + when { + msg.isNullOrBlank() -> "鑾峰彇鍗′俊鎭け璐ワ紝璇烽噸鏂板埛鍗¢噸璇曘��" + msg.contains("鏁版嵁涓嶅瓨鍦�") -> "璇ュ崱鐗囨湭鍦ㄧ郴缁熶腑娉ㄥ唽锛屾棤娉曡繘琛岄攢鍗℃搷浣溿��" + msg.contains("缃戠粶") -> "缃戠粶杩炴帴寮傚父锛岃妫�鏌ョ綉缁滆繛鎺ュ悗閲嶆柊鍒峰崱銆�" + msg.contains("瓒呮椂") -> "缃戠粶璇锋眰瓒呮椂锛岃閲嶆柊鍒峰崱閲嶈瘯銆�" + else -> "鑾峰彇鍗′俊鎭け璐ワ細$msg\n\n璇烽噸鏂板埛鍗¢噸璇曘��" + } + } + } + + // 鏄剧ず閿欒淇℃伅鐨勫璇濇 + showConfirmDialog(errorMessage) { + resetToReadingState() + } + } + + /** + * 鎵ц閿�鍗℃搷浣� + */ + private fun performCardCancel() { + // 楠岃瘉杈撳叆 + val refundAmountStr = binding.etRefundAmount.text.toString().trim() + val remarks = binding.etRemarks.text.toString().trim() + + if (TextUtils.isEmpty(refundAmountStr)) { + ToastUtil.showToast("璇疯緭鍏ラ��娆鹃噾棰�") + return + } + + val refundAmount = try { + refundAmountStr.toDouble() + } catch (e: NumberFormatException) { + ToastUtil.showToast("璇疯緭鍏ユ湁鏁堢殑閫�娆鹃噾棰�") + return + } + + if (refundAmount < 0) { + ToastUtil.showToast("閫�娆鹃噾棰濅笉鑳戒负璐熸暟") + return + } + + if (TextUtils.isEmpty(remarks)) { + ToastUtil.showToast("璇疯緭鍏ュ娉ㄤ俊鎭�") + return + } + + // 纭閿�鍗� + showConfirmDialog( + "纭瑕侀攢鍗″悧锛焅n\n鍗″彿锛�${cardNumber}\n閫�娆鹃噾棰濓細${refundAmount}鍏僜n澶囨敞锛�${remarks}\n\n閿�鍗″悗姝ゅ崱灏嗘棤娉曞啀娆′娇鐢紒" + ) { + callCancelCardApi(refundAmount, remarks) + } + } + + /** + * 璋冪敤閿�鍗PI鎺ュ彛 + */ + private fun callCancelCardApi(refundAmount: Double, remarks: String) { + if (cardNumber.isNullOrBlank()) { + ToastUtil.showToast("鍗″彿淇℃伅寮傚父锛岃閲嶆柊鍒峰崱") + return + } + + val map = mutableMapOf<String, Any>() + map["cardNum"] = cardNumber!! + map["refund"] = (refundAmount * 100).toInt() // 杞崲涓哄垎 + map["refundType"] = 1838466162264350700L + map["remarks"] = remarks + map["operator"] = 2024090516595200300L + + ApiManager.getInstance().requestPostLoading( + this, + "terminal/card/termCancel", + Boolean::class.java, + map, + object : SubscriberListener<BaseResponse<Boolean>>() { + override fun onNext(t: BaseResponse<Boolean>) { + if (t.success && t.content == true) { + // 閿�鍗℃垚鍔� + showConfirmDialog("閿�鍗℃垚鍔燂紒\n\n閫�娆鹃噾棰濓細${refundAmount}鍏冨凡閫�杩�") { + finish() + } + } else { + // 閿�鍗″け璐� + val errorMsg = if (t.msg.isNullOrBlank()) "閿�鍗″け璐ワ紝璇烽噸璇�" else t.msg + showConfirmDialog("閿�鍗″け璐ワ細$errorMsg") { + } + } + } + + override fun onError(e: Throwable?) { + super.onError(e) + showConfirmDialog("閿�鍗¤姹傚け璐�: ${e?.message ?: "缃戠粶寮傚父锛岃妫�鏌ョ綉缁滆繛鎺�"}") { + } + } + } + ) + } +} \ No newline at end of file diff --git a/generallibrary/src/main/java/com/dayu/general/activity/CardReadActivity.kt b/generallibrary/src/main/java/com/dayu/general/activity/CardReadActivity.kt index 069d464..07015c8 100644 --- a/generallibrary/src/main/java/com/dayu/general/activity/CardReadActivity.kt +++ b/generallibrary/src/main/java/com/dayu/general/activity/CardReadActivity.kt @@ -307,7 +307,7 @@ binding.tvIdCard.text = info.userCode ?: "鏈綍鍏�" // 浣跨敤userCode浣滀负韬唤璇佸彿鐨勬浛浠� // 鏍规嵁status瀛楁鏄剧ず鐘舵�� - val statusText = when (info.status) { + val statusText = when (info.state) { 1 -> "姝e父" 2 -> "鎸傚け" 3 -> "閿佸畾" diff --git a/generallibrary/src/main/java/com/dayu/general/activity/RechargeDetailActivity.kt b/generallibrary/src/main/java/com/dayu/general/activity/RechargeDetailActivity.kt index 8ea5625..f460d84 100644 --- a/generallibrary/src/main/java/com/dayu/general/activity/RechargeDetailActivity.kt +++ b/generallibrary/src/main/java/com/dayu/general/activity/RechargeDetailActivity.kt @@ -267,7 +267,7 @@ binding.redRemainderBlance.text = "$balance 鍏�" // 璁剧疆鍗$姸鎬佸拰瀵瑰簲棰滆壊 - val cardStatus = when (info.status) { + val cardStatus = when (info.state) { 1 -> "姝e父" 2 -> "鎸傚け" 3 -> "閿佸畾" @@ -277,7 +277,7 @@ binding.redStatu.text = cardStatus // 鏍规嵁鍗$姸鎬佽缃笉鍚岄鑹� - val statusColor = when (info.status) { + val statusColor = when (info.state) { 1 -> android.graphics.Color.parseColor("#4CAF50") // 缁胯壊-姝e父 2 -> android.graphics.Color.parseColor("#FF9800") // 姗欒壊-鎸傚け 3 -> android.graphics.Color.parseColor("#F44336") // 绾㈣壊-閿佸畾 @@ -433,7 +433,7 @@ putExtra("bonusAmount", bonusAmount) // 浼犻�掕禒閫侀噾棰� } startActivity(intent) - + finish() } catch (e: Exception) { ToastUtil.show("鍚姩鍐欏崱鐣岄潰澶辫触: ${e.message}") } diff --git a/generallibrary/src/main/java/com/dayu/general/adapter/SearchUserListAdapter.kt b/generallibrary/src/main/java/com/dayu/general/adapter/SearchUserListAdapter.kt index 5c311e0..1d1bcb7 100644 --- a/generallibrary/src/main/java/com/dayu/general/adapter/SearchUserListAdapter.kt +++ b/generallibrary/src/main/java/com/dayu/general/adapter/SearchUserListAdapter.kt @@ -107,7 +107,7 @@ val end = idCard.substring(idCard.length - 4) "$start****$end" } else { - idCard ?: "鏃�" + "鏈綍鍏�" } } diff --git a/generallibrary/src/main/java/com/dayu/general/bean/net/CardInfoResult.kt b/generallibrary/src/main/java/com/dayu/general/bean/net/CardInfoResult.kt index e9c544e..ca692a3 100644 --- a/generallibrary/src/main/java/com/dayu/general/bean/net/CardInfoResult.kt +++ b/generallibrary/src/main/java/com/dayu/general/bean/net/CardInfoResult.kt @@ -12,7 +12,7 @@ val phone: String? = null, // 鎵嬫満鍙� val address: String? = null, // 鍦板潃 val balance: Double? = 0.0, // 浣欓 - val status: Int? = 0, // 鍗$姸鎬�: 1-姝e父, 2-鎸傚け, 3-閿佸畾 + val state: Int? = 0, // 鍗$姸鎬�: 1-姝e父, 2-鎸傚け, 3-閿佸畾 val createTime: String? = null, // 鍒涘缓鏃堕棿 val updateTime: String? = null // 鏇存柊鏃堕棿 ) : Serializable \ No newline at end of file diff --git a/generallibrary/src/main/res/drawable/item_bg_selector.xml b/generallibrary/src/main/res/drawable/item_bg_selector.xml new file mode 100644 index 0000000..702d275 --- /dev/null +++ b/generallibrary/src/main/res/drawable/item_bg_selector.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true"> + <shape android:shape="rectangle"> + <solid android:color="#f5f5f5" /> + <corners android:radius="8dp" /> + </shape> + </item> + <item> + <shape android:shape="rectangle"> + <solid android:color="#fafafa" /> + <corners android:radius="8dp" /> + </shape> + </item> +</selector> \ No newline at end of file diff --git a/generallibrary/src/main/res/layout/activity_card_cancel.xml b/generallibrary/src/main/res/layout/activity_card_cancel.xml new file mode 100644 index 0000000..31345af --- /dev/null +++ b/generallibrary/src/main/res/layout/activity_card_cancel.xml @@ -0,0 +1,365 @@ +<?xml version="1.0" encoding="utf-8"?> +<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/base_green_bg"> + + <com.dayu.baselibrary.view.TitleBar + android:id="@+id/titleBar" + android:layout_width="match_parent" + android:layout_height="@dimen/dimen_title_height" + android:background="@color/title_bar_bg" + android:elevation="4dp" + app:centerText="閿�鍗�" + app:leftImage="@mipmap/icon_back" /> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_below="@+id/titleBar" + android:fillViewport="true"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + 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"> + + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginBottom="16dp" + app:cardCornerRadius="8dp" + app:cardElevation="2dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical" + android:padding="16dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + android:gravity="center" + android:text="閿�鍗℃搷浣�" + android:textColor="@color/base_blue_bg" + android:textSize="@dimen/big_text_size" + android:textStyle="bold" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="20dp" + android:gravity="center" + android:text="璇峰皢闇�瑕侀攢鍗$殑鍗$墖璐村湪璁惧涓婅繘琛岃鍙�" + android:textColor="#333333" + android:textSize="@dimen/text_size" + android:textStyle="bold" /> + + <ImageView + android:layout_width="120dp" + android:layout_height="120dp" + android:layout_gravity="center" + android:layout_marginBottom="20dp" + android:scaleType="fitCenter" + android:src="@mipmap/nfc_write" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:text="璇蜂繚鎸佹墜鎸佹満鍜屽崱鐗囦笉瑕佺Щ鍔�" + android:textColor="#666666" + android:textSize="@dimen/new_card_size" /> + + </LinearLayout> + </androidx.cardview.widget.CardView> + </LinearLayout> + + <!-- 鍗$墖淇℃伅鏄剧ず鍖哄煙 --> + <LinearLayout + android:id="@+id/card_info_container" + 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" + 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:gravity="center" + android:text="鍗$墖淇℃伅" + android:textColor="@color/base_blue_bg" + android:textSize="@dimen/big_text_size" + android:textStyle="bold" /> + + <!-- 鎸佸崱浜� --> + <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"> + + <TextView + android:layout_width="105dp" + android:layout_height="wrap_content" + android:text="鎸佸崱浜猴細" + android:textColor="#333333" + android:textSize="@dimen/text_size" /> + + <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="@dimen/text_size" /> + </LinearLayout> + + <!-- 鍗″彿 --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="2dp" + android:background="#FFFFFF" + android:gravity="center_vertical" + android:orientation="horizontal" + android:padding="12dp"> + + <TextView + android:layout_width="105dp" + android:layout_height="wrap_content" + android:text="鍗″湴鍧�锛�" + android:textColor="#333333" + android:textSize="@dimen/text_size" /> + + <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="@dimen/text_size" /> + </LinearLayout> + + <!-- 鍗$墖鐘舵�� --> + <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"> + + <TextView + android:layout_width="105dp" + android:layout_height="wrap_content" + android:text="鍗$墖鐘舵�侊細" + android:textColor="#333333" + android:textSize="@dimen/text_size" /> + + <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="@dimen/text_size" /> + </LinearLayout> + + <!-- 鍗″唴浣欓 --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="2dp" + android:background="#FFFFFF" + android:gravity="center_vertical" + android:orientation="horizontal" + android:padding="12dp"> + + <TextView + android:layout_width="105dp" + android:layout_height="wrap_content" + android:text="鍗′綑棰濓細" + android:textColor="#333333" + android:textSize="@dimen/text_size" /> + + <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="@dimen/text_size" + android:textStyle="bold" /> + </LinearLayout> + + <!-- 鎵嬫満鍙� --> + <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"> + + <TextView + android:layout_width="105dp" + android:layout_height="wrap_content" + android:text="鎵嬫満鍙凤細" + android:textColor="#333333" + android:textSize="@dimen/text_size" /> + + <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="@dimen/text_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="16dp" + android:gravity="center" + android:text="閿�鍗℃搷浣�" + android:textColor="@color/base_blue_bg" + android:textSize="@dimen/big_text_size" + 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" + 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" /> + + <EditText + android:id="@+id/et_remarks" + 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> + + <!-- 閿�鍗℃寜閽� --> + <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> + </androidx.cardview.widget.CardView> + + </LinearLayout> + + </LinearLayout> + </ScrollView> + +</RelativeLayout> \ No newline at end of file diff --git a/generallibrary/src/main/res/layout/activity_card_read.xml b/generallibrary/src/main/res/layout/activity_card_read.xml index 2e2cf6b..5e5c589 100644 --- a/generallibrary/src/main/res/layout/activity_card_read.xml +++ b/generallibrary/src/main/res/layout/activity_card_read.xml @@ -250,7 +250,7 @@ android:textStyle="bold" /> </LinearLayout> - <!-- 鐢ㄦ埛缂栧彿 --> + <!-- 鍗$紪鍙� --> <LinearLayout android:id="@+id/ll_user_number" android:layout_width="match_parent" @@ -265,7 +265,7 @@ <TextView android:layout_width="105dp" android:layout_height="wrap_content" - android:text="鐢ㄦ埛缂栧彿锛�" + android:text="鍗$紪鍙凤細" android:textColor="#333333" android:textSize="@dimen/text_size" /> diff --git a/generallibrary/src/main/res/values/strings.xml b/generallibrary/src/main/res/values/strings.xml new file mode 100644 index 0000000..b781705 --- /dev/null +++ b/generallibrary/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- SmartRefreshLayout搴曢儴Footer鐩稿叧鏂囨湰 --> + <string name="srl_footer_nothing">宸插埌搴�</string> + <string name="srl_footer_pulling">涓婃媺鍔犺浇鏇村</string> + <string name="srl_footer_release">閲婃斁绔嬪嵆鍔犺浇</string> + <string name="srl_footer_loading">姝e湪鍔犺浇鈥�</string> + <string name="srl_footer_refreshing">绛夊緟澶撮儴鍒锋柊瀹屾垚鈥�</string> +</resources> \ No newline at end of file -- Gitblit v1.8.0