Commit b28c60f3 authored by xw's avatar xw

[提交人]:王雪伟

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