Commit d20322f8 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent ff10cd77
......@@ -50,13 +50,13 @@ interface MainApi {
/**
* 开通vip
*/
@POST("api/getVipProductsByType")
@POST("common/getVipProductsByType")
fun getVipProductsByType(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<VipBean>>>
/**
* 获取vip支付渠道
*/
@POST("api/getPayChannels")
@POST("common/getPayChannels")
fun getPayChannels(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<PaymentBean>>>
/**
......
......@@ -126,11 +126,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
//设置立即领取点击事件
binding.btTry.setOnClickListener {
// startActivity(PermissionsActivity::class.java)
if (userManager.userIsLogin()) {
startActivity(OpenvipActivity::class.java)
} else {
ToastUtils.showLong("请先登录!")
}
startActivity(OpenvipActivity::class.java)
}
......
......@@ -51,12 +51,10 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override fun initData() {
super.initData()
if(!TextUtils.isEmpty(UserManager.INSTANCE.getUserID())){
//获取vip福利信息
viewModel.getVipProductsByType()
//获取支付方式
viewModel.getpaymentwey("android")
}
StatusBarUtil.setHeightAndPadding(this, binding.viewBg)
initView()
......@@ -235,7 +233,11 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
currentPayType="ALIPAY"
}
R.id.bt_try -> {//点击开通全球会员按钮
payVip()
if (UserManager.INSTANCE.userIsLogin()) {
payVip()
} else {
startActivity(OpenvipActivity::class.java)
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment