parent
31cc77fb6b
commit
89e9a677d3
|
|
@ -9,6 +9,7 @@ import android.util.Log
|
|||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.Switch
|
||||
|
|
@ -547,62 +548,136 @@ 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)
|
||||
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@影猫充值")
|
||||
}
|
||||
if(data.payType!=null){
|
||||
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
|
||||
)
|
||||
for (index in data.payType!!){
|
||||
if(index.payModel==10){
|
||||
findViewById<LinearLayout>(R.id.llAggregatePayment).visibility=View.VISIBLE
|
||||
val JUhePay=findViewById<TextView>(R.id.JUhePay)
|
||||
JUhePay.visibility=View.VISIBLE
|
||||
JUhePay.text = index.payChannel
|
||||
if(index.payType==1){
|
||||
val ivAlipay =findViewById<AppCompatImageView>(R.id.ivAlipay)
|
||||
ivAlipay.visibility=View.VISIBLE
|
||||
ivAlipay.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, 10, 1, "ip@影猫充值")
|
||||
}
|
||||
}
|
||||
}else if(index.payType==2){
|
||||
val ivWechatPay= findViewById<AppCompatImageView>(R.id.ivWechatPay)
|
||||
ivWechatPay.visibility=View.VISIBLE
|
||||
ivWechatPay.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, 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@影猫充值")
|
||||
}
|
||||
}
|
||||
}else if(index.payModel==11){
|
||||
findViewById<LinearLayout>(R.id.llQuickPayment).visibility=View.VISIBLE
|
||||
val KJPay=findViewById<TextView>(R.id.KJPay)
|
||||
KJPay.visibility=View.VISIBLE
|
||||
KJPay.text = index.payChannel
|
||||
if(index.payType==1){
|
||||
val ivQuickPayment=findViewById<AppCompatImageView>(R.id.ivQuickPayment)
|
||||
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 {
|
||||
dismiss()
|
||||
getCustomView().findViewById<AppCompatImageView>(R.id.ivBack).setOnClickListener {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -24,12 +24,15 @@
|
|||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/JUhePay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="17sp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@color/white"
|
||||
|
|
@ -48,7 +51,9 @@
|
|||
android:background="@drawable/press_effect"
|
||||
android:padding="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
app:srcCompat="@drawable/alipay" />
|
||||
app:srcCompat="@drawable/alipay"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivWechatPay"
|
||||
|
|
@ -56,6 +61,7 @@
|
|||
android:layout_height="60dp"
|
||||
android:background="@drawable/press_effect"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="20dp"
|
||||
app:srcCompat="@drawable/wechat" />
|
||||
</LinearLayout>
|
||||
|
|
@ -69,8 +75,8 @@
|
|||
android:background="@drawable/payment_options_bg"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/KJPay"
|
||||
|
|
@ -80,6 +86,7 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="gone"
|
||||
android:text="@string/quickPayment" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -94,6 +101,7 @@
|
|||
android:layout_height="60dp"
|
||||
android:background="@drawable/press_effect"
|
||||
android:layout_marginStart="20dp"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp"
|
||||
app:srcCompat="@drawable/alipay" />
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue