Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
59d2fcbc
Commit
59d2fcbc
authored
Feb 24, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 支付部分提交,1.支持药品支付,跳转订单详情,2.订单详情跳转未添加
parent
aa3203dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
211 additions
and
2 deletions
+211
-2
AndroidManifest.xml
ydl-medical-pay/src/main/AndroidManifest.xml
+7
-0
MedicalPayActivity.kt
ydl-medical-pay/src/main/java/com/medical/ydl/medical/pay/MedicalPayActivity.kt
+20
-2
MedicalPaySuccessActivity.kt
ydl-medical-pay/src/main/java/com/medical/ydl/medical/pay/MedicalPaySuccessActivity.kt
+61
-0
medical_pay_success_activity.xml
ydl-medical-pay/src/main/res/layout/medical_pay_success_activity.xml
+123
-0
No files found.
ydl-medical-pay/src/main/AndroidManifest.xml
View file @
59d2fcbc
...
@@ -11,6 +11,12 @@
...
@@ -11,6 +11,12 @@
android:name=
".MedicalPayActivity"
android:name=
".MedicalPayActivity"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
android:theme=
"@style/platform_NoTitleTheme"
/>
android:theme=
"@style/platform_NoTitleTheme"
/>
<!--支付成功界面-->
<activity
android:name=
".MedicalPaySuccessActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/platform_NoTitleTheme"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
ydl-medical-pay/src/main/java/com/medical/ydl/medical/pay/MedicalPayActivity.kt
View file @
59d2fcbc
...
@@ -40,9 +40,11 @@ class MedicalPayActivity : BaseActivity() {
...
@@ -40,9 +40,11 @@ class MedicalPayActivity : BaseActivity() {
private
const
val
PRICE_KEY
=
"price"
private
const
val
PRICE_KEY
=
"price"
private
const
val
ORDER_KEY
=
"orderId"
private
const
val
ORDER_KEY
=
"orderId"
private
const
val
DOCTORUID_KEY
=
"doctorUid"
private
const
val
DOCTORUID_KEY
=
"doctorUid"
private
const
val
Medical_KEY
=
"isMedical"
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
timer
:
CountDownTimer
?
=
null
private
var
timer
:
CountDownTimer
?
=
null
...
@@ -58,6 +60,7 @@ class MedicalPayActivity : BaseActivity() {
...
@@ -58,6 +60,7 @@ class MedicalPayActivity : BaseActivity() {
private
var
payType
=
PAY_WECHAT
private
var
payType
=
PAY_WECHAT
/**
/**
* 医疗图文问诊支付
* @param price 价格
* @param price 价格
* @param orderId 订单id
* @param orderId 订单id
* */
* */
...
@@ -69,6 +72,15 @@ class MedicalPayActivity : BaseActivity() {
...
@@ -69,6 +72,15 @@ class MedicalPayActivity : BaseActivity() {
.
putExtra
(
DOCTORUID_KEY
,
doctorUid
)
.
putExtra
(
DOCTORUID_KEY
,
doctorUid
)
context
.
startActivity
(
starter
)
context
.
startActivity
(
starter
)
}
}
@JvmStatic
fun
start
(
context
:
Context
,
price
:
String
,
orderId
:
String
,
doctorUid
:
String
,
isMedical
:
Boolean
)
{
val
starter
=
Intent
(
context
,
MedicalPayActivity
::
class
.
java
)
.
putExtra
(
PRICE_KEY
,
price
)
.
putExtra
(
ORDER_KEY
,
orderId
)
.
putExtra
(
DOCTORUID_KEY
,
doctorUid
)
.
putExtra
(
Medical_KEY
,
isMedical
)
context
.
startActivity
(
starter
)
}
@SuppressLint
(
"HandlerLeak"
)
@SuppressLint
(
"HandlerLeak"
)
private
val
mHandler
:
Handler
=
object
:
Handler
()
{
private
val
mHandler
:
Handler
=
object
:
Handler
()
{
...
@@ -112,6 +124,7 @@ class MedicalPayActivity : BaseActivity() {
...
@@ -112,6 +124,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
)
payType
=
PAY_WECHAT
payType
=
PAY_WECHAT
price
.
text
=
mPrice
price
.
text
=
mPrice
...
@@ -279,8 +292,13 @@ class MedicalPayActivity : BaseActivity() {
...
@@ -279,8 +292,13 @@ class MedicalPayActivity : BaseActivity() {
fun
onEvent
(
event
:
MedicalWXPayEvent
)
{
fun
onEvent
(
event
:
MedicalWXPayEvent
)
{
if
(
event
.
status
.
success
)
{
if
(
event
.
status
.
success
)
{
MedicalPayIn
.
mainIntentMessage
(
this
@MedicalPayActivity
,
mDoctorUid
)
if
(
mIsMedical
){
ToastUtil
.
toastShort
(
"支付成功"
)
MedicalPaySuccessActivity
.
start
(
this
@MedicalPayActivity
,
mPrice
,
mOrderId
)
}
else
{
MedicalPayIn
.
mainIntentMessage
(
this
@MedicalPayActivity
,
mDoctorUid
)
ToastUtil
.
toastShort
(
"支付成功"
)
}
finish
()
finish
()
}
else
{
}
else
{
ToastUtil
.
toastShort
(
"支付失败"
)
ToastUtil
.
toastShort
(
"支付失败"
)
...
...
ydl-medical-pay/src/main/java/com/medical/ydl/medical/pay/MedicalPaySuccessActivity.kt
0 → 100644
View file @
59d2fcbc
package
com.medical.ydl.medical.pay
import
android.content.Context
import
android.content.Intent
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
kotlinx.android.synthetic.main.medical_pay_success_activity.*
import
java.util.*
/**
* 医疗 成功页
* */
class
MedicalPaySuccessActivity
:
BaseActivity
()
{
companion
object
{
private
const
val
PRICE_KEY
=
"price"
private
const
val
ORDER_KEY
=
"orderId"
private
lateinit
var
mPrice
:
String
private
lateinit
var
mOrderId
:
String
/**
* @param price 价格
* @param orderId 订单id
* */
@JvmStatic
fun
start
(
context
:
Context
,
price
:
String
,
orderId
:
String
)
{
val
starter
=
Intent
(
context
,
MedicalPaySuccessActivity
::
class
.
java
)
.
putExtra
(
PRICE_KEY
,
price
)
.
putExtra
(
ORDER_KEY
,
orderId
)
context
.
startActivity
(
starter
)
}
}
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
medical_pay_success_activity
}
override
fun
initDataAndEvent
()
{
initStatus
()
mPrice
=
intent
.
getStringExtra
(
PRICE_KEY
)
mOrderId
=
intent
.
getStringExtra
(
ORDER_KEY
)
price
.
text
=
mPrice
iv_back
.
setOnClickListener
{
finish
()
}
to_order
.
setOnClickListener
{
//查看订单
}
}
private
fun
initStatus
()
{
StatusBarUtils
.
setTransparentForImageView
(
this
@MedicalPaySuccessActivity
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
@MedicalPaySuccessActivity
)
}
}
\ No newline at end of file
ydl-medical-pay/src/main/res/layout/medical_pay_success_activity.xml
0 → 100644
View file @
59d2fcbc
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#F6F7F9"
tools:context=
".MedicalPayActivity"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"96dp"
android:background=
"@color/white"
android:elevation=
"0dp"
android:gravity=
"bottom"
app:contentInsetStart=
"0dp"
app:layout_collapseMode=
"pin"
app:layout_constraintTop_toTopOf=
"parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:ellipsize=
"end"
android:gravity=
"center"
android:maxEms=
"10"
android:maxLines=
"1"
android:text=
"支付订单"
android:textColor=
"#10233a"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_back"
android:layout_width=
"wrap_content"
android:layout_height=
"56dp"
android:paddingStart=
"16dp"
android:paddingEnd=
"16dp"
android:src=
"@mipmap/medical_icon_title_back"
/>
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
<ImageView
android:id=
"@+id/success_icon"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_marginTop=
"100dp"
android:src=
"@mipmap/medical_pay_check"
app:layout_constraintTop_toBottomOf=
"@id/toolbar"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
<TextView
android:id=
"@+id/price"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:layout_marginTop=
"28dp"
android:textColor=
"#ff0c1d31"
android:textSize=
"32sp"
android:textStyle=
"bold"
app:layout_constraintHorizontal_chainStyle=
"packed"
app:layout_constraintLeft_toRightOf=
"@id/price_unit"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/success_icon"
tools:text=
"99"
/>
<TextView
android:id=
"@+id/price_unit"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"¥"
android:textColor=
"#ff0c1d31"
android:textSize=
"24sp"
app:layout_constraintBaseline_toBaselineOf=
"@id/price"
app:layout_constraintHorizontal_chainStyle=
"packed"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@id/price"
/>
<TextView
android:id=
"@+id/hold_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:text=
"支付成功"
android:textColor=
"#ff0c1d31"
android:textSize=
"16sp"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/price"
/>
<LinearLayout
android:id=
"@+id/ll_to_order"
android:layout_width=
"match_parent"
android:layout_height=
"98dp"
android:layout_alignParentBottom=
"true"
android:background=
"@color/white"
android:orientation=
"horizontal"
android:padding=
"16dp"
app:layout_constraintBottom_toBottomOf=
"parent"
>
<TextView
android:id=
"@+id/to_order"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:background=
"@drawable/medical_bg_3464ec_8dp"
android:gravity=
"center"
android:text=
"查看订单"
android:textColor=
"@color/white"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment