local UIChannelChatAudio = UIViewClass() --录制语音时,纯表现界面 function UIChannelChatAudio:OnOpened(context) self.obj_state:SetState(1) self:RegistSystemEvent(EventID.UI_ChannelChat_OnExitPress, self.OnExitPress) self:RegistSystemEvent(EventID.UI_ChannelChat_OnEnterPress, self.OnEnterPress) local max = DataSheetManager.ConstData:GetDataByID("AudioChatDuration").IntValue self.img_VoiceProgressBar:ResetAndBeginTimer(true, 0, max) self:StartRepeatFunc(self.OnRecordFinish, max, 1) end function UIChannelChatAudio:OnRecordFinish() self:CloseView() end function UIChannelChatAudio:OnExitPress() self.obj_state:SetState(0) end function UIChannelChatAudio:OnEnterPress() self.obj_state:SetState(1) end return UIChannelChatAudio