ソースを参照

feat: 小黑屋

tongmengxiao 5 ヶ月 前
コミット
d0fdbf8ea7
22 ファイル変更613 行追加244 行削除
  1. 7 2
      baseswago/src/main/java/com/swago/baseswago/HandleVm.kt
  2. 1 1
      baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt
  3. 1 1
      baseswago/src/main/java/com/swago/baseswago/dialog/HandleDialogFragment.kt
  4. 9 0
      baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt
  5. 4 0
      baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt
  6. 164 1
      baseswago/src/main/java/com/swago/baseswago/inter/RoomApi.kt
  7. 8 0
      baseswago/src/main/java/com/swago/baseswago/model/im/HouseOpenLiveData.kt
  8. 9 0
      baseswago/src/main/java/com/swago/baseswago/model/live/RankListModel.java
  9. 1 1
      home/src/main/java/com/swago/home/innerhome/FollowFragment.kt
  10. 8 2
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  11. 65 51
      room/src/main/java/com/swago/room/bean/UserRoomModel.kt
  12. 5 29
      room/src/main/java/com/swago/room/dialog/AudienceListDialog.kt
  13. 1 0
      room/src/main/java/com/swago/room/enum/RoomType.kt
  14. 23 5
      room/src/main/java/com/swago/room/gift/GiftDialog.kt
  15. 42 0
      room/src/main/java/com/swago/room/gift/GiftVm.kt
  16. 6 1
      room/src/main/java/com/swago/room/ranklist/RankListAdapter.kt
  17. 1 1
      room/src/main/java/com/swago/room/user/UserRoomActivity.kt
  18. 19 0
      room/src/main/java/com/swago/room/vm/MsgVm.kt
  19. 128 20
      room/src/main/java/com/swago/room/vm/RoomOtherVm.kt
  20. 65 16
      room/src/main/java/com/swago/room/vm/RoomVm.kt
  21. 44 0
      room/src/main/java/com/swago/room/wishgift/WishGiftOnUserDialog.kt
  22. 2 113
      room/src/main/res/layout/dialog_audience_list.xml

+ 7 - 2
baseswago/src/main/java/com/swago/baseswago/HandleVm.kt

@@ -27,9 +27,14 @@ class HandleVm(application: Application) : BaseViewModel(application) {
     }
 
 
