local UIPKAddInPanel = UIViewClass() function UIPKAddInPanel:OnOpened(context) self.activityID = context.activityID self.roomID = context.roomID local _, info = MDL.CustomRoom.GetRoomInfoInCacheByRoomID(self.roomID) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS["IDS_PK_PWWindow_Title"]) UIUtils.SetLabel(self.txt_RoomName, string.FormatByIdsId(Const_IDS["IDS_PK_PWWindow_RoomName"], info.BriefInfo.RoomName)) end function UIPKAddInPanel:OnValueChanged(comp, value) if comp == self.obj_CodeInputField then self.obj_CodeInputField.text = UTL.String.CutStrByLength(value, 6) end end function UIPKAddInPanel:OnBackButtonPressed() self:OnButtonClicked(self.btn_2) end function UIPKAddInPanel:OnButtonClicked(comp) if comp == self.btn_1 then if not CTL.CustomRoom.IsValidPWD(self.obj_CodeInputField.text) then self.obj_CodeInputField.text = nil return end CTL.CustomRoom.OnClickEnterRoom(false, self.activityID, self.roomID, self.obj_CodeInputField.text, self.context.enterType) elseif comp == self.UICommonPopUp.btn_Close or comp == self.btn_2 then -- 将加入房间的操作锁去掉 self:CloseView() end end return UIPKAddInPanel