Browse Source

feat: 屏蔽

tongmengxiao 4 months ago
parent
commit
e4382c8db9

+ 1 - 0
baseswago/src/main/java/com/swago/baseswago/model/ConfigModel.kt

@@ -17,6 +17,7 @@ data class ConfigModel(
 
     //版本更新
     val app_version:Int,
+    val android_app_version:String = "",
     val store_url:String="",//应用时长地址
     val link_url:String="",//渠道包下载地址
     val upgrade:String="",//版本描述

+ 32 - 14
room/src/main/java/com/swago/room/vm/MsgVm.kt

@@ -6,6 +6,7 @@ import com.swago.baseswago.baseroom.IRoomInfo
 import com.swago.baseswago.baseroom.RoleType
 import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.baseroom.viewmodel.AbsMsgVm
+import com.swago.baseswago.constant.UrlConstant
 import com.swago.baseswago.im.IRoomChat
 import com.swago.baseswago.im.ImConstant
 import com.swago.baseswago.im.ImConstant.anchor_close_room
@@ -61,6 +62,7 @@ import com.swago.baseswago.model.live.audio.*
 import com.swago.baseswago.model.live.gift.IMGiftModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.BitmapUtils
+import com.swago.baseswago.util.SwagoInfo
 import com.swago.baseswago.util.UserInfo
 import com.swago.room.R
 import com.swago.room.audio.AudioRoomManager
@@ -354,9 +356,9 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
         }
         //游戏中奖飘条
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<GamePrize>>(game_win_big_prize) {
-            SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
+            UrlConstant.getConfigModel()?.let { configModel ->
                 it.data?.let {
-                    if (isReady) {
+                    if (isReady && configModel.android_app_version != SwagoInfo.getVersionCode()) {
                         //游戏飘条
                         waftFun?.invoke(it)
                     }
@@ -788,33 +790,49 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
         }
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(today_star_rewards) {
             if (isReady) {
-                it.data?.let {
-                    it.type = 505
-                    waftFun?.invoke(it)
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()){
+                        it.data?.let {
+                            it.type = 505
+                            waftFun?.invoke(it)
+                        }
+                    }
                 }
             }
         }
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(game_key_rewards) {
             if (isReady) {
-                it.data?.let {
-                    it.type = 506
-                    waftFun?.invoke(it)
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 506
+                            waftFun?.invoke(it)
+                        }
+                    }
                 }
             }
         }
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_rewards) {
             if (isReady) {
-                it.data?.let {
-                    it.type = 507
-                    waftFun?.invoke(it)
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 507
+                            waftFun?.invoke(it)
+                        }
+                    }
                 }
             }
         }
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_sum) {
             if (isReady) {
-                it.data?.let {
-                    it.type = 508
-                    waftFun?.invoke(it)
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 508
+                            waftFun?.invoke(it)
+                        }
+                    }
                 }
             }
         }