Commit b28c60f3 authored by xw's avatar xw

[提交人]:王雪伟

[提交简述] :多多菜园1.0.9
[实现方案] :小满加一个上报
parent 67e35eea
...@@ -82,14 +82,14 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -82,14 +82,14 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}, { }, {
}) })
xiaoManInit() // xiaoManInit()
openNotif() openNotif()
AdUtils.loadNextCacheRewardVideoAd(this) AdUtils.loadNextCacheRewardVideoAd(this)
AdUtils.loadFeedCacheAdToCache(this) AdUtils.loadFeedCacheAdToCache(this)
} }
private fun xiaoManInit() { private fun xiaoManInit(json: NewLandListEntity) {
val client = OkHttpClient() val client = OkHttpClient()
val request: Request = Request.Builder() val request: Request = Request.Builder()
.url("https://saas.hixiaoman.com/placeEnter?appKey=ddcy-az-hdgj_vbskkc&placeId=2773") .url("https://saas.hixiaoman.com/placeEnter?appKey=ddcy-az-hdgj_vbskkc&placeId=2773")
...@@ -98,30 +98,39 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -98,30 +98,39 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
call.enqueue(object : Callback { call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
Log.d("wxwwww", "XiaoMan code:$ error $") Log.d("wxwwww", "XiaoMan code:$ error $")
runOnUiThread {
callUnity("Canvas", "loadLoadingLandListSuccess", Utils.obj2Str(json))
}
} }
override fun onResponse(call: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
if (response.isSuccessful) { if (response.isSuccessful) {
val result = response.body()?.string() val result = response.body()?.string()
if (result != null) { runOnUiThread {
val xiaoMan = if (result != null) {
Utils.str2Obj(result, XiaoManEntity::class.java) as XiaoManEntity val xiaoMan =
if (xiaoMan.code == "0") { Utils.str2Obj(result, XiaoManEntity::class.java) as XiaoManEntity
mXiaoManPlaceMateId = xiaoMan.data.placeMaterialId if (xiaoMan.code == "0") {
//小满上报 mXiaoManPlaceMateId = xiaoMan.data.placeMaterialId
if (MyConstant.isReportXiaoman) { json.xiaoManPath=xiaoMan.data.materialPath
runOnUiThread{ //小满上报
AdSdk.exposure( if (MyConstant.isReportXiaoman) {
"2773", runOnUiThread {
AdPreference.getToken(), AdSdk.exposure(
mXiaoManPlaceMateId.toString() "2773",
) AdPreference.getToken(),
mXiaoManPlaceMateId.toString()
)
}
MyConstant.isReportXiaoman = false
}
} }
MyConstant.isReportXiaoman = false
} }
callUnity("Canvas", "loadLoadingLandListSuccess", Utils.obj2Str(json))
} }
}else{
callUnity("Canvas", "loadLoadingLandListSuccess", Utils.obj2Str(json))
} }
}
} }
}) })
} }
...@@ -250,7 +259,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -250,7 +259,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun onMonopolyClick() { fun onMonopolyClick() {
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) { if (Utils.isFastClick2()) {
JumpUtils.h5NormalJump("大富翁", NetConfig.H5.CONFIRMURL + "?is_popup1="+mDFWType, false, act) JumpUtils.h5NormalJump(
"大富翁",
NetConfig.H5.CONFIRMURL + "?is_popup1=" + mDFWType,
false,
act
)
//CashExchangeDialog.showCashExchage(this, this) //CashExchangeDialog.showCashExchage(this, this)
// PuzzleDialog.showPuzzleDialog(this, this) // PuzzleDialog.showPuzzleDialog(this, this)
} }
...@@ -409,6 +423,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -409,6 +423,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
* 获取地块列表 土地列表 * 获取地块列表 土地列表
* */ * */
fun getListLandNew(from: Int) { fun getListLandNew(from: Int) {
Log.d("Wxw", "1初始化地块列表失败$from")
GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<NewLandListEntity>() { .subscribe(object : BaseObserver<NewLandListEntity>() {
override fun onSuccess(result: NewLandListEntity?) { override fun onSuccess(result: NewLandListEntity?) {
...@@ -417,7 +432,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -417,7 +432,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
var json = Utils.obj2Str(result) var json = Utils.obj2Str(result)
if (from == 1) { if (from == 1) {
callUnity("Canvas", "loadLandListSuccess", json) if (result != null) {
xiaoManInit(result)
}
// callUnity("Canvas", "loadLoadingLandListSuccess", json)
} }
if (from == 2) { if (from == 2) {
callUnity("Form_land", "sycnLandListSuccess", json) callUnity("Form_land", "sycnLandListSuccess", json)
......
...@@ -1042,9 +1042,12 @@ abstract class JavaInterface { ...@@ -1042,9 +1042,12 @@ abstract class JavaInterface {
type, type,
object : object :
H5Listener { H5Listener {
override fun onDialogClose(type: String) { override fun onDialogClose(
type: String,
shutdownType: Int
) {
var type = "2" var type = "2"
mWebView.loadUrl("javascript:closeWindows('$type')") mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
} }
}) })
...@@ -1193,8 +1196,8 @@ abstract class JavaInterface { ...@@ -1193,8 +1196,8 @@ abstract class JavaInterface {
LogUtils.e("huang -----h5", "showBigImgDialog 0 $number") LogUtils.e("huang -----h5", "showBigImgDialog 0 $number")
mWebView.context.runOnUiThread { mWebView.context.runOnUiThread {
CenterDialog.showH5Dialog(act!!, number.toDouble(), 1, h5Page, object : H5Listener { CenterDialog.showH5Dialog(act!!, number.toDouble(), 1, h5Page, object : H5Listener {
override fun onDialogClose(type: String) { override fun onDialogClose(type: String, shutdownType: Int) {
mWebView.loadUrl("javascript:closeWindows('$type')") mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
} }
}) })
...@@ -1217,9 +1220,8 @@ abstract class JavaInterface { ...@@ -1217,9 +1220,8 @@ abstract class JavaInterface {
type, type,
h5Page, h5Page,
object : H5Listener { object : H5Listener {
override fun onDialogClose(type: String) { override fun onDialogClose(type: String, shutdownType: Int) {
mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
mWebView.loadUrl("javascript:closeWindows('$type')")
} }
}) })
LogUtils.e("huang4", "h5page:" + h5Page + " type:" + type) LogUtils.e("huang4", "h5page:" + h5Page + " type:" + type)
......
...@@ -105,10 +105,11 @@ class XiaoManActivityMy : MyBaseActivity() { ...@@ -105,10 +105,11 @@ class XiaoManActivityMy : MyBaseActivity() {
//视频广告素材加载到,如title,视频url等,不包括视频文件 //视频广告素材加载到,如title,视频url等,不包括视频文件
override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) { override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) {
campaignFragment?.setVideoLoad(requestId)
ad.setRewardAdInteractionListener(object : ad.setRewardAdInteractionListener(object :
TTRewardVideoAd.RewardAdInteractionListener { TTRewardVideoAd.RewardAdInteractionListener {
override fun onAdShow() { override fun onAdShow() {
campaignFragment?.setVideoLoad(requestId) campaignFragment?.setVideoExposeComplete(requestId)
EventUtils.onEvent("XIAO_MAN_CSJ_SHOW","小满穿山甲广告展示") EventUtils.onEvent("XIAO_MAN_CSJ_SHOW","小满穿山甲广告展示")
} }
override fun onAdVideoBarClick() { override fun onAdVideoBarClick() {
...@@ -126,7 +127,7 @@ class XiaoManActivityMy : MyBaseActivity() { ...@@ -126,7 +127,7 @@ class XiaoManActivityMy : MyBaseActivity() {
campaignFragment?.setVideoComplete(requestId) campaignFragment?.setVideoComplete(requestId)
} }
override fun onRewardVerify(rewardVerify: Boolean, rewardAmount: Int, rewardName: String?) { override fun onRewardVerify(rewardVerify: Boolean, rewardAmount: Int, rewardName: String?) {
campaignFragment?.setVideoExposeComplete(requestId)
} }
override fun onSkippedVideo() { override fun onSkippedVideo() {
//视频跳过时调用 //视频跳过时调用
......
...@@ -6,5 +6,5 @@ package com.ym.library.listener ...@@ -6,5 +6,5 @@ package com.ym.library.listener
*/ */
interface H5Listener { interface H5Listener {
fun onDialogClose(type: String) fun onDialogClose(type: String,shutdownType:Int)
} }
\ No newline at end of file
...@@ -20,8 +20,19 @@ public class NewLandListEntity { ...@@ -20,8 +20,19 @@ public class NewLandListEntity {
private int configNum; private int configNum;
private float timeRate; private float timeRate;
private int videoRate; private int videoRate;
private String xiaoManPath;
private List<LandListEntity> landList; private List<LandListEntity> landList;
public String getXiaoManPath() {
return xiaoManPath;
}
public void setXiaoManPath(String xiaoManPath) {
this.xiaoManPath = xiaoManPath;
}
public int getVideoRate() { public int getVideoRate() {
return videoRate; return videoRate;
} }
......
...@@ -830,9 +830,9 @@ object CenterDialog : BaseDialog() { ...@@ -830,9 +830,9 @@ object CenterDialog : BaseDialog() {
} }
if (type == 1) { if (type == 1) {
listener.onDialogClose("2") listener.onDialogClose("2",0)
} else if (type == 0) { } else if (type == 0) {
listener.onDialogClose("1") listener.onDialogClose("1",0)
} }
} }
iv_ok.setOnClickListener { iv_ok.setOnClickListener {
...@@ -842,9 +842,9 @@ object CenterDialog : BaseDialog() { ...@@ -842,9 +842,9 @@ object CenterDialog : BaseDialog() {
} }
if (type == 1) { if (type == 1) {
listener.onDialogClose("2") listener.onDialogClose("2",1)
} else if (type == 0) { } else if (type == 0) {
listener.onDialogClose("1") listener.onDialogClose("1",1)
} }
} }
......
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