描述:备用充值界面更改为使用服务端字段进程数据展示

This commit is contained in:
level 2024-08-22 15:51:31 +08:00
parent 918f5b1c4e
commit 77d659467e
3 changed files with 53 additions and 6 deletions

View File

@ -547,6 +547,8 @@ class RechargeFragment : BaseFragment() {
}
private fun orderPayment(data: Trade) {
val jhPay = data.payType?.get(0)?.payChannel
val kjPay = data.payType?.get(2)?.payChannel
activity?.let {
MaterialDialog(it).show {
this.cancelable(true)
@ -557,16 +559,44 @@ class RechargeFragment : BaseFragment() {
noVerticalPadding = true,
horizontalPadding = false
)
if (jhPay != null) {
findViewById<TextView>(R.id.JUhePay).text = jhPay
}
if (kjPay != null) {
findViewById<TextView>(R.id.KJPay).text = kjPay
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivAlipay).setOnClickListener {
viewModel.orderPayment(data, 10, 1, "ip@影猫充值")
val payModel = data.payType?.get(0)?.payModel
val payType = data.payType?.get(0)?.payType
val payParam = data.payType?.get(0)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 10, 1, "ip@影猫充值")
}
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivWechatPay)
.setOnClickListener {
viewModel.orderPayment(data, 10, 2, "ip@影猫充值")
val payModel = data.payType?.get(1)?.payModel
val payType = data.payType?.get(1)?.payType
val payParam = data.payType?.get(1)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 10, 2, "ip@影猫充值")
}
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivQuickPayment)
.setOnClickListener {
viewModel.orderPayment(data, 11, 1, "ip@影猫充值")
val payModel = data.payType?.get(2)?.payModel
val payType = data.payType?.get(2)?.payType
val payParam = data.payType?.get(2)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 11, 1, "ip@影猫充值")
}
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivBack).setOnClickListener {
dismiss()

View File

@ -24,7 +24,8 @@ data class PayRsp(
data class Trade(
@field:SerializedName("payUrl")
var payUrl: String? = null,
@field:SerializedName("payType")
var payType: List<PayType>? = null,
@field:SerializedName("totalFee")
val totalFee: String? = null,
@ -42,6 +43,22 @@ data class Trade(
}
}
data class PayType(
@field:SerializedName("id")
var id: Int? = null,
@field:SerializedName("templateId")
var templateId: Int? = null,
@field:SerializedName("payModel")
var payModel: Int? = null,
@field:SerializedName("payChannel")
var payChannel: String? = null,
@field:SerializedName("payType")
var payType: Int? = null,
@field:SerializedName("payParam")
var payParam: String? = null,
@field:SerializedName("payOrder")
var payOrder: Int? = null,
)
//汇旺财
data class QRPayRsp(@field:SerializedName("msg")
val msg: String? = null,

View File

@ -26,7 +26,7 @@
android:layout_marginTop="20dp"
>
<TextView
android:id="@+id/textView"
android:id="@+id/JUhePay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
@ -73,7 +73,7 @@
android:layout_marginBottom="20dp"
>
<TextView
android:id="@+id/textView2"
android:id="@+id/KJPay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"