|
|
@@ -1,11 +1,13 @@
|
|
|
package com.yingyang.healthconsultation.dialog
|
|
|
|
|
|
import android.os.Bundle
|
|
|
+import android.text.TextUtils
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
import androidx.appcompat.widget.AppCompatButton
|
|
|
import androidx.appcompat.widget.AppCompatImageView
|
|
|
+import androidx.appcompat.widget.AppCompatTextView
|
|
|
import androidx.fragment.app.DialogFragment
|
|
|
import com.bumptech.glide.Glide
|
|
|
import com.google.zxing.common.BitmapUtils
|
|
|
@@ -25,15 +27,18 @@ class PaymentQrCodeDialog : DialogFragment() {
|
|
|
|
|
|
private var orderNo = ""
|
|
|
private var qrCode = ""
|
|
|
+ private var method = ""
|
|
|
|
|
|
+ private var purchaseServicesBtn: AppCompatTextView? = null
|
|
|
private var payImage: AppCompatImageView? = null
|
|
|
private var paySuccessBtn: AppCompatButton? = null
|
|
|
private var imageClose: AppCompatImageView? = null
|
|
|
var onQueryPaymentStatusListener: ((orderNo: String) -> Unit)? = null
|
|
|
|
|
|
- fun setPaymentQrCodeBean(orderNo: String, qrCode: String) {
|
|
|
+ fun setPaymentQrCodeBean(orderNo: String, qrCode: String, method: String) {
|
|
|
this.orderNo = orderNo
|
|
|
this.qrCode = qrCode
|
|
|
+ this.method = method
|
|
|
}
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
@@ -70,9 +75,15 @@ class PaymentQrCodeDialog : DialogFragment() {
|
|
|
}
|
|
|
|
|
|
private fun findId(rootView: View) {
|
|
|
+ purchaseServicesBtn = rootView.findViewById(R.id.purchaseServicesBtn)
|
|
|
payImage = rootView.findViewById(R.id.payImage)
|
|
|
paySuccessBtn = rootView.findViewById(R.id.paySuccessBtn)
|
|
|
imageClose = rootView.findViewById(R.id.imageClose)
|
|
|
+ if (TextUtils.equals("1", method)) {
|
|
|
+ purchaseServicesBtn?.setBackgroundResource(R.drawable.bg_payment_services_wechatpay)
|
|
|
+ } else {
|
|
|
+ purchaseServicesBtn?.setBackgroundResource(R.drawable.bg_payment_services_alipay)
|
|
|
+ }
|
|
|
imageClose!!.setOnSingleClickListener {
|
|
|
if (orderNo.isEmpty()) {
|
|
|
dismiss()
|