|
|
@@ -2,6 +2,7 @@ package com.yingyang.healthconsultation.payment
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
import android.os.Bundle
|
|
|
+import android.text.TextUtils
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
@@ -28,6 +29,7 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
|
|
|
View.OnTouchListener {
|
|
|
|
|
|
private var id: String = ""
|
|
|
+ private var price: String = ""
|
|
|
private var doctorBean: DoctorBean? = null
|
|
|
private var orderNo = ""
|
|
|
private var method = ""
|
|
|
@@ -36,6 +38,7 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
id = intent.getStringExtra("id") ?: ""
|
|
|
+ price = intent.getStringExtra("price") ?: ""
|
|
|
purchaseConsultationBean =
|
|
|
intent.getSerializableExtra("purchaseConsultationBean") as PurchaseConsultationBean
|
|
|
super.onCreate(savedInstanceState)
|
|
|
@@ -46,10 +49,35 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
|
|
|
doctorBean = doctorDao?.getDoctor(id)
|
|
|
if (doctorBean != null) {
|
|
|
binding.data = doctorBean
|
|
|
+ binding.tvMoney.text = if (TextUtils.isEmpty(price)) {
|
|
|
+ "¥ " + doctorBean?.price
|
|
|
+ } else {
|
|
|
+ "¥ $price"
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ getDoctorDetail()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取医生信息
|
|
|
+ */
|
|
|
+ private fun getDoctorDetail() {
|
|
|
+ viewModel.getDoctorDetail(id, fail = {
|
|
|
+ it.toast()
|
|
|
+ }, success = {
|
|
|
+ if (it != null) {
|
|
|
+ binding.data = it
|
|
|
+ binding.tvMoney.text = if (TextUtils.isEmpty(price)) {
|
|
|
+ "¥ " + it.price
|
|
|
+ } else {
|
|
|
+ "¥ $price"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
override fun initListener() {
|
|
|
binding {
|