Commit df2c2ab5 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 8a4c3b5d
...@@ -15,6 +15,7 @@ import com.duben.dayplaylet.mvp.model.RiskBean; ...@@ -15,6 +15,7 @@ import com.duben.dayplaylet.mvp.model.RiskBean;
import com.duben.dayplaylet.ui.activitys.HintActivity; import com.duben.dayplaylet.ui.activitys.HintActivity;
import com.duben.dayplaylet.utils.AccessibilityUtils; import com.duben.dayplaylet.utils.AccessibilityUtils;
import com.duben.dayplaylet.utils.ForegroundOrBackground; import com.duben.dayplaylet.utils.ForegroundOrBackground;
import com.duben.dayplaylet.utils.HitChanceKeeper;
import com.duben.dayplaylet.utils.ToastUtil; import com.duben.dayplaylet.utils.ToastUtil;
import com.duben.dayplaylet.utils.rxutil.CommonRxTask; import com.duben.dayplaylet.utils.rxutil.CommonRxTask;
import com.duben.dayplaylet.utils.rxutil.RxjavaUtil; import com.duben.dayplaylet.utils.rxutil.RxjavaUtil;
...@@ -412,7 +413,9 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -412,7 +413,9 @@ public class TrackPresenter extends BaseTrackPresenter {
AppConfig.awardYuanbao = data.get("di").getAsInt(); AppConfig.awardYuanbao = data.get("di").getAsInt();
} }
if (HitChanceKeeper.INSTANCE.isHitChance(AppConfig.riskPercentage)) {
riskinfo(3);
}
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -320,7 +320,7 @@ public interface LoanService { ...@@ -320,7 +320,7 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/riskinfo/save2") @POST("api/riskinfo/save")
Observable<BaseResponse<RiskBean>> riskinfo2(@Body Map<String, Object> vo); Observable<BaseResponse<RiskBean>> riskinfo2(@Body Map<String, Object> vo);
/** /**
......
...@@ -15,7 +15,9 @@ import com.duben.dayplaylet.ad.AdStatusListener ...@@ -15,7 +15,9 @@ import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.AlipayAuthManager
import com.duben.dayplaylet.manager.TrackManager import com.duben.dayplaylet.manager.TrackManager
import com.duben.dayplaylet.manager.UserManager
import com.duben.dayplaylet.ui.activitys.base.BaseActivity import com.duben.dayplaylet.ui.activitys.base.BaseActivity
import com.duben.dayplaylet.ui.widgets.DialogListener import com.duben.dayplaylet.ui.widgets.DialogListener
import com.duben.dayplaylet.ui.widgets.WithDrawSucDialog import com.duben.dayplaylet.ui.widgets.WithDrawSucDialog
...@@ -78,6 +80,24 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -78,6 +80,24 @@ class NineActivity : BaseActivity(), View.OnClickListener {
finish() finish()
} }
R.id.iv_nine_next -> { R.id.iv_nine_next -> {
if (!UserManager.getInstance().alipaySet) {
// 去授权
showToast("发起支付宝授权..")
AlipayAuthManager.authV2(this@NineActivity,
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
showToast("支付宝授权成功")
}
override fun authFail(resultStatus: String) {
showToast("支付宝授权失败 " + resultStatus)
}
})
return
}
HalfScreenManager.getInstance().preLoadAd(this) HalfScreenManager.getInstance().preLoadAd(this)
showAd(Constant.CARRIERTYPE_SING_OVER) showAd(Constant.CARRIERTYPE_SING_OVER)
// adCloseNext("") // adCloseNext("")
......
...@@ -508,20 +508,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -508,20 +508,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
} }
R.id.tv_sign_withdraw -> { R.id.tv_sign_withdraw -> {
userInfo?.let { userInfo?.let {
if (it.isAlipaySet) { if (!it.isAlipaySet) {
dialog?.dismiss()
val bundle = Bundle()
if (signMsg != null) {
val signWeekCashArr = signMsg!!.signWeekCashArr
val cash = signWeekCashArr[signMsg!!.signDay - 1]
bundle.putString(LoadingActivity.TEXT, "${cash}元现金马上到账")
}
readyGo(LoadingActivity::class.java, bundle)
Handler(Looper.getMainLooper()).postDelayed({
showAd(Constant.CARRIERTYPE_SIGN)
}, 2500)
} else {
showToast("发起支付宝授权..") showToast("发起支付宝授权..")
AlipayAuthManager.authV2(requireActivity(), AlipayAuthManager.authV2(requireActivity(),
...@@ -535,7 +522,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -535,7 +522,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
showToast("支付宝授权失败 " + resultStatus) showToast("支付宝授权失败 " + resultStatus)
} }
}) })
return@let
}
dialog?.dismiss()
val bundle = Bundle()
if (signMsg != null) {
val signWeekCashArr = signMsg!!.signWeekCashArr
val cash = signWeekCashArr[signMsg!!.signDay - 1]
bundle.putString(LoadingActivity.TEXT, "${cash}元现金马上到账")
} }
readyGo(LoadingActivity::class.java, bundle)
Handler(Looper.getMainLooper()).postDelayed({
showAd(Constant.CARRIERTYPE_SIGN)
}, 2500)
} }
} }
......
...@@ -18,6 +18,7 @@ import com.duben.dayplaylet.ad.NoPreAdManager ...@@ -18,6 +18,7 @@ import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.AlipayAuthManager
import com.duben.dayplaylet.manager.TrackManager import com.duben.dayplaylet.manager.TrackManager
import com.duben.dayplaylet.manager.UserManager import com.duben.dayplaylet.manager.UserManager
import com.duben.dayplaylet.mvp.model.HongbaoBean import com.duben.dayplaylet.mvp.model.HongbaoBean
...@@ -295,6 +296,24 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -295,6 +296,24 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
} }
override fun rdHongbaoClickSuc(isCash: Boolean, cash: Double, unitId: String) { override fun rdHongbaoClickSuc(isCash: Boolean, cash: Double, unitId: String) {
if (!UserManager.getInstance().alipaySet) {
// 去授权
showToast("发起支付宝授权..")
AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
showToast("支付宝授权成功")
}
override fun authFail(resultStatus: String) {
showToast("支付宝授权失败 " + resultStatus)
}
})
return
}
if (!isCash) { if (!isCash) {
val bundle = Bundle() val bundle = Bundle()
bundle.putString(LoadingActivity.TEXT, "正在为您发放奖励..") bundle.putString(LoadingActivity.TEXT, "正在为您发放奖励..")
......
...@@ -16,6 +16,7 @@ import com.duben.dayplaylet.ad.AdStatusListener ...@@ -16,6 +16,7 @@ import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.AlipayAuthManager
import com.duben.dayplaylet.manager.TrackManager import com.duben.dayplaylet.manager.TrackManager
import com.duben.dayplaylet.mvp.model.DrawInfoBean import com.duben.dayplaylet.mvp.model.DrawInfoBean
import com.duben.dayplaylet.mvp.presenters.DrawCashPresenter import com.duben.dayplaylet.mvp.presenters.DrawCashPresenter
...@@ -187,10 +188,22 @@ class DrawCashFragment : LazyLoadBaseFragment(), DrawCashView, DrawCashAdapter.O ...@@ -187,10 +188,22 @@ class DrawCashFragment : LazyLoadBaseFragment(), DrawCashView, DrawCashAdapter.O
} }
// 2、授权支付宝 // 2、授权支付宝
// if (!alipayStatus) { if (!alipayStatus) {
// // 去授权 // 去授权
// return showToast("发起支付宝授权..")
// } AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
showToast("支付宝授权成功")
}
override fun authFail(resultStatus: String) {
showToast("支付宝授权失败 " + resultStatus)
}
})
return
}
/** /**
* 21 任务弹框, * 21 任务弹框,
......
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