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]; }