1. bugs fix, 多是 UI 问题,部份是线上问题
2. 要注意更新数据时的保护操作
This commit is contained in:
eggmanQQQ
2024-06-21 16:14:36 +08:00
parent 9af02cd815
commit 2d4c030a09
21 changed files with 104 additions and 82 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "1024.png",
"filename" : "10241024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View File

@@ -5,7 +5,6 @@
"scale" : "1x"
},
{
"filename" : "ming_setting_about_us@2x.png",
"idiom" : "universal",
"scale" : "2x"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_top_tab_marks@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_top_tab_marks@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

View File

@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger onlineNum;
@property (nonatomic, assign) NSInteger micUserCount;
@property (nonatomic, assign) NSInteger partitionId;
@property (nonatomic, assign) NSString *roomDesc;
@property (nonatomic, strong) NSArray<HomePlayMicUserModel *> *micUsers;
@end

View File

@@ -66,6 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,copy) NSString *nick;
@property(nonatomic,copy) NSString *introduction;
@property(nonatomic,strong) UserLevelVo *userLevelVo;
@property (nonatomic, copy) NSString *roomDesc;
@end
@interface HomePlayMicUserModel : PIBaseModel

View File

@@ -148,6 +148,7 @@
}];
_subView.text = _roomInfo.introduction;
_subView.text = _roomInfo.roomDesc;
_heatView.text = @(_roomInfo.onlineNum).stringValue;
_rankImageView.image = nil;
_pkImageView.hidden = !_roomInfo.crossPking;

View File

@@ -149,6 +149,7 @@
_collectionView.pagingEnabled = NO;
_collectionView.hidden = YES;
_collectionView.scrollEnabled = NO;
// _collectionView.userInteractionEnabled = NO;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerClass:[XPNewHomeItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomeItemCell class])];
_collectionView.showsVerticalScrollIndicator = NO;

View File

@@ -248,7 +248,8 @@
_pi_BannerView.layer.masksToBounds = YES;
_pi_BannerView.delegate = self;
_pi_BannerView.showPageControl = NO;
_pi_BannerView.autoScrollTimeInterval = 5.0;
_pi_BannerView.autoScrollTimeInterval = 10.0;
[_pi_BannerView disableScrollGesture];
_pi_BannerView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
_pi_BannerView.scrollDirection = UICollectionViewScrollDirectionVertical;
}

View File