-    fun getUserRoomAuth(userId: String, roomId: String) {
+    fun getUserRoomAuth(userId: String, roomId: String , roomType: Int) {
         requestData {
-            roomAuthLiveData.value = ApiManager.roomApi.getUserRoomAuth(roomId,userId)
+            if (roomType == 3) {
+                roomAuthLiveData.value = ApiManager.roomApi.getHouseUserRoomAuth(roomId,userId)
+            } else {
+                roomAuthLiveData.value = ApiManager.roomApi.getUserRoomAuth(roomId,userId)
+            }
+
         }
     }
 

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt

@@ -78,7 +78,7 @@ class PersonDataDFragment : BaseXDFragment<DialogPersonDataBinding>() {
                 }else{
                     if (inRoom){
                         SwagoRoomManager.iRoomInfo?.let {
-                            handleVm.getUserRoomAuth(uid,it.getRoomId())
+                            handleVm.getUserRoomAuth(uid,it.getRoomId(),it.getRoomType())
                         }
                         binding.ivGift.visibility = View.VISIBLE
                         binding.tvAt.visibility = View.VISIBLE

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/dialog/HandleDialogFragment.kt

@@ -102,7 +102,7 @@ class HandleDialogFragment : BaseXDFragment<DialogHandleBinding>() {
                 binding.tvMute.visibility = View.GONE
             }
             SwagoRoomManager.iRoomInfo?.let { info ->
-                handleVm.getUserRoomAuth(userId,info.getRoomId())
+                handleVm.getUserRoomAuth(userId,info.getRoomId(),info.getRoomType())
                 if (inRoom){
                     if (SwagoRoomManager.roleType == RoleType.user){
                         binding.tvNeverWatcherAnchor.visibility = View.VISIBLE

+ 9 - 0
baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt

@@ -22,6 +22,7 @@ import com.swago.baseswago.im.ImConstant.forbid_speak
 import com.swago.baseswago.im.ImConstant.force_close_live_room
 import com.swago.baseswago.im.ImConstant.fruit_game
 import com.swago.baseswago.im.ImConstant.game_win_big_prize
+import com.swago.baseswago.im.ImConstant.house_open_live
 import com.swago.baseswago.im.ImConstant.invite_user_on_mic
 import com.swago.baseswago.im.ImConstant.jifen_change
 import com.swago.baseswago.im.ImConstant.jifen_clear
@@ -366,6 +367,14 @@ class GroupMsgParser : IGroupNewMsgParser {
                     )
                     parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
                 }
+                house_open_live -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(HouseOpenLiveData::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
 
             }
             parserModel?.v2TIMMessage = v2TIMMessage

+ 4 - 0
baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt

@@ -242,6 +242,10 @@ object ImConstant {
      * 重置用户昵称
      * */
     const val change_user_name = 503
+    /**
+     * 主播开播
+     * */
+    const val house_open_live = 504
 
     /**********游戏相关IM********/
     const val fruit_game = 1001

+ 164 - 1
baseswago/src/main/java/com/swago/baseswago/inter/RoomApi.kt

@@ -31,12 +31,24 @@ interface RoomApi {
     @POST("/v2/rtc/game/list")
     suspend fun getGameList(): GameListModel
 
+    /**
+     * 游戏列表(小黑屋)
+     */
+    @POST("/v1/rtc/house/game/list")
+    suspend fun getHouseGameList(): GameListModel
+
     /**
      * 推荐游戏列表
      * */
     @POST("/v3/home/recommend/game/list")
     suspend fun getRecommendGameList(): RecommendGameListModel
 
+    /**
+     * 推荐游戏列表(小黑屋)
+     * */
+    @POST("/v1/rtc/house/recommend/game/list")
+    suspend fun getHouseRecommendGameList(): RecommendGameListModel
+
     /**
      * 开播
      * broadcast_type 直播间类型(1视频2语音)
@@ -49,7 +61,7 @@ interface RoomApi {
     /**
      * 关播
      */
-    @POST("/v1/rtc/end/broadcast")
+    @POST("/v2/rtc/end/broadcast")
     suspend fun closeLive(): AnchorClosedModel
 
 
@@ -60,6 +72,13 @@ interface RoomApi {
     @POST("/v1/rtc/join/broadcast")
     suspend fun joinRoom(@Field("room_id") room_id: String,@Field("broadcast_password")broadcast_password:String?=""): RoomModel
 
+    /**
+     * 加入房间(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/join")
+    suspend fun joinHouseRoom(@Field("room_id") room_id: String): RoomModel
+
     /**
      * 退出房间
      */
@@ -67,6 +86,13 @@ interface RoomApi {
     @POST("/v1/rtc/leave/broadcast")
     suspend fun leaveRoom(@Field("room_id") room_id: String): Any
 
+    /**
+     * 退出房间(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/leave/broadcast")
+    suspend fun houseLeaveRoom(@Field("room_id") room_id: String): Any
+
 
     /**
      * 观众列表
@@ -79,6 +105,17 @@ interface RoomApi {
         @Field("page_size") page_size: Int = 5
     ): RoomUserModel
 
+    /**
+     * 观众列表(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/user/list")
+    suspend fun getHouseRoomUser(
+        @Field("room_id") room_id: String,
+        @Field("page") page: Int = 1,
+        @Field("page_size") page_size: Int = 5
+    ): RoomUserModel
+
     /**
      * 直播间排行榜
      * 排行榜类型(1日榜2周榜3月榜)rank_type
@@ -92,6 +129,19 @@ interface RoomApi {
         @Field("page_size") page_size: Int = 20
     ): RankListModel
 
+    /**
+     * 直播间排行榜(小黑屋)
+     * 排行榜类型(1日榜2周榜3月榜)rank_type
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/fans/rank/list")
+    suspend fun getHouseRankList(
+        @Field("room_id") room_id: String,
+        @Field("rank_type") rank_type: Int,
+        @Field("page") page: Int = 1,
+        @Field("page_size") page_size: Int = 20
+    ): RankListModel
+
 
     /**
      * 直播间礼物
@@ -99,6 +149,12 @@ interface RoomApi {
     @POST("/v1/rtc/gift/list")
     suspend fun getGiftList(): List<GiftAllModel>
 
+    /**
+     * 直播间礼物(小黑屋)
+     */
+    @POST("/v1/rtc/house/gift/list")
+    suspend fun getHouseGiftList(): List<GiftAllModel>
+
     /**
      * 直播间礼物
      */
@@ -136,6 +192,21 @@ interface RoomApi {
         @Field("pk_id") pk_id: String,
     ): GiftSendModel
 
+    /**
+     * 赠送礼物(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/buy/gift")
+    suspend fun sendHouseGift(
+        @Field("room_id") room_id: String,
+        @Field("gift_id") gift_id: String,
+        @Field("gift_batch") gift_batch: Int,
+        @Field("gift_receive_id") gift_receive_id: String,
+        @Field("is_combo") is_combo: Int,
+        @Field("gift_num") gift_num: Int,
+        @Field("pk_id") pk_id: String,
+    ): GiftSendModel
+
     /**
      * 语音房赠送心愿礼物
      */
@@ -153,6 +224,16 @@ interface RoomApi {
         @Field("user_id") user_id: String
     ): RoomAuthModel
 
+    /**
+     * 用户在直播间权限(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("v1/rtc/house/broadcast/auth")
+    suspend fun getHouseUserRoomAuth(
+        @Field("room_id") room_id: String,
+        @Field("user_id") user_id: String
+    ): RoomAuthModel
+
     /**
      * 剔除直播间
      * type 1 添加  0移除
@@ -196,12 +277,24 @@ interface RoomApi {
     @POST("/v1/rtc/broadcast/share/link")
     suspend fun getShareConfig(): ShareConfig
 
+    /**
+     * 获取分享配置(小黑屋)
+     */
+    @POST("/v1/rtc/house/broadcast/share/link")
+    suspend fun getHouseShareConfig(): ShareConfig
+
     /**
      * 获取直播间配置
      */
     @POST("/v1/rtc/broadcast/setting")
     suspend fun getRoomConfig(): RoomConfig
 
+    /**
+     * 获取直播间配置(小黑屋)
+     */
+    @POST("/v1/rtc/house/broadcast/setting")
+    suspend fun getHouseRoomConfig(): RoomConfig
+
     /**
      * 获取红包列表
      */
@@ -209,6 +302,13 @@ interface RoomApi {
     @POST("/v1/rtc/broadcast/package/list")
     suspend fun getRedEnvelopeList(@Field("room_id") room_id: String): ArrayList<RedEnvelope>
 
+    /**
+     * 获取红包列表(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/package/list")
+    suspend fun getHouseRedEnvelopeList(@Field("room_id") room_id: String): ArrayList<RedEnvelope>
+
 
     /**
      * 发送红包接口
@@ -221,6 +321,17 @@ interface RoomApi {
         @Field("package_total_num") package_total_num: Int,
     ): Any
 
+    /**
+     * 发送红包接口(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/send/package")
+    suspend fun sendHouseRedEnvelope(
+        @Field("room_id") room_id: String,
+        @Field("package_total_coins") package_total_coins: String,
+        @Field("package_total_num") package_total_num: Int,
+    ): Any
+
 
     /**
      * 领取红包接口
@@ -232,6 +343,16 @@ interface RoomApi {
         @Field("package_id") package_id: String
     ): RedEnvelopeResult
 
+    /**
+     * 领取红包接口(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/receive/package")
+    suspend fun getHouseRedEnvelopeCoin(
+        @Field("room_id") room_id: String,
+        @Field("package_id") package_id: String
+    ): RedEnvelopeResult
+
 
     /**
      * 根据主播ID获取主播信息
@@ -240,6 +361,13 @@ interface RoomApi {
     @POST("/v1/rtc/broadcast/user/detail")
     suspend fun getMomentModel(@Field("room_id") room_id: String): MomentModel
 
+    /**
+     * 根据主播ID获取主播信息(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/user/detail")
+    suspend fun getHouseMomentModel(@Field("room_id") room_id: String): MomentModel
+
 
     /***********************PK*********************************/
 
@@ -496,6 +624,13 @@ interface RoomApi {
     @POST("/v1/rtc/barrage/send")
     suspend fun sendDanMu(@Field("room_id") room_id: String,@Field("message") message: String):Any
 
+    /**
+     * 发送弹幕(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/barrage/send")
+    suspend fun sendHouseDanMu(@Field("room_id") room_id: String,@Field("message") message: String):Any
+
     /**
      * 红包领取详情
      */
@@ -503,6 +638,13 @@ interface RoomApi {
     @POST("/v1/rtc/broadcast/package/detail")
     suspend fun getRedReceivedList(@Field("package_id") package_id: String):RedReceiveListModel
 
+    /**
+     * 红包领取详情(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/package/detail")
+    suspend fun getHouseRedReceivedList(@Field("package_id") package_id: String):RedReceiveListModel
+
     /**
      * 主播端心愿礼物列表
      */
@@ -537,6 +679,13 @@ interface RoomApi {
     @POST("/v4/rtc/broadcast/give")
     suspend fun userDianZan(@Field("room_id") room_id:String):Any
 
+    /**
+     * 用户点赞(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/give")
+    suspend fun userHouseDianZan(@Field("room_id") room_id:String):Any
+
     /**
      * 粉丝团列表
      */
@@ -544,6 +693,13 @@ interface RoomApi {
     @POST("/v4/rtc/broadcast/fans/list")
     suspend fun getFanClubList(@Field("room_id") room_id:String,@Field("page") page:Int,@Field("page_size") page_size:Int=50): FanClubUserModel
 
+    /**
+     * 粉丝团列表(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/fans/list")
+    suspend fun getHouseFanClubList(@Field("room_id") room_id:String,@Field("page") page:Int,@Field("page_size") page_size:Int=50): FanClubUserModel
+
     /**
      * 加入粉丝团
      */
@@ -551,6 +707,13 @@ interface RoomApi {
     @POST("/v4/rtc/broadcast/fans/join")
     suspend fun joinFanClub(@Field("room_id") room_id:String):Any
 
+    /**
+     * 加入粉丝团(小黑屋)
+     */
+    @FormUrlEncoded
+    @POST("/v1/rtc/house/broadcast/fans/join")
+    suspend fun joinHouseFanClub(@Field("room_id") room_id:String):Any
+
     /**
      * 开播背景图
      */

+ 8 - 0
baseswago/src/main/java/com/swago/baseswago/model/im/HouseOpenLiveData.kt

@@ -0,0 +1,8 @@
+package com.swago.baseswago.model.im
+
+data class HouseOpenLiveData(
+    val roomId:String = "",
+    val anchorId:String = "",
+    val anchorName:String = "",
+    val anchorAvatar:String = ""
+)

+ 9 - 0
baseswago/src/main/java/com/swago/baseswago/model/live/RankListModel.java

@@ -55,6 +55,7 @@ public class RankListModel {
         private String user_head_img_url;
         private String user_name;
         private String user_wealth_level;
+        private String offlive;
 
         public String getTotal_coins() {
             return total_coins;
@@ -95,5 +96,13 @@ public class RankListModel {
         public void setUser_wealth_level(String user_wealth_level) {
             this.user_wealth_level = user_wealth_level;
         }
+
+        public String getOfflive() {
+            return offlive;
+        }
+
+        public void setOfflive(String offlive) {
+            this.offlive = offlive;
+        }
     }
 }

+ 1 - 1
home/src/main/java/com/swago/home/innerhome/FollowFragment.kt

@@ -51,7 +51,7 @@ class FollowFragment : BaseListFragment<FragmentHotBinding, MomentModel>(){
                         .navigation()
                 }else{
                     ARouter.getInstance()
-                        .build(ARouteConstant.Room.black)
+                        .build(ARouteConstant.Room.user)
                         .withInt("position",position)
                         .withParcelableArrayList("data",adapter.data as ArrayList<MomentModel>)
                         .navigation()

+ 8 - 2
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -577,6 +577,10 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
             binding.bannerWishGift.setData(wishGiftData)
         }
 
+        msgVm.openHouseOpenLiveDialog = {
+
+        }
+
 
         //打开红包
         binding.ivRedEnvelopeView.openRedEnvelope = {
@@ -745,7 +749,9 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
     private var isFirst = true
     override fun joinedRoom(iRoomInfo: IRoomInfo) {
         roomOtherVm.getRedEnvelopeList()
-        roomOtherVm.getFirstWishGiftData(iRoomInfo.getRoomId())
+        if (iRoomInfo.getRoomType() != RoomType.HOUSE.type){
+            roomOtherVm.getFirstWishGiftData(iRoomInfo.getRoomId())
+        }
         if (iRoomInfo.getRoomType() == RoomType.AUDIO.type) {
             roomVm.getAudioList(iRoomInfo.getAnchorId(), 2)
             binding.rvAudio.visibility = View.VISIBLE
@@ -782,7 +788,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
             UserInfo.getUserInfo()?.let {
                 if (it.id.isNotEmpty()) {
                     SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
-                        roomVm.getUserRoomAuth(it.id, iRoomInfo.getRoomId())
+                        roomVm.getUserRoomAuth(it.id, iRoomInfo.getRoomId() , iRoomInfo.getRoomType())
                     }
                 }
 

+ 65 - 51
room/src/main/java/com/swago/room/bean/UserRoomModel.kt

@@ -11,13 +11,13 @@ import com.swago.room.enum.RoomType
  *@date 2021/10/11 14:29
  *description:
  */
-class UserRoomModel :  IRoomInfo{
+class UserRoomModel : IRoomInfo {
 
-    var roomModel:RoomModel? = null
+    var roomModel: RoomModel? = null
 
-    var momentModel:MomentModel? = null
+    var momentModel: MomentModel? = null
 
-    var userInRoomIsAdmin:Int = 0//用户自己是否是直播间管理员
+    var userInRoomIsAdmin: Int = 0//用户自己是否是直播间管理员
 
     var roomType = RoomType.VIDEO
 
@@ -25,94 +25,94 @@ class UserRoomModel :  IRoomInfo{
 
     var password = ""
 
-    var passwordStatus:Int = 0 //是否密码房(1是0否)
+    var passwordStatus: Int = 0 //是否密码房(1是0否)
 
     override fun getAnchorName(): String {
-        return roomModel?.user_name?:""
+        return roomModel?.user_name ?: ""
     }
 
     override fun getAnchorId(): String {
-        return if (RoleType.user == SwagoRoomManager.roleType){
-            momentModel?.id?:""
-        }else{
-            roomModel?.id?:""
+        return if (RoleType.user == SwagoRoomManager.roleType) {
+            momentModel?.id ?: ""
+        } else {
+            roomModel?.id ?: ""
         }
     }
 
     override fun getAnchorCode(): String {
-        return roomModel?.user_account?:""
+        return roomModel?.user_account ?: ""
     }
 
     override fun getAnchorType(): Int {
-        return roomModel?.anchor_type?:0
+        return roomModel?.anchor_type ?: 0
     }
 
     override fun getRoomId(): String {
-        return if (RoleType.user == SwagoRoomManager.roleType){
-            momentModel?.id?:""
-        }else{
-            roomModel?.id?:""
+        return if (RoleType.user == SwagoRoomManager.roleType) {
+            momentModel?.id ?: ""
+        } else {
+            roomModel?.id ?: ""
         }
     }
 
     override fun getBroadcastId(): String {
-        return roomModel?.broadcast_id?:""
+        return roomModel?.broadcast_id ?: ""
     }
 
     override fun getRoomGroupId(): String {
-        return roomModel?.im_group_id?:""
+        return roomModel?.im_group_id ?: ""
     }
 
     override fun getAgoraToken(): String {
-        return roomModel?.rtc_token?:""
+        return roomModel?.rtc_token ?: ""
     }
 
     override fun getRoomCover(): String {
-        return if (RoleType.user == SwagoRoomManager.roleType){
-            momentModel?.user_head_img_url?:""
-        }else{
-            roomModel?.user_head_img_url?:""
+        return if (RoleType.user == SwagoRoomManager.roleType) {
+            momentModel?.user_head_img_url ?: ""
+        } else {
+            roomModel?.user_head_img_url ?: ""
         }
     }
 
     override fun getChannelName(): String {
-        return if (RoleType.user == SwagoRoomManager.roleType){
-            momentModel?.user_account?:""
-        }else{
-            roomModel?.user_account?:""
+        return if (RoleType.user == SwagoRoomManager.roleType) {
+            momentModel?.user_account ?: ""
+        } else {
+            roomModel?.user_account ?: ""
         }
     }
 
     override fun getRoomHot(): String {
-        return roomModel?.broadcast_hot?:"0"
+        return roomModel?.broadcast_hot ?: "0"
     }
 
     override fun getIsFollow(): Int {
-        return roomModel?.is_follow?:0
+        return roomModel?.is_follow ?: 0
     }
 
     override fun getRoomIncome(): String {
-        return roomModel?.broadcast_income_coins?:"0"
+        return roomModel?.broadcast_income_coins ?: "0"
     }
 
     override fun getGameUrl(): String {
-        return roomModel?.game_url?:""
+        return roomModel?.game_url ?: ""
     }
 
     override fun getGameApiBaseUrl(): String {
-        return roomModel?.game_api_url?:""
+        return roomModel?.game_api_url ?: ""
     }
 
     override fun getGameType(): Int {
-        return roomModel?.game_type?:0
+        return roomModel?.game_type ?: 0
     }
 
     override fun getGameVersion(): Int {
-        return roomModel?.game_version?:0
+        return roomModel?.game_version ?: 0
     }
 
     override fun getGameDownLoadUrl(): String {
-        return roomModel?.game_down_url?:""
+        return roomModel?.game_down_url ?: ""
     }
 
     override fun getIsFullGame(): Boolean {
@@ -120,14 +120,14 @@ class UserRoomModel :  IRoomInfo{
     }
 
     override fun getRoomSystemMsg(): String {
-        return roomModel?.broadcast_notice_content?:""
+        return roomModel?.broadcast_notice_content ?: ""
     }
 
     override fun getIsRobot(): Boolean {
-        return if (RoleType.user == SwagoRoomManager.roleType){
-            momentModel?.is_robot?:0 == 1
-        }else{
-           false
+        return if (RoleType.user == SwagoRoomManager.roleType) {
+            momentModel?.is_robot ?: 0 == 1
+        } else {
+            false
         }
     }
 
@@ -137,13 +137,27 @@ class UserRoomModel :  IRoomInfo{
 
     override fun getRoomType(): Int {
         momentModel?.let {
-            roomType = when (it.user_broadcast_type) {
+            roomType = when (it.user_broadcast_status) {
                 1 -> {
-                    RoomType.VIDEO
+                    when (it.user_broadcast_type) {
+                        1 -> {
+                            RoomType.VIDEO
+                        }
+
+                        2 -> {
+                            RoomType.AUDIO
+                        }
+
+                        else -> {
+                            RoomType.NULL
+                        }
+                    }
                 }
-                2 -> {
-                    RoomType.AUDIO
+
+                0 -> {
+                    RoomType.HOUSE
                 }
+
                 else -> {
                     RoomType.NULL
                 }
@@ -153,30 +167,30 @@ class UserRoomModel :  IRoomInfo{
     }
 
     override fun getAudioNotice(): String {
-        return roomModel?.yuying_notice_content?:""
+        return roomModel?.yuying_notice_content ?: ""
     }
 
     override fun getIsFans(): Int {
-        return roomModel?.is_fans?:0
+        return roomModel?.is_fans ?: 0
     }
 
     override fun getFanScore(): String {
-        return roomModel?.fans_score?:"0"
+        return roomModel?.fans_score ?: "0"
     }
 
     override fun getFanClubLevel(): Int {
-        return roomModel?.fans_level?:1
+        return roomModel?.fans_level ?: 1
     }
 
     override fun getLikeNum(): String {
-        return roomModel?.give_val?:"0"
+        return roomModel?.give_val ?: "0"
     }
 
     override fun getRoomBg(): String {
-        return roomModel?.broadcast_bg_url?:""
+        return roomModel?.broadcast_bg_url ?: ""
     }
 
     override fun getPassStatus(): Int {
-        return momentModel?.broadcast_password_status?:0
+        return momentModel?.broadcast_password_status ?: 0
     }
 }

+ 5 - 29
room/src/main/java/com/swago/room/dialog/AudienceListDialog.kt

@@ -67,36 +67,12 @@ class AudienceListDialog : BaseListDialogFragment<DialogAudienceListBinding,Room
            if (it == null){
                smartRecyclerView.onFetchDataError()
            }else{
-               UserInfo.getUserInfo()?.let {userInfo ->
-                   it.list.forEach { data ->
-                       if(userInfo.id == data.user_id){
-                           binding.ll.visibility = View.VISIBLE
-                           binding.tvContribution.text = data.contribute_val
-                           activity?.let { activity ->
-                               binding.ivAvatar.loadUrl(activity,data.user_head_img_url)
-                           }
-                           binding.tvName.text = data.user_name
-                           if(data.is_benefit == 1){
-                               binding.ivBenefit.visibility = View.VISIBLE
-                           }
-                           if(data.is_service == 1){
-                               binding.tvAgent.visibility = View.VISIBLE
-                           }
-                           if(data.is_official == 1){
-                               binding.tvOfficial.visibility = View.VISIBLE
-                           }
-                           if(data.is_crown == 1){
-                               binding.ivCrown.visibility = View.VISIBLE
-                           }
-                           if(data.is_cup == 1){
-                               binding.ivCup.visibility = View.VISIBLE
-                           }
-                           binding.tvLevel.setUserLevel(data.user_wealth_level)
-                           return@forEach
-                       }
-                   }
+               if (!it.list.isNullOrEmpty()){
+                   smartRecyclerView.onFetchDataFinish(it.list,true)
+               } else {
+                   adapter.loadMoreEnd()
                }
-               smartRecyclerView.onFetchDataFinish(it.list,true)
+
            }
        }
     }

+ 1 - 0
room/src/main/java/com/swago/room/enum/RoomType.kt

@@ -3,5 +3,6 @@ package com.swago.room.enum
 enum class RoomType(val type: Int) {
     VIDEO(1),
     AUDIO(2),
+    HOUSE(3),
     NULL(0)
 }

+ 23 - 5
room/src/main/java/com/swago/room/gift/GiftDialog.kt

@@ -152,6 +152,11 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
                     }
 
                     json = SpUtil.readString("audioGiftList")
+                } else if (iRoomInfo.getRoomType() == 3){
+                    binding.tvSender.visibility = View.VISIBLE
+                    binding.rvAudioUser.visibility = View.GONE
+                    //先走缓存
+                    json = SpUtil.readString("houseGiftList")
                 }
             }
             if (json.isNullOrEmpty()) {
@@ -373,7 +378,7 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
             binding.combo.setOnClick(object : ComboView.OnClick {
                 override fun click() {
                     SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
-                        if(iRoomInfo.getRoomType() == 1){
+                        if(iRoomInfo.getRoomType() == 1 || iRoomInfo.getRoomType() == 3){
                             val gifModel =
                                 luckyData[GiftConfig.giftSelectedPageIndex * 8 + GiftConfig.giftSelectedPageSelectedPosition]
                             LogUtil.d("礼物id", "${gifModel.gift_name}")
@@ -398,12 +403,12 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
             //点击送礼
             binding.tvToSend.setOnClickListener {
                 SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
-                    if(iRoomInfo.getRoomType() == 1){
+                    if(iRoomInfo.getRoomType() == 1 || iRoomInfo.getRoomType() == 3){
                         when (type) {
                             1 -> {
                                 //幸运
                                 SwagoRoomManager.iRoomInfo?.let {
-                                    if (it.getRoomType() == 1){
+                                    if (it.getRoomType() == 1 || iRoomInfo.getRoomType() == 3){
                                         binding.combo.visibility = View.VISIBLE
                                         binding.combo.start()
                                         binding.tvToSend.visibility = View.GONE
@@ -517,7 +522,7 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
     private fun setExp(){
         LogUtil.d("点击次数","${GiftConfig.clickCount}")
         SwagoRoomManager.iRoomInfo?.let {iRoomInfo ->
-            if (iRoomInfo.getRoomType() == 1) {
+            if (iRoomInfo.getRoomType() == 1 || iRoomInfo.getRoomType() == 3) {
                 if (GiftConfig.giftSelectedWhichType==3){
                     //幸运礼物
                     if (GiftConfig.list.isEmpty()){
@@ -572,6 +577,17 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
                         giftNum
                     )
                 }
+            } else if (iRoomInfo.getRoomType() == 3){
+                if (receiveId.isNotEmpty()) {
+                    giftVm.sendHouseGift(
+                        iRoomInfo.getRoomId(),
+                        giftModel.id,
+                        giftBatch,
+                        receiveId,
+                        isCombo,
+                        giftNum
+                    )
+                }
             } else if (iRoomInfo.getRoomType() == 2) {
                 //语音房送礼
                 if (binding.rvAudioUser.visibility == View.VISIBLE){
@@ -624,6 +640,8 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
                         SpUtil.putString("giftList", netJson)
                     } else if (iRoomInfo.getRoomType() == 2) {
                         SpUtil.putString("audioGiftList", netJson)
+                    } else if (iRoomInfo.getRoomType() == 3){
+                        SpUtil.putString("houseGiftList", netJson)
                     }
                 }
 
@@ -817,7 +835,7 @@ class GiftDialog : BaseXDFragment<DialogGiftBinding>() {
                 binding.tvAllExp.text = "/"+(it.next_wealth_need_jingyan.toDouble()+it.user_wealth_jingyan_value.toDouble()).toInt()
                 binding.tvExp.text = it.user_wealth_jingyan_value.toString()
 
-                if (iRoomInfo.getRoomType() == 1){
+                if (iRoomInfo.getRoomType() == 1 || iRoomInfo.getRoomType() == 3){
                     if (GiftConfig.giftSelectedWhichType==3){
                         //幸运礼物
                         if (GiftConfig.list.isEmpty()){

+ 42 - 0
room/src/main/java/com/swago/room/gift/GiftVm.kt

@@ -43,6 +43,9 @@ class GiftVm(application: Application) : BaseViewModel(application) {
                 } else if (iRoomInfo.getRoomType() == 2) {
                     val data = ApiManager.roomApi.getAudioGiftList()
                     allGiftLiveData.value = data
+                } else if (iRoomInfo.getRoomType() == 3){
+                    val data = ApiManager.roomApi.getHouseGiftList()
+                    allGiftLiveData.value = data
                 }
             }
 
@@ -98,6 +101,42 @@ class GiftVm(application: Application) : BaseViewModel(application) {
         }
     }
 
+    fun sendHouseGift(
+        room_id: String,
+        gift_id: String,
+        gift_batch: Int,
+        gift_receive_id: String,
+        isCombo: Int = 0,
+        gift_num: Int = 1,
+    ) {
+        requestData2(false) {
+            requestData {
+                val data = ApiManager.roomApi.sendHouseGift(
+                    room_id,
+                    gift_id,
+                    gift_batch,
+                    gift_receive_id,
+                    isCombo,
+                    gift_num,
+                    PKStateManager.pkId
+                )
+                LogUtil.d("送礼", "接口调用成功--${System.currentTimeMillis()}")
+                sendResultLiveData.value = data
+                UserInfo.getUserInfo()?.let {
+                    if (data.user_coins.toLong() < it.user_coins.toLong()) {
+                        it.user_coins = data.user_coins
+                    }
+                }
+            }
+
+            requestError {
+                if (it is SwagoException) {
+                    val errorModel = ErrorModel(it.code, it.message ?: "")
+                    sendGiftCodeLiveData.value = errorModel
+                }
+            }
+        }
+    }
 
     val sendResultAudioLiveData by lazy {
         MutableLiveData<AudioSendGiftModel?>()
@@ -186,6 +225,9 @@ class GiftVm(application: Application) : BaseViewModel(application) {
             } else if (roomType == 2) {
                 val data = ApiManager.roomApi.getAudioGiftList()
                 allWishGiftLiveData.value = data
+            } else if (roomType == 3) {
+                val data = ApiManager.roomApi.getHouseGiftList()
+                allWishGiftLiveData.value = data
             }
         }
     }

+ 6 - 1
room/src/main/java/com/swago/room/ranklist/RankListAdapter.kt

@@ -27,7 +27,12 @@ class RankListAdapter  : BaseQuickAdapter<RankListModel.ListBean, BaseViewHolder
             tvLevel.setUserLevel(item.user_wealth_level.toInt())
 
             setText(R.id.tvName,item.user_name)
-            setText(R.id.tvIncomeValue,item.total_coins)
+            if (item.offlive.isNullOrEmpty()){
+                setText(R.id.tvIncomeValue,item.total_coins)
+            } else {
+                setText(R.id.tvIncomeValue,item.total_coins + "(${item.offlive})")
+            }
+
 
             UserInfo.getUserInfo()?.let {
                 when(it.user_type){

+ 1 - 1
room/src/main/java/com/swago/room/user/UserRoomActivity.kt

@@ -286,7 +286,7 @@ class UserRoomActivity : AbsUserActivity<ActivityAbsRoomUserBinding, UserRoomMod
     }
 
     override fun joinedRoom(iRoomInfo: IRoomInfo) {
-        if (iRoomInfo.getIsRobot()) {
+        if (iRoomInfo.getIsRobot() || iRoomInfo.getRoomType() == RoomType.HOUSE.type) {
             ivCover?.visibility = View.GONE
         }else{
             pkVm.getPKInfo(iRoomInfo.getRoomId())

+ 19 - 0
room/src/main/java/com/swago/room/vm/MsgVm.kt

@@ -14,6 +14,7 @@ import com.swago.baseswago.im.ImConstant.follow_anchor_success
 import com.swago.baseswago.im.ImConstant.forbid_speak
 import com.swago.baseswago.im.ImConstant.force_close_live_room
 import com.swago.baseswago.im.ImConstant.game_win_big_prize
+import com.swago.baseswago.im.ImConstant.house_open_live
 import com.swago.baseswago.im.ImConstant.invite_user_on_mic
 import com.swago.baseswago.im.ImConstant.jifen_change
 import com.swago.baseswago.im.ImConstant.jifen_clear
@@ -58,6 +59,7 @@ import com.swago.baseswago.util.UserInfo
 import com.swago.room.audio.AudioRoomManager
 import com.swago.room.audio.IAudioRoomListener
 import com.swago.room.bean.UserRoomModel
+import com.swago.room.enum.RoomType
 import com.swago.room.manager.JoinRoomManager
 import java.util.concurrent.CopyOnWriteArrayList
 
@@ -145,6 +147,11 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
      */
     var likeActionFun:((url:String,value:String)->Unit)? = null
 
+    /**
+     * 开播(小黑屋)
+     */
+    var openHouseOpenLiveDialog:((houseOpenLiveData: HouseOpenLiveData)->Unit)? = null
+
     val joinRoomManager by lazy {
         JoinRoomManager()
     }
@@ -737,6 +744,18 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
             }
         }
 
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<HouseOpenLiveData>>(
+            house_open_live
+        ){
+            SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
+                it.data?.let {
+                    if (it.roomId == iRoomInfo.getRoomId() && iRoomInfo.getRoomType() == RoomType.HOUSE.type && it.anchorId == iRoomInfo.getAnchorId()){
+                        openHouseOpenLiveDialog?.invoke(it)
+                    }
+                }
+            }
+        }
+
     }
 
 

+ 128 - 20
room/src/main/java/com/swago/room/vm/RoomOtherVm.kt

@@ -25,6 +25,7 @@ import com.swago.baseswago.model.live.game.GameListModel
 import com.swago.baseswago.model.live.gift.GiftSendModel
 import com.swago.baseswago.util.*
 import com.swago.room.bean.UserRoomModel
+import com.swago.room.enum.RoomType
 import com.swago.room.pk.PKStateManager
 import okhttp3.MediaType.Companion.toMediaType
 import okhttp3.RequestBody.Companion.toRequestBody
@@ -50,9 +51,18 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
     fun getRankList(roomId: String, rankType: Int, page: Int) {
         requestData2 {
             requestData {
-                val data = ApiManager.roomApi.getRankList(roomId, rankType, page)
-                rankListLiveData.value = data.list
-                totalLiveData.value = data.total
+                SwagoRoomManager.iRoomInfo?.let {
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        val data = ApiManager.roomApi.getHouseRankList(roomId, rankType, page)
+                        rankListLiveData.value = data.list
+                        totalLiveData.value = data.total
+                    } else {
+                        val data = ApiManager.roomApi.getRankList(roomId, rankType, page)
+                        rankListLiveData.value = data.list
+                        totalLiveData.value = data.total
+                    }
+                }
+
             }
 
             requestError {
@@ -72,8 +82,15 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
      */
     fun getShareConfig() {
         requestData {
-            val data = ApiManager.roomApi.getShareConfig()
-            shareConfigLiveData.value = data
+            SwagoRoomManager.iRoomInfo?.let {
+                if (it.getRoomType() == RoomType.HOUSE.type){
+                    val data = ApiManager.roomApi.getHouseShareConfig()
+                    shareConfigLiveData.value = data
+                } else {
+                    val data = ApiManager.roomApi.getShareConfig()
+                    shareConfigLiveData.value = data
+                }
+            }
         }
     }
 
@@ -88,8 +105,14 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         LogUtil.d("加入房间", "红包")
         requestData {
             SwagoRoomManager.iRoomInfo?.let {
-                redEnvelopeListLiveData.value =
-                    ApiManager.roomApi.getRedEnvelopeList(it.getRoomId())
+                if (it.getRoomType() == RoomType.HOUSE.type){
+                    redEnvelopeListLiveData.value =
+                        ApiManager.roomApi.getHouseRedEnvelopeList(it.getRoomId())
+                } else {
+                    redEnvelopeListLiveData.value =
+                        ApiManager.roomApi.getRedEnvelopeList(it.getRoomId())
+                }
+
             }
         }
     }
@@ -109,9 +132,16 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         requestData2(false) {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    ApiManager.roomApi.sendRedEnvelope(it.getRoomId(), coins, count)
-                    sendSuccessLiveData.value = 200
-                    SwagoLoading.cancelLoadingDialog()
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        ApiManager.roomApi.sendHouseRedEnvelope(it.getRoomId(), coins, count)
+                        sendSuccessLiveData.value = 200
+                        SwagoLoading.cancelLoadingDialog()
+                    } else {
+                        ApiManager.roomApi.sendRedEnvelope(it.getRoomId(), coins, count)
+                        sendSuccessLiveData.value = 200
+                        SwagoLoading.cancelLoadingDialog()
+                    }
+
                 }
             }
 
@@ -139,9 +169,16 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         requestData2 {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    val data = ApiManager.roomApi.getRedEnvelopeCoin(it.getRoomId(), redEnvelopeId)
-                    receiveRedEnvelopeResultLiveData.value = data.coin
-                    UserInfo.getUserInfo()?.user_coins = data.user_coin
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        val data = ApiManager.roomApi.getHouseRedEnvelopeCoin(it.getRoomId(), redEnvelopeId)
+                        receiveRedEnvelopeResultLiveData.value = data.coin
+                        UserInfo.getUserInfo()?.user_coins = data.user_coin
+                    } else {
+                        val data = ApiManager.roomApi.getRedEnvelopeCoin(it.getRoomId(), redEnvelopeId)
+                        receiveRedEnvelopeResultLiveData.value = data.coin
+                        UserInfo.getUserInfo()?.user_coins = data.user_coin
+                    }
+
                 }
             }
 
@@ -188,7 +225,11 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
     fun sendDanMu(message: String) {
         requestData {
             SwagoRoomManager.iRoomInfo?.let {
-                ApiManager.roomApi.sendDanMu(it.getRoomId(), message)
+                if (it.getRoomType() == RoomType.HOUSE.type){
+                    ApiManager.roomApi.sendHouseDanMu(it.getRoomId(), message)
+                } else {
+                    ApiManager.roomApi.sendDanMu(it.getRoomId(), message)
+                }
                 sendDanMuNum++
                 sendDanMuResultLiveData.value = sendDanMuNum
             }
@@ -205,8 +246,17 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
     fun getRedReceivedList(package_id: String) {
         requestData2 {
             requestData {
-                val data = ApiManager.roomApi.getRedReceivedList(package_id)
-                redListLiveData.value = data.list
+                SwagoRoomManager.iRoomInfo?.let {
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        val data = ApiManager.roomApi.getHouseRedReceivedList(package_id)
+                        redListLiveData.value = data.list
+                    } else {
+                        val data = ApiManager.roomApi.getRedReceivedList(package_id)
+                        redListLiveData.value = data.list
+                    }
+
+                }
+
             }
             requestError {
                 redListLiveData.value = null
@@ -292,7 +342,12 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
     fun userDianZan() {
         requestData {
             SwagoRoomManager.iRoomInfo?.let {
-                ApiManager.roomApi.userDianZan(it.getRoomId())
+                if (it.getRoomType() == RoomType.HOUSE.type){
+                    ApiManager.roomApi.userHouseDianZan(it.getRoomId())
+                } else {
+                    ApiManager.roomApi.userDianZan(it.getRoomId())
+                }
+
             }
         }
     }
@@ -309,8 +364,14 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         requestData2 {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    fanClubUserModelLiveData.value =
-                        ApiManager.roomApi.getFanClubList(it.getRoomId(), page)
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        fanClubUserModelLiveData.value =
+                            ApiManager.roomApi.getHouseFanClubList(it.getRoomId(), page)
+                    } else {
+                        fanClubUserModelLiveData.value =
+                            ApiManager.roomApi.getFanClubList(it.getRoomId(), page)
+                    }
+
                 }
             }
             requestError {
@@ -334,7 +395,11 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         requestData2 {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    ApiManager.roomApi.joinFanClub(it.getRoomId())
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        ApiManager.roomApi.joinHouseFanClub(it.getRoomId())
+                    } else {
+                        ApiManager.roomApi.joinFanClub(it.getRoomId())
+                    }
                     SwagoLoading.cancelLoadingDialog()
                     (it as UserRoomModel).roomModel?.is_fans = 1
                     isFansLiveData.value = 1
@@ -393,6 +458,49 @@ class RoomOtherVm(application: Application) : BaseViewModel(application) {
         }
     }
 
+    /**
+     * 送礼
+     */
+    val sendHouseResultLiveData by lazy {
+        MutableLiveData<GiftSendModel?>()
+    }
+
+    val sendHouseGiftCodeLiveData by lazy {
+        MutableLiveData<ErrorModel>()
+    }
+
+    fun sendHouseGift(
+        room_id: String,
+        gift_id: String,
+        gift_batch: Int,
+        gift_receive_id: String,
+        isCombo: Int = 0,
+        gift_num: Int = 1,
+    ) {
+        requestData2(false) {
+            requestData {
+                val data = ApiManager.roomApi.sendHouseGift(
+                    room_id, gift_id, gift_batch, gift_receive_id, isCombo, gift_num,
+                    PKStateManager.pkId
+                )
+                LogUtil.d("送礼", "接口调用成功--${System.currentTimeMillis()}")
+                sendHouseResultLiveData.value = data
+                UserInfo.getUserInfo()?.let {
+                    if (data.user_coins.toLong() < it.user_coins.toLong()) {
+                        it.user_coins = data.user_coins
+                    }
+                }
+            }
+
+            requestError {
+                if (it is SwagoException) {
+                    val errorModel = ErrorModel(it.code, it.message ?: "")
+                    sendHouseGiftCodeLiveData.value = errorModel
+                }
+            }
+        }
+    }
+
 
     val sendResultAudioLiveData by lazy {
         MutableLiveData<AudioSendGiftModel?>()

+ 65 - 16
room/src/main/java/com/swago/room/vm/RoomVm.kt

@@ -20,6 +20,7 @@ import com.swago.baseswago.util.*
 import com.swago.room.R
 import com.swago.room.audio.AudioRoomManager
 import com.swago.room.bean.UserRoomModel
+import com.swago.room.enum.RoomType
 import com.swago.room.user.UserRoomActivity
 
 /**
@@ -75,13 +76,24 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
     ) {
         requestData2 {
             requestData {
-                val roomModel = ApiManager.roomApi.joinRoom(iRoomInfo.getRoomId(),password)
-                val roomInfo = iRoomInfo as UserRoomModel
-                roomInfo.roomModel = roomModel
-                roomModel.join_im_data?.let {
-                    joinRoomUserDataLiveData.value = roomModel.join_im_data.data
+                if (iRoomInfo.getRoomType() == RoomType.HOUSE.type){
+                    //小黑屋
+                    val roomModel = ApiManager.roomApi.joinHouseRoom(iRoomInfo.getRoomId())
+                    val roomInfo = iRoomInfo as UserRoomModel
+                    roomInfo.roomModel = roomModel
+                    roomModel.join_im_data?.let {
+                        joinRoomUserDataLiveData.value = roomModel.join_im_data.data
+                    }
+                } else {
+                    val roomModel = ApiManager.roomApi.joinRoom(iRoomInfo.getRoomId(),password)
+                    val roomInfo = iRoomInfo as UserRoomModel
+                    roomInfo.roomModel = roomModel
+                    roomModel.join_im_data?.let {
+                        joinRoomUserDataLiveData.value = roomModel.join_im_data.data
+                    }
                 }
 
+
                 callback.invoke(true)
             }
 
@@ -169,8 +181,15 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
         requestData2 {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    val data = ApiManager.roomApi.getRoomUser(it.getRoomId(),page)
-                    roomUserDataLiveData.value = data
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        //小黑屋
+                        val data = ApiManager.roomApi.getHouseRoomUser(it.getRoomId(),page)
+                        roomUserDataLiveData.value = data
+                    } else {
+                        val data = ApiManager.roomApi.getRoomUser(it.getRoomId(),page)
+                        roomUserDataLiveData.value = data
+                    }
+
                 }
             }
 
@@ -189,8 +208,15 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
         requestData2 {
             requestData {
                 SwagoRoomManager.iRoomInfo?.let {
-                    val data = ApiManager.roomApi.getRoomUser(it.getRoomId(),page)
-                    roomUserListDialogLiveData.value = data
+                    if (it.getRoomType() == RoomType.HOUSE.type){
+                        //小黑屋
+                        val data = ApiManager.roomApi.getHouseRoomUser(it.getRoomId(),page)
+                        roomUserListDialogLiveData.value = data
+                    } else {
+                        val data = ApiManager.roomApi.getRoomUser(it.getRoomId(),page)
+                        roomUserListDialogLiveData.value = data
+                    }
+
                 }
             }
 
@@ -253,7 +279,11 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
     private fun leaveCurrentRoom(iRoomInfo: IRoomInfo) {
         requestData2(false) {
             requestData {
-                ApiManager.roomApi.leaveRoom(iRoomInfo.getRoomId())
+                if (iRoomInfo.getRoomType() == RoomType.HOUSE.type){
+                    ApiManager.roomApi.houseLeaveRoom(iRoomInfo.getRoomId())
+                } else {
+                    ApiManager.roomApi.leaveRoom(iRoomInfo.getRoomId())
+                }
             }
 
             requestError {
@@ -266,9 +296,15 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
         MutableLiveData<RoomAuthModel>()
     }
 
-    fun getUserRoomAuth(userId: String, roomId: String) {
+    fun getUserRoomAuth(userId: String, roomId: String , roomType: Int) {
         requestData {
-            roomAuthLiveData.value = ApiManager.roomApi.getUserRoomAuth(roomId,userId)
+            if (roomType == RoomType.HOUSE.type){
+                roomAuthLiveData.value = ApiManager.roomApi.getHouseUserRoomAuth(roomId,userId)
+            } else {
+                roomAuthLiveData.value = ApiManager.roomApi.getUserRoomAuth(roomId,userId)
+
+            }
+
         }
     }
 
@@ -297,9 +333,18 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
     fun getRoomConfig(){
         requestData {
             //首先获取游戏列表 然后获取直播间配置
-            recommendGameListModelLiveData.value = ApiManager.roomApi.getRecommendGameList()
-            gameListModelLiveData.value = ApiManager.roomApi.getGameList()
-            roomConfigLiveData.value = ApiManager.roomApi.getRoomConfig()
+            SwagoRoomManager.iRoomInfo?.let{
+                if (it.getRoomType() == 3){
+                    gameListModelLiveData.value = ApiManager.roomApi.getHouseGameList()
+                    roomConfigLiveData.value = ApiManager.roomApi.getHouseRoomConfig()
+                    recommendGameListModelLiveData.value = ApiManager.roomApi.getHouseRecommendGameList()
+                } else {
+                    gameListModelLiveData.value = ApiManager.roomApi.getGameList()
+                    roomConfigLiveData.value = ApiManager.roomApi.getRoomConfig()
+                    recommendGameListModelLiveData.value = ApiManager.roomApi.getRecommendGameList()
+                }
+            }
+
         }
     }
 
@@ -313,7 +358,11 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
     fun getMomentModel(anchorId: String) {
         requestData {
             SwagoRoomManager.iRoomInfo?.let {
-                momentModelLiveData.value  = ApiManager.roomApi.getMomentModel(anchorId)
+                if (it.getRoomType() == RoomType.HOUSE.type){
+                    momentModelLiveData.value  = ApiManager.roomApi.getHouseMomentModel(anchorId)
+                } else {
+                    momentModelLiveData.value  = ApiManager.roomApi.getMomentModel(anchorId)
+                }
             }
         }
     }

+ 44 - 0
room/src/main/java/com/swago/room/wishgift/WishGiftOnUserDialog.kt

@@ -128,6 +128,50 @@ class WishGiftOnUserDialog : BaseXDFragment<DialogWishGiftOnUserBinding>(){
             }
         }
 
+
+        otherVm.sendHouseResultLiveData.observe(this) {
+            if (it != null) {
+                if (it.im_data != null) {
+                    if(it.im_data.giftType==3 || it.im_data.giftType==5){
+                        msgVm.showGiftDanDao?.invoke(it.im_data)
+                    }
+                    msgVm.inComeChange?.invoke(it.im_data.incomeCount)
+                    if (it.im_data.multiple >= 500) {
+                        msgVm.waftFun?.invoke(it.im_data)
+                    }
+
+                    adapter.data.forEachIndexed { index, wishGift ->
+                        if (wishGift.gift_id == it.im_data.giftId){
+                            wishGift.gift_receive_num = "${wishGift.gift_receive_num.toInt()+1}"
+                            adapter.notifyItemChanged(index)
+                            return@forEachIndexed
+                        }
+                    }
+
+                }
+            }
+        }
+
+        otherVm.sendHouseGiftCodeLiveData.observe(this) {
+            when (it.code) {
+                517 -> {
+                    val payDialog = PayDialog.newInstance()
+                    payDialog.show(parentFragmentManager, "PayDialog")
+                    dismissAllowingStateLoss()
+                    Toast.makeText(AppContext.getContext(), it.msg, Toast.LENGTH_SHORT).show()
+                }
+                542, 543 -> {
+                    UnReachLevelDialog.newInstance(it.msg)
+                        .show(parentFragmentManager, "UnReachLevelDialog")
+                }
+
+                544 -> {
+                    ReachLevelServiceDialog.newInstance(it.msg)
+                        .show(parentFragmentManager, "ReachLevelServiceDialog")
+                }
+            }
+        }
+
         otherVm.sendResultAudioLiveData.observe(this){
             if (it != null) {
                 msgVm.inComeChange?.invoke(it.incomeCount)

+ 2 - 113
room/src/main/res/layout/dialog_audience_list.xml

@@ -36,123 +36,12 @@
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:id="@+id/ll"
-            android:visibility="gone"
+            android:visibility="visible"
             tools:visibility="visible"
             app:layout_constraintTop_toBottomOf="@+id/swagoRv"
             app:layout_constraintBottom_toBottomOf="parent"
             android:layout_width="match_parent"
-            android:layout_height="64dp">
-
-            <de.hdodenhof.circleimageview.CircleImageView
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                android:layout_marginStart="16dp"
-                android:id="@+id/ivAvatar"
-                android:layout_width="50dp"
-                android:layout_height="50dp"/>
-
-            <com.swago.baseswago.cusview.MediumTextView
-                android:id="@+id/tvName"
-                app:layout_constraintStart_toEndOf="@+id/ivAvatar"
-                android:layout_marginStart="8dp"
-                android:layout_marginTop="4dp"
-                android:textSize="18dp"
-                android:textColor="#fff"
-                tools:text="Chridfsfdsfdfs"
-                android:maxLines="1"
-                android:maxWidth="150dp"
-                app:layout_constraintTop_toTopOf="@+id/ivAvatar"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <com.swago.baseswago.cusview.SwagoLevelView
-                android:id="@+id/tvLevel"
-                android:layout_marginStart="8dp"
-                app:layout_constraintStart_toEndOf="@+id/ivAvatar"
-                app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <ImageView
-                android:id="@+id/ivBenefit"
-                android:src="@mipmap/vip"
-                android:layout_marginStart="5dp"
-                android:visibility="gone"
-                tools:visibility="visible"
-                app:layout_constraintTop_toTopOf="@+id/tvLevel"
-                app:layout_constraintBottom_toBottomOf="@+id/tvLevel"
-                app:layout_constraintStart_toEndOf="@+id/tvLevel"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <ImageView
-                android:id="@+id/ivCrown"
-                android:src="@mipmap/icon_crown"
-                android:visibility="gone"
-                tools:visibility="visible"
-                app:layout_constraintBottom_toBottomOf="@+id/tvLevel"
-                app:layout_constraintTop_toTopOf="@+id/tvLevel"
-                app:layout_constraintStart_toEndOf="@+id/ivBenefit"
-                app:layout_constraintEnd_toStartOf="@+id/ivCup"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <ImageView
-                android:id="@+id/ivCup"
-                android:src="@mipmap/icon_cup"
-                android:visibility="gone"
-                tools:visibility="visible"
-                app:layout_constraintBottom_toBottomOf="@+id/tvLevel"
-                app:layout_constraintTop_toTopOf="@+id/tvLevel"
-                app:layout_constraintStart_toEndOf="@+id/ivCrown"
-                app:layout_constraintEnd_toStartOf="@+id/tvAgent"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <ImageView
-                android:id="@+id/tvAgent"
-                android:src="@mipmap/icon_agent"
-                android:layout_marginStart="5dp"
-                android:visibility="gone"
-                tools:visibility="visible"
-                app:layout_constraintBottom_toBottomOf="@+id/tvLevel"
-                app:layout_constraintTop_toTopOf="@+id/tvLevel"
-                app:layout_constraintStart_toEndOf="@+id/ivBenefit"
-                app:layout_constraintEnd_toStartOf="@+id/tvOfficial"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <TextView
-                android:id="@+id/tvOfficial"
-                android:textSize="10dp"
-                android:text="@string/official"
-                android:textColor="#fff"
-                android:paddingStart="16dp"
-                android:paddingEnd="5dp"
-                android:layout_marginStart="5dp"
-                android:visibility="gone"
-                tools:visibility="visible"
-                android:background="@mipmap/icon_official_bg"
-                app:layout_constraintBottom_toBottomOf="@+id/tvLevel"
-                app:layout_constraintTop_toTopOf="@+id/tvLevel"
-                app:layout_constraintStart_toEndOf="@+id/tvAgent"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-            <TextView
-                android:id="@+id/tvContribution"
-                android:textSize="14dp"
-                android:textColor="#ffffff"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                android:layout_marginEnd="16dp"
-                android:drawableStart="@mipmap/live_contribute"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-        </androidx.constraintlayout.widget.ConstraintLayout>
+            android:layout_height="1dp"/>
 
 
     </androidx.constraintlayout.widget.ConstraintLayout>