修复bug

This commit is contained in:
liyuhua
2023-08-29 17:54:23 +08:00
parent a1ff09f33f
commit 09cbeb72a6
26 changed files with 202 additions and 39 deletions

View File

@@ -9718,13 +9718,13 @@
E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */ = { E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */,
E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */,
E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */,
E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */,
E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */,
E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */,
E8EEB8F126FC2050007C6EBA /* SDBrowserImageView.h */, E8EEB8F126FC2050007C6EBA /* SDBrowserImageView.h */,
E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */,
E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */,
E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */,
E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */,
E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */,
E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */,
); );
path = SDPhotoBrowser; path = SDPhotoBrowser;
sourceTree = "<group>"; sourceTree = "<group>";

View File

@@ -8,9 +8,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "SDWaitingView.h" #import "SDWaitingView.h"
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
@interface SDBrowserImageView : FLAnimatedImageView <UIGestureRecognizerDelegate>
@interface SDBrowserImageView : UIImageView <UIGestureRecognizerDelegate>
@property (nonatomic, assign) CGFloat progress; @property (nonatomic, assign) CGFloat progress;
@property (nonatomic, assign, readonly) BOOL isScaled; @property (nonatomic, assign, readonly) BOOL isScaled;

View File