@@ -22,58 +22,6 @@
#import "AccountInfoStorage.h"
#import "Api+Room.h"
@interface XPHomeCustomJXTitleCell : JXCategoryTitleCell
@property (nonatomic, assign) bool isDisplayLine;
@property (nonatomic, strong) UIView *line;
@end
@implementation XPHomeCustomJXTitleCell
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self.line mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.width.mas_equalTo(1.5);
make.height.mas_equalTo(12.5);
make.right.mas_equalTo(self);
}];
}
return self;
}
- (void)setIsDisplayLine:(bool)isDisplayLine {
self.line.hidden = !isDisplayLine;
}
- (UIView *)line {
if (!_line) {
_line = [[UIView alloc] init];
_line.backgroundColor = UIColorRGBAlpha(0x1E1E1E, 0.2);
[self addSubview:_line];
}
return _line;
}
@end
@interface XPHomeCustomJXTitleView : JXCategoryTitleView
///VIP
//@property (nonatomic, strong) NSArray<NobleInfo *> *vipInfos;
@end
@implementation XPHomeCustomJXTitleView
- (Class)preferredCellClass{
return XPHomeCustomJXTitleCell.class;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeCustomJXTitleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self preferredCellClass]) forIndexPath:indexPath];
cell.isDisplayLine = indexPath.row == self.titles.count - 1 ? NO : YES;
return cell;
}
@end
@interface XPHomeMineRoomCard : UIView
@property (nonatomic, strong) HomeMineRoomModel *model;
@@ -104,7 +52,7 @@
if (model) {
self.avatarImageView.imageUrl = model.avatar;
self.roomNameLabel.text = model.title;
self.descLabel.text = model.introduction;
self.descLabel.text = model.roomDesc;
self.heatLabel.text = [NSString stringWithFormat:@"%ld", model.onlineNum];
for (UIView *subView in self.miniAvatarsContainer.subviews) {
@@ -161,12 +109,12 @@
gradientType:GradientTypeTopToBottom
imgSize:CGSizeMake(350, 100)];
UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:gradientColorImage];
backgroundImageView.layer.cornerRadius = 20;
backgroundImageView.layer.cornerRadius = 16;
backgroundImageView.clipsToBounds = YES;
[self addSubview:backgroundImageView];
[backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(92)));
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(88)));
}];
[self addSubview:self.avatarImageView];
@@ -261,16 +209,21 @@
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"F5EDFF"];
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 56/2;
// _avatarImageView.layer.cornerRadius = 56/2;
_avatarImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_avatarImageView.layer.borderWidth = 1;
[_avatarImageView setCornerWithLeftTopCorner:kGetScaleWidth(10)
rightTopCorner:kGetScaleWidth(10)
bottomLeftCorner:kGetScaleWidth(10)
bottomRightCorner:kGetScaleWidth(10)
size:CGSizeMake(kGetScaleWidth(72), kGetScaleWidth(72))];
}
return _avatarImageView;
}
- (UILabel *)roomNameLabel {
if (!_roomNameLabel) {
_roomNameLabel = [UILabel labelInitWithText:@""
_roomNameLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPMinePersonalCenterCell1")
font:[UIFont systemFontOfSize:15 weight:UIFontWeightBold]
textColor:[DJDKMIMOMColor colorWithHexString:@"18181A"]];
}
@@ -279,7 +232,7 @@
- (UILabel *)descLabel {
if (!_descLabel) {
_descLabel = [UILabel labelInitWithText:@""
_descLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPHomeMineViewController3")
font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium]
textColor:[DJDKMIMOMColor colorWithHexString:@"18181A"]];
}
@@ -288,7 +241,7 @@
- (UILabel *)heatLabel {
if (!_heatLabel) {
_heatLabel = [UILabel labelInitWithText:@""
_heatLabel = [UILabel labelInitWithText:@"0"
font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium]
textColor:[DJDKMIMOMColor colorWithHexString:@"797B80"]];
}

View File

@@ -20,6 +20,7 @@
@property (nonatomic, strong) UIPageViewController *pageContainer;
@property (nonatomic, strong) NSArray *viewControllers; //
@property (nonatomic, assign) NSUInteger currentIndex; //
@property (nonatomic, strong) UIImageView *tabMarks;
@property (nonatomic, strong) XPNewHomeViewController *recommendVC;
@property (nonatomic, strong) XPHomeMineViewController *mineVC;
@@ -94,6 +95,7 @@
[_topControlView addSubview:_recommendButton];
[_recommendButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView).offset(-8);
make.width.mas_greaterThanOrEqualTo(40);
if (isMSRTL()) {
make.right.mas_equalTo(self.topControlView).offset(-16);
} else {
@@ -109,6 +111,7 @@
[_topControlView addSubview:_mineButton];
[_mineButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView).offset(-8);
make.width.mas_greaterThanOrEqualTo(40);
if (isMSRTL()) {
make.right.mas_equalTo(_recommendButton.mas_left).offset(-32);
} else {
@@ -123,7 +126,7 @@
forControlEvents:UIControlEventTouchUpInside];
[_topControlView addSubview:searchButton];
[searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView).offset(-8);
make.centerY.mas_equalTo(self.mineButton);
if (isMSRTL()) {
make.left.mas_equalTo(self.topControlView).offset(16);
} else {
@@ -131,6 +134,15 @@
}
make.width.height.mas_equalTo(16);
}];
_tabMarks = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_top_tab_marks"]];
[_topControlView addSubview:_tabMarks];
[_tabMarks mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView);
make.width.mas_equalTo(10);
make.height.mas_equalTo(2.5);
make.centerX.mas_equalTo(self.recommendButton.mas_centerX);
}];
}
- (void)displayMineTab {
@@ -138,6 +150,16 @@
[_recommendButton.titleLabel setFont:kFontBold(18)];
[_mineButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_recommendButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.6] forState:UIControlStateNormal];
// [UIView animateWithDuration:0.25 animations:^{
[self.tabMarks mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView);
make.width.mas_equalTo(10);
make.height.mas_equalTo(2.5);
make.centerX.mas_equalTo(self.mineButton.mas_centerX);
}];
// [self.view setNeedsLayout];
// }];
}
- (void)displayRecommendTab {
@@ -145,6 +167,16 @@
[_recommendButton.titleLabel setFont:kFontBold(21)];
[_recommendButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_mineButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.6] forState:UIControlStateNormal];
// [UIView animateWithDuration:0.25 animations:^{
[self.tabMarks mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.topControlView);
make.width.mas_equalTo(10);
make.height.mas_equalTo(2.5);
make.centerX.mas_equalTo(self.recommendButton.mas_centerX);
}];
// [self.view setNeedsLayout];
// }];
}
#pragma mark -

