浏览代码

1.修改bug

王鹏鹏 1 年之前
父节点
当前提交
3fbb5cdb76

+ 1 - 1
.idea/misc.xml

@@ -526,7 +526,7 @@
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/activity_consultation_sheet.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/activity_doctor_details.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/activity_health_consultation.xml" value="0.23697916666666666" />
-        <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/activity_payment.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/activity_payment.xml" value="0.4744525547445255" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_consultation_record.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_recommend_doctor.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/home/src/main/res/drawable/bg_results_content.xml" value="0.151" />

+ 0 - 43
healthconsultation/src/main/java/com/yingyang/healthconsultation/payment/PaymentActivity.kt

@@ -19,7 +19,6 @@ import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
 import com.yingyangfly.baselib.router.RouterUrlCommon
 import com.yingyangfly.baselib.utils.LiveEventBusUtil
 import com.yingyangfly.baselib.utils.RxBusCodes
-import com.yingyangfly.baselib.utils.RxTimer
 
 /**
  * 订单支付
@@ -28,8 +27,6 @@ import com.yingyangfly.baselib.utils.RxTimer
 class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewModel>(),
     View.OnTouchListener {
 
-    private lateinit var rxTimer: RxTimer
-    var time: Long = 0
     private var id: String = ""
     private var doctorBean: DoctorBean? = null
     private var orderNo = ""
@@ -45,7 +42,6 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
     }
 
     override fun initViews() {
-        rxTimer = RxTimer()
         if (doctorDao != null) {
             doctorBean = doctorDao?.getDoctor(id)
             if (doctorBean != null) {
@@ -133,7 +129,6 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
                 viewModel.saveConsultation(purchaseConsultationBean!!, fail = {
                     it.toast()
                 }, success = {
-                    startTimer()
                     if (it != null) {
                         orderNo = it.orderNo
                         paymentQrCodeDialog = PaymentQrCodeDialog()
@@ -150,42 +145,4 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
             }
         }
     }
-
-    /**
-     * 取消支付
-     */
-    private fun delPayOrder() {
-        viewModel.delPayOrder(orderNo, fail = {
-            it.toast()
-        }, success = {
-            if (paymentQrCodeDialog != null && paymentQrCodeDialog?.dialog?.isShowing == true) {
-                paymentQrCodeDialog?.dismiss()
-            }
-        })
-    }
-
-    /**
-     * 开始计时
-     */
-    private fun startTimer() {
-        val m: Long = 1000
-        rxTimer.interval(m) {
-            time = 60 * 15 * 1 - it - 1
-//            val minutes = time / 60
-//            val seconds = time % 60
-//            binding.tvTime.text = if (minutes > 0) {
-//                if (seconds > 0) {
-//                    "请在 $minutes 分钟 $seconds 秒内完成支付,超时将取消"
-//                } else {
-//                    "请在 $minutes 分钟 内完成支付,超时将取消"
-//                }
-//            } else {
-//                "请在 $seconds 秒内完成支付,超时将取消"
-//            }
-            if (it == time - 1) {
-                delPayOrder()
-                rxTimer.cancel()
-            }
-        }
-    }
 }

+ 0 - 14
healthconsultation/src/main/java/com/yingyang/healthconsultation/payment/PaymentViewModel.kt

@@ -24,18 +24,4 @@ class PaymentViewModel : BaseViewModel() {
         fail
     )
 
-    fun delPayOrder(
-        orderNo: String,
-        fail: ((msg: String) -> Unit)? = null,
-        success: ((success: String?) -> Unit)? = null,
-    ) = launchFlow(true) {
-        HEALTHCONSULTATION_API.delPayOrder(orderNo)
-    }.runUI(
-        success,
-        fail
-    )
-
-
-
-
 }

+ 4 - 20
healthconsultation/src/main/res/layout/activity_payment.xml

@@ -75,34 +75,18 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent">
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvTime"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/divider_54px"
-                    android:layout_marginStart="@dimen/divider_36px"
-                    android:layout_marginTop="@dimen/divider_17px"
-                    android:layout_marginEnd="@dimen/divider_36px"
-                    android:background="@drawable/bg_payment_timing"
-                    android:gravity="center"
-                    android:text="@string/please_complete_payment_within_minutes_any_delay_cancelle"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_24px"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
-
                 <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvGraphicConsultation"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginStart="@dimen/divider_41px"
-                    android:layout_marginTop="@dimen/divider_16px"
+                    android:layout_marginTop="@dimen/divider_22px"
                     android:text="@string/inquiries_consultation"
                     android:textColor="@color/color_FF333333"
                     android:textSize="@dimen/divider_28px"
                     android:textStyle="bold"
                     app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/tvTime" />
+                    app:layout_constraintTop_toTopOf="parent" />
 
                 <androidx.appcompat.widget.AppCompatTextView
                     android:id="@+id/tvDocotrName"
@@ -120,14 +104,14 @@
                     android:id="@+id/tvMoney"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/divider_67px"
+                    android:layout_marginTop="@dimen/divider_11px"
                     android:layout_marginEnd="@dimen/divider_36px"
                     android:text='@{"¥ "+data.price}'
                     android:textColor="@color/color_FF333333"
                     android:textSize="@dimen/divider_28px"
                     android:textStyle="bold"
                     app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/tvTime" />
+                    app:layout_constraintTop_toBottomOf="@+id/tvGraphicConsultation" />
 
                 <View
                     android:id="@+id/lineView"