From e00b799073be0b4770051e1d4a75b11da78bf22f Mon Sep 17 00:00:00 2001 From: chenguilong <598604202@qq.com> Date: Tue, 11 Oct 2022 17:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E5=8F=91=E8=A8=80=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0cd=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QuickMessageView/XPRoomQuickMessageContainView.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m index a893ed56..5d0720d8 100644 --- a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m +++ b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m @@ -12,6 +12,7 @@ ///Tool #import "AccountInfoStorage.h" #import "XPConstant.h" +#import "XCHUDTool.h" ///Model #import "XPMessageRemoteExtModel.h" #import "UserInfoModel.h" @@ -26,6 +27,8 @@ @property (nonatomic,strong) UIButton *closeButton; ///代理 @property (nonatomic,weak) id delegate; +///最后发送消息的时间 +@property (nonatomic, assign) long long lastSendTime; @end @@ -81,6 +84,14 @@ } - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + NSDate *datenow = [NSDate date];//现在时间 + long time2 = (long)([datenow timeIntervalSince1970]*1000); + long aTime = (time2 - self.lastSendTime) / 1000; + if (aTime < 10) { + [XCHUDTool showErrorWithMessage:@"你发送的太频繁啦,请稍后再试"]; + return; + } + self.lastSendTime = time2; NSString *str = self.titleArray[indexPath.row]; [self sendText:str]; }