Explorar el Código

feat: 调整麦位点击逻辑

陈文艺 hace 3 días
padre
commit
4c75819ff7
Se han modificado 1 ficheros con 22 adiciones y 26 borrados
  1. 22 26
      Lanu/Views/Room/Seats/LNRoomUserSeatView.swift

+ 22 - 26
Lanu/Views/Room/Seats/LNRoomUserSeatView.swift

@@ -165,8 +165,8 @@ extension LNRoomUserSeatView {
                     profile, kickOffMic, closeMic, seat.isMute ? unmuteMic : muteMic
                 ])
             }
-        } else if myUserInfo.playmate { // 陪玩师
-            if seat.isLocked { return }
+        } else {
+            if seat.isLocked { return } // 麦位被锁,仅管理员能操作
             
             if !seat.uid.isEmpty { // 有人的麦位
                 let panel = LNRoomProfileCardPanel()
@@ -174,32 +174,28 @@ extension LNRoomUserSeatView {
                 panel.popup(self)
                 return
             }
-            if seat.index == .host
-                || seat.index == .guest
-                || !(.mic1 ... .mic8 ~= (room.mySeatInfo?.index ?? .none)) {
-                let panel = LNRoomApplySeatPanel()
-                panel.update(room, seat: seat.index)
-                panel.popup(self)
-                return
-            }
-            return
-        } else { // 普通用户
-            if seat.isLocked { return }
             
-            if !seat.uid.isEmpty { // 麦上有人
-                let panel = LNRoomProfileCardPanel()
-                panel.load(seat.uid)
-                panel.popup(self)
-                return
-            } else if seat.index == .host || seat.index == .guest { // 主持人 和 嘉宾位
-                let panel = LNRoomApplySeatPanel()
-                panel.update(room, seat: seat.index)
-                panel.popup(self)
+            if myUserInfo.playmate { // 陪玩师
+                if seat.index == .host
+                    || seat.index == .guest
+                    || !(.mic1 ... .mic8 ~= (room.mySeatInfo?.index ?? .none)) {
+                    let panel = LNRoomApplySeatPanel()
+                    panel.update(room, seat: seat.index)
+                    panel.popup(self)
+                    return
+                }
                 return
-            } else {
-                sheet.update(title: nil, views: [
-                    toBePlaymate
-                ])
+            } else { // 普通用户
+                if seat.index == .host || seat.index == .guest { // 主持人 和 嘉宾位
+                    let panel = LNRoomApplySeatPanel()
+                    panel.update(room, seat: seat.index)
+                    panel.popup(self)
+                    return
+                } else {
+                    sheet.update(title: nil, views: [
+                        toBePlaymate
+                    ])
+                }
             }
         }