Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
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
android
android_vedio
Commits
5a7320b1
Commit
5a7320b1
authored
Oct 09, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加蚂蚁链
parent
321ba848
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
95 deletions
+71
-95
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+9
-1
VipPresenter.kt
...a/com/duben/duoduoplayletu/mvp/presenters/VipPresenter.kt
+1
-1
VipActivity.kt
...java/com/duben/duoduoplayletu/ui/activitys/VipActivity.kt
+61
-93
No files found.
video/app/src/main/AndroidManifest.xml
View file @
5a7320b1
...
...
@@ -121,7 +121,15 @@
<activity
android:name=
".ui.activitys.VipActivity"
android:exported=
"false"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
tools:node=
"merge"
>
<intent-filter
tools:node=
"replace"
>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"com.duben.duoduoplayletu.ui.activitys.VipActivity"
tools:ignore=
"AppLinkUrlError"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.activitys.SettingsActivity"
android:exported=
"false"
...
...
video/app/src/main/java/com/duben/duoduoplayletu/mvp/presenters/VipPresenter.kt
View file @
5a7320b1
...
...
@@ -184,7 +184,7 @@ class VipPresenter : BasePresenter<VipView>() {
fun
getVipPayParams
(
payChannel
:
String
,
pid
:
String
,
isInstallAlipay
:
Boolean
,
enter
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
//
vo["payChannel"] = payChannel
vo
[
"payChannel"
]
=
payChannel
vo
[
"payChannel"
]
=
"ALIPAY"
vo
[
"pid"
]
=
pid
vo
[
"isInstallAlipay"
]
=
isInstallAlipay
...
...
video/app/src/main/java/com/duben/duoduoplayletu/ui/activitys/VipActivity.kt
View file @
5a7320b1
...
...
@@ -8,15 +8,14 @@ import android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.util.Log
import
android.view.KeyEvent
import
android.view.View
import
android.widget.CompoundButton
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.alipay.sdk.app.OpenAuthTask
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.duoduoplayletu.BuildConfig
import
com.duben.duoduoplayletu.R
import
com.duben.duoduoplayletu.common.AppConfig
...
...
@@ -32,6 +31,8 @@ import com.duben.duoduoplayletu.ui.adapter.VipBannerAdapter
import
com.duben.duoduoplayletu.ui.widgets.*
import
com.duben.duoduoplayletu.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.duben.duoduoplayletu.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.jobo.alipay.AliPay
import
com.jobo.alipay.AlipayInfoImpl
import
com.jobo.rxpay.RxPay
...
...
@@ -43,6 +44,7 @@ import com.tencent.mm.opensdk.openapi.IWXAPI
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
import
com.youth.banner.listener.OnPageChangeListener
import
kotlinx.android.synthetic.main.activity_new_vip.*
import
java.net.URLDecoder
import
java.net.URLEncoder
...
...
@@ -250,6 +252,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
openAlipayApp
(
vipBean
.
payToModel2SecondAlipayAppid
)
}
}
4
->
{
goAlipaySignExecute
(
paramsBean
.
params
.
params
)
}
}
}
}
...
...
@@ -344,6 +349,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
payType
=
ALIPAY
iv_vip_alipay
.
setImageResource
(
R
.
mipmap
.
ic_vip_enable_blue
)
iv_vip_wx
.
setImageResource
(
R
.
mipmap
.
ic_vip_none
)
}
else
{
payType
=
ALIPAY
}
backPayYesDialog
(
vipBean
)
}
else
{
...
...
@@ -362,20 +369,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(
vipBean
.
isShowCycTips
)
{
agreementPayDialog
()
}
else
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
payType
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
}
}
else
{
showToast
(
"产品未配置"
)
}
...
...
@@ -491,25 +490,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
override
fun
cancel
()
{
vipPresenter
.
queryVipOrder
(
wxParanBean
.
tid
.
toString
(),
false
)
mainHandler
.
postDelayed
(
{
if
(
isFinishing
)
return
@postDelayed
// 挽留弹窗存在也不弹
if
(
payYesDialog
!=
null
&&
payYesDialog
!!
.
isShowing
)
return
@postDelayed
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
// 0.01
if
(
vipBean
.
trial
!=
0
)
{
showPayCancelDialog
()
}
}
},
2000
)
}
})
}
...
...
@@ -563,20 +543,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
payType
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_DIALOG
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_DIALOG
)
}
}
else
{
showToast
(
"产品未配置"
)
}
...
...
@@ -619,21 +591,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
when
(
v
.
id
)
{
R
.
id
.
tv_agreement_next
->
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
payType
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
}
}
}
})
...
...
@@ -670,19 +633,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(
vipBean
.
isShowCycTips
)
{
agreementPayDialog
()
}
else
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
payType
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_ACTIVITY
)
}
}
}
else
{
showToast
(
"产品未配置"
)
...
...
@@ -746,24 +701,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
tv_banner_title
.
text
=
String
.
format
(
"《%1s》"
,
data
[
0
].
title
)
}
private
fun
showPayCancelDialog
()
{
val
vipBean
=
vipList
!!
[
0
]
VipPayCancelDialog
(
this
,
vipBean
.
price
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
(),
ENTER_TYPE_DIALOG
)
}
})
.
show
()
}
fun
startTimer
()
{
if
(
timer
!=
null
)
{
//防止计时器重复
timer
!!
.
stop
()
...
...
@@ -826,4 +763,35 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
e
.
printStackTrace
()
}
}
/**
* 唤起独立签约-拿到结果
*
* @param signParams
*/
private
fun
goAlipaySignExecute
(
signParams
:
String
)
{
AppConfig
.
enterAlipay
=
true
try
{
val
openAuthTask
=
OpenAuthTask
(
this
)
val
map
:
MutableMap
<
String
,
String
>
=
HashMap
()
map
[
"sign_params"
]
=
signParams
openAuthTask
.
execute
(
"com.duben.duoduoplayletu.ui.activitys.VipActivity"
,
OpenAuthTask
.
BizType
.
Deduct
,
map
,
{
resultCode
:
Int
,
memo
:
String
?,
bundle
:
Bundle
->
if
(
resultCode
==
OpenAuthTask
.
OK
)
{
// 对业务完成的结果做后续处理
}
else
{
// 对业务失败的结果做后续处理
showToast
(
"支付失败"
)
}
},
true
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
\ 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