View File

@@ -421,8 +421,11 @@
model.image = image;
CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width;
CGFloat height = image.size.height ;
CGFloat getHeigth = KScreenWidth * height / width;
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeigth) ];
CGFloat getHeight = KScreenWidth * height / width;
if (getHeight > 100) {
getHeight = 100;
}
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeight) ];
[self showGeneralFloatingScreenView:bannerView model:model];
}fail:^(NSError * _Nonnull error) {
@@ -448,6 +451,7 @@
springAnimation.springBounciness = 10.f;
springAnimation.fromValue = [NSValue valueWithCGPoint:bannerView.center];
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(bannerView.frame.size.width / 2, bannerView.center.y)];
@kWeakify(self);
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
@@ -457,7 +461,7 @@
moveAnimation.duration = 0.5;
moveAnimation.repeatCount = 1;
moveAnimation.removedOnCompletion = YES;
@kWeakify(self);
// @kWeakify(self);
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
@kStrongify(self);
if (finished) {

View File

@@ -290,7 +290,7 @@
[self.contributeEnterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(22);
make.width.mas_greaterThanOrEqualTo(60);
make.width.mas_greaterThanOrEqualTo(50);
}];
[self.topicStackView mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -90,15 +90,18 @@ BOOL isNumeric(NSString *string) {
}
#pragma mark - Getters And Setters
- (void)setTitle:(NSString *)title {
if (isNumeric(title)) {
self.title = [self formatCoins:[title integerValue]];
} else {
self.titleLabel.text = title;
if (![title isKindOfClass:[NSString class]]) {
return;
}
if (title.length == 0) {
return;
}
}
- (void)setArray:(NSArray *)array {
if (isNumeric(title)) {
_titleLabel.text = [self formatCoins:[title integerValue]];
} else {
_titleLabel.text = title;
}
}
- (UIView *)bgView {
@@ -128,7 +131,7 @@ BOOL isNumeric(NSString *string) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = [UIColor colorWithWhite:1 alpha:0.8];
_titleLabel.font = [UIFont systemFontOfSize:9 weight:UIFontWeightBold];
_titleLabel.text = YMLocalizedString(@"XPRoomRankEntranceView0");
_titleLabel.text = @"0"; YMLocalizedString(@"XPRoomRankEntranceView0");
_titleLabel.numberOfLines = 2;
}
return _titleLabel;

View File

@@ -223,7 +223,7 @@
self.collectButton.hidden = YES;
} else {
self.collectButton.hidden = NO;
self.collectButton.selected = roomInfo.isRoomFans;
// self.collectButton.selected = roomInfo.isRoomFans;
}
self.lockRoomImageView.hidden = roomInfo.roomPwd.length <= 0;
}
@@ -282,13 +282,11 @@
NSString * type = self.collectButton.selected ? @"2" : @"1";
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
@kWeakify(self);
[Api collectRoom:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
self.collectButton.selected = !self.collectButton.selected;
if ([type isEqualToString:@"1"]) {///
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"RoomHeaderView6")];
if (self.hadShowCollectInScreen) {

View File

@@ -111,13 +111,19 @@
[self.avatarStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.topImageView.mas_bottom);
make.leading.trailing.mas_equalTo(self.contentImageView);
// make.leading.trailing.mas_equalTo(self.contentImageView);
make.centerX.mas_equalTo(self.topImageView);
make.width.mas_equalTo(self.contentImageView.mas_width);
make.height.mas_equalTo(65);
}];
[self.fightScoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.avatarStackView.mas_bottom).offset(8);
make.left.mas_equalTo(self.avatarStackView).offset(8);
if (isMSRTL()) {
make.right.mas_equalTo(self.avatarStackView).offset(-8);
}else {
make.left.mas_equalTo(self.avatarStackView).offset(8);
}
make.height.mas_equalTo(15);
}];