@@ -9,7 +9,10 @@
#import "SDPhotoBrowser.h" #import "SDPhotoBrowser.h"
#import "UIImageView+WebCache.h" #import "UIImageView+WebCache.h"
#import "SDBrowserImageView.h" #import "SDBrowserImageView.h"
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import <PhotosUI/PhotosUI.h>
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) //iPhoneX #define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) //iPhoneX
#define iPhoneX_NavSafeArea ([[UIScreen mainScreen] bounds].size.height >= 812.0 ? 24 : 0) // iphoneX 24 #define iPhoneX_NavSafeArea ([[UIScreen mainScreen] bounds].size.height >= 812.0 ? 24 : 0) // iphoneX 24
@@ -95,9 +98,18 @@
- (void)saveImage - (void)saveImage
{ {
int index = _scrollView.contentOffset.x / _scrollView.bounds.size.width; int index = _scrollView.contentOffset.x / _scrollView.bounds.size.width;
UIImageView *currentImageView = _scrollView.subviews[index]; FLAnimatedImageView *currentImageView = _scrollView.subviews[index];
BOOL isGif = [UIImage isGifWithImageData:currentImageView.animatedImage.data];
if(isGif){
ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init];
NSDictionary *metadate = @{@"UTI":(__bridge NSString *)kUTTypeGIF};
 [library writeImageDataToSavedPhotosAlbum:currentImageView.animatedImage.data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
[self saveImageFinishWithError:error];
}];
}else{
UIImageWriteToSavedPhotosAlbum(currentImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
}
UIImageWriteToSavedPhotosAlbum(currentImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
if (_indicatorView == nil) { if (_indicatorView == nil) {
_indicatorView = [[UIActivityIndicatorView alloc] init]; _indicatorView = [[UIActivityIndicatorView alloc] init];
@@ -108,7 +120,27 @@
[_indicatorView startAnimating]; [_indicatorView startAnimating];
} }
-(void)saveImageFinishWithError:(NSError *)error{
[_indicatorView stopAnimating];
UILabel *label = [[UILabel alloc] init];
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.90f];
label.layer.cornerRadius = 5;
label.clipsToBounds = YES;
label.bounds = CGRectMake(0, 0, 150, 30);
label.center = self.center;
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont boldSystemFontOfSize:17];
[[UIApplication sharedApplication].keyWindow addSubview:label];
[[UIApplication sharedApplication].keyWindow bringSubviewToFront:label];
if (error) {
label.text = SDPhotoBrowserSaveImageFailText;
} else {
label.text = SDPhotoBrowserSaveImageSuccessText;
}
[label performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1.0];
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo; - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
{ {
[_indicatorView stopAnimating]; [_indicatorView stopAnimating];

View File

@@ -9,6 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface UIButton (EnlargeTouchArea) @interface UIButton (EnlargeTouchArea)
@property (nonatomic, assign) NSTimeInterval yn_acceptEventInterval; // 重复点击的间隔
//图片frmae //图片frmae
@property (strong, nonatomic) NSValue *imageFrame; @property (strong, nonatomic) NSValue *imageFrame;
@@ -33,4 +34,7 @@
*/ */
- (void)enlargeTouchArea:(UIEdgeInsets)insets; - (void)enlargeTouchArea:(UIEdgeInsets)insets;
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage;
@end @end

View File

@@ -9,8 +9,18 @@
#import "UIButton+EnlargeTouchArea.h" #import "UIButton+EnlargeTouchArea.h"
#import <objc/runtime.h> #import <objc/runtime.h>
#define defaultInterval 0.0003 //,
@interface UIButton ()
/**
* bool YES NO
*/
@property (nonatomic, assign) BOOL isIgnoreEvent;
@end
@implementation UIButton (EnlargeTouchArea) @implementation UIButton (EnlargeTouchArea)
static const char *UIControl_acceptEventInterval = "UIControl_acceptEventInterval";
static const char *UIControl_enventIsIgnoreEvent = "UIControl_enventIsIgnoreEvent";
// C // C
static const char *imageFrameStr = "imageFrame"; static const char *imageFrameStr = "imageFrame";
@@ -26,9 +36,54 @@ static const char *titleFrameStr = "titleFrame";
Method newTitleMethod = class_getInstanceMethod(self, @selector(new_titleRectForContentRect:)); Method newTitleMethod = class_getInstanceMethod(self, @selector(new_titleRectForContentRect:));
Method oldTitleMethod = class_getInstanceMethod(self, @selector(titleRectForContentRect:)); Method oldTitleMethod = class_getInstanceMethod(self, @selector(titleRectForContentRect:));
method_exchangeImplementations(newTitleMethod, oldTitleMethod); method_exchangeImplementations(newTitleMethod, oldTitleMethod);
//selectorMethod
SEL selA = @selector(sendAction:to:forEvent:);
SEL selB = @selector(new_sendAction:to:forEvent:);
Method methodA = class_getInstanceMethod(self,selA);
Method methodB = class_getInstanceMethod(self, selB);
//
BOOL isAdd = class_addMethod(self, selA, method_getImplementation(methodB), method_getTypeEncoding(methodB));
if (isAdd) {//->
class_replaceMethod(self, selB, method_getImplementation(methodA), method_getTypeEncoding(methodA));
}else{//->
// methodBmethodAmethodBIMP
method_exchangeImplementations(methodA, methodB);
}
}); });
} }
- (void)new_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event {
self.yn_acceptEventInterval = self.yn_acceptEventInterval == 0 ? defaultInterval : self.yn_acceptEventInterval;
if (self.isIgnoreEvent){//
return;
}
if (self.yn_acceptEventInterval > 0){//eventTimeInterval
[self performSelector:@selector(setNoIgnoreEvent) withObject:nil afterDelay:self.yn_acceptEventInterval];
}
self.isIgnoreEvent = YES;//
[self new_sendAction:action to:target forEvent:event];
}
// runtime
- (BOOL)isIgnoreEvent{
return [objc_getAssociatedObject(self, UIControl_enventIsIgnoreEvent) boolValue];
}
-(void)setNoIgnoreEvent{
self.isIgnoreEvent = NO;
}
- (void)setIsIgnoreEvent:(BOOL)isIgnoreEvent {
objc_setAssociatedObject(self, UIControl_enventIsIgnoreEvent, @(isIgnoreEvent), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
-(void)setYn_acceptEventInterval:(NSTimeInterval)yn_acceptEventInterval{
objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(yn_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
-(NSTimeInterval)yn_acceptEventInterval{
return [objc_getAssociatedObject(self, UIControl_acceptEventInterval) doubleValue];
}
- (void)setImageFrame:(NSValue *)imageFrame{ - (void)setImageFrame:(NSValue *)imageFrame{
objc_setAssociatedObject(self, imageFrameStr, imageFrame, OBJC_ASSOCIATION_RETAIN); objc_setAssociatedObject(self, imageFrameStr, imageFrame, OBJC_ASSOCIATION_RETAIN);
} }
@@ -111,5 +166,27 @@ static char leftNameKey;
} }
return CGRectContainsPoint(rect, point) ? self : nil; return CGRectContainsPoint(rect, point) ? self : nil;
} }
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage{
UIButton *button = [[UIButton alloc]initWithFrame:CGRectZero];
if(text.length > 0){
[button setTitle:text forState:UIControlStateNormal];
}
if(font != nil){
button.titleLabel.font = font;
}
if(textColor != nil){
[button setTitleColor:textColor forState:UIControlStateNormal];
}
if (image != nil){
[button setImage:image forState:UIControlStateNormal];
}
if(bgImage != nil){
[button setBackgroundImage:bgImage forState:UIControlStateNormal];
}
return button;
}
@end @end

