Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fiveworld
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_fiveworld
Commits
6e3e048f
Commit
6e3e048f
authored
Aug 05, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改开通vip点击事件
parent
eb1a045a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
22 deletions
+51
-22
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+32
-14
OpenvipViewModel.kt
...rc/main/java/com/mints/street/main/my/OpenvipViewModel.kt
+3
-0
view_data_page1.xml
app/src/main/res/layout/view_data_page1.xml
+2
-1
view_data_page2.xml
app/src/main/res/layout/view_data_page2.xml
+2
-1
view_data_page3.xml
app/src/main/res/layout/view_data_page3.xml
+2
-1
view_data_page4.xml
app/src/main/res/layout/view_data_page4.xml
+2
-1
view_data_page5.xml
app/src/main/res/layout/view_data_page5.xml
+2
-1
view_data_page6.xml
app/src/main/res/layout/view_data_page6.xml
+2
-1
view_data_page7.xml
app/src/main/res/layout/view_data_page7.xml
+2
-1
view_data_page8.xml
app/src/main/res/layout/view_data_page8.xml
+2
-1
No files found.
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
6e3e048f
...
...
@@ -2,7 +2,6 @@ package com.mints.street.main.my
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.content.Intent
import
android.graphics.Color
import
android.os.Bundle
import
android.text.TextUtils
...
...
@@ -22,21 +21,15 @@ import com.mints.street.bean.PaymentBean
import
com.mints.street.bean.VipBean
import
com.mints.street.bean.WxPayParamBean
import
com.mints.street.databinding.ActivityOpenvipBinding
import
com.mints.street.main.MainActivity
import
com.mints.street.manager.UserManager
import
com.mints.street.utils.json.JsonUtil
import
com.mints.street.widget.dialog.DialogListener
import
com.mints.street.widget.dialog.DialogUtils
import
com.mints.street.widget.dialog.WxLoginDialog
import
kotlinx.android.synthetic.main.activity_openvip.*
import
kotlinx.android.synthetic.main.activity_openvip.bt_try
import
kotlinx.android.synthetic.main.fragment_my.*
import
kotlinx.android.synthetic.main.include_header.*
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.AppUtils
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.ToastUtils
import
me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class
OpenvipActivity
:
BaseActivity
<
ActivityOpenvipBinding
,
OpenvipViewModel
>(),
View
.
OnClickListener
{
...
...
@@ -59,10 +52,10 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override
fun
initData
()
{
super
.
initData
()
//获取vip福利信息
viewModel
.
getVipProductsByType
()
//获取支付方式
viewModel
.
getpaymentwey
(
"android"
)
//获取vip福利信息
viewModel
.
getVipProductsByType
()
//获取支付方式
viewModel
.
getpaymentwey
(
"android"
)
initView
()
initListener
()
...
...
@@ -81,7 +74,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
ly_weixin
.
setOnClickListener
(
this
)
ly_alipay
.
setOnClickListener
(
this
)
loginDialog
.
setListener
(
object
:
WxLoginDialog
.
WxLoginListener
{
loginDialog
.
setListener
(
object
:
WxLoginDialog
.
WxLoginListener
{
override
fun
loginSuc
(
wxInfo
:
String
)
{
viewModel
.
wechatlogin
(
wxInfo
)
}
...
...
@@ -113,6 +106,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
list
.
add
(
page5
)
list
.
add
(
page8
)
// page1.setOnClickListener {
// if (UserManager.INSTANCE.userIsLogin()) {
// payVip()
// } else {
// loginDialog.show()
// }
// }
//设置显示的数据
cfp_data_viewpager
.
setViewList
(
list
)
...
...
@@ -165,6 +165,17 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
mAdapter
=
DelegateAdapter
(
vLayout
,
false
)
binding
.
listview
.
adapter
=
mAdapter
binding
.
listview
.
layoutManager
=
vLayout
}
//添加page点击时间
fun
pageOnClick
(
view
:
View
?)
{
if
(
UserManager
.
INSTANCE
.
userIsLogin
())
{
payVip
()
}
else
{
loginDialog
.
show
()
}
}
override
fun
initViewObservable
()
{
...
...
@@ -191,7 +202,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
})
viewModel
.
isPaySuc
.
observe
(
this
,
Observer
<
Boolean
>
{
if
(
it
)
{
if
(
it
)
{
finish
()
}
})
...
...
@@ -217,6 +228,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
})
viewModel
.
isloginSuc
.
observe
(
this
,
Observer
{
if
(
it
)
{
payVip
()
}
else
{
ToastUtils
.
showLong
(
"登录失败"
)
}
})
}
...
...
@@ -359,7 +377,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override
fun
onResume
()
{
super
.
onResume
()
KLog
.
e
(
"OpenvipActivity"
,
"onResume"
)
KLog
.
e
(
"OpenvipActivity"
,
"onResume"
)
// if(userManager.userIsLogin()&&userManager.getVipFlag()){
// finish()
// }
...
...
app/src/main/java/com/mints/street/main/my/OpenvipViewModel.kt
View file @
6e3e048f
...
...
@@ -110,6 +110,7 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
)
}
var
isloginSuc
:
MutableLiveData
<
Boolean
>
=
MutableLiveData
()
fun
wechatlogin
(
wxInfo
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"wxInfo"
]
=
wxInfo
...
...
@@ -125,11 +126,13 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
KLog
.
e
(
"wechatlogin"
,
"微信登录接口成功"
)
ToastUtils
.
showLong
(
"登录成功"
)
isloginSuc
.
value
=
true
}
override
fun
onError
(
e
:
Throwable
)
{
super
.
onError
(
e
)
KLog
.
e
(
"wechatlogin"
,
"微信登录接口失败"
)
isloginSuc
.
value
=
false
}
})
}
...
...
app/src/main/res/layout/view_data_page1.xml
View file @
6e3e048f
...
...
@@ -5,6 +5,7 @@
android:background=
"@mipmap/icon_card"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page2.xml
View file @
6e3e048f
...
...
@@ -5,7 +5,8 @@
android:background=
"@mipmap/icon_card1"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page3.xml
View file @
6e3e048f
...
...
@@ -5,5 +5,6 @@
android:background=
"@mipmap/icon_card2"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page4.xml
View file @
6e3e048f
...
...
@@ -5,5 +5,6 @@
android:background=
"@mipmap/icon_card3"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page5.xml
View file @
6e3e048f
...
...
@@ -5,6 +5,7 @@
android:background=
"@mipmap/icon_card4"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page6.xml
View file @
6e3e048f
...
...
@@ -5,6 +5,7 @@
android:background=
"@mipmap/icon_card5"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page7.xml
View file @
6e3e048f
...
...
@@ -5,6 +5,7 @@
android:background=
"@mipmap/icon_card6"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_data_page8.xml
View file @
6e3e048f
...
...
@@ -5,6 +5,7 @@
android:background=
"@mipmap/icon_card7"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingTop=
"20dp"
>
android:paddingTop=
"20dp"
android:onClick=
"pageOnClick"
>
</RelativeLayout>
\ 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