Commit 8fb63493 authored by maxiaoliang's avatar maxiaoliang

修改代码

parent 7b6df7ec
......@@ -470,6 +470,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
// })
// })
GameDialog.showRedPgDoubled(act, "${moneyNum}", View.OnClickListener {
AdUtils.playRewardAd(
this@GameActivity,
"receive_redPack_double_click",
......@@ -481,6 +482,33 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
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 {
.subscribe(object : BaseObserver<RedPackDoubleReceiveEntity>() {
override fun onSuccess(result: RedPackDoubleReceiveEntity?) {
if (result != null) {
GameEvent("show_receive_redPack_double_success", "倍领取成功")
GameEvent("show_receive_redPack_double_success", "3倍领取成功")
// var allMoneyNum =
// "总共获得奖励+${result.rewardContentList[0].totalRewardNum / 100.toDouble()}元";
// ToastUtil.showImageToas(act, allMoneyNum)
// callUnity("RedPackList", "redPackListDataUpdate", "")
MainDialog.showgetWaterDrop(
act,
4,
"redPack_double",
result.rewardContentList[0].totalRewardNum,
null
)
callUnity("RedPackList", "redPackListDataUpdate", "")
// MainDialog.showgetWaterDrop(
// act,
// 4,
// "redPack_double",
// ,
// null
// )
GameDialog.showGetCash(this@GameActivity,"${result.rewardContentList[0].totalRewardNum?.toDouble()/100}",
View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
}
}
......@@ -911,15 +943,22 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) {
var type = result.type
if (type != null) {
MainDialog.showopenBox(
this@GameActivity, type,
"宝箱奖励",
result.awardNum ?: 0,
result,
this@GameActivity
)
if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
}else{
if (type != null) {
MainDialog.showopenBox(
this@GameActivity, type,
"宝箱奖励",
"${result.awardNum ?: 0}",
result,
this@GameActivity
)
}
}
}
}
......@@ -938,13 +977,20 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) {
var type = result.type
if (type != null) {
MainDialog.showopenBox(
this@GameActivity, type,
"拆红包",
result.awardNum ?: 0,
result,
this@GameActivity
)
if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "")
})
}else{
MainDialog.showopenBox(
this@GameActivity, type,
"拆红包",
"${result.awardNum ?: 0}",
result,
this@GameActivity
)
}
}
}
}
......@@ -1156,6 +1202,23 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
MainLooper.get()?.post(Runnable {
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 {
//大富翁美梦成真
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 {
//获得加速剂弹窗
fun showjiasu(getnum: Int, num: Int) {
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 {
MainDialog.showopenBox(
activity, type,
"宝箱奖励",
result.awardNum ?: 0,
"${result.awardNum ?: 0}",
result,
object : IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) {
......
......@@ -240,7 +240,7 @@ object MainDialog {
context: Context?,
type: Int,
adType: String,
rewardCount: Int,
rewardCount: String,
result: FlyBoxEntity,
mListener: IDialogViewCloseCallback
) {
......@@ -259,7 +259,7 @@ object MainDialog {
val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg)
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 ivGetDropBg2 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg2)
val tvGetDropCount2 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count2)
......
......@@ -31,7 +31,7 @@
android:id="@+id/rl_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_64"
android:layout_marginTop="@dimen/dp_84"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
......
......@@ -14,15 +14,13 @@
<ImageView
android:id="@+id/id_img_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/baicai_fruit"/>
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_ownnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1111"
android:textColor="#94491A"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
......
......@@ -4,7 +4,7 @@ class FlyBoxEntity {
var id: Int = 0
var type: Int? = 0
var ownNum:Int?=0
var awardNum: Int? = 0
var awardNum: String? = ""
var awardType: Int? = 0//1种子 2金币 3加速剂
var subType: Int? = 0
var seedList: MutableList<SeedList> = ArrayList()
......
......@@ -20,6 +20,7 @@ public class RedPackReceiveEntity {
private int totalCents;
@SerializedName("double")
private DoubleBean doubleX;
private int force;
public int getTotalCoins() {
return totalCoins;
......@@ -70,4 +71,12 @@ public class RedPackReceiveEntity {
this.buttonText = buttonText;
}
}
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
}
}
......@@ -351,4 +351,7 @@ interface IGameApi {
*/
@GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA)
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 {
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_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_RECEIVE = "app/v1/game/farm/order_receive";//订单领取
// public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/farm/unlock_land";//解锁地块/种植种子/收获果实
......@@ -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_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_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现
......@@ -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_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_FORCE_POST = "app/v1/game/farm/force_post";//拆红包不看视频翻倍上报接口
}
}
......@@ -341,7 +341,8 @@ object GameDialog : BaseDialog() {
fun showRedPgDoubled(
activity: Activity,
reward: String,
listener: View.OnClickListener
listener: View.OnClickListener,
listener2: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
......@@ -371,7 +372,7 @@ object GameDialog : BaseDialog() {
}
layout_red_pg_give_up.setOnClickListener {
listener.onClick(null)
listener2.onClick(null)
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