Commit d20322f8 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

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