描述:

1.修复备用支付的bug
This commit is contained in:
level 2024-09-25 19:01:11 +08:00
parent 31cc77fb6b
commit 89e9a677d3
2 changed files with 135 additions and 52 deletions

View File

@ -9,6 +9,7 @@ import android.util.Log
import android.view.View import android.view.View
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.Switch import android.widget.Switch
@ -547,62 +548,136 @@ class RechargeFragment : BaseFragment() {
} }
private fun orderPayment(data: Trade) { private fun orderPayment(data: Trade) {
val jhPay = data.payType?.get(0)?.payChannel if(data.payType!=null){
val kjPay = data.payType?.get(2)?.payChannel activity?.let {
activity?.let { MaterialDialog(it).show {
MaterialDialog(it).show { this.cancelable(true)
this.cancelable(true) cornerRadius(res = R.dimen.dp_10)
cornerRadius(res = R.dimen.dp_10) customView(
customView( R.layout.backup_payment_dialog,
R.layout.backup_payment_dialog, scrollable = false,
scrollable = false, noVerticalPadding = true,
noVerticalPadding = true, horizontalPadding = false
horizontalPadding = false )
) for (index in data.payType!!){
if (jhPay != null) { if(index.payModel==10){
findViewById<TextView>(R.id.JUhePay).text = jhPay findViewById<LinearLayout>(R.id.llAggregatePayment).visibility=View.VISIBLE
} val JUhePay=findViewById<TextView>(R.id.JUhePay)
if (kjPay != null) { JUhePay.visibility=View.VISIBLE
findViewById<TextView>(R.id.KJPay).text = kjPay JUhePay.text = index.payChannel
} if(index.payType==1){
getCustomView().findViewById<AppCompatImageView>(R.id.ivAlipay).setOnClickListener { val ivAlipay =findViewById<AppCompatImageView>(R.id.ivAlipay)
val payModel = data.payType?.get(0)?.payModel ivAlipay.visibility=View.VISIBLE
val payType = data.payType?.get(0)?.payType ivAlipay.setOnClickListener {
val payParam = data.payType?.get(0)?.payParam val payModel = index.payModel
if (payModel != null && payType != null && payParam != null) { val payType =index.payType
viewModel.orderPayment(data, payModel, payType, payParam) val payParam = index.payParam
} else { if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, 10, 1, "ip@影猫充值") viewModel.orderPayment(data, payModel, payType, payParam)
} } else {
} viewModel.orderPayment(data, 10, 1, "ip@影猫充值")
getCustomView().findViewById<AppCompatImageView>(R.id.ivWechatPay) }
.setOnClickListener { }
val payModel = data.payType?.get(1)?.payModel }else if(index.payType==2){
val payType = data.payType?.get(1)?.payType val ivWechatPay= findViewById<AppCompatImageView>(R.id.ivWechatPay)
val payParam = data.payType?.get(1)?.payParam ivWechatPay.visibility=View.VISIBLE
if (payModel != null && payType != null && payParam != null) { ivWechatPay.setOnClickListener {
viewModel.orderPayment(data, payModel, payType, payParam) val payModel = index.payModel
} else { val payType =index.payType
viewModel.orderPayment(data, 10, 2, "ip@影猫充值") val payParam =index.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 { }else if(index.payModel==11){
val payModel = data.payType?.get(2)?.payModel findViewById<LinearLayout>(R.id.llQuickPayment).visibility=View.VISIBLE
val payType = data.payType?.get(2)?.payType val KJPay=findViewById<TextView>(R.id.KJPay)
val payParam = data.payType?.get(2)?.payParam KJPay.visibility=View.VISIBLE
if (payModel != null && payType != null && payParam != null) { KJPay.text = index.payChannel
viewModel.orderPayment(data, payModel, payType, payParam) if(index.payType==1){
} else { val ivQuickPayment=findViewById<AppCompatImageView>(R.id.ivQuickPayment)
viewModel.orderPayment(data, 11, 1, "ip@影猫充值") ivQuickPayment.visibility=View.VISIBLE
ivQuickPayment.setOnClickListener {
val payModel =index.payModel
val payType =index.payType
val payParam =index.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 { getCustomView().findViewById<AppCompatImageView>(R.id.ivBack).setOnClickListener {
dismiss() dismiss()
}
} }
} }
} }
// activity?.let {
// MaterialDialog(it).show {
// this.cancelable(true)
// cornerRadius(res = R.dimen.dp_10)
// customView(
// R.layout.backup_payment_dialog,
// scrollable = false,
// 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 {
// 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 {
// 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 {
// 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()
// }
// }
// }
} }
// private fun goWebViewStartPayClient(rsp: BaseRsp, isPayWeb: Boolean) { // private fun goWebViewStartPayClient(rsp: BaseRsp, isPayWeb: Boolean) {

View File

@ -24,12 +24,15 @@
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:visibility="gone"
> >
<TextView <TextView
android:id="@+id/JUhePay" android:id="@+id/JUhePay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp" android:textSize="17sp"
android:visibility="gone"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:textColor="@color/white" android:textColor="@color/white"
@ -48,7 +51,9 @@
android:background="@drawable/press_effect" android:background="@drawable/press_effect"
android:padding="5dp" android:padding="5dp"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
app:srcCompat="@drawable/alipay" /> app:srcCompat="@drawable/alipay"
android:visibility="gone"
/>
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivWechatPay" android:id="@+id/ivWechatPay"
@ -56,6 +61,7 @@
android:layout_height="60dp" android:layout_height="60dp"
android:background="@drawable/press_effect" android:background="@drawable/press_effect"
android:padding="5dp" android:padding="5dp"
android:visibility="gone"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
app:srcCompat="@drawable/wechat" /> app:srcCompat="@drawable/wechat" />
</LinearLayout> </LinearLayout>
@ -69,8 +75,8 @@
android:background="@drawable/payment_options_bg" android:background="@drawable/payment_options_bg"
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:visibility="gone"
> >
<TextView <TextView
android:id="@+id/KJPay" android:id="@+id/KJPay"
@ -80,6 +86,7 @@
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:textColor="@color/white" android:textColor="@color/white"
android:visibility="gone"
android:text="@string/quickPayment" /> android:text="@string/quickPayment" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -94,6 +101,7 @@
android:layout_height="60dp" android:layout_height="60dp"
android:background="@drawable/press_effect" android:background="@drawable/press_effect"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:visibility="gone"
android:padding="5dp" android:padding="5dp"
app:srcCompat="@drawable/alipay" /> app:srcCompat="@drawable/alipay" />