Commit 59c8427b authored by mengcuiguang's avatar mengcuiguang

代码优化

parent cd6e5f16
......@@ -65,7 +65,6 @@ android {
buildConfigField "boolean", "LOG_DEBUG", "true"
buildConfigField "String", "AppKeyPre", "\"abcd\""
buildConfigField "String", "MainIp", DEBUG_URL
// buildConfigField "String", "MainIp", RELEASE_URL
//混淆
minifyEnabled false
......
//package com.wenshu.youyou.manager
//
//import android.app.Application
//import android.os.Build
//import android.text.TextUtils
//import com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
//import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.WenshuApplication
//
///**
// * 描述:鱼丸盒子游戏
// * 作者:孟崔广
// */
//object YwhzManager {
//
// private const val APPID_DEBUG = ""
// private const val APPSECRET_DEBUG = ""
//
// private const val APPID_RELEASE = ""
// private const val APPSECRET_RELEASE = ""
//
// fun init(application: Application) {
// val userManager = UserManager.getInstance()
// var userID = userManager.userID
// if (!userManager.userIsLogin() || TextUtils.isEmpty(userID)) {
// // 用户id为空 或 未登录 = 游客
// userID = "0"
// }
//
// val appid: String
// val appSecret: String
// if (BuildConfig.DEBUG) {
// appid = APPID_DEBUG
// appSecret = APPSECRET_DEBUG
// } else {
// appid = APPID_RELEASE
// appSecret = APPSECRET_RELEASE
// }
// var oaid: String = ""
// if (Build.VERSION.SDK_INT > 28) {
// if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
// oaid = WenshuApplication.OAID
// }
// }
// setDebugMode()
// init(application, appSecret, appid, userID, "1", oaid)
// }
//}
\ No newline at end of file
package com.wenshu.youyou.mvp.model
import java.io.Serializable
data class CpdBean(val needSeconds: Int = 0,
val coin: Int = 0,
val CPD: Int = 0,
val CPD_SYD: Int = 0,
val cpdOrder: String = "",
val coinSh: Int = 0,
val coinSyd: Int = 0
) : Serializable
\ No newline at end of file
......@@ -35,6 +35,7 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
when (baseResponse.status) {
200 -> {
sonCashoutChallengeMsg()
view.getFriendsHallMsgSuc(baseResponse.data)
}
else -> {
......@@ -185,7 +186,7 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
/**
* 新版分红逻辑
*/
fun sonCashoutChallengeMsg() {
private fun sonCashoutChallengeMsg() {
AppHttpManager.getInstance(loanApplication)
.call(
loanService.sonCashoutChallengeMsg(),
......
......@@ -16,6 +16,7 @@ import com.wenshu.youyou.utils.LogUtil
import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable
import com.wenshu.library.utils.json.JsonUtil
import com.wenshu.youyou.mvp.model.CpdBean
class TaskPresenter : BasePresenter<TaskView>() {
fun getShCpdTime() {
......@@ -25,7 +26,7 @@ class TaskPresenter : BasePresenter<TaskView>() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.getShCpdTime(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
object : BaseSubscriber<BaseResponse<CpdBean>>() {
override fun onCompleted() {
}
......@@ -35,20 +36,14 @@ class TaskPresenter : BasePresenter<TaskView>() {
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
override fun onNext(baseResponse: BaseResponse<CpdBean>) {
if (isLinkView) return
val code = baseResponse.status
val data = baseResponse.data
when (code) {
200 -> {
if (data != null) {
view.getShCpdTimeSuc(
data.get("needSeconds").asInt,
data.get("coin").asInt,
data.get("CPD").asInt,
data.get("CPD_SYD").asInt,
data.get("cpdOrder").asString
)
view.getShCpdTimeSuc(baseResponse.data)
}
}
}
......
package com.wenshu.youyou.mvp.views
import com.wenshu.youyou.mvp.model.CpdBean
import com.wenshu.youyou.mvp.model.CpdModelBean
import com.wenshu.youyou.mvp.model.SydCpdListBean
interface TaskView : BaseView {
fun getShCpdTimeSuc(time: Int, coin: Int, CPD: Int, CPD_SYD: Int, CPD_ORDER: String?)
fun getShCpdTimeSuc(data: CpdBean)
fun getCpdModelSuc(dataBean: CpdModelBean.DataBean)
......
......@@ -10,6 +10,7 @@ import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.model.CashoutChallengeBean;
import com.wenshu.youyou.mvp.model.ClickTurnBean;
import com.wenshu.youyou.mvp.model.CommonParamBean;
import com.wenshu.youyou.mvp.model.CpdBean;
import com.wenshu.youyou.mvp.model.DrawcashBean;
import com.wenshu.youyou.mvp.model.DrawcashRecordBean;
import com.wenshu.youyou.mvp.model.FriendHallMsgBean;
......@@ -538,7 +539,7 @@ public interface LoanService {
* @return
*/
@POST("api/114/getCPDBaseMsg")
Observable<BaseResponse<JsonObject>> getShCpdTime(@Body Map<String, Object> vo);
Observable<BaseResponse<CpdBean>> getShCpdTime(@Body Map<String, Object> vo);
/**
* 获取用户配置信息
......
......@@ -182,8 +182,6 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
// 刷新分红数据
friendsPresenter.getFriendHallMsg()
friendsPresenter.sonCashoutChallengeMsg()
when (view_pager_friends.currentItem) {
0 -> {
friendsPresenter.getContributionBigLeaders()
......
......@@ -38,6 +38,7 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.tz.sdk.coral.ad.CoralAD
import com.tz.sdk.coral.callback.h5.DownloadProcess
import com.wenshu.youyou.mvp.model.CpdBean
import kotlinx.android.synthetic.main.fragment_task_cpd.*
private val TAG = TaskCpdFragment::class.java.simpleName
......@@ -139,12 +140,12 @@ class TaskCpdFragment : BaseFragment(), TaskView,
override fun getContentViewLayoutID() = R.layout.activity_task
override fun getShCpdTimeSuc(time: Int, coin: Int, CPD: Int, CPD_SYD: Int, CPD_ORDER: String?) {
needUseTime = time
shCoin = coin
sydCoin = coin
shMax = CPD
cpdMax = CPD_SYD
override fun getShCpdTimeSuc(data: CpdBean) {
needUseTime = data.needSeconds
shCoin = data.coinSh
sydCoin = data.coinSyd
shMax = data.CPD
cpdMax = data.CPD_SYD
if ((shMax + cpdMax) <= 0) {
hideLoading()
......@@ -164,13 +165,13 @@ class TaskCpdFragment : BaseFragment(), TaskView,
cpdLoadCountTime = 0
mFakeTaskList.clear()
if (TextUtils.isEmpty(CPD_ORDER)) {
if (TextUtils.isEmpty(data.cpdOrder)) {
notifyDataAndShowAd()
return
}
// 珊瑚和CPD展示顺序
when (CPD_ORDER) {
when (data.cpdOrder) {
"CPD_SYD" -> {
when {
cpdMax > 0 -> {
......
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