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
0448737f
Commit
0448737f
authored
Jul 11, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
889ed912
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
69 deletions
+92
-69
VipActivity.kt
...java/com/duben/miaoquplayletu/ui/activitys/VipActivity.kt
+92
-69
No files found.
video/app/src/main/java/com/duben/miaoquplayletu/ui/activitys/VipActivity.kt
View file @
0448737f
...
@@ -40,6 +40,7 @@ import com.jobo.wxpay.WXPay
...
@@ -40,6 +40,7 @@ import com.jobo.wxpay.WXPay
import
com.jobo.wxpay.WXPayInfoImpl
import
com.jobo.wxpay.WXPayInfoImpl
import
com.youth.banner.listener.OnPageChangeListener
import
com.youth.banner.listener.OnPageChangeListener
import
kotlinx.android.synthetic.main.activity_new_vip.*
import
kotlinx.android.synthetic.main.activity_new_vip.*
import
java.net.URLEncoder
/**
/**
...
@@ -226,6 +227,21 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -226,6 +227,21 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
return
return
}
}
// 自动签约付费
try
{
if
(
paramsBean
.
params
.
isSign
)
{
AppConfig
.
enterAlipay
=
true
openAutoAlipay
(
paramsBean
.
params
.
params
)
return
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
//支付宝小程序
// openAlipayApp()
// sdk支付
alipay
(
paramsBean
)
alipay
(
paramsBean
)
}
}
}
}
...
@@ -442,18 +458,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -442,18 +458,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
}
fun
alipay
(
wxParanBean
:
WxPayParamBean
)
{
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
()
val
aliPay
=
AliPay
()
//构造支付宝订单实体。一般都是由服务端直接返回。
//构造支付宝订单实体。一般都是由服务端直接返回。
...
@@ -764,4 +768,23 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -764,4 +768,23 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
})
})
timer
!!
.
start
()
timer
!!
.
start
()
}
}
/**
* 跳转支付宝小程序
*/
private
fun
openAlipayApp
()
{
try
{
val
alipayAppId
=
"2021004145639480"
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
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