Commit 2dd1bc06 authored by jyx's avatar jyx

牧场人生获取奖励方式修改

parent a998e702
......@@ -251,6 +251,7 @@
<!-- 监听apk安装 -->
<service
android:name=".service.AppInstallService"
android:enabled="true"
android:exported="false" />
<!-- JPUSH 用户自定义的广播接收器 -->
......
......@@ -251,9 +251,9 @@ open class MyPresenter : BasePresenter<MyView>() {
*
* value
*/
fun setHighTaskType(value: String) {
fun setHighTaskType(carrierType: String, value: String) {
val vo = HashMap<String, Any>()
vo["carrierType"] = Constant.CARRIER_HIGH_ACTIVITY
vo["carrierType"] = carrierType
vo["value"] = value
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
......
......@@ -89,7 +89,6 @@ class MyFragment : BaseFragment(),
private var curSignCoin = 50
// 牧场人生安装奖励金币
private var downloadMCRSCoin = 50
private var pkgMCRSName = "com.harvestmoon.android"
// 签到信息
......@@ -157,14 +156,14 @@ class MyFragment : BaseFragment(),
private fun refreshHighTask() {
if (AppConfig.isHighTask && mCurrentPkg != null) {
if (AppTryPlayManager.getTryPlayIsOK(mCurrentPkg!!, 30)) {
myPresenter.setHighTaskType("1")
myPresenter.setHighTaskType(Constant.CARRIER_HIGH_ACTIVITY, "1")
} else {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, 0)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_HIGH_ACTIVITY)
readyGo(AwardActivity::class.java, bundle)
myPresenter.setHighTaskType("0")
myPresenter.setHighTaskType(Constant.CARRIER_HIGH_ACTIVITY, "0")
}
AppConfig.isHighTask = false
}
......@@ -514,7 +513,7 @@ class MyFragment : BaseFragment(),
// if (TextUtils.isEmpty(mCurrentPkg)) {
if (mCurrentPkg == null) {
showToast("任务异常,请重试~")
myPresenter.setHighTaskType("0")
myPresenter.setHighTaskType(Constant.CARRIER_HIGH_ACTIVITY, "0")
AppConfig.isHighTask = false
} else {
......@@ -524,7 +523,7 @@ class MyFragment : BaseFragment(),
AppConfig.isHighTask = true
} else {
showToast("未找到当前APP、可能被卸载,请重试~")
myPresenter.setHighTaskType("0")
myPresenter.setHighTaskType(Constant.CARRIER_HIGH_ACTIVITY, "0")
AppConfig.isHighTask = false
}
......@@ -714,8 +713,10 @@ class MyFragment : BaseFragment(),
}
}
MainMyAdapter.TO_FIRSTDOWNLOAD -> {
// 牧场人生下载金币赋值
downloadMCRSCoin = taskBean.otherConfig.coin
if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) {
0 -> {
// 牧场人生包名
pkgMCRSName = taskBean.otherConfig.pkg
// 下载牧场人生
......@@ -724,6 +725,16 @@ class MyFragment : BaseFragment(),
// 开启广播监听安装事件
registerBroad()
}
1 -> {
// 牧场人生APP,直接弹奖励框
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_MC_FIRSTDOWNLOAD)
readyGo(AwardActivity::class.java, bundle)
}
}
}
}
}
}
}
......@@ -1256,14 +1267,11 @@ class MyFragment : BaseFragment(),
mCurrentPkg = pkg
// ps.put(Constant.HIGH_TASK_PKG_NAME, pkg)
myPresenter.setHighTaskType("3")
myPresenter.setHighTaskType(Constant.CARRIER_HIGH_ACTIVITY, "3")
} else if (TextUtils.equals(pkg, pkgMCRSName)) {
// 牧场人生APP,直接弹奖励框
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, downloadMCRSCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_MC_FIRSTDOWNLOAD)
readyGo(AwardActivity::class.java, bundle)
// 上报后台更新按钮状态
myPresenter.setHighTaskType(Constant.CARRIER_MC_FIRSTDOWNLOAD, "1")
}
} catch (e: Exception) {
......
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