feat(card): 添加卡片返还功能- 新增 CardReturnActivity 用于执行卡片返还操作
- 在 BSCardFragment 中添加返还按钮,跳转到 CardReturnActivity
- 在 CardOperationType 中添加 ReturnCard 类型
- 修改 CardReadActivity,优化卡片信息显示逻辑
- 更新 CardWriteSuccessActivity,支持返还成功提示
- 新增 ic_morny_back 图标用于返还操作
| | |
| | | </intent-filter> |
| | | </activity> |
| | | |
| | | <activity android:name=".activity.CardReturnActivity" |
| | | 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" /> |
| | |
| | | context?.let { CardReadActivity.start(it) } |
| | | } |
| | | binding.homeReverse.setOnClickListener { |
| | | context?.let { CardReturnActivity.start(it) } |
| | | } |
| | | binding.homeCancelCard.setOnClickListener { |
| | | context?.let { CardCancelActivity.start(it) } |
| | | } |
| | | } |
| | |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import com.dayu.baselibrary.net.subscribers.SubscriberListener |
| | | import com.dayu.baselibrary.utils.ToastUtil |
| | | import com.dayu.baselibrary.utils.MornyUtil |
| | | import com.dayu.baselibrary.view.TipDialog |
| | | import com.dayu.baselibrary.view.TitleBar |
| | | import com.dayu.general.bean.card.UserCard |
| | | import com.dayu.general.bean.net.CardInfoResult |
| | | import com.dayu.general.databinding.ActivityCardReadBinding |
| | | 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 |
| | | import com.dayu.general.tool.NfcReadHelper |
| | | |
| | | /** |
| | | * @author: zuo |
| | |
| | | |
| | | 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.tvCardBalance.text = MornyUtil.changeF2Y(card.balance.toInt()) + "元" |
| | | |
| | | // 使用完整的用户编号 |
| | | binding.tvUserNumber.text = cardInfo?.cardNum |
| | | |
| | | // 卡片状态(假设正常状态,因为UserCard中没有状态字段) |
| | | binding.tvCardStatus.text = "正常" |
| | | binding.tvCardStatus.setTextColor(android.graphics.Color.parseColor("#4CAF50")) |
| | | |
| | | // 充值时间作为最后使用时间 |
| | | if (card.rechargeDate != null) { |
| | |
| | | binding.tvPhone.text = info.phone ?: "未绑定" |
| | | binding.tvIdCard.text = info.userCode ?: "未录入" // 使用userCode作为身份证号的替代 |
| | | |
| | | // 根据status字段显示状态 |
| | | val statusText = when (info.state) { |
| | | 1 -> "正常" |
| | | 2 -> "挂失" |
| | | 3 -> "锁定" |
| | | else -> "未知" |
| | | // 根据state字段显示状态 |
| | | val (statusText, statusColor) = when (info.state) { |
| | | 1 -> Pair("正常", 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) |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.dayu.general.activity |
| | | |
| | | import android.content.Context |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import com.dayu.baselibrary.net.subscribers.SubscriberListener |
| | | import com.dayu.baselibrary.utils.MornyUtil |
| | | import com.dayu.baselibrary.utils.ToastUtil |
| | | import com.dayu.baselibrary.view.TipDialog |
| | | import com.dayu.baselibrary.view.TitleBar |
| | | import com.dayu.general.BaseApplication |
| | | import com.dayu.general.bean.card.UserCard |
| | | import com.dayu.general.bean.net.CardInfoResult |
| | | import com.dayu.general.bean.net.CardReturnResult |
| | | import com.dayu.general.databinding.ActivityCardReturnBinding |
| | | import com.dayu.general.net.ApiManager |
| | | import com.dayu.general.net.BaseResponse |
| | | import com.dayu.general.tool.CardCommon |
| | | import com.dayu.general.tool.CardOperationType |
| | | import com.dayu.general.tool.NfcReadHelper |
| | | |
| | | /** |
| | | * @author: zuo |
| | | * @desc: 返还Activity |
| | | * @since: 2025/6/17 |
| | | */ |
| | | class CardReturnActivity : BaseNfcActivity() { |
| | | private lateinit var binding: ActivityCardReturnBinding |
| | | private var cardNumber: String? = null |
| | | private var cardInfo: CardInfoResult? = null |
| | | private var userCard: UserCard? = null |
| | | |
| | | companion object { |
| | | /** |
| | | * 启动返还Activity |
| | | */ |
| | | fun start(context: Context) { |
| | | val intent = Intent(context, CardReturnActivity::class.java) |
| | | context.startActivity(intent) |
| | | } |
| | | } |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | binding = ActivityCardReturnBinding.inflate(layoutInflater) |
| | | setContentView(binding.root) |
| | | |
| | | initView() |
| | | } |
| | | |
| | | private fun initView() { |
| | | // 设置TitleBar的返回按钮点击事件 |
| | | binding.titleBar.setOnItemclickListner(TitleBar.ClickType_LEFT_IMAGE) { |
| | | finish() |
| | | } |
| | | |
| | | // 设置返还按钮点击事件 |
| | | binding.btnReturn.setOnClickListener { |
| | | performCardReturn() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 重置到读卡状态 |
| | | */ |
| | | private fun resetToReadingState() { |
| | | binding.scrollReadCard.visibility = android.view.View.VISIBLE |
| | | binding.cardInfoContainer.visibility = android.view.View.GONE |
| | | binding.bottomButtonContainer.visibility = android.view.View.GONE |
| | | cardNumber = null |
| | | cardInfo = null |
| | | binding.etReturnAmount.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 { |
| | | // 检查intent中是否包含NFC 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 -> { |
| | | // 用户卡:解析卡内数据并调用接口 |
| | | handleUserCard(cardNumber, cardType, nfcAdapter) |
| | | } |
| | | |
| | | else -> { |
| | | // 管理类卡不支持返还 |
| | | showConfirmDialog("该卡片类型不支持返还操作") { |
| | | resetToReadingState() |
| | | } |
| | | } |
| | | } |
| | | } catch (e: Exception) { |
| | | showConfirmDialog("读卡异常:${e.message}") { |
| | | } |
| | | e.printStackTrace() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理用户卡 |
| | | */ |
| | | private fun handleUserCard(cardNumber: String, cardType: String, nfcAdapter: NfcReadHelper) { |
| | | // 解析用户卡数据 |
| | | val userCard = nfcAdapter.getUserCardData() |
| | | if (userCard == null) { |
| | | showConfirmDialog("解析卡片数据失败,请重新刷卡") { |
| | | } |
| | | return |
| | | } |
| | | |
| | | // 输出用户卡内所有信息到日志 |
| | | android.util.Log.d("CardReturnActivity", "=== 用户卡信息 ===") |
| | | android.util.Log.d("CardReturnActivity", "卡号: $cardNumber") |
| | | android.util.Log.d("CardReturnActivity", "卡片类型: $cardType") |
| | | android.util.Log.d("CardReturnActivity", "卡内余额: ${userCard.balance}") |
| | | android.util.Log.d("CardReturnActivity", "==================") |
| | | 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 |
| | | binding.tvCardNumber.text = cardNumber |
| | | |
| | | userCard.let { card -> |
| | | // 余额转换为元(原始数据可能是分) |
| | | binding.tvCardBalance.text = MornyUtil.changeF2Y(card.balance) + "元" |
| | | } |
| | | |
| | | // 显示服务器数据 |
| | | cardInfo?.let { info -> |
| | | binding.tvUserName.text = info.userName ?: "未知" |
| | | binding.tvPhone.text = info.phone ?: "未绑定" |
| | | |
| | | // 根据state字段显示状态 |
| | | val (statusText, statusColor) = when (info.state) { |
| | | 1 -> Pair("正常", 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) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理卡信息获取错误 |
| | | */ |
| | | 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 performCardReturn() { |
| | | // 验证输入 |
| | | val returnAmountStr = binding.etReturnAmount.text.toString().trim() |
| | | val remarks = binding.etRemarks.text.toString().trim() |
| | | |
| | | // 返还金额验证(必填) |
| | | if (returnAmountStr.isEmpty()) { |
| | | ToastUtil.show("请输入返还金额") |
| | | return |
| | | } |
| | | |
| | | val returnAmount = try { |
| | | val amount = returnAmountStr.toDouble() |
| | | if (amount <= 0) { |
| | | ToastUtil.show("返还金额必须大于0") |
| | | return |
| | | } |
| | | amount |
| | | } catch (e: NumberFormatException) { |
| | | ToastUtil.show("请输入有效的返还金额") |
| | | return |
| | | } |
| | | |
| | | // 备注处理(非必填) |
| | | val finalRemarks = if (remarks.isEmpty()) { |
| | | "返还" // 如果未输入备注,使用默认值 |
| | | } else { |
| | | remarks |
| | | } |
| | | |
| | | callReturnCardApi(returnAmount, finalRemarks) |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 调用返还API接口 |
| | | */ |
| | | private fun callReturnCardApi(returnAmount: Double, finalRemarks: String) { |
| | | if (cardNumber.isNullOrBlank()) { |
| | | ToastUtil.show("卡号信息异常,请重新刷卡") |
| | | return |
| | | } |
| | | |
| | | // 获取当前卡内余额(以分为单位) |
| | | val currentBalance = userCard?.balance?.let { MornyUtil.changeF2Y(it) } ?: 0 |
| | | |
| | | val map = mutableMapOf<String, Any>() |
| | | map["cardNum"] = cardInfo?.cardNum.toString() |
| | | map["supplementMoney"] = returnAmount.toString() |
| | | map["balance"] = currentBalance.toString() |
| | | map["remarks"] = finalRemarks |
| | | map["operator"] = BaseApplication.userId |
| | | |
| | | ApiManager.getInstance().requestPostLoading( |
| | | this, |
| | | "terminal/card/supplement", |
| | | CardReturnResult::class.java, |
| | | map, |
| | | object : SubscriberListener<BaseResponse<CardReturnResult>>() { |
| | | override fun onNext(t: BaseResponse<CardReturnResult>) { |
| | | if (t.success && t.content != null) { |
| | | // 返还成功,跳转到写卡界面 |
| | | startWriteCardActivity(t.content!!, returnAmount, userCard!!) |
| | | } else { |
| | | // 返还失败 |
| | | val errorMsg = if (t.msg.isNullOrBlank()) "返还失败,请重试" else t.msg |
| | | showConfirmDialog("返还失败:$errorMsg") { |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onError(e: Throwable?) { |
| | | super.onError(e) |
| | | showConfirmDialog("返还请求失败: ${e?.message ?: "网络异常,请检查网络连接"}") { |
| | | } |
| | | } |
| | | } |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 跳转到写卡界面进行卡内容更新 |
| | | */ |
| | | private fun startWriteCardActivity( |
| | | returnResult: CardReturnResult, |
| | | returnAmount: Double, |
| | | userCard: UserCard |
| | | ) { |
| | | // 创建更新后的用户卡数据 |
| | | val updatedUserCard = UserCard().apply { |
| | | // 复制原有属性 |
| | | cardType = userCard.cardType |
| | | areaNumber = userCard.areaNumber |
| | | userCode = userCard.userCode |
| | | userCodeNumber = userCard.userCodeNumber |
| | | phoneNumber = userCard.phoneNumber |
| | | projectCode = userCard.projectCode |
| | | surplusWater = userCard.surplusWater |
| | | waterPrice = userCard.waterPrice |
| | | electricPrice = userCard.electricPrice |
| | | rechargeDate = userCard.rechargeDate |
| | | |
| | | // 使用返回的新余额 |
| | | balance = MornyUtil.changeY2F(returnResult.balance.toString()) |
| | | } |
| | | |
| | | val intent = Intent(this, NfcWreatActivity::class.java).apply { |
| | | putExtra("cardAddr", cardNumber) |
| | | putExtra("operationTypeCode", CardOperationType.ReturnCard.code) // 使用返还类型进行写卡 |
| | | putExtra("orderNumber", returnResult.orderNo) |
| | | putExtra("returnAmount", returnAmount) |
| | | putExtra("userCard", updatedUserCard as java.io.Serializable) |
| | | } |
| | | startActivity(intent) |
| | | finish() |
| | | } |
| | | } |
| | |
| | | package com.dayu.general.activity |
| | | |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import com.dayu.general.databinding.ActivityCardWriteSuccessBinding |
| | | import com.dayu.general.tool.CardOperationType |
| | | |
| | | /** |
| | | * @author: zuo |
| | |
| | | |
| | | private lateinit var binding: ActivityCardWriteSuccessBinding |
| | | private var cardNumber: String? = null |
| | | private var operationTypeCode: Int = -1 |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | binding = ActivityCardWriteSuccessBinding.inflate(layoutInflater) |
| | | setContentView(binding.root) |
| | | |
| | | // 获取传入的卡号 |
| | | // 获取传入的卡号和操作类型 |
| | | cardNumber = intent.getStringExtra("cardNumber") |
| | | operationTypeCode = intent.getIntExtra("operationTypeCode", -1) |
| | | |
| | | initView() |
| | | } |
| | | |
| | | private fun initView() { |
| | | // 设置标题 |
| | | binding.titleBar.setCenterText("销卡成功") |
| | | val operationType = CardOperationType.fromCode(operationTypeCode) |
| | | |
| | | // 设置成功信息 |
| | | binding.successTitle.text = "销卡成功" |
| | | |
| | | // 设置详细信息 |
| | | val message = if (cardNumber.isNullOrBlank()) { |
| | | "卡片已成功销卡并清除内容\n该卡片将无法再次使用" |
| | | } else { |
| | | "卡片已成功销卡并清除内容\n卡号:$cardNumber\n该卡片将无法再次使用" |
| | | // 根据操作类型设置不同的标题和信息 |
| | | when (operationType) { |
| | | CardOperationType.CancelCard -> { |
| | | // 设置标题 |
| | | binding.titleBar.setCenterText("销卡成功") |
| | | |
| | | // 设置成功信息 |
| | | binding.successTitle.text = "销卡成功" |
| | | |
| | | // 设置详细信息 |
| | | val message = if (cardNumber.isNullOrBlank()) { |
| | | "卡片已成功销卡并清除内容\n该卡片将无法再次使用" |
| | | } else { |
| | | "卡片已成功销卡并清除内容\n卡号:$cardNumber\n该卡片将无法再次使用" |
| | | } |
| | | binding.successMessage.text = message |
| | | } |
| | | |
| | | CardOperationType.ReturnCard -> { |
| | | // 设置标题 |
| | | binding.titleBar.setCenterText("返还成功") |
| | | |
| | | // 设置成功信息 |
| | | binding.successTitle.text = "返还成功" |
| | | |
| | | // 设置详细信息 |
| | | val message = if (cardNumber.isNullOrBlank()) { |
| | | "卡片返还操作已成功完成\n卡内余额已更新" |
| | | } else { |
| | | "卡片返还操作已成功完成\n卡号:$cardNumber\n卡内余额已更新" |
| | | } |
| | | binding.successMessage.text = message |
| | | } |
| | | |
| | | else -> { |
| | | // 默认显示写卡成功 |
| | | binding.titleBar.setCenterText("写卡成功") |
| | | binding.successTitle.text = "写卡成功" |
| | | |
| | | val message = if (cardNumber.isNullOrBlank()) { |
| | | "卡片操作已成功完成" |
| | | } else { |
| | | "卡片操作已成功完成\n卡号:$cardNumber" |
| | | } |
| | | binding.successMessage.text = message |
| | | } |
| | | } |
| | | binding.successMessage.text = message |
| | | |
| | | // 设置点击确定按钮后关闭页面 |
| | | binding.btnConfirm.setOnClickListener { |
| | |
| | | import com.dayu.baselibrary.utils.ToastUtil |
| | | import com.dayu.general.bean.card.ClearCard |
| | | import com.dayu.general.bean.card.UserCard |
| | | import com.dayu.general.tool.CardCommon |
| | | import com.dayu.general.tool.CardOperationType |
| | | import com.dayu.general.dao.BaseDaoSingleton |
| | | import com.dayu.general.databinding.ActivityNfcWriteGeBinding |
| | | import com.dayu.general.net.ApiManager |
| | | import com.dayu.general.net.BaseResponse |
| | | import com.dayu.general.tool.CardOperationType |
| | | import com.dayu.general.tool.NfcReadHelper |
| | | import com.dayu.general.tool.NfcWreatHelper |
| | | import com.dayu.general.dao.BaseDaoSingleton |
| | | import com.tencent.bugly.crashreport.CrashReport |
| | | import kotlinx.coroutines.launch |
| | | import java.lang.StringBuilder |
| | | |
| | | /** |
| | | * @author: zuo |
| | |
| | | // 销卡相关信息 |
| | | private var refundAmount = 0.0 |
| | | private var cardBalance = 0.0 |
| | | |
| | | // 返还相关信息 |
| | | private var returnAmount = 0.0 |
| | | |
| | | //订单编号 |
| | | var orderNumber = "" |
| | |
| | | // 获取销卡相关信息 |
| | | refundAmount = intent?.getDoubleExtra("refundAmount", 0.0) ?: 0.0 |
| | | cardBalance = intent?.getDoubleExtra("cardBalance", 0.0) ?: 0.0 |
| | | |
| | | // 获取返还相关信息 |
| | | returnAmount = intent?.getDoubleExtra("returnAmount", 0.0) ?: 0.0 |
| | | |
| | | if (intent?.hasExtra("cardFee") == true) { |
| | | cardFee = intent?.getIntExtra("cardFee", 0) ?: 0 |
| | |
| | | binding?.cardData?.text = textData.toString() |
| | | } |
| | | |
| | | CardOperationType.ReturnCard -> { |
| | | var textData = StringBuilder() |
| | | textData.append("返还\n") |
| | | textData.append("卡内余额:" + MornyUtil.changeF2Y(userCard.balance) + "元\n") |
| | | textData.append("返还金额:" + returnAmount + "元") |
| | | binding?.cardData?.text = textData.toString() |
| | | } |
| | | |
| | | CardOperationType.CheckCard -> TODO() |
| | | CardOperationType.DeductCard -> TODO() |
| | | CardOperationType.ReplaceCard -> TODO() |
| | |
| | | }) |
| | | } |
| | | |
| | | CardOperationType.ReturnCard -> { |
| | | nfcWreatHelper.writeUserDataAsync(userCard, object : NFCCallBack { |
| | | override fun isSusses(flag: Boolean, msg: String?) { |
| | | // 确保Toast在主线程中调用 |
| | | runOnUiThread { |
| | | if (flag) { |
| | | postCardData(cardAddr) |
| | | } else { |
| | | ToastUtil.show("返还写卡失败: ${msg ?: "未知错误"}") |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | CardOperationType.CheckCard -> TODO() |
| | | CardOperationType.DeductCard -> TODO() |
| | | CardOperationType.ReplaceCard -> TODO() |
| | |
| | | finish() |
| | | Intent(this@NfcWreatActivity, CardWriteSuccessActivity::class.java).apply { |
| | | putExtra("cardNumber", cardNumber) |
| | | putExtra("operationTypeCode", operationTypeCode) |
| | | startActivity(this) |
| | | } |
| | | } |
| | |
| | | object DeductCard : CardOperationType(5, "补扣") |
| | | object CleanCard : CardOperationType(6, "清零卡") |
| | | object CheckCard : CardOperationType(7, "检查卡") |
| | | object ReturnCard : CardOperationType(8, "返还") |
| | | |
| | | companion object { |
| | | fun fromCode(code: Int): CardOperationType? { |
| | |
| | | 5 -> DeductCard |
| | | 6 -> CleanCard |
| | | 7 -> CheckCard |
| | | 8 -> ReturnCard |
| | | else -> null |
| | | } |
| | | } |
New file |
| | |
| | | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:width="200dp" |
| | | android:height="200dp" |
| | | android:viewportWidth="1024" |
| | | android:viewportHeight="1024"> |
| | | <path |
| | | android:pathData="M860.7,81.9L163.3,81.9c-39.4,0 -69.6,30.2 -69.6,69.6v720.9c0,39.4 30.2,69.6 69.6,69.6h697.3c39.4,0 69.6,-30.2 69.6,-69.6L930.3,151.6c0,-39.4 -30.2,-69.6 -69.6,-69.6zM711.7,837.6l-4.6,4.6 -9.2,7.2c-9.2,0 -16.4,-4.6 -21,-13.8 -74.2,-120.8 -188.4,-104.4 -232.4,-102.4v72.2c0,32.8 -21,34.8 -27.6,34.8 -11.8,0 -21,-7.2 -25.6,-11.8l-153.6,-160.3c-2.6,-2.6 -18.4,-16.4 -18.4,-34.8 0,-16.4 13.8,-32.8 16.4,-34.8l151,-151 4.6,-2.6c16.4,-7.2 30.2,-4.6 37.4,4.6 7.2,7.2 7.2,16.4 7.2,21l2.6,90.6c269.8,11.8 279,214 281.1,260.6 -0.5,1.5 -0.5,11.3 -7.7,15.9zM802.8,246.8l-76.8,116.2h65c7.2,4.6 9.2,11.8 9.2,21 0,9.2 -2.6,13.8 -9.2,21h-81.4v32.8h81.4c7.2,4.6 9.2,11.8 9.2,21 0,9.2 -2.6,13.8 -9.2,21h-81.4L709.6,563.2c2.6,23 -9.2,37.4 -30.2,37.4 -21,0 -32.8,-11.8 -32.8,-37.4L646.7,479.2h-81.4c-9.2,-4.6 -11.8,-11.8 -11.8,-21s4.6,-16.4 11.8,-21h81.4L646.7,404.5h-81.4c-7.2,-4.6 -11.8,-11.8 -11.8,-21s4.6,-13.8 11.8,-21h63l-76.8,-116.2c-7.2,-13.8 -2.6,-25.6 13.8,-34.8 13.8,-9.2 27.6,-4.6 37.4,9.2l74.2,116.2 76.8,-116.2c9.2,-13.8 21,-18.4 34.8,-11.8 14.3,7.7 18.9,19.5 14.3,37.9z" |
| | | android:fillColor="#009ad6"/> |
| | | </vector> |
New file |
| | |
| | | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:width="220dp" |
| | | android:height="180dp" |
| | | android:viewportWidth="1024" |
| | | android:viewportHeight="1024"> |
| | | <path |
| | | android:pathData="M725.3,501.3c65.9,0 127.8,26.2 173.5,71.9A244.6,244.6 0,0 1,970.7 746.7a244.6,244.6 0,0 1,-71.9 173.5A244.6,244.6 0,0 1,725.3 992a244.6,244.6 0,0 1,-173.5 -71.9A244.6,244.6 0,0 1,480 746.7c0,-65.9 26.2,-127.8 71.9,-173.5A244.6,244.6 0,0 1,725.3 501.3zM768,53.3A117.3,117.3 0,0 1,885.3 170.7l0,311.2a308.1,308.1 0,0 0,-146.9 -44.3L725.3,437.3c-11.6,0 -23.2,0.6 -34.6,1.9A32,32 0,0 0,661.3 394.7h-298.7a32,32 0,0 0,0 64h249.5a309.2,309.2 0,0 0,-105.6 69.2A308.4,308.4 0,0 0,416 746.7a308.4,308.4 0,0 0,96.1 224.1L256,970.7A117.3,117.3 0,0 1,138.7 853.3L138.7,170.7A117.3,117.3 0,0 1,256 53.3h512zM784.8,633.6L741.1,633.6a10.1,10.1 0,0 0,-6 1.6,5.1 5.1,0 0,0 -2.2,4.4c0,1.7 0.6,3.5 1.9,5.3l2.6,4.1a16.1,16.1 0,0 1,2.1 7.6v194c0,2.9 0.9,5.2 2.6,6.9a9.4,9.4 0,0 0,6.9 2.6h35.8a9.4,9.4 0,0 0,6.9 -2.6,9.4 9.4,0 0,0 2.6,-6.9v-98.4c0,-0.9 0.3,-1.5 1.1,-1.9a5.3,5.3 0,0 1,2.7 -0.6c1.7,0 2.6,0.6 2.8,1.9l10.7,52.5c1.3,5.7 4.7,8.5 10.1,8.5h23.3c5.7,0 8.5,-2.6 8.5,-7.6a9.6,9.6 0,0 0,-0.3 -2.8l-18.9,-94.7c-0.9,-5.6 -4.2,-8.5 -10.1,-8.5h-23.6c-4.2,0 -6.3,-2.1 -6.3,-6.3L794.2,643a9.4,9.4 0,0 0,-2.5 -6.9,9.4 9.4,0 0,0 -6.9,-2.5zM696.7,671.4h-88.7a9.4,9.4 0,0 0,-7 2.5,9.4 9.4,0 0,0 -2.5,7v10.7c0,3 0.9,5.2 2.6,6.9a9.4,9.4 0,0 0,6.9 2.6h34.3c1.7,0 3,0.3 3.9,1.1a3.3,3.3 0,0 1,1.4 2.7c0,1 -0.5,2.3 -1.5,3.8l-46.3,63.9c-1.7,2.3 -2.5,4.3 -2.5,6 0,1.7 0.7,3 2.2,4.1a10.1,10.1 0,0 0,6 1.6h15.1c4.2,0 6.3,2.1 6.3,6.3v60.1c0,2.9 0.9,5.2 2.5,6.9a9.4,9.4 0,0 0,6.9 2.5h34.9a9.4,9.4 0,0 0,6.9 -2.6,9.4 9.4,0 0,0 2.6,-6.9v-41.2c0,-1.7 0.3,-3 1.1,-3.9a3.3,3.3 0,0 1,2.7 -1.4c1.3,0 2.6,0.6 4.1,1.9l9.4,8.8c2.1,2.1 4.2,3.2 6.3,3.2 1.7,0 3,-0.7 3.9,-2.2a11,11 0,0 0,1.4 -6v-17a14.2,14.2 0,0 0,-4.7 -11.3c-1.3,-1.3 -1.9,-2.4 -1.9,-3.5 0,-1.7 0.9,-3.2 2.8,-4.4a12.1,12.1 0,0 0,5.7 -10.7v-18.6a10.1,10.1 0,0 0,-1.6 -6,5.1 5.1,0 0,0 -4.4,-2.2 9.7,9.7 0,0 0,-5.4 1.9l-11.3,7.3a13,13 0,0 1,-6.9 2.8c-0.6,0 -0.9,-0.3 -0.9,-0.9 0,-2.1 0.9,-4.3 2.5,-6.6l18.9,-25.8a21.2,21.2 0,0 0,3.8 -11.9v-21.7a9.4,9.4 0,0 0,-2.5 -7,9.4 9.4,0 0,0 -6.9,-2.5zM666.2,634.2h-28a16.5,16.5 0,0 0,-7.7 1.6c-2,1 -3,2.2 -3,3.4 0,0.9 0.4,1.9 1.3,3 0.8,1.2 1.4,2.2 1.8,3l6.6,13.9c2.1,4.6 5.9,6.9 11.3,6.9h27.7c2.7,0 4.7,-0.6 6.1,-1.7a5.7,5.7 0,0 0,2 -4.6,11.9 11.9,0 0,0 -0.9,-4.7l-6.3,-13.6a11.1,11.1 0,0 0,-11 -7.3zM426.7,522.7L362.7,522.7a32,32 0,1 0,0 64L426.7,586.7a32,32 0,1 0,0 -64zM416,117.3h-64L352,128A117.3,117.3 0,0 0,469.3 245.3h85.3A117.3,117.3 0,0 0,672 128v-10.7h-64L608,128c0,29.4 -23.9,53.3 -53.3,53.3h-85.3l-5.5,-0.3A53.3,53.3 0,0 1,416 128v-10.7z" |
| | | android:fillColor="#009ad6"/> |
| | | </vector> |
New file |
| | |
| | | <?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:id="@+id/scroll_read_card" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@+id/titleBar" |
| | | android:fillViewport="true" |
| | | android:visibility="visible"> |
| | | |
| | | <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"> |
| | | |
| | | <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" |
| | | 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"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:padding="12dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="8dp" |
| | | android:gravity="" |
| | | android:text="卡片信息" |
| | | android:textColor="@color/base_blue_bg" |
| | | android:textSize="16sp" |
| | | 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="8dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="80dp" |
| | | android:layout_height="wrap_content" |
| | | android:text="持卡人:" |
| | | android:textColor="#333333" |
| | | android:textSize="14sp" /> |
| | | |
| | | <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="14sp" /> |
| | | </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="8dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="80dp" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡地址:" |
| | | android:textColor="#333333" |
| | | android:textSize="14sp" /> |
| | | |
| | | <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="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" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_card_status" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="正常" |
| | | android:textColor="#4CAF50" |
| | | android:textSize="14sp" /> |
| | | </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="8dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="80dp" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡内余额:" |
| | | android:textColor="#333333" |
| | | android:textSize="14sp" /> |
| | | |
| | | <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 |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | 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" /> |
| | | |
| | | <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="14sp" /> |
| | | </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="12dp"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="12dp" |
| | | android:gravity="" |
| | | android:text="返还操作" |
| | | android:textColor="@color/base_blue_bg" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <!-- 返还金额和备注并排显示 --> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <!-- 返还金额输入 --> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="6dp" |
| | | android:layout_weight="1" |
| | | 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="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="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:layout_weight="1" |
| | | 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_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 |
| | | 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_return" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="48dp" |
| | | android:background="@drawable/button_green_bg" |
| | | android:text="确认返还" |
| | | android:textColor="#FFFFFF" |
| | | android:textSize="@dimen/big_text_size" |
| | | android:textStyle="bold" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | |
| | | <ImageView |
| | | android:layout_width="55dp" |
| | | android:layout_height="55dp" |
| | | android:src="@drawable/xiaoka" /> |
| | | android:src="@drawable/ic_morny_back" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="6dp" |
| | | android:gravity="center" |
| | | android:text="销卡" |
| | | android:text="返还" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="14sp" /> |
| | | </LinearLayout> |
| | |
| | | android:padding="12dp"> |
| | | |
| | | <ImageView |
| | | android:layout_width="55dp" |
| | | android:layout_width="65dp" |
| | | android:layout_height="55dp" |
| | | android:src="@drawable/bukou" /> |
| | | android:src="@drawable/ic_supplement" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | </LinearLayout> |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/home_cancel_card" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginTop="16dp" |
| | | android:layout_marginEnd="6dp" |
| | | android:clickable="true" |
| | | android:focusable="true" |
| | | android:foreground="?android:attr/selectableItemBackground" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="3dp" |
| | | app:layout_constraintEnd_toStartOf="@+id/home_manage" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/home_reverse"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | android:padding="12dp"> |
| | | |
| | | <ImageView |
| | | android:layout_width="55dp" |
| | | android:layout_height="55dp" |
| | | android:src="@drawable/xiaoka" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="6dp" |
| | | android:gravity="center" |
| | | android:text="销卡" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="14sp" /> |
| | | </LinearLayout> |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/home_manage" |
| | | android:layout_width="match_parent" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginTop="16dp" |
| | |
| | | app:cardElevation="3dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | |
| | | app:layout_constraintStart_toEndOf="@+id/home_cancel_card" |
| | | app:layout_constraintTop_toBottomOf="@+id/home_deduction" |
| | | app:layout_constraintVertical_bias="0.0"> |
| | | |