Commit df5a43dd by 刘鹏

feat : 支付相关组件适配

parent fe2aab27
...@@ -11,7 +11,7 @@ ext { ...@@ -11,7 +11,7 @@ ext {
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99", "m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.20.92", "m-im-medical" : "0.0.20.94",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -38,10 +38,10 @@ ext { ...@@ -38,10 +38,10 @@ ext {
"ydl-platform" : "0.0.40.73", "ydl-platform" : "0.0.40.73",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.56", "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.20", "ydl-medical-pay" : "0.0.01.22",
"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",
...@@ -97,7 +97,7 @@ ext { ...@@ -97,7 +97,7 @@ ext {
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99", "m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.20.92", "m-im-medical" : "0.0.20.94",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -123,10 +123,10 @@ ext { ...@@ -123,10 +123,10 @@ ext {
"ydl-platform" : "0.0.40.73", "ydl-platform" : "0.0.40.73",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.56", "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.19", "ydl-medical-pay" : "0.0.01.22",
"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",
......
...@@ -214,7 +214,8 @@ class GraphicConsulttionFlow2Activity : BaseActivity() { ...@@ -214,7 +214,8 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
this@GraphicConsulttionFlow2Activity, this@GraphicConsulttionFlow2Activity,
response.data.payAmountStr, response.data.payAmountStr,
response.data.inquiryOrderId, response.data.inquiryOrderId,
doctorUidStrExtra doctorUidStrExtra,
1
) )
scope.cancel() scope.cancel()
mFlow1Activity?.finish() mFlow1Activity?.finish()
......
...@@ -46,13 +46,14 @@ dependencies { ...@@ -46,13 +46,14 @@ dependencies {
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
compileOnly project(':ydl-webview')
implementation modularPublication('com.ydl:m-im-api') implementation modularPublication('com.ydl:m-im-api')
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
}else { }else {
compileOnly rootProject.ext.dependencies["ydl-m-im-api"] compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-webview"]
//发布时使用 //发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
...@@ -37,15 +37,27 @@ import java.util.* ...@@ -37,15 +37,27 @@ import java.util.*
class MedicalPayActivity : BaseActivity() { class MedicalPayActivity : BaseActivity() {
companion object { companion object {
//价格
private const val PRICE_KEY = "price" private const val PRICE_KEY = "price"
//订单id
private const val ORDER_KEY = "orderId" private const val ORDER_KEY = "orderId"
//医生uid
private const val DOCTORUID_KEY = "doctorUid" private const val DOCTORUID_KEY = "doctorUid"
private const val Medical_KEY = "isMedical"
// 0账户充值(充值记录表)、1问诊订单(inquiry_order表)、2药品订单
private const val PAYBIZTYPE_KEY = "payBizType"
private lateinit var mPrice: String private lateinit var mPrice: String
private lateinit var mOrderId: String private lateinit var mOrderId: String
private lateinit var mDoctorUid: String private lateinit var mDoctorUid: String
private var mIsMedical: Boolean = false private var mPayBizType: Int = 1
//问诊订单
private val INQUIRY_ORDER_TYPE = 1;
//药品订单
private val MEDICAL_ORDER_TYPE = 2;
private var timer: CountDownTimer? = null private var timer: CountDownTimer? = null
//阿里支付 //阿里支付
...@@ -65,20 +77,18 @@ class MedicalPayActivity : BaseActivity() { ...@@ -65,20 +77,18 @@ class MedicalPayActivity : BaseActivity() {
* @param orderId 订单id * @param orderId 订单id
* */ * */
@JvmStatic @JvmStatic
fun start(context: Context, price: String, orderId: String, doctorUid: String) { fun start(
val starter = Intent(context, MedicalPayActivity::class.java) context: Context,
.putExtra(PRICE_KEY, price) price: String,
.putExtra(ORDER_KEY, orderId) orderId: String,
.putExtra(DOCTORUID_KEY, doctorUid) doctorUid: String,
context.startActivity(starter) payBizType: Int
} ) {
@JvmStatic
fun start(context: Context, price: String, orderId: String, doctorUid: String,isMedical :Boolean) {
val starter = Intent(context, MedicalPayActivity::class.java) val starter = Intent(context, MedicalPayActivity::class.java)
.putExtra(PRICE_KEY, price) .putExtra(PRICE_KEY, price)
.putExtra(ORDER_KEY, orderId) .putExtra(ORDER_KEY, orderId)
.putExtra(DOCTORUID_KEY, doctorUid) .putExtra(DOCTORUID_KEY, doctorUid)
.putExtra(Medical_KEY, isMedical) .putExtra(PAYBIZTYPE_KEY, payBizType)
context.startActivity(starter) context.startActivity(starter)
} }
...@@ -124,7 +134,7 @@ class MedicalPayActivity : BaseActivity() { ...@@ -124,7 +134,7 @@ class MedicalPayActivity : BaseActivity() {
mPrice = intent.getStringExtra(PRICE_KEY) mPrice = intent.getStringExtra(PRICE_KEY)
mOrderId = intent.getStringExtra(ORDER_KEY) mOrderId = intent.getStringExtra(ORDER_KEY)
mDoctorUid = intent.getStringExtra(DOCTORUID_KEY) mDoctorUid = intent.getStringExtra(DOCTORUID_KEY)
mIsMedical = intent.getBooleanExtra(Medical_KEY,false) mPayBizType = intent.getIntExtra(PAYBIZTYPE_KEY, INQUIRY_ORDER_TYPE)
payType = PAY_WECHAT payType = PAY_WECHAT
price.text = mPrice price.text = mPrice
...@@ -156,7 +166,8 @@ class MedicalPayActivity : BaseActivity() { ...@@ -156,7 +166,8 @@ class MedicalPayActivity : BaseActivity() {
CreatePayReqDtoBody( CreatePayReqDtoBody(
mPrice, mPrice,
mOrderId, mOrderId,
payChannel = payType payType,
mPayBizType
) )
) )
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -292,9 +303,9 @@ class MedicalPayActivity : BaseActivity() { ...@@ -292,9 +303,9 @@ class MedicalPayActivity : BaseActivity() {
fun onEvent(event: MedicalWXPayEvent) { fun onEvent(event: MedicalWXPayEvent) {
if (event.status.success) { if (event.status.success) {
if (mIsMedical){ if (mPayBizType == MEDICAL_ORDER_TYPE) {
MedicalPaySuccessActivity.start(this@MedicalPayActivity, mPrice, mOrderId) MedicalPaySuccessActivity.start(this@MedicalPayActivity, mPrice, mOrderId)
}else{ } else if (mPayBizType == INQUIRY_ORDER_TYPE) {
MedicalPayIn.mainIntentMessage(this@MedicalPayActivity, mDoctorUid) MedicalPayIn.mainIntentMessage(this@MedicalPayActivity, mDoctorUid)
ToastUtil.toastShort("支付成功") ToastUtil.toastShort("支付成功")
} }
......
...@@ -2,7 +2,10 @@ package com.medical.ydl.medical.pay ...@@ -2,7 +2,10 @@ package com.medical.ydl.medical.pay
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import kotlinx.android.synthetic.main.medical_pay_success_activity.* import kotlinx.android.synthetic.main.medical_pay_success_activity.*
import java.util.* import java.util.*
...@@ -46,13 +49,19 @@ class MedicalPaySuccessActivity : BaseActivity() { ...@@ -46,13 +49,19 @@ class MedicalPaySuccessActivity : BaseActivity() {
finish() finish()
} }
to_order.setOnClickListener { to_order.setOnClickListener {
//查看订单 //查看药品订单
NewH5Activity.start(
this@MedicalPaySuccessActivity,
H5Params(
HttpConfig.MEDICAL_H5URL + "ct/drug/order/details" + "?drugOrderId=" + mOrderId + "&hideNavBar=1",
"订单详情"
)
)
} }
} }
private fun initStatus() { private fun initStatus() {
StatusBarUtils.setTransparentForImageView(this@MedicalPaySuccessActivity, null) StatusBarUtils.setTransparentForImageView(this@MedicalPaySuccessActivity, null)
StatusBarUtils.statusBarLightMode(this@MedicalPaySuccessActivity) StatusBarUtils.statusBarLightMode(this@MedicalPaySuccessActivity)
......
...@@ -65,7 +65,7 @@ class H5JsBean { ...@@ -65,7 +65,7 @@ class H5JsBean {
var succ: String? = null var succ: String? = null
var course_id: String? = null var course_id: String? = null
var courseType: String? = null//课程类型:0 音频 1 视屏 var courseType: String? = null//课程类型:0 音频 1 视屏
var mediaType : String? = null//资料类型 1.音频 2.视频 var mediaType: String? = null//资料类型 1.音频 2.视频
var coursePlayUrl: String? = null//课程播放地址 var coursePlayUrl: String? = null//课程播放地址
var testResultId: Int? = 0 var testResultId: Int? = 0
...@@ -73,6 +73,7 @@ class H5JsBean { ...@@ -73,6 +73,7 @@ class H5JsBean {
//群聊id //群聊id
var tid: Int = 0 var tid: Int = 0
//专家id //专家id
var doctor_id: Int = 0 var doctor_id: Int = 0
...@@ -113,38 +114,51 @@ class H5JsBean { ...@@ -113,38 +114,51 @@ class H5JsBean {
} }
var test_items_id = 0 var test_items_id = 0
//倾诉线路类型 //倾诉线路类型
var confideType = 1 //1 axb 2双呼 3声网 var confideType = 1 //1 axb 2双呼 3声网
//倾诉支付参数 //倾诉支付参数
var payTitle: String? = null var payTitle: String? = null
//订单金额 //订单金额
var orderPrice: Double? = null var orderPrice: Double? = null
//优惠金额 //优惠金额
var coupnPrice: Double? = null var coupnPrice: Double? = null
//测评题 优惠券金额 //测评题 优惠券金额
var couponMoney: String? = "" var couponMoney: String? = ""
//可用余额 //可用余额
var avliableMoney: Double? = null var avliableMoney: Double? = null
//倾诉支付成功跳转地址 //倾诉支付成功跳转地址
var confideUrl: String? = null var confideUrl: String? = null
//打开与关闭右上角菜单 //打开与关闭右上角菜单
var toggleRightTopMenu: Int = 0 //0 关闭,1 打开 var toggleRightTopMenu: Int = 0 //0 关闭,1 打开
//打开与关闭分享菜单 //打开与关闭分享菜单
var toggleShareMenu: Int = 0 //0 关闭,1 打开 var toggleShareMenu: Int = 0 //0 关闭,1 打开
//标识首页第几个tab //标识首页第几个tab
var selectTab:Int = 0 var selectTab: Int = 0
//倾诉拨打电话使用参数 //倾诉拨打电话使用参数
var callType:String?=null var callType: String? = null
var switchStatus = 1 var switchStatus = 1
var closeReplaceChat=false var closeReplaceChat = false
var merchantType: String = ""
var day: String = "" // 预约日期
var merchantType:String="" var payBizType: Int = 1 // 0账户充值(充值记录表)、1问诊订单(inquiry_order表)、2药品订单
var day:String="" // 预约日期 var drugOrderId: String = "" // 药品订单id
} }
} }
} }
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