Commit 7b0a3f58 authored by maxiaoliang's avatar maxiaoliang

修改bug

parent 716ec6ea
......@@ -42,7 +42,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
private var mOrderString = "";
private val mContext = AppliContext.get()
private var mRefreshLoginObservable: Observable<String>? = null
var ispop:Int=0
@SuppressLint("CheckResult")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -266,12 +266,19 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
/**
* 领金币
*/
private var iscoinclick = false
fun getCoin() {
this.runOnUiThread(object : Runnable {
override fun run() {
if (!iscoinclick) {
iscoinclick = true
MainLooper.get()?.post(Runnable {
SiginDropsPopupwindow().init(this@GameActivity, this@GameActivity)
}
})
})
MainLooper.get()?.postDelayed(Runnable {
iscoinclick = false
}, 2000)
}
}
/**
......@@ -334,8 +341,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
GameApiClient.gameApi.getGameHomeInfo().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<HomeInfoEntity>() {
override fun onSuccess(result: HomeInfoEntity?) {
Log.d("wxw", "获取首页信息" + Utils.obj2Str(result))
callback?.onHomeSuccess(true, Utils.obj2Str(result))
if(result!=null){
ispop=result.isPopup
Log.d("wxw", "获取首页信息" + Utils.obj2Str(result))
callback?.onHomeSuccess(true, Utils.obj2Str(result))
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
......@@ -434,7 +445,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
//拆开红包弹窗
fun onRedPackReceive(redPackId: Int, moneyNum: String) {
Log.d("wxw", "redId" + redPackId + "moneyNum" + moneyNum)
GameApiClient.gameApi.getRedPackReceive(redPackId)
......@@ -481,7 +492,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if(result.force==1){
AdUtils.playRewardAd(
this@GameActivity,
"receive_redPack_double_click",
"qiangtan_redPack_double_click",
object : IAdVideoListener {
override fun onAdClose() {
onRedPackAwardReceive(result.doubleX.multipleSid)
......@@ -624,22 +635,25 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
//看视频除虫
fun lookAdVideoCleanWorm(id: Int,type: Int) {
fun lookAdVideoCleanWorm(id: Int,isshow:Boolean) {
this.runOnUiThread(object : Runnable {
override fun run() {
GameDialog.showShopDamage(this@GameActivity, type, View.OnClickListener {
AdUtils.playRewardAd(
this@GameActivity,
"shop_damage_video",
object : IAdVideoListener {
override fun onAdClose() {
getUnlockLandNew(id, 4, 0)
}
GameDialog.showShopDamage(this@GameActivity, id, isshow,View.OnClickListener {
if(isshow){
AdUtils.playRewardAd(
this@GameActivity,
"shop_damage_video",
object : IAdVideoListener {
override fun onAdClose() {
getUnlockLandNew(id, 4, 0)
}
override fun onError(errorMsg: String?) {
override fun onError(errorMsg: String?) {
}
})
}
}
})
})
......@@ -850,6 +864,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getVideoSeedReceiveNew(id: Int, time: Int) {
if (videoSeedClick) {
videoSeedClick = false
AdUtils.playRewardAd(
this@GameActivity,
"receive_seed_click",
......@@ -892,6 +907,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getVideoAcceleratorsReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoJiasuClick) {
videoJiasuClick = false
AdUtils.playRewardAd(
this@GameActivity,
"accelerator_receive_click",
......@@ -1169,6 +1185,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onError(errorMsg: String?) {
cloudIsClick = true
}
})
})
// MainDialog.showDialogCloud(this, speedtime, sppedtimes, View.OnClickListener {
......@@ -1184,12 +1201,18 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
//仓库弹窗
private var iswarehoseclick=false
fun showWareHouseDialog() {
MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) {
if (!iswarehoseclick) {
iswarehoseclick = true
MainLooper.get()?.post(Runnable {
WareHouseDialog.showWareHouse(this)
}
})
})
MainLooper.get()?.postDelayed(Runnable {
iswarehoseclick = false
}, 2000)
}
}
//飞行宝箱
......@@ -1267,7 +1290,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//大富翁美梦成真
fun onClickDreamComeTrue() {
JumpUtils.h5Jump("美梦成真", "http://h5v2test.zhangxinzhixun.com/monopoly/Confirm", false, this)
JumpUtils.h5Jump("美梦成真", "${Constant.Param.Confirmurl}?is_popup=${ispop}", false, this)
}
//展示不可拆红包弹窗
......
......@@ -105,8 +105,8 @@ class SplashActivity : BaseActivity(), SplashContract.View {
val token =com.ym.modulecommon.utils.SettingPreference.getToken()
if (token.isEmpty()){
EventUtils.onEvent("login_token_null", "未登录")
// startActivity(Intent(this@SplashActivity, WxLoginActivity::class.java))
startActivity(Intent(this@SplashActivity, GameActivity::class.java))
startActivity(Intent(this@SplashActivity, WxLoginActivity::class.java))
// startActivity(Intent(this@SplashActivity, GameActivity::class.java))
finish()
}else{
EventUtils.onEvent("login_token_not_null", "已登录")
......
......@@ -3,6 +3,7 @@ package com.ym.msdh.game.activity
import android.content.Intent
import android.view.View
import com.umeng.analytics.MobclickAgent
import com.ym.library.Constant
import com.ym.msdh.game.GameActivity
import com.ym.library.net.*
import com.ym.library.utils.*
......@@ -30,10 +31,10 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback {
wxLogin();
})
id_tv_User_agreement.setOnClickListener(View.OnClickListener {
JumpUtils.h5Jump("用户协议", NetConfig.H5.WEB_URL_USER, true,act)
JumpUtils.h5Jump("用户协议", Constant.Param.userAgreementUrl, true,act)
})
id_tv_privacy_policy.setOnClickListener(View.OnClickListener {
JumpUtils.h5Jump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY, true,act)
JumpUtils.h5Jump("隐私政策", Constant.Param.privacyAgreementUrl , true,act)
})
}
......
......@@ -180,7 +180,7 @@ public class NotificationService extends Service {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String channelId = "luck_farm";
CharSequence channelName = "幸运农场";
CharSequence channelName = "美食大亨";
String channelDescription = "快速收获";
int channelImportance = NotificationManager.IMPORTANCE_MIN;
......
......@@ -11,6 +11,7 @@ import android.text.style.ForegroundColorSpan
import android.view.Gravity
import android.view.View
import android.widget.TextView
import com.ym.library.Constant
import com.ym.library.base.BaseDialog
import com.ym.library.net.NetConfig
......@@ -42,12 +43,12 @@ object CenterDialog:BaseDialog() {
.setOnClickListener { activity.finish() }
val clickUa: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY,true,activity)
JumpUtils.h5Jump("隐私政策", Constant.Param.privacyAgreementUrl,true,activity)
}
}
val clickPrivat: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("用户协议", NetConfig.H5.WEB_URL_USER,true,activity)
JumpUtils.h5Jump("用户协议", Constant.Param.userAgreementUrl,true,activity)
}
}
// 《隐私政策》和《用户协议》,请您在使用前仔细阅读并了解
......
......@@ -182,7 +182,7 @@ object MainDialog {
AdUtils.showFeedAd(context, adType, layoutAd)
mDialogView.findViewById<TextView>(R.id.btn_get_drop_happy_accept).setOnClickListener {
mDialogView.findViewById<ImageView>(R.id.btn_get_drop_happy_accept).setOnClickListener {
mDialog.dismiss()
}
mDialogView.findViewById<ImageView>(R.id.lv_get_drop_close).setOnClickListener {
......@@ -706,6 +706,7 @@ object MainDialog {
0,
Gravity.CENTER
)
EventUtils.onEvent("seed_show","生产弹窗展示")
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.tv_dialog_shengchan_coin)?.text = "$seedPrice"
......@@ -725,6 +726,7 @@ object MainDialog {
}
//看视频领取种子
mDialogView.findViewById<ImageView>(R.id.btn_dialog_ad_shengchan).setOnClickListener {
EventUtils.onEvent("seed_video_btn_click","生产视频按钮点击")
receiveSeedOnClickListener.onClick(it)
mDialog.dismiss()
}
......
......@@ -29,7 +29,7 @@ object WareHouseDialog : WareHouseContract.View {
return
}
this.context = context
EventUtils.onEvent("show_cangku_dialog", "仓库弹窗曝光")
EventUtils.onEvent("cangku_show", "仓库弹窗展示")
mPresenter = WareHousePresenter(this)
mPresenter?.getwarehouseData()
RxBusUtil.getDefault().register(this)
......
......@@ -411,7 +411,6 @@ public class Constant {
public static String ActivityRulesUrl = "";//
public static String MakeMoneyUrl = "";//
public static String USER = "";//用户协议
public static String ABOUTUS = "";//关于我们
public static String PRIVACY = "";//隐私条款
public static String md5 = "";
......@@ -434,8 +433,9 @@ public class Constant {
public static String achievementUrl = "";
public static String taskDetailsUrl = "";
public static String payAgreementUrl = "";
public static String userAgreementUrl = "https://newspool.huolea.com/sspapiNovel/su/custom/zhentanapp/user.html";
public static String privacyAgreementUrl = "https://newspool.huolea.com/sspapiNovel/su/custom/zhentanapp/privacy.html";
public static String ABOUTUS = "https://newspool.huolea.com/sspapiNovel/su/custom/meishidaheng/aboutMe.html";//关于我们
public static String userAgreementUrl = "https://newspool.huolea.com/sspapiNovel/su/custom/meishidaheng/user.html";
public static String privacyAgreementUrl = "https://newspool.huolea.com/sspapiNovel/su/custom/meishidaheng/privacy.html";
public static String wx_share = "";
public static String APPICON = "https://zx-cdn.zhangxinhulian.com/images/2020/4/89d309616c4c85968f9171503665b3fdecdcaef3.png";
public static String invite = "";
......@@ -460,6 +460,7 @@ public class Constant {
public static String PunchRecord = "http://h5v3.ihuomao.com/BarbaraFarm/ClockIn";//打卡记录
public static String RankList = "https://h5v3.zhangxinzhixun.com/huayuan/Ranking";//排行榜
public static String WithDraw = "http://h5v2.zhangxinzhixun.com/farm/Withdraw";//提现页
public static String Confirmurl = "http://h5v2test.zhangxinzhixun.com/monopoly/Confirm";//美梦成真
public static String WithDraw2 = "http://h5v2.zhangxinzhixun.com/farm/Withdraw?novice=1";//提现页
}
......
......@@ -1218,4 +1218,9 @@ abstract class JavaInterface {
fun getPackageName(): String {
return act?.packageName.toString()
}
@JavascriptInterface
fun goNativeWithdrawal() {
JumpUtils.jumpUserInfoActivity()
}
}
\ No newline at end of file
......@@ -31,6 +31,15 @@ public class HomeInfoEntity {
private int subSeedVideoNum;//看种子不足视频剩余次数
private int acceleratorsVideoNum;//看视频给加速剂的个数
private int lotteryNum;//转盘剩余次数
private int isPopup;//是否选过商品
public int getIsPopup() {
return isPopup;
}
public void setIsPopup(int isPopup) {
this.isPopup = isPopup;
}
public int getLotteryNum() {
return lotteryNum;
......
......@@ -19,6 +19,16 @@ public class NewLandListEntity {
private int rate;
private int configNum;
private float timeRate;
private int videoRate;
public int getVideoRate() {
return videoRate;
}
public void setVideoRate(int videoRate) {
this.videoRate = videoRate;
}
private List<LandListEntity> landList;
public float getTimeRate() {
......
......@@ -45,8 +45,11 @@ public abstract class BaseActivity extends RxAppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (com.ym.modulecommon.net.NetConfig.sEnvironment == com.ym.modulecommon.net.NetConfig.Environment.PRODUCT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // 禁用横屏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
//
RxBusUtil.getDefault().register(this);
before();
if (layoutID() != 0) {
......
......@@ -151,7 +151,7 @@ public class NetConfig {
public static String WEB_URL_CLEARINSTRUCTIONS;//TODO
public static String WEB_URL_USER = "https://newspool.huolea.com/sspapiNovel/su/custom/duoduocaiyuan/privacy.html\n";//TODO 用户协议
public static String WEB_URL_USER = "https://newspool.huolea.com/sspapiNovel/su/custom/duoduocaiyuan/privacy.html";//TODO 用户协议
public static String WEB_URL_SHARE_LAND; //TODO
......
......@@ -131,6 +131,7 @@ class NovelInitEntity {
var clockInzurl:String?=""//打卡提现
var rankingurl:String?=""//排行榜
var withdrawurl:String?=""//提现页面
var Confirmurl:String?=""//大富翁页面
}
class WxConfig {
......
......@@ -306,6 +306,7 @@ class SplashPresenter : SplashContract.Presenter {
Constant.Param.PunchRecord = mNovelInitEntity.h5_url?.clockInzurl
Constant.Param.RankList = mNovelInitEntity.h5_url?.rankingurl
Constant.Param.WithDraw = mNovelInitEntity.h5_url?.withdrawurl
Constant.Param.Confirmurl = mNovelInitEntity.h5_url?.Confirmurl
}
......@@ -356,10 +357,10 @@ class SplashPresenter : SplashContract.Presenter {
Constant.Param.env = CesCore.getInstance().Ckwork(com.ym.modulecommon.utils.SettingPreference.getAndroidId())
}
}
deviceLogin()
// deviceLogin()
// getUserInfo()
// TODO
// mView.jumpPage()
mView.jumpPage()
}
private fun deviceLogin() {
......
......@@ -66,6 +66,24 @@ object AdUtils {
EventUtils.onEvent("renwu_video_show")
} else if(actionName.equals("welfare_task")) {
EventUtils.onEvent("fuli_video_show")
}else if(actionName.equals("unlockLand")){
EventUtils.onEvent("unlock_video_show")
}else if(actionName.equals("cloud_acceleration_click")){
EventUtils.onEvent("alljiasu_video_show", "全体加速视频曝光")
}else if(actionName.equals("accelerator_receive_click")){
EventUtils.onEvent("jiasu_video_show","加速器视频曝光")
}else if(actionName.equals("receive_seed_click")){
EventUtils.onEvent("seed_video_show","生产视频曝光")
}else if(actionName.equals("box_click")){
EventUtils.onEvent("box_video_show","宝箱视频曝光")
}else if(actionName.equals("bottom_open_red_envelope_click")){
EventUtils.onEvent("hongbao_video_show","次数红包视频曝光")
}else if(actionName.equals("shop_damage_video")){
EventUtils.onEvent("weixiu_video_btn_show","维修视频曝光")
}else if(actionName.equals("receive_redPack_double_click")){
EventUtils.onEvent("chai_hongbao_double_video_show","红包翻倍视频曝光")
}else if(actionName.equals("qiangtan_redPack_double_click")){
EventUtils.onEvent("chai_hongbao_video_show","拆红包强弹视频曝光")
}
}
......
......@@ -94,7 +94,7 @@ object GameDialog : BaseDialog() {
0,
Gravity.CENTER
)
EventUtils.onEvent("hongbao_show","次数红包弹窗展示")
val layout_dialog_root =
mDialogView?.findViewById<LinearLayout>(R.id.layout_dialog_open_red_root)
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_open_red_close)
......@@ -148,7 +148,7 @@ object GameDialog : BaseDialog() {
Gravity.CENTER
)
EventUtils.onEvent("alljiasu_show", "全体加速弹窗展示")
val layout_dialog_root =
mDialogView?.findViewById<LinearLayout>(R.id.layout_speed_up_root)
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_speed_up_close)
......@@ -160,6 +160,7 @@ object GameDialog : BaseDialog() {
tv_speed_up_num.text = "今天还剩${num}次"
btn_speed_up_btn.setOnClickListener {
listener.onClick(it)
EventUtils.onEvent("alljiasu_video_btn_click", "全体加速视频按钮点击")
mDialog?.dismiss()
}
......@@ -272,7 +273,7 @@ object GameDialog : BaseDialog() {
0,
Gravity.CENTER
)
EventUtils.onEvent("box_show","宝箱弹窗展示")
val layout_dialog_root =
mDialogView?.findViewById<LinearLayout>(R.id.layout_get_box_root)
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_get_box_close)
......@@ -285,6 +286,7 @@ object GameDialog : BaseDialog() {
btn_get_box_btn.setOnClickListener {
adListener.onClick(it)
EventUtils.onEvent("box_video_btn_click","宝箱视频按钮点击")
mDialog?.dismiss()
}
......@@ -369,6 +371,7 @@ object GameDialog : BaseDialog() {
tv_red_pg_reward.text = "+${reward}元"
btn_red_pg_doubled.setOnClickListener {
EventUtils.onEvent("chai_hongbao_double_video_click","红包翻倍按钮点击")
listener.onClick(it)
mDialog?.dismiss()
}
......@@ -401,7 +404,7 @@ object GameDialog : BaseDialog() {
/**
* 店铺损坏
*/
fun showShopDamage(activity: Activity, type: Int, listener: View.OnClickListener) {
fun showShopDamage(activity: Activity, type: Int, isshow:Boolean,listener: View.OnClickListener) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
......@@ -412,7 +415,7 @@ object GameDialog : BaseDialog() {
0,
Gravity.CENTER
)
EventUtils.onEvent("stop_show","暂停营业弹窗展示")
val layout_dialog_root =
mDialogView.findViewById<LinearLayout>(R.id.layout_dialog_shop_damage_root)
val btn_shop_damage_ad = mDialogView.findViewById<ImageView>(R.id.btn_shop_damage_ad)
......@@ -421,8 +424,13 @@ object GameDialog : BaseDialog() {
val iv_diamoind_close = mDialogView.findViewById<ImageView>(R.id.iv_shop_damage_close)
val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
setSunHuaiImg(iv_shop_damage_img_reward, type)
if(isshow){
btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_btn)
}else{
btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_no_btn)
}
btn_shop_damage_ad.setOnClickListener {
EventUtils.onEvent("weixiu_video_btn_click","维修视频按钮点击")
listener.onClick(it)
mDialog?.dismiss()
}
......@@ -592,6 +600,7 @@ object GameDialog : BaseDialog() {
btn_accelerator_btn.setOnClickListener {
mDialog?.dismiss()
EventUtils.onEvent("jiasu_video_btn_click","加速器视频按钮点击")
listener.onClick(it)
}
......
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