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
31d876fc
Commit
31d876fc
authored
Jul 16, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加支付宝小程序跳转,添加支付宝渠道
parent
87f5c72d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
94 deletions
+125
-94
build.gradle
video/app/build.gradle
+2
-2
VipBean.java
.../main/java/com/duben/speedplayletu/mvp/model/VipBean.java
+9
-0
VipActivity.kt
.../java/com/duben/speedplayletu/ui/activitys/VipActivity.kt
+95
-70
MyFragment.kt
...in/java/com/duben/speedplayletu/ui/fragment/MyFragment.kt
+15
-15
fragment_main_my.xml
video/app/src/main/res/layout/fragment_main_my.xml
+3
-6
gradle.properties
video/gradle.properties
+1
-1
No files found.
video/app/build.gradle
View file @
31d876fc
...
...
@@ -10,8 +10,8 @@ android {
applicationId
"com.duben.speedplayletu"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
71
2
versionName
"7.1.
2
"
versionCode
71
3
versionName
"7.1.
3
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
video/app/src/main/java/com/duben/speedplayletu/mvp/model/VipBean.java
View file @
31d876fc
...
...
@@ -33,6 +33,7 @@ public class VipBean implements Serializable {
private
String
title
;
private
String
topTitle
;
private
String
buttonText
;
private
int
payToModel
;
//0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序)
public
String
getButtonText
()
{
return
buttonText
;
...
...
@@ -113,5 +114,13 @@ public class VipBean implements Serializable {
public
int
getTrial
()
{
return
trial
;
}
public
int
getPayToModel
()
{
return
payToModel
;
}
public
void
setPayToModel
(
int
payToModel
)
{
this
.
payToModel
=
payToModel
;
}
}
}
video/app/src/main/java/com/duben/speedplayletu/ui/activitys/VipActivity.kt
View file @
31d876fc
...
...
@@ -40,6 +40,7 @@ import com.jobo.wxpay.WXPay
import
com.jobo.wxpay.WXPayInfoImpl
import
com.youth.banner.listener.OnPageChangeListener
import
kotlinx.android.synthetic.main.activity_new_vip.*
import
java.net.URLEncoder
/**
...
...
@@ -48,8 +49,8 @@ import kotlinx.android.synthetic.main.activity_new_vip.*
* 时间:2022/12/22 14:48
*/
class
VipActivity
:
BaseActivity
(),
VipView
,
View
.
OnClickListener
,
VipAdapter
.
OnItemClickListener
,
CompoundButton
.
OnCheckedChangeListener
{
VipAdapter
.
OnItemClickListener
,
CompoundButton
.
OnCheckedChangeListener
{
companion
object
{
const
val
IS_DETAIL
=
"IS_DETAIL"
//是否从剧集详情页进入
...
...
@@ -226,7 +227,22 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
return
}
alipay
(
paramsBean
)
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
val
payToModel
=
vipBean
.
payToModel
//0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序)
when
(
payToModel
){
0
->{
alipay
(
paramsBean
)
}
1
->{
openAutoAlipay
(
paramsBean
.
params
.
params
)
}
2
->{
openAlipayApp
()
}
}
}
}
}
}
...
...
@@ -262,7 +278,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(
data
.
expireTime
>
0
)
{
readyGo
(
MainActivity
::
class
.
java
)
val
activity
=
ActivityPageManager
.
getInstance
().
getActivity
(
MainActivity
::
class
.
java
)
ActivityPageManager
.
getInstance
().
getActivity
(
MainActivity
::
class
.
java
)
if
(
activity
!=
null
&&
activity
is
MainActivity
)
{
activity
.
clickTab4Layout
()
}
...
...
@@ -279,7 +295,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
if
(
UserManager
.
getInstance
().
newFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
vipAdapter
.
setPosition
(
0
)
...
...
@@ -308,7 +324,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
when
(
v
?.
id
)
{
R
.
id
.
ic_vip_quit
->
{
if
(
UserManager
.
getInstance
().
newFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
vipAdapter
.
setPosition
(
0
)
vipAdapter
.
notifyDataSetChanged
()
...
...
@@ -339,13 +355,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
else
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
}
...
...
@@ -386,7 +402,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
shimmer_text
?.
postDelayed
({
shimmer_text
?.
startShimmerAnimation
()
breathAnim
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
700
).
repeat
(-
1
).
playOn
(
shimmer_text
)
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
700
).
repeat
(-
1
).
playOn
(
shimmer_text
)
},
200
)
ic_vip_quit
.
setOnClickListener
(
this
)
...
...
@@ -442,18 +458,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
fun
alipay
(
wxParanBean
:
WxPayParamBean
)
{
try
{
// 自动签约付费
if
(
wxParanBean
.
params
.
isSign
)
{
AppConfig
.
enterAlipay
=
true
openAutoAlipay
(
wxParanBean
.
params
.
params
)
return
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
//实例化支付宝支付策略
val
aliPay
=
AliPay
()
//构造支付宝订单实体。一般都是由服务端直接返回。
...
...
@@ -478,22 +482,22 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
vipPresenter
.
queryVipOrder
(
wxParanBean
.
tid
.
toString
(),
false
)
mainHandler
.
postDelayed
(
{
if
(
isFinishing
)
return
@postDelayed
{
if
(
isFinishing
)
return
@postDelayed
// 挽留弹窗存在也不弹
if
(
payYesDialog
!=
null
&&
payYesDialog
!!
.
isShowing
)
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
()
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
// 0.01
if
(
vipBean
.
trial
!=
0
)
{
showPayCancelDialog
()
}
}
}
},
2000
},
2000
)
}
})
...
...
@@ -520,6 +524,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
* 自动续费
*/
fun
openAutoAlipay
(
url
:
String
)
{
AppConfig
.
enterAlipay
=
true
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url
))
startActivity
(
intent
)
}
...
...
@@ -549,13 +554,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
}
else
{
...
...
@@ -602,13 +607,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
R
.
id
.
tv_agreement_next
->
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
...
...
@@ -617,10 +622,10 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
})
ruleAgreementDialog
!!
.
setText
(
vipBean
.
remarks
,
vipBean
.
trialFirstDay
,
vipBean
.
price
,
vipBean
.
title
vipBean
.
remarks
,
vipBean
.
trialFirstDay
,
vipBean
.
price
,
vipBean
.
title
)
ruleAgreementDialog
!!
.
show
()
}
else
{
...
...
@@ -651,13 +656,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
else
{
if
(
TextUtils
.
equals
(
payType
,
WEIXIN_PAY
))
{
vipPresenter
.
getVipPayParams
(
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
"WEIXIN"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
else
if
(
TextUtils
.
equals
(
payType
,
ALIPAY
))
{
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
}
...
...
@@ -680,7 +685,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private
fun
setBanner
(
data
:
List
<
VedioBean
>)
{
mainHandler
.
postDelayed
({
val
scrollToBottomAnimator
=
ValueAnimator
.
ofInt
(
0
,
nsv
.
getChildAt
(
0
).
height
-
nsv
.
height
)
ValueAnimator
.
ofInt
(
0
,
nsv
.
getChildAt
(
0
).
height
-
nsv
.
height
)
scrollToBottomAnimator
.
addUpdateListener
{
animator
->
val
value
=
animator
.
animatedValue
as
Int
nsv
.
scrollTo
(
0
,
value
)
...
...
@@ -702,23 +707,23 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
val
adapter
=
VipBannerAdapter
(
data
)
// 绑定生命周期
vip_banner
.
addBannerLifecycleObserver
(
this
)
.
setBannerGalleryEffect
(
80
,
15
,
0.8f
)
.
setAdapter
(
adapter
)
.
addOnPageChangeListener
(
object
:
OnPageChangeListener
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
}
.
setBannerGalleryEffect
(
80
,
15
,
0.8f
)
.
setAdapter
(
adapter
)
.
addOnPageChangeListener
(
object
:
OnPageChangeListener
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
}
override
fun
onPageSelected
(
position
:
Int
)
{
GlideUtils
.
loadBlurImageView
(
mContext
,
data
[
position
].
coverImage
,
iv_blur
)
tv_banner_title
.
text
=
String
.
format
(
"《%1s》"
,
data
[
position
].
title
)
}
override
fun
onPageSelected
(
position
:
Int
)
{
GlideUtils
.
loadBlurImageView
(
mContext
,
data
[
position
].
coverImage
,
iv_blur
)
tv_banner_title
.
text
=
String
.
format
(
"《%1s》"
,
data
[
position
].
title
)
}
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{}
})
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{}
})
GlideUtils
.
loadBlurImageView
(
mContext
,
data
[
0
].
coverImage
,
iv_blur
)
tv_banner_title
.
text
=
String
.
format
(
"《%1s》"
,
data
[
0
].
title
)
}
...
...
@@ -732,12 +737,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
)
}
})
.
show
()
.
show
()
}
fun
startTimer
()
{
...
...
@@ -764,4 +769,24 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
})
timer
!!
.
start
()
}
/**
* 跳转支付宝小程序
*/
private
fun
openAlipayApp
()
{
AppConfig
.
enterAlipay
=
true
try
{
val
alipayAppId
=
"2021004157617228"
val
path
=
"app_uid="
+
UserManager
.
getInstance
().
userID
//这里是传的参数
val
link
=
URLEncoder
.
encode
(
path
,
"UTF-8"
)
//这里是encode传的参数
val
url
=
// "alipays://platformapi/startapp?appId=2021004129666486&page=pages/loading&query=" + link
"alipays://platformapi/startapp?appId="
+
alipayAppId
+
"&page=pages/loading&query="
+
link
val
uri
=
Uri
.
parse
(
url
)
// url为你要链接的地址
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
uri
)
startActivity
(
intent
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/speedplayletu/ui/fragment/MyFragment.kt
View file @
31d876fc
...
...
@@ -149,21 +149,21 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
private
fun
loginStatus
(
consumer
:
UserBean
)
{
// 1-匹配用户
if
(
consumer
.
activiteFlag
==
1
)
{
// 匹配
ll_my_vip
.
visibility
=
View
.
VISIBLE
ll_my_payrecord
.
visibility
=
View
.
VISIBLE
ll_contactus
.
visibility
=
View
.
VISIBLE
line_my_payrecord
.
visibility
=
View
.
VISIBLE
line_my_contactus
.
visibility
=
View
.
VISIBLE
}
else
{
// 未匹配
ll_my_vip
.
visibility
=
View
.
GONE
ll_my_payrecord
.
visibility
=
View
.
GONE
ll_contactus
.
visibility
=
View
.
GONE
line_my_payrecord
.
visibility
=
View
.
GONE
line_my_contactus
.
visibility
=
View
.
GONE
}
//
if (consumer.activiteFlag == 1) {
//
// 匹配
//
ll_my_vip.visibility = View.VISIBLE
//
ll_my_payrecord.visibility = View.VISIBLE
//
ll_contactus.visibility = View.VISIBLE
//
line_my_payrecord.visibility = View.VISIBLE
//
line_my_contactus.visibility = View.VISIBLE
//
} else {
//
// 未匹配
//
ll_my_vip.visibility = View.GONE
//
ll_my_payrecord.visibility = View.GONE
//
ll_contactus.visibility = View.GONE
//
line_my_payrecord.visibility = View.GONE
//
line_my_contactus.visibility = View.GONE
//
}
// 2-是否有手机号
if
(!
TextUtils
.
isEmpty
(
userManager
.
mobile
))
{
...
...
video/app/src/main/res/layout/fragment_main_my.xml
View file @
31d876fc
...
...
@@ -95,8 +95,7 @@
android:layout_marginRight=
"10dp"
android:background=
"@mipmap/bg_my_vip"
android:orientation=
"vertical"
android:paddingLeft=
"24dp"
android:visibility=
"gone"
>
android:paddingLeft=
"24dp"
>
<TextView
android:id=
"@+id/tv_my_vip"
...
...
@@ -241,8 +240,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
android:visibility=
"gone"
>
android:paddingEnd=
"15dp"
>
<TextView
android:layout_width=
"0dp"
...
...
@@ -305,8 +303,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
android:visibility=
"gone"
>
android:paddingEnd=
"15dp"
>
<TextView
android:id=
"@+id/tv_contact"
...
...
video/gradle.properties
View file @
31d876fc
...
...
@@ -44,7 +44,7 @@ WEIXIN_APP_SECRET =c7ae162c83efbb8449d576fa9b85a07e
RELEASE_UMENG_KEY
=
64b8de13a1a164591b5133df
#TalkingData
RELEASE_TALKING_DATA_KEY
=
"3510E9DDC0E74A44A2BBA904A8345918
"
RELEASE_TALKING_DATA_KEY
=
"3510E9DDC0E74A44A2BBA904A8345918"
GROMORE_APP_ID="5566629"
...
...
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