diff --git a/app/src/main/java/com/gh/common/util/DialogUtils.java b/app/src/main/java/com/gh/common/util/DialogUtils.java index 9ebab7a1a5..dad8ac5a72 100644 --- a/app/src/main/java/com/gh/common/util/DialogUtils.java +++ b/app/src/main/java/com/gh/common/util/DialogUtils.java @@ -2209,14 +2209,17 @@ public class DialogUtils { dialog.show(); } - public static void showReserveSuccess2WechatBindDialog(Context context, ConfirmListener callback) { + public static void showReserveSuccess2WechatBindDialog(Context context, ConfirmListener confirmListener,CancelListener cancelListener) { context = checkDialogContext(context); final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent); DialogWecahtReserveSuccessBinding binding = DialogWecahtReserveSuccessBinding.inflate(LayoutInflater.from(context)); - binding.closeBtn.setOnClickListener(v -> dialog.dismiss()); + binding.closeBtn.setOnClickListener(v -> { + cancelListener.onCancel(); + dialog.dismiss(); + }); binding.openBtn.setOnClickListener(v -> { - callback.onConfirm(); + confirmListener.onConfirm(); dialog.dismiss(); }); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); diff --git a/app/src/main/java/com/gh/common/util/NewLogUtils.kt b/app/src/main/java/com/gh/common/util/NewLogUtils.kt index 82eea04e2b..f699c9fdde 100644 --- a/app/src/main/java/com/gh/common/util/NewLogUtils.kt +++ b/app/src/main/java/com/gh/common/util/NewLogUtils.kt @@ -7,6 +7,7 @@ import com.gh.common.loghub.LoghubUtils import com.gh.common.tracker.Tracker import com.gh.gamecenter.entity.LinkEntity import com.gh.gamecenter.entity.QuoteCountEntity +import com.gh.gamecenter.entity.WechatConfigEntity import com.gh.gamecenter.retrofit.EmptyResponse import com.gh.gamecenter.retrofit.RetrofitManager import com.lightgame.utils.Utils @@ -1779,4 +1780,72 @@ object NewLogUtils { } log(json, "event", false) } + + //成功预约游戏 + @JvmStatic + fun logReserveGameSuccess(wechatConfigEntity: WechatConfigEntity) { + val json = json { + "event" to "appointment_wechat_appointment_game" + "wechat_is_bind" to wechatConfigEntity.bind + "wechat_is_follow" to wechatConfigEntity.follow + "wechat_is_remind" to wechatConfigEntity.notice + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "appointment", false) + } + + //引导设置微信提醒弹窗事件 + @JvmStatic + fun logReserveWechatRemindPopShow(wechatConfigEntity: WechatConfigEntity) { + val json = json { + "event" to "appointment_wechat_remind_pop_show" + "wechat_is_bind" to wechatConfigEntity.bind + "wechat_is_follow" to wechatConfigEntity.follow + "wechat_is_remind" to wechatConfigEntity.notice + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "appointment", false) + } + + //引导设置微信提醒弹窗点击事件 + @JvmStatic + fun logReserveWechatRemindPopClick(wechatConfigEntity: WechatConfigEntity, operationType: String) { + val json = json { + "event" to "appointment_wechat_remind_pop_click" + "wechat_is_bind" to wechatConfigEntity.bind + "wechat_is_follow" to wechatConfigEntity.follow + "wechat_is_remind" to wechatConfigEntity.notice + "operation_type" to operationType + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "appointment", false) + } + + //预约成功弹窗事件 + @JvmStatic + fun logReserveWechatSuccessPopShow() { + val json = json { + "event" to "appointment_wechat_success_pop_show" + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "appointment", false) + } + + //点击微信提醒 + @JvmStatic + fun logWechatRemindConfigClick(wechatConfigEntity: WechatConfigEntity) { + val json = json { + "event" to "appointment_wechat_remind_config_click" + "wechat_is_bind" to wechatConfigEntity.bind + "wechat_is_follow" to wechatConfigEntity.follow + "wechat_is_remind" to wechatConfigEntity.notice + "timestamp" to System.currentTimeMillis() / 1000 + parseAndPutMeta().invoke(this) + } + log(json, "appointment", false) + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/common/util/ReservationHelper.kt b/app/src/main/java/com/gh/common/util/ReservationHelper.kt index 9e1ab06459..11c95137ee 100644 --- a/app/src/main/java/com/gh/common/util/ReservationHelper.kt +++ b/app/src/main/java/com/gh/common/util/ReservationHelper.kt @@ -73,12 +73,18 @@ object ReservationHelper { callback.onCallback() val wechatConfig = SPUtils.getString(Constants.SP_WECHAT_CONFIG).toObject() wechatConfig?.run { + NewLogUtils.logReserveGameSuccess(wechatConfig) if (bind && follow && notice) { + NewLogUtils.logReserveWechatSuccessPopShow() DialogUtils.showReserveSuccessDialog(context) } else { - DialogUtils.showReserveSuccess2WechatBindDialog(context) { + NewLogUtils.logReserveWechatRemindPopShow(wechatConfig) + DialogUtils.showReserveSuccess2WechatBindDialog(context,{ + NewLogUtils.logReserveWechatRemindPopClick(wechatConfig,"开启微信提醒") context.startActivity(WebActivity.getBindWechatIntent(context)) - } + },{ + NewLogUtils.logReserveWechatRemindPopClick(wechatConfig,"关闭弹窗") + }) } } } diff --git a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt index 23ebc78a4c..54194f1a3e 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt @@ -12,11 +12,13 @@ import androidx.recyclerview.widget.RecyclerView import com.facebook.drawee.view.SimpleDraweeView import com.gh.common.constant.Constants import com.gh.common.util.* +import com.gh.common.util.NewLogUtils.logWechatRemindConfigClick import com.gh.gamecenter.* import com.gh.gamecenter.db.GameTrendsDao import com.gh.gamecenter.entity.FunctionalGroupEntity import com.gh.gamecenter.entity.FunctionalLinkEntity import com.gh.gamecenter.entity.FunctionalMessageType +import com.gh.gamecenter.entity.WechatConfigEntity import com.gh.gamecenter.game.upload.GameSubmissionActivity import com.gh.gamecenter.gamecollection.mine.MyGameCollectionActivity import com.gh.gamecenter.gamedetail.myrating.MyRatingActivity @@ -29,7 +31,6 @@ import com.gh.gamecenter.security.SecurityActivity import com.gh.gamecenter.simulatorgame.SimulatorGameActivity import com.gh.gamecenter.teenagermode.TeenagerModeActivity import com.gh.gamecenter.toolbox.ToolBoxBlockActivity -import com.gh.gamecenter.user.UserViewModel import com.gh.gamecenter.video.videomanager.VideoManagerActivity import com.halo.assistant.HaloApp import com.lightgame.adapter.BaseRecyclerAdapter @@ -206,8 +207,12 @@ class PersonalFunctionAdapter(val context: Context, val groupName: String, var m context.startActivity(ShellActivity.getIntent(context, ShellActivity.Type.REAL_NAME_INFO, null)) } "微信提醒" -> { - MtaHelper.onEvent("我的光环", "设置微信提醒") - context.startActivity(WebActivity.getBindWechatIntent(context)) + if (UserManager.getInstance().isLoggedIn) { + MtaHelper.onEvent("我的光环", "设置微信提醒") + context.startActivity(WebActivity.getBindWechatIntent(context)) + } else { + CheckLoginUtils.checkLogin(context, "我的光环-微信提醒") { } + } } "分享光环" -> { MtaHelper.onEvent("我的光环", "分享") diff --git a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.java b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.java index ba7dc400ac..8ebb48139e 100644 --- a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.java +++ b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.java @@ -29,6 +29,7 @@ import com.gh.common.util.EntranceUtils; import com.gh.common.util.GsonUtils; import com.gh.common.util.LoginUtils; import com.gh.common.util.MtaHelper; +import com.gh.common.util.NewLogUtils; import com.gh.common.util.NotificationHelper; import com.gh.common.util.PackageUtils; import com.gh.common.util.PermissionHelper; @@ -190,8 +191,6 @@ public class SettingsFragment extends NormalFragment { initLoginStatus(); initUsageStats(); - - initWechatBindStatus(); } private boolean checkPrivacyIsSame() { @@ -453,6 +452,11 @@ public class SettingsFragment extends NormalFragment { break; case R.id.setting_rl_wechat_remind: if (UserManager.getInstance().isLoggedIn()) { + String json = SPUtils.getString(Constants.SP_WECHAT_CONFIG); + WechatConfigEntity entity = GsonUtils.fromJson(json, WechatConfigEntity.class); + if (entity != null) { + NewLogUtils.logWechatRemindConfigClick(entity); + } requireContext().startActivity(WebActivity.getBindWechatIntent(requireContext())); } break;