Commit 3edfc1a4 by 刘鹏

feat : 购药返回逻辑优化

parent 372e14b2
...@@ -41,7 +41,7 @@ ext { ...@@ -41,7 +41,7 @@ ext {
"ydl-webview" : "0.0.38.57", "ydl-webview" : "0.0.38.57",
"ydl-media" : "0.0.21.10", "ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.29", "ydl-medical-pay" : "0.0.01.31",
"m-audioim" : "0.0.49.29.37", "m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26", "ydl-flutter-base": "0.0.14.26",
...@@ -126,7 +126,7 @@ ext { ...@@ -126,7 +126,7 @@ ext {
"ydl-webview" : "0.0.38.57", "ydl-webview" : "0.0.38.57",
"ydl-media" : "0.0.21.10", "ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.29", "ydl-medical-pay" : "0.0.01.31",
"m-audioim" : "0.0.49.29.37", "m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26", "ydl-flutter-base": "0.0.14.26",
......
...@@ -103,9 +103,10 @@ object MedicalPayIn { ...@@ -103,9 +103,10 @@ object MedicalPayIn {
.navigation() .navigation()
} }
fun mainIntentToWebView(type: String) { fun mainIntentToWebView(type: String,data :String) {
val bundle = Bundle(); val bundle = Bundle();
bundle.putString("webView", type) bundle.putString("webView", type)
bundle.putString("data", data)
ARouter.getInstance().build("/main/main") ARouter.getInstance().build("/main/main")
.withBundle("webView", bundle) .withBundle("webView", bundle)
.navigation() .navigation()
......
...@@ -37,6 +37,7 @@ import java.util.* ...@@ -37,6 +37,7 @@ import java.util.*
class MedicalPayActivity : BaseActivity() { class MedicalPayActivity : BaseActivity() {
companion object { companion object {
private const val DRUG_ORDER_DETAIL = "medical_drug_order_detail"
//价格 //价格
private const val PRICE_KEY = "price" private const val PRICE_KEY = "price"
...@@ -198,10 +199,10 @@ class MedicalPayActivity : BaseActivity() { ...@@ -198,10 +199,10 @@ class MedicalPayActivity : BaseActivity() {
if (response.code == 200) { if (response.code == 200) {
showCloseDialog(response.data) showCloseDialog(response.data)
} else { } else {
finish() payTypefinish()
} }
}, { e -> }, { e ->
finish() payTypefinish()
e.printStackTrace() e.printStackTrace()
}) })
...@@ -232,7 +233,7 @@ class MedicalPayActivity : BaseActivity() { ...@@ -232,7 +233,7 @@ class MedicalPayActivity : BaseActivity() {
) { dialog, which -> ) { dialog, which ->
//关闭页面 //关闭页面
timer?.cancel() timer?.cancel()
finish() payTypefinish()
dialog.dismiss() dialog.dismiss()
} }
builder.setRight_color("#3464EC") builder.setRight_color("#3464EC")
...@@ -260,7 +261,7 @@ class MedicalPayActivity : BaseActivity() { ...@@ -260,7 +261,7 @@ class MedicalPayActivity : BaseActivity() {
override fun onFinish() { override fun onFinish() {
builder.dismiss() builder.dismiss()
finish() payTypefinish()
} }
...@@ -268,6 +269,18 @@ class MedicalPayActivity : BaseActivity() { ...@@ -268,6 +269,18 @@ class MedicalPayActivity : BaseActivity() {
timer?.start() timer?.start()
} }
/**
* 不同支付场景的关闭返回路径
* */
private fun payTypefinish() {
if (mPayBizType == MEDICAL_ORDER_TYPE) {
MedicalPayIn.mainIntentToWebView(DRUG_ORDER_DETAIL, mOrderId)
finish()
} else if (mPayBizType == INQUIRY_ORDER_TYPE) {
finish()
}
}
private fun toPay(response: BaseResponse<CreatePayRespose>, payType: Int) { private fun toPay(response: BaseResponse<CreatePayRespose>, payType: Int) {
if (payType == PAY_ALI && response.data.payParams.isNotEmpty()) { if (payType == PAY_ALI && response.data.payParams.isNotEmpty()) {
val payRunnable = Runnable { val payRunnable = Runnable {
......
...@@ -49,9 +49,7 @@ class MedicalPaySuccessActivity : BaseActivity() { ...@@ -49,9 +49,7 @@ class MedicalPaySuccessActivity : BaseActivity() {
iv_back.setOnClickListener { iv_back.setOnClickListener {
MedicalPayIn.mainIntentToWebView(MEDICAL_ORDER_LIST_KEY) onBackPressed()
finish()
} }
to_order.setOnClickListener { to_order.setOnClickListener {
//查看药品订单 //查看药品订单
...@@ -66,6 +64,11 @@ class MedicalPaySuccessActivity : BaseActivity() { ...@@ -66,6 +64,11 @@ class MedicalPaySuccessActivity : BaseActivity() {
} }
override fun onBackPressed() {
MedicalPayIn.mainIntentToWebView(MEDICAL_ORDER_LIST_KEY,"")
finish()
}
private fun initStatus() { private fun initStatus() {
StatusBarUtils.setTransparentForImageView(this@MedicalPaySuccessActivity, null) StatusBarUtils.setTransparentForImageView(this@MedicalPaySuccessActivity, null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment