Commit a4ed5af4 authored by maxiaoliang's avatar maxiaoliang

修改任务完成后领取接口

parent 8e3fc437
......@@ -18,6 +18,7 @@ import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskCompleteEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
......@@ -54,6 +55,7 @@ class WateringTaskAdpater :
holder.imgcoin.setImageResource(R.mipmap.icon_popupwater_icon)
if (data.description != null) {
holder.btnProgess.visibility = View.GONE
holder.tvTitle.text = data.title+" (${data.current_nums}/${data.awardLimit})"
holder.tvProgess.text = data.description
} else {
holder.btnProgess.visibility = View.VISIBLE
......@@ -116,10 +118,11 @@ class WateringTaskAdpater :
// 领取水滴 type:1每日领水 2高额领水
private fun getDripTaskReceive(type: Int, data: NewsEntity) {
GameApiClient.gameApi.getTaskReceive(data.sid, type).compose(
GameApiClient.gameApi.getTaskComplete(data.sid).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) {
).subscribe(object : BaseObserver<TaskCompleteEntity>() {
override fun onSuccess(result: TaskCompleteEntity?) {
RxBusUtil.getDefault()
.send(RxBusConstant.RX_MAIN_WATER_DROP_UPDATE)
if (result != null) {
......@@ -133,10 +136,14 @@ class WateringTaskAdpater :
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.awardCoins!!, null)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
/**
......
......@@ -75,7 +75,8 @@ class WateringRewardPresenter : WateringRewardContract.Presenter {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskListResult(null)
getRrchardDailyTask()
}
})
}
......
......@@ -96,6 +96,7 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
@SuppressLint()
@Subscribe(code = RxBusConstant.RX_MAIN_WATER_DROP_UPDATE, threadMode = ThreadMode.MAIN)
fun updateList() {
mPresenter?.getRrchardDailyTask()
}
......
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