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
d957dab4
Commit
d957dab4
authored
Aug 23, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付成功添加vip状态调用
parent
3a08adeb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
1 deletion
+69
-1
VipPresenter.kt
...in/java/com/duben/xixifree/mvp/presenters/VipPresenter.kt
+38
-0
VipView.kt
...app/src/main/java/com/duben/xixifree/mvp/views/VipView.kt
+3
-0
VipActivity.kt
.../main/java/com/duben/xixifree/ui/activitys/VipActivity.kt
+28
-1
No files found.
video/app/src/main/java/com/duben/xixifree/mvp/presenters/VipPresenter.kt
View file @
d957dab4
...
...
@@ -209,4 +209,42 @@ class VipPresenter : BasePresenter<VipView>() {
}
})
}
fun
getMyInfo
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"os"
]
=
"android"
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getMyInfo
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
UserBean
>)
{
if
(
isLinkView
)
return
val
code
:
Int
=
baseResponse
.
status
val
message
:
String
=
baseResponse
.
message
when
(
code
)
{
200
->
{
view
.
getUserSuc
(
baseResponse
.
data
)
}
else
->
{
view
.
showToast
(
message
)
}
}
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/xixifree/mvp/views/VipView.kt
View file @
d957dab4
package
com.duben.xixifree.mvp.views
import
com.duben.xixifree.mvp.model.UserBean
import
com.duben.xixifree.mvp.model.VipBean
import
com.duben.xixifree.mvp.model.WxPayParamBean
interface
VipView
:
BaseView
{
fun
getUserSuc
(
data
:
UserBean
)
fun
getVipProductSuc
(
data
:
VipBean
)
fun
getVipPayParamsSuc
(
payChannel
:
String
,
data
:
WxPayParamBean
)
fun
queryVipOrderSuc
(
isPay
:
Boolean
)
...
...
video/app/src/main/java/com/duben/xixifree/ui/activitys/VipActivity.kt
View file @
d957dab4
...
...
@@ -31,6 +31,7 @@ import com.duben.xixifree.ui.activitys.base.BaseActivity
import
com.duben.xixifree.ui.adapter.VipAdapter
import
com.duben.xixifree.ui.widgets.*
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.xixifree.mvp.model.UserBean
import
kotlinx.android.synthetic.main.activity_vip.*
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -66,6 +67,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
private
var
isGuide
:
Boolean
=
false
// 从启动页进入vip界面,返回时要回到首页
private
var
isMain
:
Boolean
=
false
private
var
isRecommend
:
Boolean
=
false
private
var
isClickAlipayZero
:
Boolean
=
false
private
var
payType
=
ALIPAY
// 支付类型
private
var
vedioId
=
""
private
var
thirdId
=
""
...
...
@@ -103,6 +105,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
initListener
()
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
isClickAlipayZero
)
{
isClickAlipayZero
=
false
vipPresenter
.
getMyInfo
()
}
}
override
fun
finish
()
{
super
.
finish
()
//关闭窗体动画显示
...
...
@@ -403,14 +413,31 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
try
{
// 自动签约付费
if
(
wxParanBean
.
params
.
isSign
)
{
isClickAlipayZero
=
true
openAutoAlipay
(
wxParanBean
.
params
.
params
)
return
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
override
fun
getUserSuc
(
data
:
UserBean
)
{
if
(
isFinishing
)
return
if
(
data
.
expireTime
>
0
)
{
UserManager
.
getInstance
().
vipFlag
=
true
showToast
(
"支付成功"
)
if
(!
UserManager
.
getInstance
().
userIsLogin
())
{
val
b
=
Bundle
()
b
.
putString
(
MobileLoginActivity
.
TYPE
,
"vip"
)
readyGoThenKill
(
MobileLoginActivity
::
class
.
java
,
b
)
}
else
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
}
}
/**
* 检测是否安装支付宝
*
...
...
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