Commit c9286519 authored by zhaopengxiang's avatar zhaopengxiang

匡威新需求Ui验收完成

parent 8110e192
package com.miya.fastcashier.config
interface IntentExtra {
companion object {
const val KEY_EXTRA_DATA = "extra_data"
const val KEY_EXTRA_TYPE = "extra_type"
}
}
\ No newline at end of file
......@@ -48,9 +48,7 @@ class MainActivity : BaseActivity() {
tvSlog.text = AccountService.getUserName()
llPay.clickWithTrigger {
val intent = Intent()
intent.setClass(this@MainActivity, PriceInputActivity::class.java)
startActivity(intent)
PriceInputActivity.start(this@MainActivity)
}
llRefund.clickWithTrigger {
val intent = Intent()
......@@ -101,7 +99,6 @@ class MainActivity : BaseActivity() {
}
}
initData()
}
......
......@@ -3,16 +3,27 @@ package com.miya.fastcashier.ui
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.widget.Toast
import androidx.lifecycle.ViewModelProvider
import com.miya.fastcashier.R
import com.miya.fastcashier.config.IntentExtra
import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.ui.dialog.MessageDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog.GeneratePayCodeClickListener
import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.WordUtil
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.fastcashier.widget.DecimalKeyboard.DELETE
import com.miya.fastcashier.widget.DecimalKeyboard.DOT
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import java.math.BigDecimal
......@@ -20,8 +31,25 @@ class PriceInputActivity : BaseActivity() {
private lateinit var viewModel: PayViewModel
private lateinit var binding: ActivityPriceInputBinding
private var payChooseDialog: PayChooseDialog? = null;
private var payChooseDialog: PayChooseDialog? = null
private var alertDialog: CommonDialog? = null
private lateinit var payServiceResponse: PayServiceResponse
companion object {
const val PRICEINPUT_TYPE_COLLECTION = 1
const val PRICEINPUT_TYPE_CREFUND = 2
fun start(context: BaseActivity) {
start(context, PRICEINPUT_TYPE_COLLECTION, null)
}
fun start(context: BaseActivity, type: Int, payServiceResponse: PayServiceResponse?) {
val intent = Intent(context, PriceInputActivity::class.java)
intent.putExtra(IntentExtra.KEY_EXTRA_DATA, payServiceResponse)
intent.putExtra(IntentExtra.KEY_EXTRA_TYPE, type)
context.startActivity(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -30,17 +58,44 @@ class PriceInputActivity : BaseActivity() {
setContentView(binding.root)
viewModel = ViewModelProvider(this).get(PayViewModel::class.java)
val tvGeneratePayCode = binding.tvGeneratePayCode
val tvScanPayCode = binding.tvScanPayCode
val llBack = binding.llBack
val etPrice = binding.etPrice
val numKeyboard = binding.numKeyboard
initView()
initListener()
}
private fun initView() {
val type = intent.getIntExtra(IntentExtra.KEY_EXTRA_TYPE, PRICEINPUT_TYPE_COLLECTION)
when (type) {
PRICEINPUT_TYPE_COLLECTION -> {
binding.tvTitle.text = "收款"
binding.tvPriceText.text = "收款金额"
binding.etPrice.setHint("输入收款金额")
binding.tvRefundPriceTotal.visibility = View.GONE
binding.tvScanPayCode.visibility = View.VISIBLE
binding.tvGeneratePayCode.visibility = View.VISIBLE
binding.tvRefund.visibility = View.GONE
}
PRICEINPUT_TYPE_CREFUND -> {
binding.tvTitle.text = "退款"
binding.tvPriceText.text = "订单金额"
binding.etPrice.setHint("输入退款金额")
binding.tvRefundPriceTotal.visibility = View.VISIBLE
this.payServiceResponse =
intent.getSerializableExtra(IntentExtra.KEY_EXTRA_DATA) as PayServiceResponse
binding.tvRefundPriceTotal.text =
"¥${StringPriceFormat.transStringPriceToDecimalString(payServiceResponse.tradPrice)}"
binding.tvScanPayCode.visibility = View.GONE
binding.tvGeneratePayCode.visibility = View.GONE
binding.tvRefund.visibility = View.VISIBLE
}
}
}
tvScanPayCode.clickWithTrigger {
private fun initListener() {
binding.tvScanPayCode.clickWithTrigger {
val price = etPrice.text
if(TextUtils.isEmpty(price)){
CenterToasty.error(this,"请输入金额!",Toast.LENGTH_LONG).show()
val price = binding.etPrice.text
if (TextUtils.isEmpty(price)) {
CenterToasty.error(this, "请输入金额!", Toast.LENGTH_LONG).show()
return@clickWithTrigger
}
......@@ -48,59 +103,64 @@ class PriceInputActivity : BaseActivity() {
intent.setClass(this@PriceInputActivity, PayActivity::class.java)
intent.putExtra("price", price)
startActivity(intent)
}
tvGeneratePayCode.clickWithTrigger {
binding.tvGeneratePayCode.clickWithTrigger {
if (null == payChooseDialog) {
payChooseDialog = PayChooseDialog(this)
payChooseDialog!!.setGeneratePayCodeClickListener(object :
GeneratePayCodeClickListener {
override fun choose(payType: String) {
showProgressDialog("生成付款码")
viewModel.generatePayCode(etPrice.text.toString(),payType)
viewModel.generatePayCode(binding.etPrice.text.toString(), payType)
}
})
}
payChooseDialog!!.show()
}
llBack.clickWithTrigger { finish() }
binding.llBack.clickWithTrigger { finish() }
numKeyboard.setKeyboardClickListener {
binding.numKeyboard.setKeyboardClickListener {
when (it) {
DELETE -> {
if (TextUtils.isEmpty(etPrice.text.toString())) {
if (TextUtils.isEmpty(binding.etPrice.text.toString())) {
return@setKeyboardClickListener
}
var currentCode: String = etPrice.text.toString()
var currentCode: String = binding.etPrice.text.toString()
currentCode = if (currentCode.length <= 1) {
""
} else {
currentCode.substring(0, currentCode.length - 1)
}
etPrice.setText(currentCode)
binding.etPrice.setText(currentCode)
if (binding.tvInvalidRefundPrice.visibility == View.VISIBLE) {
binding.tvInvalidRefundPrice.visibility = View.GONE
}
}
DOT -> {
var currentCode: String = etPrice.text.toString()
var currentCode: String = binding.etPrice.text.toString()
if (!currentCode.contains(".") && !TextUtils.isEmpty(currentCode)) {
currentCode += "."
etPrice.setText(currentCode)
binding.etPrice.setText(currentCode)
} else {
CenterToasty.error(this, "金额格式有误!", Toast.LENGTH_SHORT).show()
}
}
else -> {
var currentCode: String = etPrice.text.toString()
var currentCode: String = binding.etPrice.text.toString()
if (currentCode.contains(".")) {
val tmp =
currentCode.substring(currentCode.indexOf("."), currentCode.length - 1)
currentCode.substring(
currentCode.indexOf("."),
currentCode.length - 1
)
if (tmp.length < 2) {
if (BigDecimal(currentCode + it).compareTo(BigDecimal.ZERO) == 0 && tmp.length == 1) {
CenterToasty.error(this, "金额不能为0!", Toast.LENGTH_SHORT).show()
} else {
currentCode += it
etPrice.text = currentCode
binding.etPrice.text = currentCode
}
} else {
CenterToasty.error(this, "金额最多设置2位小数!", Toast.LENGTH_SHORT).show()
......@@ -110,10 +170,11 @@ class PriceInputActivity : BaseActivity() {
CenterToasty.error(this, "第二位不能输入0!", Toast.LENGTH_SHORT).show()
} else {
if (BigDecimal(currentCode + it).compareTo(BigDecimal("99999")) == 1) {
CenterToasty.error(this, "金额不能超过99999!", Toast.LENGTH_SHORT).show()
CenterToasty.error(this, "金额不能超过99999!", Toast.LENGTH_SHORT)
.show()
} else {
currentCode += it
etPrice.text = currentCode
binding.etPrice.text = currentCode
}
}
}
......@@ -125,16 +186,18 @@ class PriceInputActivity : BaseActivity() {
dismissProgressDialog()
result.getOrElse {
it.message?.let { it1 -> CenterToasty.error(this, it1, Toast.LENGTH_LONG).show() }
it.message?.let { it1 ->
CenterToasty.error(this, it1, Toast.LENGTH_LONG).show()
}
return@observe
}
result.getOrNull().also {
it?.let { it1 ->
val intent = Intent()
if ("1" == it1.chanelTag){
if ("1" == it1.chanelTag) {
intent.setClass(this@PriceInputActivity, WxPayCodeActivity::class.java)
}else{
} else {
intent.setClass(this@PriceInputActivity, AliPayCodeActivity::class.java)
}
intent.putExtra("payServiceResponse", it1)
......@@ -142,10 +205,80 @@ class PriceInputActivity : BaseActivity() {
}
}
})
viewModel.refundLiveData.observe(this, { payResult ->
payResult.onFailure {
dismissProgressDialog()
it.message?.let { it1 ->
CenterToasty.error(this, it1, Toast.LENGTH_LONG).show()
}
}
payResult.onSuccess {
dismissProgressDialog()
CenterToasty.success(this, "退款成功!!", Toast.LENGTH_LONG).show()
finish()
}
})
binding.tvRefund.clickWithTrigger {
val price = binding.etPrice.text.toString()
if (TextUtils.isEmpty(price)) {
CenterToasty.error(this, "退款金额不能为空!", Toast.LENGTH_SHORT).show()
return@clickWithTrigger
}
val priceYuan2Fen = StringPriceFormat.transStringYuan2Fen(price)
if (priceYuan2Fen.toDouble() > payServiceResponse.tradPrice.toDouble()) {
binding.tvInvalidRefundPrice.visibility = View.VISIBLE
return@clickWithTrigger
}
doubleRefundConfirm(price)
}
}
/**
* 二次退款确认
*/
private fun doubleRefundConfirm(refundPrice: String) {
var content: String = getString(R.string.text_refund_amount, refundPrice)
if (null == alertDialog) {
alertDialog = CommonDialog(this)
}
alertDialog!!.setCustomMessage(
WordUtil.matcherDiscolor(
this,
R.color.color_D83773, content,
"¥$refundPrice"
)
)
.setNegativeStr(getString(R.string.cancel))
.setPositiveStr("确认退款")
.setOnClickListener(object : CommonDialog.OnDialogClickListener {
override fun onNegativeClick() {
alertDialog!!.dismiss()
alertDialog = null
}
override fun onPositiveClick() {
alertDialog!!.dismiss()
alertDialog = null
run {
showProgressDialog("退款中")
viewModel.refund(
payServiceResponse,
StringPriceFormat.transStringYuan2Fen(refundPrice)
)
}
}
})
.show()
}
override fun onStop() {
super.onStop()
payChooseDialog?.dismiss()
alertDialog?.dismiss()
}
}
\ No newline at end of file
......@@ -8,21 +8,17 @@ import com.miya.fastcashier.databinding.ActivityRefundBinding
import com.miya.fastcashier.ui.dialog.MessageDialog
import com.miya.fastcashier.ui.dialog.NumberManualDialog
import com.miya.fastcashier.ui.dialog.NumberManualDialog.NumberInputListener
import com.miya.fastcashier.ui.dialog.RefundInfoDialog
import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.ScanGunKeyEventHelper
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
class RefundActivity : BaseActivity() {
private var alertDialog: MessageDialog? = null
private lateinit var viewModel: PayViewModel
private lateinit var binding: ActivityRefundBinding
private var refundInfoDialog: RefundInfoDialog? = null
private var numberManualDialog: NumberManualDialog? = null
private var numberManualDialog: NumberManualDialog? = null
private var scanGunKeyEventHelper: ScanGunKeyEventHelper = ScanGunKeyEventHelper()
......@@ -32,33 +28,29 @@ class RefundActivity : BaseActivity() {
binding = ActivityRefundBinding.inflate(layoutInflater)
setContentView(binding.root)
viewModel = ViewModelProvider(this).get(PayViewModel::class.java)
viewModel.payResultLiveData.observe(this, { payResult ->
viewModel.payResultLiveData.observe(this, { payResult ->
payResult.onFailure {
dismissProgressDialog()
it.message?.let { it1 -> CenterToasty.error(this, it1,Toast.LENGTH_LONG).show() }
it.message?.let { it1 -> CenterToasty.error(this, it1, Toast.LENGTH_LONG).show() }
}
payResult.onSuccess { payServiceResponse ->
dismissProgressDialog()
//金额确认弹窗
if(null == refundInfoDialog){
refundInfoDialog = RefundInfoDialog(this)
}
refundInfoDialog?.setData(payServiceResponse) {
doubleRefundConfirm(it)
};
refundInfoDialog?.show()
PriceInputActivity.start(
this@RefundActivity,
PriceInputActivity.Companion.PRICEINPUT_TYPE_CREFUND,
payServiceResponse
)
}
})
viewModel.refundLiveData.observe(this, { payResult ->
viewModel.refundLiveData.observe(this, { payResult ->
payResult.onFailure {
dismissProgressDialog()
it.message?.let { it1 -> CenterToasty.error(this, it1,Toast.LENGTH_LONG).show() }
it.message?.let { it1 -> CenterToasty.error(this, it1, Toast.LENGTH_LONG).show() }
}
payResult.onSuccess {
dismissProgressDialog()
CenterToasty.success(this,"退款成功!!",Toast.LENGTH_LONG).show()
CenterToasty.success(this, "退款成功!!", Toast.LENGTH_LONG).show()
finish()
}
})
......@@ -87,33 +79,8 @@ class RefundActivity : BaseActivity() {
}
}
/**
* 二次退款确认
*/
private fun doubleRefundConfirm(payServiceResponse: PayServiceResponse) {
if (null == alertDialog) {
alertDialog = MessageDialog(this)
.setCustomMessage("是否确认退款")
.setPositiveButton("确认退款"
) { _, _ ->
run {
showProgressDialog("退款中")
viewModel.refund(payServiceResponse)
}
}
}
alertDialog?.show()
}
override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
scanGunKeyEventHelper.analysisKeyEvent(event)
return super.dispatchKeyEvent(event)
}
override fun onStop() {
super.onStop()
refundInfoDialog?.dismiss()
}
}
\ No newline at end of file
......@@ -133,6 +133,11 @@ class CommonDialog : Dialog {
return this
}
fun setCustomMessage(contentStr: SpannableString): CommonDialog {
mContentSpanStr = contentStr
return this
}
fun setMessageGravity(gravity: Int): CommonDialog {
mMessageGravity = gravity
return this
......
package com.miya.fastcashier.utils
import android.content.Context
import android.text.SpannableString
import com.miya.fastcashier.utils.WordUtil
import android.text.TextUtils
import android.text.style.ForegroundColorSpan
import androidx.core.content.ContextCompat
import android.text.Spanned
import android.text.style.StyleSpan
import android.graphics.Typeface
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.text.style.ClickableSpan
import android.text.TextPaint
import android.text.Html
import android.util.Log
import android.view.View
import java.lang.Exception
import java.util.regex.Pattern
object WordUtil {
/**
* 关键字变色
*
* @param context 上下文
* @param color 变化的色值
* @param text 文字
* @param keyword 文字中的关键字
* @return 结果SpannableString
*/
fun matcherDiscolor(
context: Context?,
color: Int,
text: String,
keyword: String
): SpannableString {
var text = text
var keyword = keyword
val s = SpannableString(text)
keyword = escapeExprSpecialWord(keyword)
text = escapeExprSpecialWord(text)
if (!TextUtils.isEmpty(keyword) && text.contains(keyword)) {
try {
val p = Pattern.compile(keyword)
val m = p.matcher(s)
while (m.find()) {
val start = m.start()
val end = m.end()
//注意:请使用ContextCompat.getColor获取颜色值。
s.setSpan(
ForegroundColorSpan(ContextCompat.getColor(context!!, color)),
start,
end,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
return s
}
fun matcherBold(context: Context?, text: String, keyword: String): SpannableString {
var text = text
var keyword = keyword
val s = SpannableString(text)
keyword = escapeExprSpecialWord(keyword)
text = escapeExprSpecialWord(text)
if (!TextUtils.isEmpty(keyword) && text.contains(keyword)) {
try {
val p = Pattern.compile(keyword)
val m = p.matcher(s)
while (m.find()) {
val start = m.start()
val end = m.end()
s.setSpan(
StyleSpan(Typeface.BOLD),
start,
end,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
break
}
} catch (e: Exception) {
e.printStackTrace()
}
}
return s
}
/**
* 关键字高亮变色 添加点击链接并跳转
*
* @param context 上下文
* @param color 变化的色值
* @param text 文字
* @param keyword 文字中的关键字
*/
fun setClickableSpanAndLighted(
context: Context,
color: Int,
text: String,
keyword: String,
intent: Intent?
): SpannableString {
var text = text
var keyword = keyword
val s = SpannableString(text)
keyword = escapeExprSpecialWord(keyword)
text = escapeExprSpecialWord(text)
if (!TextUtils.isEmpty(keyword) && text.contains(keyword)) {
try {
val p = Pattern.compile(keyword)
val m = p.matcher(s)
while (m.find()) {
val start = m.start()
val end = m.end()
val clickableSpan: ClickableSpan = object : ClickableSpan() {
override fun onClick(view: View) {
Log.e("setClickableSpan", "点击")
context.startActivity(intent)
}
//设置文字样式
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.isUnderlineText = false
ds.bgColor = Color.WHITE
ds.color = ContextCompat.getColor(context, color)
}
}
s.setSpan(clickableSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
return s
}
/**
* 关键字高亮变色 添加点击链接并跳转
*
* @param context 上下文
* @param color 变化的色值
* @param keyword 文字中的关键字
*/
fun setClickableSpanAndLighted(
context: Context,
color: Int,
s: SpannableString?,
keyword: String,
intent: Intent?
): SpannableString? {
var keyword = keyword
if (s == null) {
return null
}
keyword = escapeExprSpecialWord(keyword)
if (!TextUtils.isEmpty(keyword) && s.toString().contains(keyword)) {
try {
val p = Pattern.compile(keyword)
val m = p.matcher(s)
while (m.find()) {
val start = m.start()
val end = m.end()
val clickableSpan: ClickableSpan = object : ClickableSpan() {
override fun onClick(view: View) {
Log.e("setClickableSpan", "点击")
context.startActivity(intent)
}
//设置文字样式
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.isUnderlineText = false
ds.bgColor = Color.WHITE
ds.color = ContextCompat.getColor(context, color)
}
}
s.setSpan(clickableSpan, start, end, 0)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
return s
}
/**
* 转义正则特殊字符 ($()*+.[]?\^{},|)
*
* @param keyword
* @return keyword
*/
fun escapeExprSpecialWord(keyword: String): String {
var keyword = keyword
if (!TextUtils.isEmpty(keyword)) {
val fbsArr =
arrayOf("\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|")
for (key in fbsArr) {
if (keyword.contains(key)) {
keyword = keyword.replace(key, "\\" + key)
}
}
}
return keyword
}
/**
* 通过Html.fromHtml方式修改颜色(解决SDK版本问题)
*
* @param html
* @return
*/
fun fromHtml(html: String?): Spanned {
val result: Spanned
result = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY)
} else {
Html.fromHtml(html)
}
return result
}
/**
* 字体颜色修改
*
* @param content
* @param color
* @return
*/
fun color(content: String, color: Int): String {
return "<font color=\"#" + Integer.toHexString(color) + "\" >" + content + "</font>"
}
/**
* 加粗字体
*
* @param content
* @return
*/
fun bold(content: String): String {
return "<b>$content</b>"
}
}
\ No newline at end of file
......@@ -34,6 +34,9 @@ class PayViewModel : ViewModel() {
val payServiceResponseLiveData: MutableLiveData<Result<PayServiceResponse>> = MutableLiveData()
val payResultLiveData: MutableLiveData<Result<PayServiceResponse>> = MutableLiveData()
/**
* 退款全额
*/
fun refund(payServiceResponse: PayServiceResponse) {
XLog.d("开始退款:${JSON.toJSONString(payServiceResponse)}")
viewModelScope.launch(Dispatchers.IO) {
......@@ -79,8 +82,57 @@ class PayViewModel : ViewModel() {
}
}
/**
* 退款固定数额
*/
fun refund(payServiceResponse: PayServiceResponse, refundPrice: String) {
XLog.d("开始退款:${JSON.toJSONString(payServiceResponse)}")
viewModelScope.launch(Dispatchers.IO) {
//退款
var refundPayServiceResponse: PayServiceResponse? = null
try {
val refundParams = HashMap<String, String>()
refundParams["oriOrderNo"] = payServiceResponse.shopTradeNo;
val refundOrderNo =
AccountService.getAccountInfo()?.shopInfo?.saasid + System.currentTimeMillis()
refundParams["refundOrderNo"] = refundOrderNo
refundParams["refundPrice"] = refundPrice
refundPayServiceResponse = PayRepository.refundByOrderNo(refundParams)
XLog.d("退款成功:${JSON.toJSONString(refundPayServiceResponse)}")
//保存到数据库
ViewPayOrderData.insert(refundPayServiceResponse)
refundLiveData.postValue(Result.success(refundPayServiceResponse))
} catch (e: Exception) {
e.printStackTrace()
XLog.d("退款异常:${e.message}")
refundLiveData.postValue(Result.failure(e))
}
//退款打印
try {
XLog.d("开始退款打印")
AccountService.getAccountInfo()
?.let {
refundPayServiceResponse?.let { it1 ->
PrintService.refundPrint(
it,
it1
)
}
}
} catch (e: Exception) {
e.printStackTrace()
XLog.d("退款打印异常${e.message}")
refundLiveData.postValue(Result.failure(e))
}
}
}
/**
* 生成付款码支付
* payType 只支持微信或者支付宝
* 2是微信 1是支付宝
* price 传进来要是分,整数
......@@ -165,7 +217,7 @@ class PayViewModel : ViewModel() {
/**
* 金额是元,首先要转成分
* 被扫支付,金额是元,首先要转成分
*/
fun pay(price: String, payCode: String) {
XLog.d("被扫开始")
......
......@@ -12,7 +12,7 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llBack"
android:layout_width="200dp"
android:layout_height="87dp"
android:layout_height="88dp"
android:orientation="horizontal"
android:gravity="center_vertical"
app:layout_constraintStart_toStartOf="parent"
......@@ -44,28 +44,45 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="@+id/tvTitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_height="88dp"
android:gravity="center"
android:textColor="@color/white"
android:text="收款"
android:textSize="36sp"/>
<TextView
android:id="@+id/tvPriceText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="48dp"
android:layout_marginTop="54dp"
android:textColor="@color/white"
android:text="收款金额"
android:textSize="24sp"/>
android:textSize="32sp"/>
<TextView
android:id="@+id/tvRefundPriceTotal"
app:layout_constraintStart_toEndOf="@+id/tvPriceText"
app:layout_constraintTop_toBottomOf="@+id/llBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="54dp"
android:textColor="@color/white"
android:textStyle="bold"
android:visibility="gone"
tools:text="¥319.00"
tools:visibility="visible"
android:textSize="32sp"/>
<ImageView
android:id="@+id/ivRmb"
......@@ -107,13 +124,28 @@
android:layout_marginRight="32dp"
android:gravity="end" />
<TextView
android:id="@+id/tvInvalidRefundPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
app:layout_constraintTop_toBottomOf="@+id/vBaseLine"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="16dp"
android:textColor="@color/color_FF4E33"
android:visibility="gone"
android:text="退款金额无效"
tools:visibility="visible"
android:textSize="26sp"/>
<com.miya.fastcashier.widget.DecimalKeyboard
android:id="@+id/numKeyboard"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="@+id/tvScanPayCode"
android:layout_height="637dp"/>
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="130dp"
android:layout_height="637dp" />
<TextView
android:id="@+id/tvScanPayCode"
......@@ -141,6 +173,20 @@
android:background="@drawable/app_paycode_generate"
android:layout_width="0dp"/>
<TextView
android:id="@+id/tvRefund"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_height="130dp"
android:textColor="@color/white"
android:textSize="36sp"
android:text="确认退款"
android:gravity="center"
android:visibility="gone"
android:background="@drawable/app_paycode_generate"
android:layout_width="0dp"/>
<!-- &lt;!&ndash;封装成一个View&ndash;&gt;-->
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:visibility="gone"-->
......
......@@ -16,4 +16,5 @@
<color name="color_ECECEC">#ECECEC</color>
<color name="color_F8F8F8">#F8F8F8</color>
<color name="color_E5E5E5">#E5E5E5</color>
<color name="color_D83773">#D83773</color>
</resources>
\ No newline at end of file
......@@ -23,5 +23,6 @@
<string name="search_order_prompt_text">还没有明细哦~</string>
<string name="app_text_login_out">是否确认退出登录账号</string>
<string name="text_login_out_sure">确认退出</string>
<string name="text_refund_amount">退款金额¥%s,是否确认退款</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment