Commit b530ece9 by 刘鹏

Merge branch 'feat/lp/lp_test_vip' into 'd/v4.4.07'

测评会员代码合并

See merge request app_android_lib/YDL-Component!296
parents 25924372 2af5a191
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.18" componentVersion = "0.3.0.12"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
package com.yidianling.user.bean
data class EffectivityBean(
//1.测评在会员权益并生效中,2.该会员没有对应权益,3.权益过期
val isEffect: Int,
//0.下架,1.上架
val status: Int,
//权益包名称
val packageName: String,
//权益包id
val packageId: Int,
//到期时间
val overdue: String
)
\ No newline at end of file
...@@ -92,6 +92,8 @@ class UserMyPageEvent{ ...@@ -92,6 +92,8 @@ class UserMyPageEvent{
const val YDL_USER_MY_PAGE_STAY_VISIT=YDL_USER_MY_PAGE+"YDL_USER_MY_PAGE_STAY_VISIT" const val YDL_USER_MY_PAGE_STAY_VISIT=YDL_USER_MY_PAGE+"YDL_USER_MY_PAGE_STAY_VISIT"
const val YDL_USER_MY_TOP_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_top_type_click" const val YDL_USER_MY_TOP_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_top_type_click"
const val YDL_USER_MY_MIDDLE_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_middle_type_click" const val YDL_USER_MY_MIDDLE_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_middle_type_click"
//app我的页_会员中心区域点击
const val YDL_USER_MY_MEMBER_CENTRE_CLICK = YDL_USER_MY_PAGE + "member_centre_click"
const val YDL_USER_MY_BOTTOM_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_bottom_type_click" const val YDL_USER_MY_BOTTOM_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_bottom_type_click"
} }
} }
......
...@@ -118,6 +118,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -118,6 +118,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
rootView.findViewById<View>(R.id.ll_service).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_service).setOnClickListener(this)
//冥想 //冥想
rootView.findViewById<View>(R.id.ll_meditation).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_meditation).setOnClickListener(this)
rootView.findViewById<View>(R.id.me_card_vip).setOnClickListener(this)
//心理百科 //心理百科
rootView.findViewById<View>(R.id.ll_wiki).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_wiki).setOnClickListener(this)
...@@ -276,6 +277,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -276,6 +277,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
getLocal().setCoupon(false) getLocal().setCoupon(false)
} }
} }
MineHttpImpl.getInstance().effectivity()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe ({ response ->
if ("200" == response.code && response.data.isNotEmpty()) {
val effectivityBean = response.data[0]
if (effectivityBean.status == 1) {
//上架
me_card_vip.visibility = View.VISIBLE
if (effectivityBean.isEffect == 1) {
me_vip_des.text =
"${effectivityBean.packageName} 有效期至${effectivityBean.overdue}"
tv_open_vip.text = "查看详情"
} else {
me_vip_des.text = "您当前不是会员,开通立享会员特权"
tv_open_vip.text = "开通会员"
}
} else {
//下架
me_card_vip.visibility = View.GONE
}
} else {
me_card_vip.visibility = View.GONE
}
}, {
me_card_vip.visibility = View.GONE
})
} }
/** /**
...@@ -564,6 +593,19 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -564,6 +593,19 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
NewH5Activity.start(it, h5Params3) NewH5Activity.start(it, h5Params3)
} }
} else if (id == R.id.me_card_vip) {
count(UserMyPageEvent.YDL_USER_MY_MEMBER_CENTRE_CLICK)
//测评vip
mActivity?.let {
if (!startLoginByStatus(it, true)) {
return
}
mActivity?.let {
val h5Params3 = H5Params(MH5_URL + "ceshi/vip/detail", null)
NewH5Activity.start(it, h5Params3)
}
}
} }
} }
...@@ -606,6 +648,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -606,6 +648,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
val changeFlag = event.isChange_flag val changeFlag = event.isChange_flag
if (changeFlag) { if (changeFlag) {
initdata() initdata()
refreshCouponData()
try { try {
provide( provide(
IImService::class.java IImService::class.java
......
...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP ...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
...@@ -104,4 +105,12 @@ interface MineApi { ...@@ -104,4 +105,12 @@ interface MineApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun hasConfideOrder(@Body body: RequestBody):Observable<BaseAPIResponse<EvaluateOrderBean>> fun hasConfideOrder(@Body body: RequestBody):Observable<BaseAPIResponse<EvaluateOrderBean>>
/**
* 检查该用户是否是会员
*/
@GET("user/equity/effectivity")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>>
} }
\ No newline at end of file
...@@ -5,11 +5,15 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -5,11 +5,15 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.im.message.param.MsgListParam import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.mine.* import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.mine.APPWillUpParam
import com.yidianling.user.mine.FeedBackParam
import com.yidianling.user.mine.FundListParam
import com.yidianling.user.mine.RechargeParam
import com.yidianling.user.mine.bean.AccountBean import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.CouponNumBean import com.yidianling.user.mine.bean.CouponNumBean
...@@ -50,4 +54,6 @@ interface MineHttp { ...@@ -50,4 +54,6 @@ interface MineHttp {
fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>> fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>>
//获取测评vip数据
fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>>
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.utils.NetworkParamsUtils ...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.message.param.MsgListParam import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
...@@ -140,6 +141,10 @@ class MineHttpImpl private constructor() : MineHttp { ...@@ -140,6 +141,10 @@ class MineHttpImpl private constructor() : MineHttp {
return getAppApi().hasConfideOrder(body) return getAppApi().hasConfideOrder(body)
} }
override fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>> {
return getAppApi().effectivity()
}
object Holder { object Holder {
val INSTANCE = MineHttpImpl() val INSTANCE = MineHttpImpl()
} }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="19dp" />
<gradient
android:endColor="#ffb95f"
android:startColor="#ffc57d"
android:type="linear" />
</shape>
\ No newline at end of file
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