Commit 8fb63493 authored by maxiaoliang's avatar maxiaoliang

修改代码

parent 7b6df7ec
...@@ -470,6 +470,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -470,6 +470,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
// }) // })
// }) // })
GameDialog.showRedPgDoubled(act, "${moneyNum}", View.OnClickListener { GameDialog.showRedPgDoubled(act, "${moneyNum}", View.OnClickListener {
AdUtils.playRewardAd( AdUtils.playRewardAd(
this@GameActivity, this@GameActivity,
"receive_redPack_double_click", "receive_redPack_double_click",
...@@ -481,6 +482,33 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -481,6 +482,33 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onError(errorMsg: String?) { override fun onError(errorMsg: String?) {
} }
}) })
},View.OnClickListener {
if(result.force==1){
AdUtils.playRewardAd(
this@GameActivity,
"receive_redPack_double_click",
object : IAdVideoListener {
override fun onAdClose() {
onRedPackAwardReceive(result.doubleX.multipleSid)
}
override fun onError(errorMsg: String?) {
}
})
}else{
GameApiClient.gameApi. getForcePost()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
}) })
} }
} }
...@@ -498,18 +526,22 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -498,18 +526,22 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.subscribe(object : BaseObserver<RedPackDoubleReceiveEntity>() { .subscribe(object : BaseObserver<RedPackDoubleReceiveEntity>() {
override fun onSuccess(result: RedPackDoubleReceiveEntity?) { override fun onSuccess(result: RedPackDoubleReceiveEntity?) {
if (result != null) { if (result != null) {
GameEvent("show_receive_redPack_double_success", "倍领取成功") GameEvent("show_receive_redPack_double_success", "3倍领取成功")
// var allMoneyNum = // var allMoneyNum =
// "总共获得奖励+${result.rewardContentList[0].totalRewardNum / 100.toDouble()}元"; // "总共获得奖励+${result.rewardContentList[0].totalRewardNum / 100.toDouble()}元";
// ToastUtil.showImageToas(act, allMoneyNum) // ToastUtil.showImageToas(act, allMoneyNum)
// callUnity("RedPackList", "redPackListDataUpdate", "") callUnity("RedPackList", "redPackListDataUpdate", "")
MainDialog.showgetWaterDrop( // MainDialog.showgetWaterDrop(
act, // act,
4, // 4,
"redPack_double", // "redPack_double",
result.rewardContentList[0].totalRewardNum, // ,
null // null
) // )
GameDialog.showGetCash(this@GameActivity,"${result.rewardContentList[0].totalRewardNum?.toDouble()/100}",
View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
} }
} }
...@@ -911,16 +943,23 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -911,16 +943,23 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) { if (result != null) {
var type = result.type var type = result.type
if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
}else{
if (type != null) { if (type != null) {
MainDialog.showopenBox( MainDialog.showopenBox(
this@GameActivity, type, this@GameActivity, type,
"宝箱奖励", "宝箱奖励",
result.awardNum ?: 0, "${result.awardNum ?: 0}",
result, result,
this@GameActivity this@GameActivity
) )
} }
} }
}
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
...@@ -938,14 +977,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -938,14 +977,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) { if (result != null) {
var type = result.type var type = result.type
if (type != null) { if (type != null) {
if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
}else{
MainDialog.showopenBox( MainDialog.showopenBox(
this@GameActivity, type, this@GameActivity, type,
"拆红包", "拆红包",
result.awardNum ?: 0, "${result.awardNum ?: 0}",
result, result,
this@GameActivity this@GameActivity
) )
} }
}
} }
} }
...@@ -1156,6 +1202,23 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1156,6 +1202,23 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
GameDialog.showGetBox(this, num, View.OnClickListener { GameDialog.showGetBox(this, num, View.OnClickListener {
if(num>0){
if (flyBoxIsClick) {
flyBoxIsClick = false
AdUtils.playRewardAd(this, "box_click", object : IAdVideoListener {
override fun onAdClose() {
flyBoxIsClick = true
getFlyBoxReceive()
}
override fun onError(errorMsg: String?) {
flyBoxIsClick = true
}
})
}
}else{
Utils.showToast(AppliContext.get(), "今日次数已用完,明天再来吧~")
}
}) })
}) })
...@@ -1208,7 +1271,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1208,7 +1271,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//大富翁美梦成真 //大富翁美梦成真
fun onClickDreamComeTrue() { fun onClickDreamComeTrue() {
JumpUtils.h5Jump("美梦成真", "http://h5v2test.zhangxinzhixun.com/monopoly/Confirm", false, act) JumpUtils.h5Jump("美梦成真", "http://h5v2test.zhangxinzhixun.com/monopoly/Confirm", false, this)
} }
//展示不可拆红包弹窗 //展示不可拆红包弹窗
...@@ -1221,7 +1284,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1221,7 +1284,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//获得加速剂弹窗 //获得加速剂弹窗
fun showjiasu(getnum: Int, num: Int) { fun showjiasu(getnum: Int, num: Int) {
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
GameDialog.showAccelerator(this, getnum,num,View.OnClickListener { }) GameDialog.showAccelerator(this, getnum,num,View.OnClickListener {
callUnity("Form_land", "onVideoAcceleratorReceive", "")
})
}) })
} }
//金币不足弹窗 //金币不足弹窗
......
...@@ -63,7 +63,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter { ...@@ -63,7 +63,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
MainDialog.showopenBox( MainDialog.showopenBox(
activity, type, activity, type,
"宝箱奖励", "宝箱奖励",
result.awardNum ?: 0, "${result.awardNum ?: 0}",
result, result,
object : IDialogViewCloseCallback { object : IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) { override fun onCloseViewSuccess(isSuccess: Boolean) {
......
...@@ -240,7 +240,7 @@ object MainDialog { ...@@ -240,7 +240,7 @@ object MainDialog {
context: Context?, context: Context?,
type: Int, type: Int,
adType: String, adType: String,
rewardCount: Int, rewardCount: String,
result: FlyBoxEntity, result: FlyBoxEntity,
mListener: IDialogViewCloseCallback mListener: IDialogViewCloseCallback
) { ) {
...@@ -259,7 +259,7 @@ object MainDialog { ...@@ -259,7 +259,7 @@ object MainDialog {
val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg) val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg)
val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count) val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2) val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2)
val ivGetDropBg2 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg2) val ivGetDropBg2 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg2)
val tvGetDropCount2 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count2) val tvGetDropCount2 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count2)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
android:id="@+id/rl_record" android:id="@+id/rl_record"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_64" android:layout_marginTop="@dimen/dp_84"
android:layout_centerHorizontal="true"/> android:layout_centerHorizontal="true"/>
</RelativeLayout> </RelativeLayout>
......
...@@ -14,15 +14,13 @@ ...@@ -14,15 +14,13 @@
<ImageView <ImageView
android:id="@+id/id_img_item" android:id="@+id/id_img_item"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:src="@mipmap/baicai_fruit"/>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/id_tv_ownnum" android:id="@+id/id_tv_ownnum"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="1111"
android:textColor="#94491A" android:textColor="#94491A"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textStyle="bold" /> android:textStyle="bold" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,7 +4,7 @@ class FlyBoxEntity { ...@@ -4,7 +4,7 @@ class FlyBoxEntity {
var id: Int = 0 var id: Int = 0
var type: Int? = 0 var type: Int? = 0
var ownNum:Int?=0 var ownNum:Int?=0
var awardNum: Int? = 0 var awardNum: String? = ""
var awardType: Int? = 0//1种子 2金币 3加速剂 var awardType: Int? = 0//1种子 2金币 3加速剂
var subType: Int? = 0 var subType: Int? = 0
var seedList: MutableList<SeedList> = ArrayList() var seedList: MutableList<SeedList> = ArrayList()
......
...@@ -20,6 +20,7 @@ public class RedPackReceiveEntity { ...@@ -20,6 +20,7 @@ public class RedPackReceiveEntity {
private int totalCents; private int totalCents;
@SerializedName("double") @SerializedName("double")
private DoubleBean doubleX; private DoubleBean doubleX;
private int force;
public int getTotalCoins() { public int getTotalCoins() {
return totalCoins; return totalCoins;
...@@ -70,4 +71,12 @@ public class RedPackReceiveEntity { ...@@ -70,4 +71,12 @@ public class RedPackReceiveEntity {
this.buttonText = buttonText; this.buttonText = buttonText;
} }
} }
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
}
} }
...@@ -351,4 +351,7 @@ interface IGameApi { ...@@ -351,4 +351,7 @@ interface IGameApi {
*/ */
@GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA) @GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA)
fun getWarehouseData(): Observable<Response<List<FlyBoxEntity>>> fun getWarehouseData(): Observable<Response<List<FlyBoxEntity>>>
@POST(NetConfig.Game.URL_FORCE_POST)
fun getForcePost(): Observable<Response<Any>>
} }
\ No newline at end of file
...@@ -223,7 +223,7 @@ public class NetConfig { ...@@ -223,7 +223,7 @@ public class NetConfig {
public static final String URL_GAME_HOME_INFO = "app/v1/game/farm/home_info";//首页信息 public static final String URL_GAME_HOME_INFO = "app/v1/game/farm/home_info";//首页信息
// public static final String URL_GAME_LIST_LAND = "app/v1/game/farm/list_land";//菜园地块列表 // public static final String URL_GAME_LIST_LAND = "app/v1/game/farm/list_land";//菜园地块列表
public static final String URL_GAME_OPEN_BOX = "app/v1/game/farm/open_box";//开宝箱 public static final String URL_GAME_OPEN_BOX = "app/v1/game/msdh/open_box";//开宝箱
public static final String URL_GAME_ORDER_DATA = "app/v1/game/farm/order_data";//订单数据 public static final String URL_GAME_ORDER_DATA = "app/v1/game/farm/order_data";//订单数据
public static final String URL_GAME_ORDER_RECEIVE = "app/v1/game/farm/order_receive";//订单领取 public static final String URL_GAME_ORDER_RECEIVE = "app/v1/game/farm/order_receive";//订单领取
// public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/farm/unlock_land";//解锁地块/种植种子/收获果实 // public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/farm/unlock_land";//解锁地块/种植种子/收获果实
...@@ -253,7 +253,7 @@ public class NetConfig { ...@@ -253,7 +253,7 @@ public class NetConfig {
public static final String URL_GAME_CLOUD_CHECK = "app/v1/game/farm/cloud_check";//云朵加速判断 public static final String URL_GAME_CLOUD_CHECK = "app/v1/game/farm/cloud_check";//云朵加速判断
public static final String URL_GAME_OPEN_PLANT_BOX = "app/v1/game/ddcy/open_plant_box";//底部拆红包 public static final String URL_GAME_OPEN_PLANT_BOX = "app/v1/game/msdh/open_plant_box";//底部拆红包
public static final String URL_GAME_CLOCK_LIST = "app/v1/game/ddcy/clock_list";//打卡提现列表 public static final String URL_GAME_CLOCK_LIST = "app/v1/game/ddcy/clock_list";//打卡提现列表
public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现 public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现
...@@ -286,5 +286,6 @@ public class NetConfig { ...@@ -286,5 +286,6 @@ public class NetConfig {
public static final String URL_GAME_ORDER_LIST = "app/v1/game/farm/order_data";//美食大亨 订单列表 public static final String URL_GAME_ORDER_LIST = "app/v1/game/farm/order_data";//美食大亨 订单列表
public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表 public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表
public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口 public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口
public static final String URL_FORCE_POST = "app/v1/game/farm/force_post";//拆红包不看视频翻倍上报接口
} }
} }
...@@ -341,7 +341,8 @@ object GameDialog : BaseDialog() { ...@@ -341,7 +341,8 @@ object GameDialog : BaseDialog() {
fun showRedPgDoubled( fun showRedPgDoubled(
activity: Activity, activity: Activity,
reward: String, reward: String,
listener: View.OnClickListener listener: View.OnClickListener,
listener2: View.OnClickListener
) { ) {
if (activity == null) return if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme) val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
...@@ -371,7 +372,7 @@ object GameDialog : BaseDialog() { ...@@ -371,7 +372,7 @@ object GameDialog : BaseDialog() {
} }
layout_red_pg_give_up.setOnClickListener { layout_red_pg_give_up.setOnClickListener {
listener.onClick(null) listener2.onClick(null)
mDialog?.dismiss() mDialog?.dismiss()
} }
......
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