View File

@@ -130,9 +130,12 @@
for (HomePlayRoomModel *model in array) { for (HomePlayRoomModel *model in array) {
if (model.isBanner) { if (model.isBanner) {
self.headerView.bannerList = model.bannerVoList; self.headerView.bannerList = model.bannerVoList;
break; break;
} }
} }
[self hideHUD];
[self.pagingView reloadData];
}else{ }else{
} }
@@ -202,10 +205,12 @@
#pragma mark - JXCategoryViewDelegate #pragma mark - JXCategoryViewDelegate
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { - (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
if(self.headerView.bannerList.count == 0)return 0;
return [XPPartyHeaderView getPartyHeaderViewHeight]; return [XPPartyHeaderView getPartyHeaderViewHeight];
} }
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { - (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
return self.headerView; return self.headerView;
} }

View File

@@ -49,6 +49,7 @@
NSString * type = @"1"; NSString * type = @"1";
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] attentionUserSuccess:targetUid]; [[self getView] attentionUserSuccess:targetUid];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
} showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type]; } showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type];
} }
/// ///

View File

@@ -7,6 +7,7 @@
#import "NIMMessageUtils.h" #import "NIMMessageUtils.h"
#import "AttachmentModel.h" #import "AttachmentModel.h"
#import "UserGameInfoVo.h"
@implementation NIMMessageUtils @implementation NIMMessageUtils
@@ -66,6 +67,9 @@
return @"[分享了一条动态]"; return @"[分享了一条动态]";
} else if(attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) { } else if(attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) {
return @"[你收到一个全服红包]"; return @"[你收到一个全服红包]";
}else if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User) {
UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data];
return [gameInfo.fromUid isEqualToString:[AccountInfoStorage instance].getUid] ? @"你发送一条开黑邀请":@"你收到一条开黑邀请";
} else { } else {
text = @"[消息]"; text = @"[消息]";
} }

View File

