From dae7ab4da9f60f02b7c929a95c92977fadbf0d30 Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Tue, 13 Jan 2026 17:43:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E7=94=9F=E6=88=90=E5=B7=B4?= =?UTF-8?q?=E8=A5=BF=E7=94=B5=E8=AF=9D=E5=8F=B7=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/newUtil/NotificationDatas.kt | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/notification/src/main/java/com/remax/notification/newUtil/NotificationDatas.kt b/notification/src/main/java/com/remax/notification/newUtil/NotificationDatas.kt index 0f10b85..40ab9ee 100644 --- a/notification/src/main/java/com/remax/notification/newUtil/NotificationDatas.kt +++ b/notification/src/main/java/com/remax/notification/newUtil/NotificationDatas.kt @@ -13,6 +13,7 @@ import com.remax.notification.builder.entryPointPendingIntent import com.remax.notification.builder.type2notificationId import com.remax.notification.check.NotificationCheckController import com.remax.notification.config.PushContent +import java.util.Random import java.util.concurrent.ConcurrentHashMap @@ -193,12 +194,13 @@ object NotificationDatas { entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_9)) ) + val randomPhoneNum = generateRandomBrazilPhoneNumber() + ", " + generateRandomBrazilPhoneNumber() mRandomConfigList.add(NotificationConfig( NOTI_ID_TYPE_RANDOM_10, CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM_NAME, ResUtil.getString(R.string.notify_title_10), - ResUtil.getString(R.string.notify_des_10), + randomPhoneNum, //ResUtil.getString(R.string.notify_des_10), R.mipmap.task_cash, entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_10)) ) @@ -238,6 +240,41 @@ object NotificationDatas { return mRandomConfigList[mLastRandomIndexMap[randomType]!!] } + + private fun generateRandomBrazilPhoneNumber( + withCountryCode: Boolean = true, + formatted: Boolean = true + ): String { + val random = Random() + + // 1. 生成随机的2位地区码(巴西主要城市区号范围) + val areaCodes = arrayOf("11", "21", "31", "41", "48", "51", "61", "71", "81", "84") + val areaCode = areaCodes[random.nextInt(areaCodes.size)] + + // 2. 生成本地号码:首位必须是9,后面8位随机 + val localNumber = StringBuilder().apply { + append("9") // 巴西手机号首位固定为9 + for (i in 0 until 8) { + append(random.nextInt(10)) // 生成0-9的随机数 + } + }.toString() + + // 3. 组合成完整号码 + return if (formatted) { + if (withCountryCode) { + "+55 ($areaCode) $localNumber" + } else { + "($areaCode) $localNumber" + } + } else { + if (withCountryCode) { + "55$areaCode$localNumber" + } else { + "$areaCode$localNumber" + } + } + } + interface IResidentDataCallback { fun getGoldNumber(): Long fun getCashNumber(): Double