Commit 2dd1bc06 authored by jyx's avatar jyx

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

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