@@ -65,6 +65,8 @@
@property (nonatomic,strong) NIMMessage *lastMessage; @property (nonatomic,strong) NIMMessage *lastMessage;
/// ///
@property (nonatomic,strong) SessionRiskView *riskAlertView; @property (nonatomic,strong) SessionRiskView *riskAlertView;
///
@property(nonatomic,strong) UIView *emptyVeiw;
/// ///
@property(nonatomic,strong) UICollectionView *collectionView; @property(nonatomic,strong) UICollectionView *collectionView;
@@ -116,6 +118,14 @@
} }
-(void)getAttentionUserNotification{ -(void)getAttentionUserNotification{
[self.presenter getChatLimitReceiverUid:self.session.sessionId]; [self.presenter getChatLimitReceiverUid:self.session.sessionId];
if ([self showChatRiskView:self.userInfo]) {
self.riskAlertView.warning = self.userInfo.banAccount ? @" 温馨提醒:当前对方账号存在异常,请谨慎来往!" : @"温馨提示:对方和您非好友关系,请注意隐私安全!";
self.riskAlertView.hidden = NO;
self.emptyVeiw.hidden = YES;
}else{
self.riskAlertView.hidden = YES;
self.emptyVeiw.hidden = NO;
}
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
@@ -172,6 +182,7 @@
self.sessionNavView.isInRoom = self.openType == SessionListOpenTypeRoom; self.sessionNavView.isInRoom = self.openType == SessionListOpenTypeRoom;
[self.view addSubview:self.sessionNavView]; [self.view addSubview:self.sessionNavView];
[self.view addSubview:self.stackView]; [self.view addSubview:self.stackView];
[self.stackView addArrangedSubview:self.emptyVeiw];
[self.stackView addArrangedSubview:self.riskAlertView]; [self.stackView addArrangedSubview:self.riskAlertView];
[self.view addSubview:self.sessionTableView]; [self.view addSubview:self.sessionTableView];
[self.view addSubview:self.toolbarView]; [self.view addSubview:self.toolbarView];
@@ -308,6 +319,7 @@
[gameTextArray addObject:gameModel.gameName]; [gameTextArray addObject:gameModel.gameName];
self.collectionView.hidden = NO; self.collectionView.hidden = NO;
[self.collectionView reloadData]; [self.collectionView reloadData];
[self.sessionTableView nim_scrollToBottom:YES];
return; return;
} }
if(gameTextArray.count > 0){ if(gameTextArray.count > 0){
@@ -316,6 +328,7 @@
self.pageControl.pageList = gameTextArray; self.pageControl.pageList = gameTextArray;
self.pageControl.curPage = 0; self.pageControl.curPage = 0;
[self.collectionView reloadData]; [self.collectionView reloadData];
[self.sessionTableView nim_scrollToBottom:YES];
} }
} }
@@ -557,13 +570,12 @@
AttachmentModel * attachment = obj.attachment; AttachmentModel * attachment = obj.attachment;
if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User){ if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User){
UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data]; UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data];
if([gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid]){
return; XPMineGameOrderDetailsView *orderView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) type:[gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid] ? 1 : 0];
}
XPMineGameOrderDetailsView *orderView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
orderView.gameInfo = gameInfo; orderView.gameInfo = gameInfo;
orderView.isFormChat = YES; orderView.isFormChat = YES;
orderView.delegate = self; orderView.delegate = self;
[self.view addSubview:orderView]; [self.view addSubview:orderView];
} }
@@ -835,6 +847,7 @@
- (void)sessionRiskViewCloseButtonClick:(SessionRiskView *)view { - (void)sessionRiskViewCloseButtonClick:(SessionRiskView *)view {
[[SessionRiskCache shareCache] saveCloseRisk:self.session.sessionId]; [[SessionRiskCache shareCache] saveCloseRisk:self.session.sessionId];
self.riskAlertView.hidden = YES; self.riskAlertView.hidden = YES;
self.emptyVeiw.hidden = NO;
} }
@@ -926,5 +939,12 @@
} }
return _stackView; return _stackView;
} }
- (UIView *)emptyVeiw{
if(!_emptyVeiw){
_emptyVeiw = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(10))];
_emptyVeiw.hidden = YES;
_emptyVeiw.backgroundColor = [UIColor clearColor];
}
return _emptyVeiw;
}
@end @end

View File

@@ -37,6 +37,7 @@
NSString * type = @"1"; NSString * type = @"1";
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] attentionFansSuccess]; [[self getView] attentionFansSuccess];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
}] uid:uid likedUid:targetUid ticket:ticket type:type]; }] uid:uid likedUid:targetUid ticket:ticket type:type];
} }

