修复bug
This commit is contained in:
@@ -9718,13 +9718,13 @@
|
||||
E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */,
|
||||
E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */,
|
||||
E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */,
|
||||
E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */,
|
||||
E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */,
|
||||
E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */,
|
||||
E8EEB8F126FC2050007C6EBA /* SDBrowserImageView.h */,
|
||||
E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */,
|
||||
E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */,
|
||||
E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */,
|
||||
E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */,
|
||||
E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */,
|
||||
E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */,
|
||||
);
|
||||
path = SDPhotoBrowser;
|
||||
sourceTree = "<group>";
|
||||
|
@@ -8,9 +8,9 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "SDWaitingView.h"
|
||||
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
|
||||
|
||||
|
||||
@interface SDBrowserImageView : UIImageView <UIGestureRecognizerDelegate>
|
||||
@interface SDBrowserImageView : FLAnimatedImageView <UIGestureRecognizerDelegate>
|
||||
|
||||
@property (nonatomic, assign) CGFloat progress;
|
||||
@property (nonatomic, assign, readonly) BOOL isScaled;
|
||||
|
@@ -9,7 +9,10 @@
|
||||
#import "SDPhotoBrowser.h"
|
||||
#import "UIImageView+WebCache.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_NavSafeArea ([[UIScreen mainScreen] bounds].size.height >= 812.0 ? 24 : 0) // 如果是iphoneX 顶部安全区域 24
|
||||
@@ -95,9 +98,18 @@
|
||||
- (void)saveImage
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
if (_indicatorView == nil) {
|
||||
_indicatorView = [[UIActivityIndicatorView alloc] init];
|
||||
@@ -108,7 +120,27 @@
|
||||
|
||||
[_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;
|
||||
{
|
||||
[_indicatorView stopAnimating];
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIButton (EnlargeTouchArea)
|
||||
@property (nonatomic, assign) NSTimeInterval yn_acceptEventInterval; // 重复点击的间隔
|
||||
|
||||
//图片frmae
|
||||
@property (strong, nonatomic) NSValue *imageFrame;
|
||||
@@ -33,4 +34,7 @@
|
||||
*/
|
||||
- (void)enlargeTouchArea:(UIEdgeInsets)insets;
|
||||
|
||||
|
||||
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage;
|
||||
|
||||
@end
|
||||
|
@@ -9,8 +9,18 @@
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
#define defaultInterval 0.0003 //默认时间间隔,不能太长,以免影响系统拍照等功能
|
||||
@interface UIButton ()
|
||||
/**
|
||||
* bool YES 忽略点击事件 NO 允许点击事件
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isIgnoreEvent;
|
||||
@end
|
||||
|
||||
@implementation UIButton (EnlargeTouchArea)
|
||||
|
||||
static const char *UIControl_acceptEventInterval = "UIControl_acceptEventInterval";
|
||||
static const char *UIControl_enventIsIgnoreEvent = "UIControl_enventIsIgnoreEvent";
|
||||
|
||||
//定义常量 必须是C语言字符串
|
||||
static const char *imageFrameStr = "imageFrame";
|
||||
@@ -26,9 +36,54 @@ static const char *titleFrameStr = "titleFrame";
|
||||
Method newTitleMethod = class_getInstanceMethod(self, @selector(new_titleRectForContentRect:));
|
||||
Method oldTitleMethod = class_getInstanceMethod(self, @selector(titleRectForContentRect:));
|
||||
method_exchangeImplementations(newTitleMethod, oldTitleMethod);
|
||||
|
||||
|
||||
//根据selector查找Method
|
||||
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{//添加不成功->交换
|
||||
//添加失败了 说明本类中有methodB的实现,此时只需要将methodA和methodB的IMP互换一下即可。
|
||||
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{
|
||||
objc_setAssociatedObject(self, imageFrameStr, imageFrame, OBJC_ASSOCIATION_RETAIN);
|
||||
}
|
||||
@@ -111,5 +166,27 @@ static char leftNameKey;
|
||||
}
|
||||
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
|
||||
|
@@ -130,9 +130,12 @@
|
||||
for (HomePlayRoomModel *model in array) {
|
||||
if (model.isBanner) {
|
||||
self.headerView.bannerList = model.bannerVoList;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self hideHUD];
|
||||
[self.pagingView reloadData];
|
||||
}else{
|
||||
|
||||
}
|
||||
@@ -202,10 +205,12 @@
|
||||
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
||||
if(self.headerView.bannerList.count == 0)return 0;
|
||||
return [XPPartyHeaderView getPartyHeaderViewHeight];
|
||||
}
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
|
||||
return self.headerView;
|
||||
}
|
||||
|
||||
|
@@ -49,6 +49,7 @@
|
||||
NSString * type = @"1";
|
||||
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] attentionUserSuccess:targetUid];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
} showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
}
|
||||
///用户的游戏配置信息
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "NIMMessageUtils.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "UserGameInfoVo.h"
|
||||
|
||||
@implementation NIMMessageUtils
|
||||
|
||||
@@ -66,6 +67,9 @@
|
||||
return @"[分享了一条动态]";
|
||||
} else if(attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) {
|
||||
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 {
|
||||
text = @"[消息]";
|
||||
}
|
||||
|
@@ -65,6 +65,8 @@
|
||||
@property (nonatomic,strong) NIMMessage *lastMessage;
|
||||
///私聊风险提示
|
||||
@property (nonatomic,strong) SessionRiskView *riskAlertView;
|
||||
///占位图
|
||||
@property(nonatomic,strong) UIView *emptyVeiw;
|
||||
///游戏点单轮播
|
||||
@property(nonatomic,strong) UICollectionView *collectionView;
|
||||
|
||||
@@ -116,6 +118,14 @@
|
||||
}
|
||||
-(void)getAttentionUserNotification{
|
||||
[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 {
|
||||
[super viewWillAppear:animated];
|
||||
@@ -172,6 +182,7 @@
|
||||
self.sessionNavView.isInRoom = self.openType == SessionListOpenTypeRoom;
|
||||
[self.view addSubview:self.sessionNavView];
|
||||
[self.view addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.emptyVeiw];
|
||||
[self.stackView addArrangedSubview:self.riskAlertView];
|
||||
[self.view addSubview:self.sessionTableView];
|
||||
[self.view addSubview:self.toolbarView];
|
||||
@@ -308,6 +319,7 @@
|
||||
[gameTextArray addObject:gameModel.gameName];
|
||||
self.collectionView.hidden = NO;
|
||||
[self.collectionView reloadData];
|
||||
[self.sessionTableView nim_scrollToBottom:YES];
|
||||
return;
|
||||
}
|
||||
if(gameTextArray.count > 0){
|
||||
@@ -316,6 +328,7 @@
|
||||
self.pageControl.pageList = gameTextArray;
|
||||
self.pageControl.curPage = 0;
|
||||
[self.collectionView reloadData];
|
||||
[self.sessionTableView nim_scrollToBottom:YES];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -557,13 +570,12 @@
|
||||
AttachmentModel * attachment = obj.attachment;
|
||||
if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User){
|
||||
UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data];
|
||||
if([gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid]){
|
||||
return;
|
||||
}
|
||||
XPMineGameOrderDetailsView *orderView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
||||
XPMineGameOrderDetailsView *orderView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) type:[gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid] ? 1 : 0];
|
||||
orderView.gameInfo = gameInfo;
|
||||
orderView.isFormChat = YES;
|
||||
orderView.delegate = self;
|
||||
|
||||
[self.view addSubview:orderView];
|
||||
}
|
||||
|
||||
@@ -835,6 +847,7 @@
|
||||
- (void)sessionRiskViewCloseButtonClick:(SessionRiskView *)view {
|
||||
[[SessionRiskCache shareCache] saveCloseRisk:self.session.sessionId];
|
||||
self.riskAlertView.hidden = YES;
|
||||
self.emptyVeiw.hidden = NO;
|
||||
}
|
||||
|
||||
|
||||
@@ -926,5 +939,12 @@
|
||||
}
|
||||
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
|
||||
|
@@ -37,6 +37,7 @@
|
||||
NSString * type = @"1";
|
||||
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] attentionFansSuccess];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
}] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@
|
||||
NSString * type = state ? @"1" : @"2";
|
||||
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] attentionUserSuccess:state];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
}] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,weak) id<XPMineGameOrderDetailsViewDelegate>delegate;
|
||||
@property(nonatomic,strong) UserGameInfoVo *gameInfo;
|
||||
@property(nonatomic,assign) BOOL isFormChat;
|
||||
-(instancetype)initWithFrame:(CGRect)frame type:(int)type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -34,14 +34,15 @@
|
||||
///再次邀请
|
||||
@property(nonatomic,strong) UIButton *inviteBnt;
|
||||
|
||||
|
||||
@property(nonatomic,assign) int type;
|
||||
|
||||
@end
|
||||
@implementation XPMineGameOrderDetailsView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
-(instancetype)initWithFrame:(CGRect)frame type:(int)type{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
self.type = type;
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
@@ -67,10 +68,19 @@
|
||||
[self.closeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
if(self.type == 1){
|
||||
self.inviteBnt.hidden = YES;
|
||||
[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) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(52));
|
||||
make.leading.top.mas_equalTo(kGetScaleWidth(20));
|
||||
@@ -157,8 +167,8 @@
|
||||
}
|
||||
- (void)setGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
_gameInfo = gameInfo;
|
||||
_nameView.text = _gameInfo.toNick;
|
||||
_headView.imageUrl = _gameInfo.toAvatar;
|
||||
_nameView.text = _type == 1 ?_gameInfo.fromNick : _gameInfo.toNick;
|
||||
_headView.imageUrl = _type == 1 ? _gameInfo.fromAvatar : _gameInfo.toAvatar;;
|
||||
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
|
||||
_gameNumView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning];
|
||||
_gameNameView.text = _gameInfo.gameName;
|
||||
@@ -175,7 +185,6 @@
|
||||
_priceView.textAlignment = NSTextAlignmentRight;
|
||||
_priceView.attributedText = textAtt;
|
||||
|
||||
|
||||
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:@"邀请时间:"]];
|
||||
_timeView.attributedText = tiemAtt;
|
||||
@@ -190,6 +199,7 @@
|
||||
[orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo].length];
|
||||
_orderNumView.attributedText = orderAtt;
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
- (UIButton *)closeView{
|
||||
if(!_closeView){
|
||||
|
@@ -94,8 +94,8 @@
|
||||
_gameInfo = gameInfo;
|
||||
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
|
||||
_gameNameVeiw.text = _gameInfo.gameName;
|
||||
_headView.imageUrl = [_type isEqualToString:@"0"] ? _gameInfo.fromAvatar : _gameInfo.toAvatar;
|
||||
_nameView.text = [_type isEqualToString:@"0"] ?_gameInfo.fromNick : _gameInfo.toNick;
|
||||
_headView.imageUrl = [_type isEqualToString:@"1"] ? _gameInfo.fromAvatar : _gameInfo.toAvatar;
|
||||
_nameView.text = [_type isEqualToString:@"1"] ?_gameInfo.fromNick : _gameInfo.toNick;
|
||||
_numView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
@@ -11,7 +11,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPMineGameOrderItemVCDelegate <NSObject>
|
||||
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo;
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo type:(int)type;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -96,14 +96,15 @@
|
||||
return cell;
|
||||
}
|
||||
XPMineGameOrderItemCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameOrderItemCell class]) forIndexPath:indexPath];
|
||||
cell.type = self.type;
|
||||
cell.gameInfo = [self.orderList safeObjectAtIndex1:indexPath.row];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(self.type.integerValue == 1)return;
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(showGameOrderDetailsViewWithGameInfo:)]){
|
||||
[self.delegate showGameOrderDetailsViewWithGameInfo:[self.orderList safeObjectAtIndex1:indexPath.row]];
|
||||
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(showGameOrderDetailsViewWithGameInfo:type:)]){
|
||||
[self.delegate showGameOrderDetailsViewWithGameInfo:[self.orderList safeObjectAtIndex1:indexPath.row]type:self.type.intValue];
|
||||
}
|
||||
|
||||
|
||||
|
@@ -108,8 +108,8 @@
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - XPMineGameOrderItemVCDelegate
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo type:(int)type{
|
||||
XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) type:type];
|
||||
detailsView.gameInfo = gameInfo;
|
||||
detailsView.delegate = self;
|
||||
[self.view addSubview:detailsView];
|
||||
|
@@ -431,7 +431,7 @@
|
||||
self.attentionButton.layer.borderColor = UIColor.clearColor.CGColor;
|
||||
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
|
||||
|
||||
self.headView.attentionButton.selected = status;
|
||||
if (self.headView.attentionButton.selected) {
|
||||
|
@@ -518,6 +518,7 @@
|
||||
_payBtn.titleLabel.font = kFontMedium(14);
|
||||
_payBtn.layer.cornerRadius = kGetScaleWidth(40)/2;
|
||||
_payBtn.layer.masksToBounds = YES;
|
||||
_payBtn.yn_acceptEventInterval = 1;
|
||||
[_payBtn addTarget:self action:@selector(invitatioAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _payBtn;
|
||||
|
@@ -244,6 +244,7 @@
|
||||
[payTitleBnt setTitle:@"咨询下单" forState:UIControlStateNormal];
|
||||
payTitleBnt.titleLabel.font = kFontMedium(12);
|
||||
[payTitleBnt addTarget:self action:@selector(consultingOrderAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
payTitleBnt.yn_acceptEventInterval = 1;
|
||||
_payTitleBnt = payTitleBnt;
|
||||
}
|
||||
return _payTitleBnt;
|
||||
|
@@ -473,7 +473,7 @@
|
||||
} else {
|
||||
NSURL *imgUrl = [NSURL URLWithString:imageName];
|
||||
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) {
|
||||
imageView.bounds = CGRectMake(0, 0, 51, 17);
|
||||
}else {
|
||||
|
@@ -401,6 +401,7 @@
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
[Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
self.attentionButton.hidden = YES;
|
||||
[XCHUDTool showErrorWithMessage:@"关注成功"];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPAnchorPKPanelViewAttentionSuccess)]) {
|
||||
|
@@ -113,6 +113,7 @@
|
||||
NSString * type = @"1";
|
||||
[Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
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 setTitle:@"已关注" forState:UIControlStateNormal];
|
||||
[self.followBtn setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal];
|
||||
|
@@ -123,7 +123,6 @@
|
||||
_nameView.text = _gameInfo.fromNick;
|
||||
_gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo;
|
||||
_gameTypeView.text = _gameInfo.gameName;
|
||||
_gameTypeView.text = @"拖泥带水清晨";
|
||||
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]];
|
||||
_inviteView.attributedText = textAtt;
|
||||
|
@@ -211,7 +211,9 @@
|
||||
}
|
||||
textView.hidden = NO;
|
||||
|
||||
|
||||
if(textView.superview == nil ){
|
||||
[view addSubview:textView];
|
||||
}
|
||||
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(view);
|
||||
make.height.mas_equalTo(40);
|
||||
|
@@ -401,6 +401,7 @@
|
||||
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
self.attentionItem.isSelect = status;
|
||||
[[self getView] attentionUserSuccess:self.attentionItem];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
|
||||
}] uid:uid likedUid:targetUid ticket:ticket type:type];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user