Commit f6d53d7f authored by jyx's avatar jyx

添加新人红包奖励审核接口

parent ef0d205d
package com.mints.flowbox.mvp.presenters
import com.google.gson.JsonObject
import com.mints.flowbox.manager.AppHttpManager
import com.mints.flowbox.mvp.model.BaseResponse
import com.mints.flowbox.mvp.model.GetPacketBean
......@@ -38,4 +37,33 @@ class GetPacketPresenter : BasePresenter<GetPacketView>() {
}
})
}
/** 我知道了 */
fun setSignComplete() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.setSignComplete(),
object : BaseSubscriber<BaseResponse<Object>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<Object>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.setSignCompleteSuc()
else -> view.showToast(message)
}
}
})
}
}
\ No newline at end of file
......@@ -5,4 +5,5 @@ import com.mints.flowbox.mvp.model.GetPacketBean
interface GetPacketView : BaseView {
fun getRankMsgSuc(getPacketBean: GetPacketBean)
fun setSignCompleteSuc()
}
\ No newline at end of file
......@@ -496,7 +496,7 @@ public interface LoanService {
* 200元现金我知道了
*/
@POST("api//setSignComplete")
Observable<BaseResponse<Object>> setSignComplete(@Body Map<String, Object> vo);
Observable<BaseResponse<Object>> setSignComplete();
/**
* 默认http工厂
......
......@@ -535,7 +535,12 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
AppConfig.FRAGMENT_THREE_SHOW_TYPE = data.signPageStatus
if (data.signPageStatus == 3) {
tab_iv_four.background = ContextCompat.getDrawable(this, R.drawable.tab_friends_btn)
tab_iv_four.setImageDrawable(
ContextCompat.getDrawable(
this,
R.drawable.tab_friends_btn
)
)
tab_tv_four.text = "平台分红"
}
......
......@@ -87,7 +87,6 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
awardContainer.visibility = View.VISIBLE
progressContainer.visibility = View.GONE
}
}
}
......@@ -131,6 +130,11 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
.create()
}
override fun setSignCompleteSuc() {
hideLoading()
(requireActivity() as MainActivity).clickTab4Layout()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.btn_speed_test -> {
......@@ -160,9 +164,7 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
// 领取奖励
showLoading("200元奖励已经发送到您的账户中!")
Handler(Looper.getMainLooper()).postDelayed({
hideLoading()
}, 1000)
getPacketPresenter.setSignComplete()
}
else -> {
}
......
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