View File

@@ -56,6 +56,7 @@
NSString * type = state ? @"1" : @"2"; NSString * type = state ? @"1" : @"2";
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] attentionUserSuccess:state]; [[self getView] attentionUserSuccess:state];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
}] uid:uid likedUid:targetUid ticket:ticket type:type]; }] uid:uid likedUid:targetUid ticket:ticket type:type];
} }

View File

@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,weak) id<XPMineGameOrderDetailsViewDelegate>delegate; @property(nonatomic,weak) id<XPMineGameOrderDetailsViewDelegate>delegate;
@property(nonatomic,strong) UserGameInfoVo *gameInfo; @property(nonatomic,strong) UserGameInfoVo *gameInfo;
@property(nonatomic,assign) BOOL isFormChat; @property(nonatomic,assign) BOOL isFormChat;
-(instancetype)initWithFrame:(CGRect)frame type:(int)type;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -34,14 +34,15 @@
/// ///
@property(nonatomic,strong) UIButton *inviteBnt; @property(nonatomic,strong) UIButton *inviteBnt;
@property(nonatomic,assign) int type;
@end @end
@implementation XPMineGameOrderDetailsView @implementation XPMineGameOrderDetailsView
-(instancetype)initWithFrame:(CGRect)frame{ -(instancetype)initWithFrame:(CGRect)frame type:(int)type{
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if(self){ if(self){
self.type = type;
[self installUI]; [self installUI];
[self installConstraints]; [self installConstraints];
} }
@@ -67,10 +68,19 @@
[self.closeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.closeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self); make.edges.equalTo(self);
}]; }];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { if(self.type == 1){
make.bottom.leading.trailing.equalTo(self); self.inviteBnt.hidden = YES;
make.height.mas_equalTo(kGetScaleWidth(298)); [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
}]; make.bottom.leading.trailing.equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(234));
}];
}else{
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.leading.trailing.equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(298));
}];
}
[self.headView mas_makeConstraints:^(MASConstraintMaker *make) { [self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(52)); make.width.height.mas_equalTo(kGetScaleWidth(52));
make.leading.top.mas_equalTo(kGetScaleWidth(20)); make.leading.top.mas_equalTo(kGetScaleWidth(20));
@@ -157,8 +167,8 @@
} }
- (void)setGameInfo:(UserGameInfoVo *)gameInfo{ - (void)setGameInfo:(UserGameInfoVo *)gameInfo{
_gameInfo = gameInfo; _gameInfo = gameInfo;
_nameView.text = _gameInfo.toNick; _nameView.text = _type == 1 ?_gameInfo.fromNick : _gameInfo.toNick;
_headView.imageUrl = _gameInfo.toAvatar; _headView.imageUrl = _type == 1 ? _gameInfo.fromAvatar : _gameInfo.toAvatar;;
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo; _gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
_gameNumView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning]; _gameNumView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning];
_gameNameView.text = _gameInfo.gameName; _gameNameView.text = _gameInfo.gameName;
@@ -175,7 +185,6 @@
_priceView.textAlignment = NSTextAlignmentRight; _priceView.textAlignment = NSTextAlignmentRight;
_priceView.attributedText = textAtt; _priceView.attributedText = textAtt;
NSMutableAttributedString *tiemAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请时间:%@ ",_gameInfo.orderTime] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}]; NSMutableAttributedString *tiemAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请时间:%@ ",_gameInfo.orderTime] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}];
[tiemAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"邀请时间:"]]; [tiemAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"邀请时间:"]];
_timeView.attributedText = tiemAtt; _timeView.attributedText = tiemAtt;
@@ -190,6 +199,7 @@
[orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo].length]; [orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo].length];
_orderNumView.attributedText = orderAtt; _orderNumView.attributedText = orderAtt;
} }
#pragma mark - #pragma mark -
- (UIButton *)closeView{ - (UIButton *)closeView{
if(!_closeView){ if(!_closeView){

View File

@@ -94,8 +94,8 @@
_gameInfo = gameInfo; _gameInfo = gameInfo;
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo; _gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
_gameNameVeiw.text = _gameInfo.gameName; _gameNameVeiw.text = _gameInfo.gameName;
_headView.imageUrl = [_type isEqualToString:@"0"] ? _gameInfo.fromAvatar : _gameInfo.toAvatar; _headView.imageUrl = [_type isEqualToString:@"1"] ? _gameInfo.fromAvatar : _gameInfo.toAvatar;
_nameView.text = [_type isEqualToString:@"0"] ?_gameInfo.fromNick : _gameInfo.toNick; _nameView.text = [_type isEqualToString:@"1"] ?_gameInfo.fromNick : _gameInfo.toNick;
_numView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning]; _numView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning];
} }
#pragma mark - #pragma mark -

