|
|
@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
import com.yingyang.healthconsultation.R
|
|
|
import com.yingyang.healthconsultation.databinding.ActivityPaymentBinding
|
|
|
import com.yingyang.healthconsultation.dialog.PaymentQrCodeDialog
|
|
|
+import com.yingyang.healthconsultation.entity.PatientInfoBean
|
|
|
import com.yingyang.healthconsultation.entity.PurchaseConsultationBean
|
|
|
import com.yingyang.healthconsultation.utils.CommonUtils
|
|
|
import com.yingyangfly.baselib.bean.PurchaseConsultationEvent
|
|
|
@@ -20,8 +21,10 @@ import com.yingyangfly.baselib.ext.show
|
|
|
import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
+import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
import gorden.rxbus2.RxBus
|
|
|
|
|
|
/**
|
|
|
@@ -198,11 +201,26 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
|
|
|
|
|
|
override fun onDestroy() {
|
|
|
if (paySuccess) {
|
|
|
- RxBus.get()
|
|
|
- .send(
|
|
|
- RxBusCodes.purchaseConsultationEvent,
|
|
|
- PurchaseConsultationEvent(id, patientInfo)
|
|
|
- )
|
|
|
+ if (TextUtils.isEmpty(patientInfo).not()) {
|
|
|
+ val patientInfoBean = GsonUtil.GsonToBean(patientInfo, PatientInfoBean::class.java)
|
|
|
+ val userAge = if (TextUtils.isEmpty(User.getUserAge()).not()) {
|
|
|
+ User.getUserAge().replace("岁", "")
|
|
|
+ } else {
|
|
|
+ ""
|
|
|
+ }
|
|
|
+ patientInfoBean.appUserAge = userAge
|
|
|
+ val consultation = if (TextUtils.equals("1", patientInfoBean.isConsultation)) {
|
|
|
+ "否"
|
|
|
+ } else {
|
|
|
+ "是"
|
|
|
+ }
|
|
|
+ patientInfoBean.isConsultation = consultation
|
|
|
+ RxBus.get()
|
|
|
+ .send(
|
|
|
+ RxBusCodes.purchaseConsultationEvent,
|
|
|
+ PurchaseConsultationEvent(id, GsonUtil.GsonString(patientInfoBean))
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
super.onDestroy()
|
|
|
}
|