View File

@@ -11,7 +11,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol XPMineGameOrderItemVCDelegate <NSObject> @protocol XPMineGameOrderItemVCDelegate <NSObject>
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo; -(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo type:(int)type;
@end @end

View File

@@ -96,14 +96,15 @@
return cell; return cell;
} }
XPMineGameOrderItemCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameOrderItemCell class]) forIndexPath:indexPath]; XPMineGameOrderItemCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameOrderItemCell class]) forIndexPath:indexPath];
cell.type = self.type;
cell.gameInfo = [self.orderList safeObjectAtIndex1:indexPath.row]; cell.gameInfo = [self.orderList safeObjectAtIndex1:indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(self.type.integerValue == 1)return;
if(self.delegate && [self.delegate respondsToSelector:@selector(showGameOrderDetailsViewWithGameInfo:)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(showGameOrderDetailsViewWithGameInfo:type:)]){
[self.delegate showGameOrderDetailsViewWithGameInfo:[self.orderList safeObjectAtIndex1:indexPath.row]]; [self.delegate showGameOrderDetailsViewWithGameInfo:[self.orderList safeObjectAtIndex1:indexPath.row]type:self.type.intValue];
} }

View File

@@ -108,8 +108,8 @@
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }
#pragma mark - XPMineGameOrderItemVCDelegate #pragma mark - XPMineGameOrderItemVCDelegate
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo{ -(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo type:(int)type{
XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) type:type];
detailsView.gameInfo = gameInfo; detailsView.gameInfo = gameInfo;
detailsView.delegate = self; detailsView.delegate = self;
[self.view addSubview:detailsView]; [self.view addSubview:detailsView];

View File

@@ -431,7 +431,7 @@
self.attentionButton.layer.borderColor = UIColor.clearColor.CGColor; self.attentionButton.layer.borderColor = UIColor.clearColor.CGColor;
} }
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
self.headView.attentionButton.selected = status; self.headView.attentionButton.selected = status;
if (self.headView.attentionButton.selected) { if (self.headView.attentionButton.selected) {

View File

@@ -518,6 +518,7 @@
_payBtn.titleLabel.font = kFontMedium(14); _payBtn.titleLabel.font = kFontMedium(14);
_payBtn.layer.cornerRadius = kGetScaleWidth(40)/2; _payBtn.layer.cornerRadius = kGetScaleWidth(40)/2;
_payBtn.layer.masksToBounds = YES; _payBtn.layer.masksToBounds = YES;
_payBtn.yn_acceptEventInterval = 1;
[_payBtn addTarget:self action:@selector(invitatioAction) forControlEvents:UIControlEventTouchUpInside]; [_payBtn addTarget:self action:@selector(invitatioAction) forControlEvents:UIControlEventTouchUpInside];
} }
return _payBtn; return _payBtn;

View File

@@ -244,6 +244,7 @@
[payTitleBnt setTitle:@"咨询下单" forState:UIControlStateNormal]; [payTitleBnt setTitle:@"咨询下单" forState:UIControlStateNormal];
payTitleBnt.titleLabel.font = kFontMedium(12); payTitleBnt.titleLabel.font = kFontMedium(12);
[payTitleBnt addTarget:self action:@selector(consultingOrderAction) forControlEvents:UIControlEventTouchUpInside]; [payTitleBnt addTarget:self action:@selector(consultingOrderAction) forControlEvents:UIControlEventTouchUpInside];
payTitleBnt.yn_acceptEventInterval = 1;
_payTitleBnt = payTitleBnt; _payTitleBnt = payTitleBnt;
} }
return _payTitleBnt; return _payTitleBnt;

View File

@@ -473,7 +473,7 @@
} else { } else {
NSURL *imgUrl = [NSURL URLWithString:imageName]; NSURL *imgUrl = [NSURL URLWithString:imageName];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]]; UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height; CGFloat scale = myImage.size.width / (myImage.size.height > 0 ? myImage.size.height : 1);
if (scale == 0) { if (scale == 0) {
imageView.bounds = CGRectMake(0, 0, 51, 17); imageView.bounds = CGRectMake(0, 0, 51, 17);
}else { }else {

View File

@@ -401,6 +401,7 @@
NSString * ticket = [[AccountInfoStorage instance] getTicket]; NSString * ticket = [[AccountInfoStorage instance] getTicket];
[Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
self.attentionButton.hidden = YES; self.attentionButton.hidden = YES;
[XCHUDTool showErrorWithMessage:@"关注成功"]; [XCHUDTool showErrorWithMessage:@"关注成功"];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPAnchorPKPanelViewAttentionSuccess)]) { if (self.delegate && [self.delegate respondsToSelector:@selector(xPAnchorPKPanelViewAttentionSuccess)]) {

View File

@@ -113,6 +113,7 @@
NSString * type = @"1"; NSString * type = @"1";
[Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
[self.followBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; [self.followBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
[self.followBtn setTitle:@"已关注" forState:UIControlStateNormal]; [self.followBtn setTitle:@"已关注" forState:UIControlStateNormal];
[self.followBtn setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal]; [self.followBtn setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal];

View File

@@ -123,7 +123,6 @@
_nameView.text = _gameInfo.fromNick; _nameView.text = _gameInfo.fromNick;
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo; _gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
_gameTypeView.text = _gameInfo.gameName; _gameTypeView.text = _gameInfo.gameName;
_gameTypeView.text = @"拖泥带水清晨";
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请你玩 %@ 局",_gameInfo.inning] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor whiteColor]}]; NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请你玩 %@ 局",_gameInfo.inning] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor whiteColor]}];
[textAtt addAttributes:@{NSFontAttributeName:kFontBold(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:_gameInfo.inning]]; [textAtt addAttributes:@{NSFontAttributeName:kFontBold(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:_gameInfo.inning]];
_inviteView.attributedText = textAtt; _inviteView.attributedText = textAtt;

View File

@@ -211,7 +211,9 @@
} }
textView.hidden = NO; textView.hidden = NO;
if(textView.superview == nil ){
[view addSubview:textView];
}
[textView mas_makeConstraints:^(MASConstraintMaker *make) { [textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(view); make.left.right.bottom.mas_equalTo(view);
make.height.mas_equalTo(40); make.height.mas_equalTo(40);

View File

@@ -401,6 +401,7 @@
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
self.attentionItem.isSelect = status; self.attentionItem.isSelect = status;
[[self getView] attentionUserSuccess:self.attentionItem]; [[self getView] attentionUserSuccess:self.attentionItem];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
}] uid:uid likedUid:targetUid ticket:ticket type:type]; }] uid:uid likedUid:targetUid ticket:ticket type:type];
} }