Finish all works!

This commit is contained in:
edwinQQQ
2025-02-28 19:04:09 +08:00
parent 8a1ed09905
commit 7807824a97
183 changed files with 9153 additions and 3938 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "形状 5@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5864-CP-奢华黑金 舞会.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5864-CP-奢华黑金 舞会 (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5864-CP-奢华黑金 舞会 (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5864-CP-奢华黑金 舞会 (3).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

View File

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

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "缺省@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

View File

@@ -9,7 +9,7 @@
"scale" : "2x"
},
{
"filename" : "zz 拷贝@3x.png",
"filename" : "zz 拷贝 2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

View File

@@ -74,7 +74,7 @@ typedef NS_ENUM(NSInteger, FaceLivenessStrategy) {
@property (nonatomic, strong) NSArray<NSString *> *officialMsgUids;
///官方账号 小秘书 红包消息
@property (nonatomic,strong) NSArray<NSString *> *officialAccountUids;
@property(nonatomic,copy) NSDictionary *publicChatRoomIdMap;
//@property(nonatomic,copy) NSDictionary *publicChatRoomIdMap; // 公聊大厅房间 IDs已不使用该业务逻辑
///星座礼物顶部是否开启
@property (nonatomic,assign) BOOL twelveStarSwitch;
/// 开房是否需要实名

View File

@@ -0,0 +1,29 @@
//
// MoliMoneyLabel.h
// YuMi
//
// Created by P on 2025/2/25.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MoliMoneyLabel : UIView
/// 带金币 icon 的 label view
/// - Parameters:
/// - textColor: 文本颜色
/// - font: 文本字体
/// - position: icon 位置1: 左2:右
/// - size: icon 大小
+ (MoliMoneyLabel *)moneyLabelWithTextColot:(UIColor *)textColor font:(UIFont *)font moneyPostion:(NSInteger)position moneySize:(CGSize)size;
- (void)updateContent:(NSString *)content;
- (void)updateFont:(UIFont *)font size:(CGSize)size;
- (void)displayIcon:(BOOL)displayOrNot;
- (void)updateSpacing:(NSInteger)space;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,66 @@
//
// MoliMoneyLabel.m
// YuMi
//
// Created by P on 2025/2/25.
//
#import "MoliMoneyLabel.h"
@interface MoliMoneyLabel()
@property(nonatomic, strong) UILabel *label;
@property(nonatomic, strong) UIImageView *money;
@property(nonatomic, strong) UIStackView *stackView;
@end
@implementation MoliMoneyLabel
+ (MoliMoneyLabel *)moneyLabelWithTextColot:(UIColor *)textColor
font:(UIFont *)font
moneyPostion:(NSInteger)position
moneySize:(CGSize)size {
MoliMoneyLabel *containerView = [[MoliMoneyLabel alloc] init];
containerView.label = [UILabel labelInitWithText:@"" font:font textColor:textColor];
containerView.label.minimumScaleFactor = 0.7;
containerView.label.adjustsFontSizeToFitWidth = YES;
containerView.money = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")];
containerView.money.contentMode = UIViewContentModeScaleAspectFill;
NSArray *subviews = position == 1 ? @[containerView.money, containerView.label] : @[containerView.label, containerView.money];
containerView.stackView = [[UIStackView alloc] initWithArrangedSubviews:subviews];
containerView.stackView.spacing = 3;
[containerView addSubview:containerView.stackView];
[containerView.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(containerView);
}];
[containerView.money mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(size);
}];
return containerView;
}
- (void)updateSpacing:(NSInteger)space {
self.stackView.spacing = space;
}
- (void)displayIcon:(BOOL)displayOrNot {
self.money.hidden = !displayOrNot;
}
- (void)updateContent:(NSString *)content {
self.label.text = content;
}
- (void)updateFont:(UIFont *)font size:(CGSize)size {
self.label.font = font;
[self.money mas_updateConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(size);
}];
[self layoutIfNeeded];
}
@end

View File

@@ -58,6 +58,10 @@ NS_ASSUME_NONNULL_BEGIN
corners:(CACornerMask)corners
borderWidth:(CGFloat)borderWidth
borderColor:(UIColor *)borderColor;
- (void)setAllCornerRadius:(CGFloat)radius
borderWidth:(CGFloat)borderWidth
borderColor:(UIColor *)borderColor;
@end
NS_ASSUME_NONNULL_END

View File

@@ -107,5 +107,19 @@
self.layer.borderWidth = borderWidth;
self.layer.borderColor = borderColor.CGColor;
}
- (void)setAllCornerRadius:(CGFloat)radius
borderWidth:(CGFloat)borderWidth
borderColor:(UIColor *)borderColor {
//
self.layer.cornerRadius = radius;
self.layer.maskedCorners = UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight;
self.layer.masksToBounds = YES; //
//
self.layer.borderWidth = borderWidth;
self.layer.borderColor = borderColor.CGColor;
}
@end

View File

@@ -107,6 +107,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
KBoomRule,
/// 房间等级说明
KRoomLevelRule,
/// 红包规则说明
KLuckyPackageRule,
};
NSString * const URLWithType(URLType type);

View File

@@ -25,7 +25,8 @@ NSString * const URLWithType(URLType type) {
@(kLUDOUrl) : @"modules/gameRank/index.html",///LUDO
@(kCPRule) : @"modules/rule/cpRule.html",
@(KBoomRule) : @"modules/rule/boom.html?partitionId=",///,
@(KRoomLevelRule) : @"modules/roomLevel/index.html",///,
@(KRoomLevelRule) : @"modules/roomLevel/index.html",///,
@(KLuckyPackageRule) : @"modules/luckyBagRules/index.html",///,
};
NSString * newUrl = [newDic objectForKey:@(type)];
if(newUrl != nil){

View File

@@ -143,5 +143,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>FacebookAutoLogAppEventsEnabled</key>
<false/>
</dict>
</plist>

View File

@@ -310,7 +310,7 @@ static NSArray<NSDictionary<NSString *, NSNumber *> *> *MyDressUpOptions(void) {
[TTPopup dismiss];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self showSuccessToast:YMLocalizedString(@"XPDressUpShopListViewController0")];
[self.listView refreshCurrentPageData];
[self.listView updateSelectedItem:indexPath];
});
} failure:^(NSError * _Nonnull error) {
@kStrongify(self);

View File

@@ -33,7 +33,6 @@ typedef void (^FetchDataForMyDressingPage)(NSInteger pageIndex, NSInteger pageNu
@property(nonatomic, copy) void(^returnMyDressingSelectedModel)(MyDressingDataModel * _Nullable model, NSInteger type, NSIndexPath *indexPath);
- (void)updateSelectedItem:(NSIndexPath *)indexPath;
- (void)refreshCurrentPageData;
@end

View File

@@ -790,6 +790,7 @@
@property (nonatomic, strong) UIScrollView *mallItemsScrollView;
@property (nonatomic, strong) NSMutableArray<ShoppingMallCategoryCard *> *categoryCardArray;
@property (nonatomic, strong) NSMutableArray<UICollectionView *> *itemCollectionViewArray;
@property (nonatomic, strong) NSMutableArray<UIActivityIndicatorView *> *itemCollectionLoadingViewArray;
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, NSArray <DressUpShopModel *>*> *dataCache; // -
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, NSArray <MyDressingDataModel *>*> *myDressingDataCache; // -
@property (nonatomic, strong) NSMutableSet<NSNumber *> *requestedPages; // ,
@@ -845,6 +846,7 @@
self.categoryCardArray = [NSMutableArray array];
self.itemCollectionViewArray = [NSMutableArray array];
self.itemCollectionLoadingViewArray = [NSMutableArray array];
}
- (void)setItems:(NSArray *)items {
@@ -896,8 +898,15 @@
[collectionView registerClass:[MyDressingItemCard class] forCellWithReuseIdentifier:@"MyDressingItemCard"];
[collectionView registerClass:[MyDressingItemCard class] forCellWithReuseIdentifier:@"MyDressingItemCard_NotUsed"];
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
loading.frame = CGRectMake(screenWidth/2 - 30, 180, 60, 60);
loading.hidesWhenStopped = YES;
[collectionView addSubview:loading];
[loading startAnimating];
[self.mallItemsScrollView addSubview:collectionView];
[self.itemCollectionViewArray addObject:collectionView];
[self.itemCollectionLoadingViewArray addObject:loading];
if (self.isForMyDressingPage) {
[self addRefreshControl:collectionView];
@@ -968,7 +977,7 @@
// 使使
for (UICollectionView *itemView in self.itemCollectionViewArray) {
[itemView reloadData];
NSArray *items = [self.myDressingDataCache objectForKey:@(index)];
if (items.count > 0) {
NSInteger selectedIndex = 0;
@@ -993,11 +1002,19 @@
NSArray *data = self.dataCache[@(itemView.tag)];
self.returnSelectedModel(data.firstObject);
}
[itemView reloadData];
}
}
- (void)updateItemCollectionViewWithShoppingMallData:(NSArray <DressUpShopModel *>*)data
atIndex:(NSInteger)index {
UIActivityIndicatorView *loading = [self.itemCollectionLoadingViewArray xpSafeObjectAtIndex:index];
if (loading) {
[loading stopAnimating];
}
if (!data) {
return;
}
@@ -1012,12 +1029,18 @@
if (self.returnSelectedModel) {
self.returnSelectedModel(data.firstObject);
}
[itemView reloadData];
}
}
- (void)updateItemCollectionViewWithMyDressingData:(NSArray <MyDressingDataModel *>*)data
pageNum:(NSInteger)pageNum
atIndex:(NSInteger)index {
UIActivityIndicatorView *loading = [self.itemCollectionLoadingViewArray xpSafeObjectAtIndex:index];
if (loading) {
[loading stopAnimating];
}
NSMutableArray <MyDressingDataModel *>*sortedData = data.mutableCopy;
[sortedData sortUsingComparator:^NSComparisonResult(MyDressingDataModel * _Nonnull obj1, MyDressingDataModel * _Nonnull obj2) {
if (obj1.used) {
@@ -1054,7 +1077,6 @@
[itemView.refreshControl endRefreshing];
[itemView.mj_header endRefreshing];
[itemView.mj_footer endRefreshing];
[itemView reloadData];
if (data.count == 0 || data.count < 20) {
[itemView.mj_footer endRefreshingWithNoMoreData];
@@ -1066,6 +1088,8 @@
withObject:currentPageNum];
}
}
[itemView reloadData];
}
}

View File

@@ -23,7 +23,7 @@
if (failure) {
failure([NSError errorWithDomain:[NSString isEmpty:msg] ? @"" : msg code:code userInfo:nil]);
}
} showLoading:YES errorToast:YES]
} showLoading:NO errorToast:YES]
dressType:@(type).stringValue];
}

View File

@@ -161,13 +161,13 @@ static NSArray<NSDictionary<NSString *, NSNumber *> *> *DressUpOptions(void) {
#pragma mark -
- (void)fetchDataForPage:(NSInteger)pageIndex
completion:(FetchDataCompletion)completion {
[self.presenter loadCategoryItems:pageIndex success:^(NSArray <DressUpShopModel *>* array) {
if (completion) {
completion(array);
}
} failure:^(NSError * _Nonnull error) {
// TODO:
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.presenter loadCategoryItems:pageIndex success:^(NSArray <DressUpShopModel *>* array) {
if (completion) {
completion(array);
}
} failure:^(NSError * _Nonnull error) {}];
});
}
- (void)updateBottomControlArea {

View File

@@ -69,9 +69,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
@property(nonatomic,strong) UILabel *nextLabel;
///
@property(nonatomic,strong) UIButton *chooseAccountBtn;
@property(nonatomic,strong) UIButton *currentLoginWayButton;
///
@property(nonatomic,strong) UIButton *chooseSMSBtn;
@property(nonatomic,strong) UIButton *otherLoginWayButton;
///
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
///
@@ -162,8 +162,8 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
[self.view addSubview:self.logoView];
[self.view addSubview:self.feedBackButton];
[self.view addSubview:self.chooseAccountBtn];
[self.view addSubview:self.chooseSMSBtn];
[self.view addSubview:self.currentLoginWayButton];
[self.view addSubview:self.otherLoginWayButton];
[self.view addSubview:self.accountView];
[self.view addSubview:self.accountPwdView];
@@ -205,18 +205,17 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}];
CGFloat width = KScreenWidth/2;
[self.chooseAccountBtn mas_makeConstraints:^(MASConstraintMaker *make) {
[self.currentLoginWayButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(width);
make.top.equalTo(self.logoView.mas_bottom).mas_offset(kGetScaleWidth(31));
make.top.equalTo(self.logoView.mas_bottom).mas_offset(kGetScaleWidth(15));
}];
[self.accountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(self.chooseAccountBtn.mas_bottom).offset(kGetScaleWidth(13));
make.top.mas_equalTo(self.currentLoginWayButton.mas_bottom).offset(kGetScaleWidth(13));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
@@ -252,10 +251,10 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
make.centerX.mas_equalTo(self.view);
}];
[self.chooseSMSBtn mas_makeConstraints:^(MASConstraintMaker *make) {
[self.otherLoginWayButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(width);
make.top.equalTo(self.stackView.mas_bottom).mas_offset(kGetScaleWidth(31));
make.top.equalTo(self.stackView.mas_bottom).mas_offset(kGetScaleWidth(23));
make.centerX.mas_equalTo(self.stackView);
}];
@@ -409,7 +408,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
self.authBubbleView.alpha = 1.0;
}];
}
}
///
@@ -495,18 +493,16 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
-(void)chooseAccountAction{
self.loginType = 0;
// self.loginType = self.loginType == 0 ? 1 : 0;
}
-(void)chooseSMSAction{
self.loginType = 1;
self.loginType = self.loginType == 0 ? 1 : 0;
}
-(void)setLoginType:(int)selectType{
_loginType = selectType;
_chooseAccountBtn.selected = _loginType == 0;
_chooseSMSBtn.selected = _loginType != 0;
_forgetBtn.hidden = _loginType != 0;
_accountView.hidden = _loginType != 0;
@@ -514,6 +510,21 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
_phoneInputView.hidden = _loginType == 0;
_codeInputView.hidden = _loginType == 0;
switch (selectType) {
case 0:
[_currentLoginWayButton setTitle:YMLocalizedString(@"XPLoginPhoneViewController9") forState:UIControlStateNormal];
[_otherLoginWayButton setTitle:YMLocalizedString(@"1.0.37_text_27")forState:UIControlStateNormal];
break;
case 1:
[_currentLoginWayButton setTitle:YMLocalizedString(@"XPLoginPhoneViewController10") forState:UIControlStateNormal];
[_otherLoginWayButton setTitle:YMLocalizedString(@"1.0.37_text_26")forState:UIControlStateNormal];
break;
default:
break;
}
}
#pragma mark - XPLoginInputViewDelegate
@@ -812,31 +823,32 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
return _loginBtn;
}
- (UIButton *)chooseAccountBtn{
if(!_chooseAccountBtn){
_chooseAccountBtn = [UIButton new];
[_chooseAccountBtn setTitle:YMLocalizedString(@"XPLoginPhoneViewController9" ) forState:UIControlStateNormal];
[_chooseAccountBtn setTitleColor:UIColorFromRGB(0x84868A) forState:UIControlStateNormal];
[_chooseAccountBtn setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateSelected];
_chooseAccountBtn.titleLabel.font = kFontMedium(16);
[_chooseAccountBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
_chooseAccountBtn.selected = YES;
[_chooseAccountBtn addTarget:self action:@selector(chooseAccountAction) forControlEvents:UIControlEventTouchUpInside];
- (UIButton *)currentLoginWayButton{
if(!_currentLoginWayButton){
_currentLoginWayButton = [UIButton new];
[_currentLoginWayButton setTitle:YMLocalizedString(@"XPLoginPhoneViewController9" ) forState:UIControlStateNormal];
[_currentLoginWayButton setTitleColor:UIColorFromRGB(0xafb1b3) forState:UIControlStateNormal];
[_currentLoginWayButton setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateSelected];
_currentLoginWayButton.titleLabel.font = kFontMedium(16);
[_currentLoginWayButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
_currentLoginWayButton.selected = NO;
[_currentLoginWayButton addTarget:self action:@selector(chooseAccountAction) forControlEvents:UIControlEventTouchUpInside];
}
return _chooseAccountBtn;
return _currentLoginWayButton;
}
- (UIButton *)chooseSMSBtn{
if(!_chooseSMSBtn){
_chooseSMSBtn = [UIButton new];
[_chooseSMSBtn setTitle:YMLocalizedString(@"XPLoginPhoneViewController10") forState:UIControlStateNormal];
[_chooseSMSBtn setTitleColor:UIColorFromRGB(0x84868A) forState:UIControlStateNormal];
[_chooseSMSBtn setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateSelected];
_chooseSMSBtn.titleLabel.font = kFontMedium(16);
[_chooseSMSBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_chooseSMSBtn addTarget:self action:@selector(chooseSMSAction) forControlEvents:UIControlEventTouchUpInside];
- (UIButton *)otherLoginWayButton{
if(!_otherLoginWayButton){
_otherLoginWayButton = [UIButton new];
[_otherLoginWayButton setTitle:YMLocalizedString(@"1.0.37_text_27") forState:UIControlStateNormal];
[_otherLoginWayButton setTitleColor:UIColorFromRGB(0x313131) forState:UIControlStateNormal];
[_otherLoginWayButton setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateSelected];
_otherLoginWayButton.titleLabel.font = kFontMedium(14);
_otherLoginWayButton.selected = YES;
[_otherLoginWayButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_otherLoginWayButton addTarget:self action:@selector(chooseSMSAction) forControlEvents:UIControlEventTouchUpInside];
}
return _chooseSMSBtn;
return _otherLoginWayButton;
}
- (XPLoginInputView *)accountView {

View File

@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)checkLimit:(HttpRequestHelperCompletion)completion receiverUid:(NSString *)receiverUid;
+ (void)sendRoomImageMessage:(HttpRequestHelperCompletion)completion picUrl:(NSString *)picUrl roomUid:(NSInteger)roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -18,5 +18,9 @@
[self makeRequest:@"privateChat/limitV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, receiverUid,nil];
}
+ (void)sendRoomImageMessage:(HttpRequestHelperCompletion)completion picUrl:(NSString *)picUrl roomUid:(NSInteger)roomUid {
[self makeRequest:@"roomScreen/sendPic" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, picUrl, @(roomUid), nil];
}
@end

View File

@@ -142,9 +142,28 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
///房间等级更新
CustomMessageType_RoomLevel_Update = 114,
/// 进房类型
CustomMessageType_User_Enter_Room = 115,
/// 新系統消息
CustomMessageType_System_message = 116,
};
/// first = CustomMessageType_System_message
typedef NS_ENUM(NSUInteger, CustomMessageTypeSystemmessage) {
Custom_Message_Sub_System_message = 1160,
};
///first = CustomMessageType_User_Enter_Room
typedef NS_ENUM(NSUInteger, CustomMessageTypeUserEnterRoom) {
/// 图片消息
Custom_Message_Sub_Pic_Message = 1151,
/// 用户进房
Custom_Message_Sub_User_Enter_Room = 1152,
};
///first = CustomMessageType_Room_Tip
typedef NS_ENUM(NSUInteger, CustomMessageSubRoomTip) {
///分享房间
@@ -381,6 +400,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubRedPacket) {
Custom_Message_Sub_AllDiamandRedPacket = 604, //全服钻石红包
Custom_Message_Sub_OpenRedPacketSuccess = 605,//抢红包成功
Custom_Message_Sub_NewRoomDiamandRedPacket = 606, //新版本房间钻石红包
Custom_Message_Sub_LuckyPackage = 607, // 最新版本房间红包推送
};
///first = CustomMessageType_Collection_Room
@@ -755,6 +776,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeRoomLevelUpdate) {
@property (nonatomic,assign) int second;
@property(nonatomic,assign) BOOL isBroadcast;
@property(nonatomic, assign) NSInteger seq; // 本地序号,用于将一条消息分解为多条有次序的消息
@end
NS_ASSUME_NONNULL_END

View File

@@ -18,64 +18,64 @@
return [self toJSONString];
}
- (NSDictionary *)toDictionary {
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
if (self.data) {
dict[@"data"] = self.data;
}
dict[@"first"] = @(self.first);
dict[@"second"] = @(self.second);
dict[@"isBroadcast"] = @(self.isBroadcast);
return [dict copy];
}
- (NSString *)convertModelToJSONString:(AttachmentModel *)model {
if (!model) {
return nil;
}
//
NSDictionary *modelDict = [model toDictionary];
// JSON
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:modelDict options:0 error:&error];
if (error) {
NSLog(@"JSON 序列化失败: %@", error.localizedDescription);
return nil;
}
//
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
- (NSString *)compressJSONString:(NSString *)jsonString {
if (!jsonString) return nil;
// JSON
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
if (error) {
NSLog(@"JSON 解析错误: %@", error.localizedDescription);
return nil;
}
// JSON
NSData *compressedData = [NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:&error];
if (error) {
NSLog(@"JSON 序列化错误: %@", error.localizedDescription);
return nil;
}
//
NSString *compressedString = [[NSString alloc] initWithData:compressedData encoding:NSUTF8StringEncoding];
return compressedString;
}
//- (NSDictionary *)toDictionary {
// NSMutableDictionary *dict = [NSMutableDictionary dictionary];
//
// if (self.data) {
// dict[@"data"] = self.data;
// }
// dict[@"first"] = @(self.first);
// dict[@"second"] = @(self.second);
// dict[@"isBroadcast"] = @(self.isBroadcast);
//
// return [dict copy];
//}
//
//- (NSString *)convertModelToJSONString:(AttachmentModel *)model {
// if (!model) {
// return nil;
// }
//
// //
// NSDictionary *modelDict = [model toDictionary];
//
// // JSON
// NSError *error;
// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:modelDict options:0 error:&error];
//
// if (error) {
// NSLog(@"JSON 序列化失败: %@", error.localizedDescription);
// return nil;
// }
//
// //
// return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
//}
//
//- (NSString *)compressJSONString:(NSString *)jsonString {
// if (!jsonString) return nil;
//
// // JSON
// NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
// NSError *error;
// id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
//
// if (error) {
// NSLog(@"JSON 解析错误: %@", error.localizedDescription);
// return nil;
// }
//
// // JSON
// NSData *compressedData = [NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:&error];
//
// if (error) {
// NSLog(@"JSON 序列化错误: %@", error.localizedDescription);
// return nil;
// }
//
// //
// NSString *compressedString = [[NSString alloc] initWithData:compressedData encoding:NSUTF8StringEncoding];
// return compressedString;
//}
@end

View File

@@ -0,0 +1,17 @@
//
// AgentMessageTableViewCell.h
// YuMi
//
// Created by P on 2025/2/20.
//
#import "MessageContentCustomView.h"
#import "UIView+NIM.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgentMessageTableViewCell : MessageContentCustomView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,167 @@
//
// AgentMessageTableViewCell.m
// YuMi
//
// Created by P on 2025/2/20.
//
#import "AgentMessageTableViewCell.h"
#import "AgentMessageModel.h"
@interface AgentMessageTableViewCell ()
@property(nonatomic, strong) UILabel *titleLabel;
@property(nonatomic, strong) UILabel *messageLabel;
@property(nonatomic, strong) UIButton *agreeButton;
@property(nonatomic, strong) UIButton *rejectButton;
@property(nonatomic, strong) UIStackView *stackView;
@end
@implementation AgentMessageTableViewCell
- (void)initSubViews {
[super initSubViews];
self.backView.backgroundColor = [UIColor whiteColor];
[self.backView addSubview:self.titleLabel];
[self.backView addSubview:self.messageLabel];
[self.backView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.rejectButton];
[self.stackView addArrangedSubview:self.agreeButton];
}
- (void)initSubViewConstraints {
[super initSubViewConstraints];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backView);
make.top.mas_equalTo(self.backView).mas_equalTo(10);
make.height.mas_equalTo(22);
}];
[self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self.backView);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_equalTo(10);
make.bottom.mas_equalTo(self.backView).offset(-40);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backView);
make.height.mas_equalTo(30);
make.bottom.mas_equalTo(-8);
}];
[self.rejectButton mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.width.mas_equalTo(94);
}];
[self.agreeButton mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.width.mas_equalTo(94);
}];
}
- (void)render:(MessageBaseModel *)message {
AgentMessageModel *model = (AgentMessageModel *)message;
switch (model.layoutType) {
case 1: {
self.agreeButton.hidden = NO;
self.rejectButton.hidden = NO;
}
break;
case 2: {
self.agreeButton.hidden = NO;
self.rejectButton.hidden = YES;
}
break;
case 3: {
self.agreeButton.hidden = YES;
self.rejectButton.hidden = NO;
}
break;
default:
break;
}
self.titleLabel.text = model.title;
self.messageLabel.text = model.content;
#if DEBUG
self.messageLabel.text = @"Agency member ID:10087 has applied to quit. Please review it within 24 hours. Otherwise, it will be resolved by the system within 24 hours.";
#endif
}
#pragma mark -
- (void)didTapAgree {
}
- (void)didTapReject {
}
#pragma mark -
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc]initWithFrame:CGRectZero];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2;
_titleLabel.textColor = UIColorFromRGB(0x313131);
_titleLabel.font = kFontSemibold(15);
}
return _titleLabel;
}
- (UILabel *)messageLabel {
if (!_messageLabel) {
_messageLabel = [[UILabel alloc]initWithFrame:CGRectZero];
_messageLabel.textAlignment = NSTextAlignmentCenter;
_messageLabel.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2;
_messageLabel.textColor = UIColorFromRGB(0x313131);
_messageLabel.font = kFontRegular(14);
_messageLabel.numberOfLines = 0;
}
return _messageLabel;
}
- (UIButton *)agreeButton {
if (!_agreeButton) {
_agreeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_agreeButton addGradientBackgroundWithColors:@[
UIColorFromRGB(0xE29030),
UIColorFromRGB(0xFCC074),
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:15];
[_agreeButton setTitle:YMLocalizedString(@"XPAnchorPKInviteView7") forState:UIControlStateNormal];
[_agreeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_agreeButton.titleLabel.font = kFontMedium(14);
[_agreeButton addTarget:self action:@selector(didTapAgree) forControlEvents:UIControlEventTouchUpInside];
}
return _agreeButton;
}
- (UIButton *)rejectButton {
if (!_rejectButton) {
_rejectButton = [UIButton buttonWithType:UIButtonTypeCustom];
_rejectButton.backgroundColor = UIColorFromRGB(0xEBEBEB);
[_rejectButton setCornerRadius:15];
[_rejectButton setTitle:YMLocalizedString(@"XPAnchorPKInviteView6") forState:UIControlStateNormal];
[_rejectButton setTitleColor:UIColorFromRGB(0x7b7b7d) forState:UIControlStateNormal];
_rejectButton.titleLabel.font = kFontMedium(14);
[_rejectButton addTarget:self action:@selector(didTapReject) forControlEvents:UIControlEventTouchUpInside];
}
return _rejectButton;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.spacing = 12;
}
return _stackView;
}
@end

View File

@@ -87,21 +87,6 @@
MessageTextClickModel * textModel = (MessageTextClickModel *)message;
_messageText.attributedText = textModel.attributedText;
_contentInfo = textModel.contentInfo;
// CGFloat oneHeight = [YMLocalizedString(@"MessageContentTweetView0") boundingRectWithSize:CGSizeMake(240, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin
// attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:16] color:[DJDKMIMOMColor mainTextColor]] context:nil].size.height + 2.5;
//
// CGFloat titleHeight = [textModel.attributedText.string boundingRectWithSize:CGSizeMake(240, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin
// attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:16] color:[DJDKMIMOMColor mainTextColor]] context:nil].size.height;
// if (titleHeight <= oneHeight * 2) {
// [self.messageText mas_updateConstraints:^(MASConstraintMaker *make) {
// make.height.mas_equalTo(titleHeight + 5);
// }];
// } else{
// [self.messageText mas_updateConstraints:^(MASConstraintMaker *make) {
// make.height.mas_equalTo(oneHeight * 2);
// }];
// }
}
- (NSDictionary<NSAttributedStringKey, id> *)messageTextAttibutes:(UIFont *)font color:(UIColor *)color {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];

View File

@@ -0,0 +1,34 @@
//
// AgentMessageModel.h
// YuMi
//
// Created by P on 2025/2/20.
//
#import "MessageBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgentTextStyleMessageModel: PIBaseModel
@property(nonatomic, copy) NSString *content;
@property(nonatomic, assign) NSInteger fontSize;
@property(nonatomic, copy) NSString *fontColor;
@property(nonatomic, assign) bool fontBold;
@end
@interface AgentMessageModel : MessageBaseModel
@property(nonatomic, copy) NSString *url;
@property(nonatomic, copy) NSString *title;
@property(nonatomic, copy) NSString *content;
@property(nonatomic, assign) NSInteger titleFontSize;
@property(nonatomic, assign) NSInteger contentFontSize;
@property(nonatomic, assign) NSInteger layoutType; // (0没有确定取消按钮,1,确定取消按钮,2,只有确定 3,只有取消)
@property(nonatomic, copy) NSArray <AgentTextStyleMessageModel *> *titleStyles;
@property(nonatomic, copy) NSArray <AgentTextStyleMessageModel *> *contentStyles;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,70 @@
//
// AgentMessageModel.m
// YuMi
//
// Created by P on 2025/2/20.
//
#import "AgentMessageModel.h"
#import "AttachmentModel.h"
@implementation AgentTextStyleMessageModel
@end
@implementation AgentMessageModel
- (instancetype)initWithMessage:(NIMMessage *)message {
if (self = [super init]) {
self.message = message;
self.isHiddenAvatar = NO;
self.messageType = SessionMessageType_Custom;
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
NSDictionary *data = attachment.data;
if (data) {
AgentMessageModel *model = [AgentMessageModel modelWithJSON:data];
//#if DEBUG
// model.url = @"/guildMember/quitAudit?uid\\u003d3456\\u0026";
//#endif
self.url = model.url;
self.title = model.title;
self.content = model.content;
self.titleFontSize = model.titleFontSize;
self.contentSize = model.contentSize;
self.layoutType = model.layoutType;
self.titleStyles = model.titleStyles;
self.contentStyles = model.contentStyles;
}
CGSize maxSize = CGSizeMake(260, CGFLOAT_MAX);
// 使 NSString boundingRectWithSize
CGRect textRect = [self.content boundingRectWithSize:maxSize
options:NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName: kFontRegular(14)}
context:nil];
CGFloat titleHeight = 30;
CGFloat contentHeight = textRect.size.height;
//#if DEBUG
// contentHeight = 150;
// self.layoutType = 2;
//#endif
CGFloat buttonHeight = self.layoutType == 0 ? 0 : 40;
self.height = titleHeight + contentHeight + buttonHeight + 20;
// TODO: API call
}
return self;
}
- (NSString *)cellContent:(MessageBaseModel *)model {
return @"AgentMessageTableViewCell";
}
@end

View File

@@ -80,6 +80,7 @@
#import "MessageGameOrderModel.h"
#import "VIPCenterViewController.h"
#import "XPSkillCardPlayerManager.h"
#import "AgentMessageModel.h"
@interface CheckLimitModel :PIBaseModel
@property (nonatomic, assign) BOOL chat;
@@ -170,9 +171,11 @@
}
- (void)headerRefresh {
@kWeakify(self);
if (self.messages.count > 0) {
MessageBaseModel * model = self.messages.firstObject;
[[[NIMSDK sharedSDK] conversationManager] messagesInSession:self.session message:model.message limit:20 completion:^(NSError * _Nullable error, NSArray<NIMMessage *> * _Nullable messages) {
@kStrongify(self);
[self.sessionTableView.mj_header endRefreshing];
if (error == nil && messages.count > 0) {
for (int i = ((int)messages.count -1); i >= 0; i--) {
@@ -193,6 +196,7 @@
}];
} else {
[[[NIMSDK sharedSDK] conversationManager] messagesInSession:self.session message:nil limit:20 completion:^(NSError * _Nullable error, NSArray<NIMMessage *> * _Nullable messages) {
@kStrongify(self);
[self.sessionTableView.mj_header endRefreshing];
if (error == nil) {
for (int i = 0; i < messages.count; i++) {
@@ -251,7 +255,17 @@
MessageBaseModel * model;
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_Gift && attachment.second == Custom_Message_Sub_Gift_Send) {
// if (attachment.first == CustomMessageType_System_message) {
// switch (attachment.second) {
// case Custom_Message_Sub_System_message:
// model = [[AgentMessageModel alloc] initWithMessage:message];
// break;
//
// default:
// break;
// }
// }
if (attachment.first == CustomMessageType_Gift && attachment.second == Custom_Message_Sub_Gift_Send) {
model = [[MessageGiftModel alloc] initWithMessage:message];
} else if(attachment.first == CustomMessageType_Secretary) {
model = [[MessageTextClickModel alloc] initWithMessage:message];

View File

@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
///是否已经喜欢了
@property (nonatomic,assign) BOOL isLike;
@property(nonatomic,assign) BOOL isPublicChatHall;
//@property(nonatomic,assign) BOOL isPublicChatHall;
///代理
@property (nonatomic,weak) id<SessionNavViewDelegate> delegate;
///是否在房间中

View File

@@ -51,12 +51,7 @@
}
return self;
}
- (void)setIsPublicChatHall:(BOOL)isPublicChatHall{
_isPublicChatHall = isPublicChatHall;
self.liveView.hidden = _isPublicChatHall;
self.reportButton.hidden = _isPublicChatHall;
self.likeButton.hidden = _isPublicChatHall;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
@@ -124,7 +119,7 @@
#pragma mark - Getters And Setters
- (void)setUserInfo:(UserInfoModel *)userInfo {
_userInfo = userInfo;
if (self.isPublicChatHall == YES){return;}
if (_userInfo) {
NSString * userId = [NSString stringWithFormat:@"%ld", userInfo.uid];
self.userId = userId;
@@ -138,11 +133,9 @@
}];
}
self.subTitleLabel.hidden = ![[NIMSDK sharedSDK].userManager isUserInBlackList:userId];
self.liveView.hidden = ([[NIMSDK sharedSDK].userManager isUserInBlackList:userId] || _userInfo.roomUid.length <= 0);
self.reportButton.hidden = [NIMMessageUtils isOfficalAccount:self.userId] || self.isInRoom;
self.subTitleLabel.hidden = ![[NIMSDK sharedSDK].userManager isUserInBlackList:userId];
self.liveView.hidden = ([[NIMSDK sharedSDK].userManager isUserInBlackList:userId] || _userInfo.roomUid.length <= 0);
self.reportButton.hidden = [NIMMessageUtils isOfficalAccount:self.userId] || self.isInRoom;
}
}
@@ -150,10 +143,8 @@
_title = title;
if (_title) {
NSString * nick = title;
if(self.isPublicChatHall == NO){
if (nick.length > 10 ) {
nick = [nick substringToIndex:10];
}
if (nick.length > 10 ) {
nick = [nick substringToIndex:10];
}
self.nickLabel.text = nick;
}

View File

@@ -54,8 +54,10 @@
NSString * uid = recent.session.sessionId;
if (uid > 0) {
NSArray * uids = @[uid];
@kWeakify(self);
[[NIMSDK sharedSDK].userManager fetchUserInfos:uids completion:^(NSArray<NIMUser *> * _Nullable users, NSError * _Nullable error) {
if (error == nil) {
@kStrongify(self);
NIMUser * userInfo = users.firstObject;
self.nameLabel.text = userInfo.userInfo.nickName;
NSString *avatarUrl = userInfo.userInfo.avatarUrl;

View File

@@ -9,6 +9,47 @@
NS_ASSUME_NONNULL_BEGIN
@interface DiamondGiveHistoryVo : PIBaseModel
@property(nonatomic, copy) NSString *id;
@property(nonatomic, assign) NSInteger fromUid;
@property(nonatomic, assign) NSInteger targetUid;
@property(nonatomic, assign) NSInteger targetErbanNo;
@property(nonatomic, assign) NSInteger readDiamondNum;
@property(nonatomic, copy) NSString *createTimeStr;
@property(nonatomic, copy) NSString *targetNick;
@property(nonatomic, copy) NSString *targetAvatar;
@property(nonatomic, assign) NSInteger diamondNum;
@property(nonatomic, assign) NSTimeInterval createTime;
@end
@interface DiamondHistoryModel : PIBaseModel
@property(nonatomic, assign) NSInteger totalGiveGold;
@property(nonatomic, assign) NSInteger totalGiveGoldUsd;
@property(nonatomic, copy) NSString *cycleDateStr;
@property(nonatomic, copy) NSArray <DiamondGiveHistoryVo *>* diamondGiveHistoryVoList;
@end
@interface SubRechargeUserModel : PIBaseModel
@property(nonatomic, copy) NSString *id;
@property(nonatomic, assign) NSInteger uid;
@property(nonatomic, assign) NSInteger manageUid;
@property(nonatomic, assign) NSInteger starLevel;
@property(nonatomic, assign) BOOL hasCharge;
@property(nonatomic, copy) NSString *erbanNo;
@property(nonatomic, copy) NSString *nick;
@property(nonatomic, copy) NSString *avatar;
@property(nonatomic, assign) BOOL isOnline;
@property(nonatomic, assign) NSInteger seq;
@property(nonatomic, assign) NSInteger starLevelSeq;
@property(nonatomic, assign) CGFloat totalGiveGoldUsd; //薪资
@property(nonatomic, assign) CGFloat totalGiveGold; //转赠金币
@end
@interface RechargeUserModel : PIBaseModel
@property(nonatomic, copy) NSString *avatar;
@@ -21,6 +62,9 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, assign) NSInteger starLevel;
@property(nonatomic, assign) NSInteger type;
@property(nonatomic, assign) NSInteger uid;
@property(nonatomic, assign) CGFloat totalGiveGoldUsd; //薪资
@property(nonatomic, assign) CGFloat totalGiveGold; //转赠金币
@property(nonatomic, assign) NSInteger subNum;
+ (RechargeUserModel *)testModel;

View File

@@ -7,6 +7,25 @@
#import "RechargeUserModel.h"
@implementation DiamondGiveHistoryVo
@end
@implementation DiamondHistoryModel
+ (NSDictionary *)objectClassInArray{
return @{
@"diamondGiveHistoryVoList":DiamondGiveHistoryVo.class
};
}
@end
@implementation SubRechargeUserModel
@end
@implementation RechargeUserModel
+ (RechargeUserModel *)testModel {

View File

@@ -46,6 +46,23 @@ NS_ASSUME_NONNULL_BEGIN
+(void)rechargeUserInfo:(HttpRequestHelperCompletion)completion;
/// 子代理接口
+(void)subrechargeListInfo:(HttpRequestHelperCompletion)completion;
/// 用户转增历史
/// - Parameters:
/// - completion: completion description
/// - periodType: 1-当前周期2-上个周期
/// - pageSize: 页内容数量
/// - pageNo: 页数
/// - type: 1-金币转赠历史2-代发薪资历史
+(void)transferDiamondHistory:(HttpRequestHelperCompletion)completion
periodType:(NSInteger)periodType
pageSize:(NSInteger)pageSize
pageNo:(NSInteger)pageNo
type:(NSInteger)type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -28,4 +28,18 @@
+(void)rechargeUserInfo:(HttpRequestHelperCompletion)completion {
[self makeRequest:@"recharge/user/info" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
+(void)subrechargeListInfo:(HttpRequestHelperCompletion)completion {
[self makeRequest:@"recharge/user/subList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
+(void)transferDiamondHistory:(HttpRequestHelperCompletion)completion
periodType:(NSInteger)periodType
pageSize:(NSInteger)pageSize
pageNo:(NSInteger)pageNo
type:(NSInteger)type {
[self makeRequest:@"user/diamond/history" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, @(periodType), @(pageSize), @(pageNo), @(type), nil];
}
@end

View File

@@ -28,6 +28,19 @@ NS_ASSUME_NONNULL_BEGIN
///充值代理信息
- (void)rechargeUserInfo;
- (void)subrechargeInfoList;
/// yonghu1
/// - Parameters:
/// - periodType: 1: 当前周期2: 上个周期
/// - page: 页数
/// - type: 1-金币转赠历史2-代发薪资历史
- (void)userTransferHistory:(NSInteger)periodType
page:(NSInteger)page
type:(NSInteger)type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -30,7 +30,9 @@
-(void)getGiveDiamondRecord{
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
@kWeakify(self);
[Api getGiveDiamondList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
NSArray * array = [XPMineGiveDiamondModel modelsWithArray:data.data];
[[self getView] getGiveDiamondListSuccess:array];
}] ticket:ticket uid:uid pageNum:@"1" pageSize:@"100"];
@@ -101,6 +103,31 @@
} showLoading:YES errorToast:YES]];
}
- (void)subrechargeInfoList {
@kWeakify(self);
[Api subrechargeListInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
if ([[self getView] respondsToSelector:@selector(loadSubRechargerInfoSuccess:)]) {
[[self getView] loadSubRechargerInfoSuccess:[SubRechargeUserModel modelsWithArray:data.data]];
}
} fail:^(NSInteger code, NSString * _Nullable msg) {
} showLoading:YES errorToast:YES]];
}
- (void)userTransferHistory:(NSInteger)periodType page:(NSInteger)page type:(NSInteger)type{
@kWeakify(self);
[Api transferDiamondHistory:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
if ([[self getView] respondsToSelector:@selector(loadTransferHistorySuccess:)]) {
[[self getView] loadTransferHistorySuccess:[DiamondHistoryModel modelWithJSON:data.data]];
}
} fail:^(NSInteger code, NSString * _Nullable msg) {
} showLoading:YES errorToast:YES] periodType:periodType pageSize:20 pageNo:page type:type];
}
@end

View File

@@ -6,7 +6,7 @@
//
#import <Foundation/Foundation.h>
@class WalletInfoModel,XPMineGiveDiamondSearchModel,XPMineGiveDiamondDetailsModel,GiftInfoModel, RechargeUserModel;
@class WalletInfoModel,XPMineGiveDiamondSearchModel,XPMineGiveDiamondDetailsModel,GiftInfoModel, RechargeUserModel, SubRechargeUserModel, DiamondHistoryModel;
NS_ASSUME_NONNULL_BEGIN
@protocol XPMineGiveDiamondProtocol <NSObject>
@@ -40,6 +40,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)loadRechargeUserSuccess:(RechargeUserModel *)userModel;
- (void)loadSubRechargerInfoSuccess:(NSArray <SubRechargeUserModel *>*)infos;
- (void)loadTransferHistorySuccess:(DiamondHistoryModel *)infos;
@end
NS_ASSUME_NONNULL_END

View File

@@ -378,7 +378,7 @@
NetImageConfig *config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_headView = [[NetImageView alloc]initWithConfig:config];
_headView.layer.cornerRadius = kGetScaleWidth(25);
_headView.layer.cornerRadius = kGetScaleWidth(59/2);
_headView.layer.masksToBounds = YES;
}
return _headView;

View File

@@ -12,6 +12,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPMineGiveDiamondCell : UITableViewCell
@property (nonatomic,strong) XPMineGiveDiamondModel *giveDiamondModel;
@property(nonatomic, copy) void(^handleTapTransfer)(XPMineGiveDiamondModel *giveDiamondModel);
@property(nonatomic, copy) void(^handleTapHistory)(XPMineGiveDiamondModel *giveDiamondModel);
@end
NS_ASSUME_NONNULL_END

View File

@@ -18,7 +18,8 @@
/// id
@property (nonatomic,strong) UILabel * IdTitleView;
@property (nonatomic,strong) UIImageView *arrowView;
@property(nonatomic, strong) UIButton *transferButton;
@property(nonatomic, strong) UIButton *historyButton;
@end
@@ -40,10 +41,11 @@
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = 0;
[self addSubview:self.headView];
[self addSubview:self.titleView];
[self addSubview:self.IdTitleView];
[self addSubview:self.arrowView];
[self.contentView addSubview:self.headView];
[self.contentView addSubview:self.titleView];
[self.contentView addSubview:self.IdTitleView];
[self.contentView addSubview:self.transferButton];
[self.contentView addSubview:self.historyButton];
}
- (void)initSubViewConstraints {
@@ -57,7 +59,7 @@
make.leading.equalTo(self.headView.mas_trailing).mas_offset( kGetScaleWidth(10));
make.height.mas_equalTo(kGetScaleWidth(17));
make.top.equalTo(self.headView.mas_top).mas_offset(kGetScaleWidth(8));
make.trailing.mas_equalTo(-kGetScaleWidth(15));
make.trailing.mas_equalTo(self.transferButton.mas_leading).offset(-4);
}];
[self.IdTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -66,22 +68,33 @@
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(4));
}];
[self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(20));
make.centerY.equalTo(self);
make.trailing.mas_equalTo(-kGetScaleWidth(15));
[self.historyButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.equalTo(self).offset(-15);
make.height.mas_equalTo(30);
make.width.mas_equalTo(68);
make.centerY.equalTo(self.headView);
}];
UIView *line = [[UIView alloc] init];
line.backgroundColor = UIColorFromRGB(0xe4e4e4);
[self addSubview: line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self);
make.leading.mas_equalTo(self.headView);
make.trailing.mas_equalTo(self.arrowView);
make.height.mas_equalTo(0.5);
[self.transferButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.equalTo(self.historyButton.mas_leading).offset(-10);
make.height.mas_equalTo(30);
make.width.mas_equalTo(68);
make.centerY.equalTo(self.headView);
}];
}
- (void)didTapTransfer {
if (_handleTapTransfer) {
self.handleTapTransfer(self.giveDiamondModel);
}
}
- (void)didTapHistory {
if (_handleTapHistory) {
self.handleTapHistory(self.giveDiamondModel);
}
}
#pragma mark -
- (NetImageView *)headView{
if (!_headView){
@@ -109,12 +122,31 @@
}
return _IdTitleView;
}
- (UIImageView *)arrowView{
if (!_arrowView){
_arrowView = [UIImageView new];
_arrowView.image = [[UIImage imageNamed:@"grey_right_arrow"] ms_SetImageForRTL];
- (UIButton *)transferButton {
if (!_transferButton) {
_transferButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_transferButton.titleLabel setFont:kFontMedium(13)];
[_transferButton setTitle:YMLocalizedString(@"1.0.37_text_46") forState:UIControlStateNormal];
[_transferButton setTitleColor:UIColorFromRGB(0xCD6300) forState:UIControlStateNormal];
[_transferButton setBackgroundColor:UIColorFromRGB(0xFFEFDC)];
[_transferButton addTarget:self action:@selector(didTapTransfer) forControlEvents:UIControlEventTouchUpInside];
[_transferButton setCornerRadius:15];
}
return _arrowView;
return _transferButton;
}
- (UIButton *)historyButton {
if (!_historyButton) {
_historyButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_historyButton.titleLabel setFont:kFontMedium(13)];
[_historyButton setTitle:YMLocalizedString(@"1.0.37_text_47") forState:UIControlStateNormal];
[_historyButton setTitleColor:UIColorFromRGB(0x3b70c8) forState:UIControlStateNormal];
[_historyButton setBackgroundColor:UIColorFromRGB(0xe4eeff)];
[_historyButton addTarget:self action:@selector(didTapHistory) forControlEvents:UIControlEventTouchUpInside];
[_historyButton setCornerRadius:15];
}
return _historyButton;
}
@end

View File

@@ -8,18 +8,23 @@
#import "XPMineGiveDiamondDetailsCell.h"
#import "NetImageView.h"
#import "NSDate+DateUtils.h"
#import "MoliMoneyLabel.h"
@interface XPMineGiveDiamondDetailsCell()
////
@property (nonatomic,strong) NetImageView * avatarImageView;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UILabel *timeLabel;
@property (nonatomic,strong) UILabel *timeLabel;
///
@property (nonatomic,strong) UILabel *contentLabel;
///
@property (nonatomic,strong) UILabel *spendingView;
@property (nonatomic,strong) UILabel *idLabel;
@property(nonatomic, strong) MoliMoneyLabel *moneyLabel;
@end
@implementation XPMineGiveDiamondDetailsCell
@@ -41,6 +46,8 @@
[self.contentView addSubview:self.timeLabel];
[self.contentView addSubview:self.contentLabel];
[self.contentView addSubview:self.spendingView];
[self.contentView addSubview:self.moneyLabel];
[self.contentView addSubview:self.idLabel];
}
- (void)initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -52,19 +59,13 @@
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(65));
make.top.mas_equalTo(self.avatarImageView).offset(3);
make.trailing.equalTo(self.timeLabel.mas_leading).mas_offset(-kGetScaleWidth(10));
}];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(15));
make.centerY.equalTo(self.contentLabel);
}];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.avatarImageView.mas_top).mas_offset(3);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10);
make.height.mas_equalTo(kGetScaleWidth(21));
make.trailing.equalTo(self.timeLabel.mas_leading).mas_offset(-kGetScaleWidth(10));
make.trailing.equalTo(self.moneyLabel.mas_leading).mas_offset(-10);
}];
[self.spendingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self.contentLabel);
@@ -73,15 +74,23 @@
make.height.mas_equalTo(kGetScaleWidth(14));
}];
UIView *line = [[UIView alloc] init];
line.backgroundColor = UIColorFromRGB(0xe4e4e4);
[self addSubview: line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self);
make.leading.mas_equalTo(self.avatarImageView);
make.trailing.mas_equalTo(self.timeLabel);
make.height.mas_equalTo(0.5);
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.contentLabel);
make.top.mas_equalTo(self.contentLabel.mas_bottom).offset(3);
make.height.mas_equalTo(20);
}];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-15);
make.top.mas_equalTo(self.titleLabel);
make.height.mas_equalTo(22);
make.width.mas_greaterThanOrEqualTo(30);
}];
// label label
[self.moneyLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[self.titleLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal];
}
#pragma mark -
- (void)setModel:(XPMineGiveDiamondDetailsModel *)model{
@@ -97,17 +106,25 @@
if(self.model.type.intValue == 0){
//
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(15));
make.bottom.equalTo(self.contentView).offset(-15);
}];
self.moneyLabel.hidden = NO;
self.titleLabel.hidden = YES;
self.contentLabel.hidden = NO;
self.spendingView.hidden = NO;
self.idLabel.hidden = NO;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", self.model.targetUid];
self.avatarImageView.image = [UIImage imageNamed:@"moli_money_icon"];
self.avatarImageView.imageUrl = self.model.targetAvatar;
self.contentLabel.text = self.model.targetNick;
self.timeLabel.text = [NSDate timestampSwitchTime:self.model.createTime/1000 andFormatter:@"yyyy-MM-dd HH:mm:ss"];
NSString *realDiamondNum = [NSString stringWithFormat:@"%.2f",self.model.realDiamondNum];
self.spendingView.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineGiveDiamondDetailsCell0"),realDiamondNum];
[self.moneyLabel updateContent:[NSString stringWithFormat:@"-%@", self.model.diamondNum]];
} else {
//
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(15));
make.centerY.equalTo(self.contentLabel);
}];
self.avatarImageView.image = [UIImageConstant defaultAvatarPlaceholder];
self.avatarImageView.imageUrl = self.model.giftUrl;
self.titleLabel.text = [NSString stringWithFormat:@"%@ x%@",self.model.giftName,self.model.giftNum];
@@ -125,7 +142,7 @@
_avatarImageView.backgroundColor = UIColorFromRGB(0xF3F5FA);
_avatarImageView.layer.cornerRadius = kGetScaleWidth(49)/2;
_avatarImageView.clipsToBounds = YES;
_avatarImageView.contentMode = UIViewContentModeScaleAspectFit;
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _avatarImageView;
}
@@ -170,4 +187,23 @@
return _spendingView;
}
- (MoliMoneyLabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0xFF8C03)
font:kFontSemibold(16)
moneyPostion:2
moneySize:CGSizeMake(22, 22)];
_moneyLabel.hidden = YES;
}
return _moneyLabel;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x7b7b7d)];
_idLabel.hidden = YES;
}
return _idLabel;
}
@end

View File

@@ -72,7 +72,8 @@
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.separatorInset = UIEdgeInsetsMake(0, 15, 0, 15);
_tableView.separatorColor = UIColorFromRGB(0xf7f7f7);
_tableView.backgroundColor = [UIColor clearColor];
[_tableView registerClass:[XPMineGiveDiamondDetailsCell class] forCellReuseIdentifier:NSStringFromClass([XPMineGiveDiamondDetailsCell class])];
[_tableView registerClass:[XPMineFriendEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];

View File

@@ -0,0 +1,18 @@
//
// RechargerTransferHistoryViewController.h
// YuMi
//
// Created by P on 2025/2/25.
//
#import "MvpViewController.h"
@class UserInfoModel;
NS_ASSUME_NONNULL_BEGIN
@interface RechargerTransferHistoryViewController : MvpViewController
- (instancetype)initWithUserInfo:(UserInfoModel *)userInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,538 @@
//
// RechargerTransferHistoryViewController.m
// YuMi
//
// Created by P on 2025/2/25.
//
#import "RechargerTransferHistoryViewController.h"
#import "MoliMoneyLabel.h"
#import "UserInfoModel.h"
#import "RechargeUserModel.h"
#import "XPMineGiveDiamondPresenter.h"
#import "XPMineGiveDiamondProtocol.h"
@interface RechargerTransferHistoryCell : UITableViewCell
@property(nonatomic, strong) NetImageView *avatarImageView;
@property(nonatomic, strong) UILabel *nameLabel;
@property(nonatomic, strong) UILabel *idLabel;
@property(nonatomic, strong) MoliMoneyLabel *moneyLabel;
@property(nonatomic, strong) UILabel *timeLabel;
@property(nonatomic, strong) DiamondGiveHistoryVo *cellModel;
@property(nonatomic, strong) UILabel *settlementLabel;
@property(nonatomic, assign) BOOL isArabia;
@end
@implementation RechargerTransferHistoryCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = [UIColor whiteColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.avatarImageView];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.contentView);
make.leading.mas_equalTo(16);
make.size.mas_equalTo(49);
}];
[self.contentView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.avatarImageView.mas_top).offset(3);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(11);
make.height.mas_equalTo(18);
}];
[self.contentView addSubview:self.idLabel];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView).offset(-12);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(11);
make.height.mas_equalTo(18);
}];
[self.contentView addSubview:self.moneyLabel];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.nameLabel);
make.trailing.mas_equalTo(self.contentView).offset(-16);
make.height.mas_equalTo(22);
make.width.mas_greaterThanOrEqualTo(30);
}];
[self.contentView addSubview:self.settlementLabel];
[self.settlementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.moneyLabel);
make.trailing.mas_equalTo(self.moneyLabel.mas_leading).offset(-4);
make.height.mas_equalTo(18);
}];
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.moneyLabel.mas_bottom).offset(8);
make.trailing.mas_equalTo(self.moneyLabel);
make.height.mas_equalTo(18);
}];
// label label
[self.moneyLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[self.settlementLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal];
}
return self;
}
- (void)setIsArabia:(BOOL)isArabia {
_isArabia = isArabia;
}
- (void)updateCellModel:(DiamondGiveHistoryVo *)cellModel isDisplayÜS:(BOOL)isDisplayÜS {
_cellModel = cellModel;
self.avatarImageView.imageUrl = cellModel.targetAvatar;
self.nameLabel.text = cellModel.targetNick;
self.idLabel.text = [NSString stringWithFormat:@"ID: %@", @(cellModel.targetUid)];
[self.moneyLabel updateContent: [NSString stringWithFormat:@"%@", @(cellModel.diamondNum)]];
self.timeLabel.text = cellModel.createTimeStr;
if (self.isArabia) {
// self.settlementLabel.text = [NSString stringWithFormat:YMLocalizedString(@"1.0.37_text_48"), cellModel.];
if (isDisplayÜS) {
[self.moneyLabel updateFont:kFontRegular(12) size:CGSizeMake(13, 13)];
} else {
[self.moneyLabel updateFont:kFontSemibold(16) size:CGSizeMake(22, 22)];
}
}
}
#pragma mark -
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
_avatarImageView = [[NetImageView alloc] init];
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
[_avatarImageView setCornerRadius:kGetScaleWidth(49/2)];
}
return _avatarImageView;
}
- (UILabel *)nameLabel {
if (!_nameLabel) {
_nameLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(15) textColor:UIColorFromRGB(0x313131)];
}
return _nameLabel;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x7b7b7d)];
}
return _idLabel;
}
- (MoliMoneyLabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0xFF8C03) font:kFontSemibold(16) moneyPostion:2 moneySize:CGSizeMake(22, 22)];
}
return _moneyLabel;
}
- (UILabel *)timeLabel {
if (!_timeLabel) {
_timeLabel = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x7b7b7d)];
}
return _timeLabel;
}
- (UILabel *)settlementLabel {
if (!_settlementLabel) {
_settlementLabel = [UILabel labelInitWithText:@"" font:kFontMedium(13) textColor:UIColorFromRGB(0x313131)];
}
return _settlementLabel;
}
@end
@interface RechargerTransferHistoryViewController () <UITableViewDelegate, UITableViewDataSource>
@property(nonatomic, strong) UserInfoModel *userInfo;
@property(nonatomic, strong) UIButton *thisCycleButton;
@property(nonatomic, strong) UIButton *lastCycleButton;
@property(nonatomic, strong) UIView *topSelectedTab;
@property(nonatomic, strong) UILabel *durationsLabel;
@property(nonatomic, strong) UIButton *ÜSSettlementButton;
@property(nonatomic, strong) UIButton *transferCoinsButton;
@property(nonatomic, strong) UILabel *totalAmountTitleLabel;
@property(nonatomic, strong) UILabel *amountLabel;
@property(nonatomic, strong) MoliMoneyLabel *moliAmountLabel;
@property(nonatomic, strong) UITableView *historyTableView;
@property(nonatomic, assign) NSInteger periodType; // 1: this, 2: last
@property(nonatomic, assign) NSInteger transferType; // 1-2-
//@property(nonatomic, strong) NSMutableArray */*dataSource*/;
@property(nonatomic, strong) DiamondHistoryModel *dataSourceModel;
@property(nonatomic, copy) NSArray *sectionTitles;
@property(nonatomic, copy) NSArray *sectionData;
@property(nonatomic, strong) NSMutableArray *originalDiamondGiveHistoryVoList;
@property(nonatomic, assign) NSInteger page;
@end
@implementation RechargerTransferHistoryViewController
- (XPMineGiveDiamondPresenter *)createPresenter {
return [[XPMineGiveDiamondPresenter alloc] init];
}
- (instancetype)initWithUserInfo:(UserInfoModel *)userInfo {
if (self = [super init]) {
self.userInfo = userInfo;
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.page = 1;
self.periodType = 1;
self.transferType = 1;
self.title = YMLocalizedString(@"1.0.37_text_41");
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.thisCycleButton];
[self.view addSubview:self.lastCycleButton];
[self.thisCycleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(8);
make.leading.mas_equalTo(16);
make.height.mas_equalTo(24);
}];
[self.lastCycleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(8);
make.leading.mas_equalTo(self.thisCycleButton.mas_trailing).offset(30);
make.height.mas_equalTo(24);
}];
[self.view addSubview:self.durationsLabel];
[self.durationsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.thisCycleButton.mas_bottom).offset(21);
make.leading.mas_equalTo(self.thisCycleButton);
make.height.mas_equalTo(18);
}];
if ([self.userInfo isArabia]) {
self.transferType = 2;
[self.moliAmountLabel displayIcon:NO];
self.ÜSSettlementButton.selected = YES;
self.transferCoinsButton.selected = NO;
UIStackView *stack = [[UIStackView alloc] initWithArrangedSubviews:@[
self.ÜSSettlementButton,
self.transferCoinsButton
]];
stack.backgroundColor = UIColorFromRGB(0xf7f7f7);
[stack setCornerRadius:16];
[self.view addSubview:stack];
[stack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.durationsLabel.mas_bottom).offset(13);
make.leading.trailing.mas_equalTo(self.view).inset(16);
make.height.mas_equalTo(32);
}];
[self.ÜSSettlementButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(stack.mas_width).multipliedBy(0.5);
make.height.mas_equalTo(stack.mas_height);
}];
[self.transferCoinsButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(stack.mas_width).multipliedBy(0.5);
make.height.mas_equalTo(stack.mas_height);
}];
}
[self.view addSubview:self.totalAmountTitleLabel];
[self.totalAmountTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.durationsLabel.mas_bottom).offset([self.userInfo isArabia] ? 56 : 12);
make.leading.mas_equalTo(self.durationsLabel);
make.height.mas_equalTo(22);
}];
[self.view addSubview:self.moliAmountLabel];
[self.moliAmountLabel updateContent:@""];
[self.moliAmountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.totalAmountTitleLabel.mas_bottom).offset(9);
make.leading.mas_equalTo(self.totalAmountTitleLabel);
}];
[self.view addSubview:self.historyTableView];
[self.historyTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.moliAmountLabel.mas_bottom).offset(16);
make.bottom.mas_equalTo(self.view).offset(-kSafeAreaBottomHeight);
make.leading.trailing.mas_equalTo(self.view);
}];
[self reloadAPI];
}
- (void)reloadAPI {
[self.presenter userTransferHistory:self.periodType page:self.page type:self.transferType];
}
#pragma mark -
- (void)didTapThisCycle {
if (self.thisCycleButton.isSelected) {
return;
}
self.thisCycleButton.selected = YES;
self.lastCycleButton.selected = NO;
self.page = 1;
self.periodType = 1;
[self reloadAPI];
}
- (void)didTapLastCycle {
if (self.lastCycleButton.isSelected) {
return;
}
self.thisCycleButton.selected = NO;
self.lastCycleButton.selected = YES;
self.page = 1;
self.periodType = 2;
[self reloadAPI];
}
- (void)didTapÜSSettlement {
if (self.ÜSSettlementButton.isSelected) {
return;
}
self.ÜSSettlementButton.selected = YES;
self.transferCoinsButton.selected = NO;
[self.moliAmountLabel displayIcon:NO];
self.page = 1;
self.transferType = 2;
[self reloadAPI];
}
- (void)didTapTransferCoins {
if (self.transferCoinsButton.isSelected) {
return;
}
self.ÜSSettlementButton.selected = NO;
self.transferCoinsButton.selected = YES;
[self.moliAmountLabel displayIcon:YES];
self.page = 1;
self.transferType = 1;
[self reloadAPI];
}
- (void)footerRefresh {
self.page++;
[self reloadAPI];
}
#pragma mark -
- (void)loadTransferHistorySuccess:(DiamondHistoryModel *)infos {
self.dataSourceModel = infos;
self.durationsLabel.text = infos.cycleDateStr;
if ([self.userInfo isArabia] && self.transferType == 2) {
[self.moliAmountLabel updateContent:[NSString stringWithFormat:YMLocalizedString(@"1.0.37_text_49"), @(infos.totalGiveGoldUsd)]];
} else {
[self.moliAmountLabel updateContent:@(infos.totalGiveGold).stringValue];
}
if (self.page == 1) {
self.originalDiamondGiveHistoryVoList = @[].mutableCopy;
} else {
[self.historyTableView.mj_footer endRefreshing];
}
if (infos.diamondGiveHistoryVoList.count == 0) {
[self.historyTableView.mj_footer endRefreshingWithNoMoreData];
if (self.page > 1) {
return;
}
}
[self.originalDiamondGiveHistoryVoList addObjectsFromArray:infos.diamondGiveHistoryVoList];
// Step 1:
NSMutableDictionary<NSString *, NSMutableArray *> *groupedData = [NSMutableDictionary dictionary];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd";
for (DiamondGiveHistoryVo *history in self.originalDiamondGiveHistoryVoList) {
// createTime NSDate
NSDate *date = [NSDate dateWithTimeIntervalSince1970:history.createTime/1000];
NSString *dateString = [dateFormatter stringFromDate:date];
//
if (!groupedData[dateString]) {
groupedData[dateString] = [NSMutableArray array];
}
[groupedData[dateString] addObject:history];
}
// Step 2: tableView 使
self.sectionTitles = [groupedData allKeys];
self.sectionData = [groupedData allValues];
// tableView
[self.historyTableView reloadData];
}
#pragma mark -
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.sectionTitles.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.sectionData[section] count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 38;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 38)];
container.backgroundColor = UIColorFromRGB(0xf4f4f4);
UILabel *label = [UILabel labelInitWithText:self.sectionTitles[section]
font:kFontMedium(14)
textColor:UIColorFromRGB(0x313131)];
[container addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(container);
make.leading.mas_equalTo(15);
make.height.mas_equalTo(20);
}];
return container;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 72;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
RechargerTransferHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RechargerTransferHistoryCell" forIndexPath:indexPath];
cell.isArabia = [self.userInfo isArabia];
DiamondGiveHistoryVo *history = self.sectionData[indexPath.section][indexPath.row];
[cell updateCellModel:history isDisplayÜS:self.transferType == 2];
return cell;
}
#pragma mark -
- (UIButton *)thisCycleButton {
if (!_thisCycleButton) {
_thisCycleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_thisCycleButton.titleLabel setFont:kFontMedium(16)];
[_thisCycleButton setTitle:YMLocalizedString(@"1.0.37_text_42") forState:UIControlStateNormal];
[_thisCycleButton setTitle:YMLocalizedString(@"1.0.37_text_42") forState:UIControlStateSelected];
[_thisCycleButton setTitleColor:UIColorFromRGB(0x313131) forState:UIControlStateSelected];
[_thisCycleButton setTitleColor:UIColorFromRGB(0xafb1b3) forState:UIControlStateNormal];
[_thisCycleButton addTarget:self action:@selector(didTapThisCycle) forControlEvents:UIControlEventTouchUpInside];
[_thisCycleButton setSelected:YES];
}
return _thisCycleButton;
}
- (UIButton *)lastCycleButton {
if (!_lastCycleButton) {
_lastCycleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_lastCycleButton.titleLabel setFont:kFontMedium(16)];
[_lastCycleButton setTitle:YMLocalizedString(@"1.0.37_text_43") forState:UIControlStateNormal];
[_lastCycleButton setTitle:YMLocalizedString(@"1.0.37_text_43") forState:UIControlStateSelected];
[_lastCycleButton setTitleColor:UIColorFromRGB(0x313131) forState:UIControlStateSelected];
[_lastCycleButton setTitleColor:UIColorFromRGB(0xafb1b3) forState:UIControlStateNormal];
[_lastCycleButton addTarget:self action:@selector(didTapLastCycle) forControlEvents:UIControlEventTouchUpInside];
}
return _lastCycleButton;
}
- (UILabel *)durationsLabel {
if (!_durationsLabel) {
_durationsLabel = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:UIColorFromRGB(0x7b7b7d)];
}
return _durationsLabel;
}
- (UIButton *)ÜSSettlementButton {
if (!_ÜSSettlementButton) {
_ÜSSettlementButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_ÜSSettlementButton.titleLabel setFont:kFontMedium(13)];
[_ÜSSettlementButton setTitle:YMLocalizedString(@"1.0.37_text_38") forState:UIControlStateNormal];
[_ÜSSettlementButton setTitleColor:UIColorFromRGB(0xafb1b3) forState:UIControlStateNormal];
[_ÜSSettlementButton setTitleColor:UIColorFromRGB(0xffffff) forState:UIControlStateSelected];
[_ÜSSettlementButton setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forState:UIControlStateNormal];
[_ÜSSettlementButton setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0xff8c03)] forState:UIControlStateSelected];
[_ÜSSettlementButton setCornerRadius:16];
[_ÜSSettlementButton addTarget:self action:@selector(didTapÜSSettlement) forControlEvents:UIControlEventTouchUpInside];
[_ÜSSettlementButton setSelected:YES];
}
return _ÜSSettlementButton;
}
- (UIButton *)transferCoinsButton {
if (!_transferCoinsButton) {
_transferCoinsButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_transferCoinsButton.titleLabel setFont:kFontMedium(13)];
[_transferCoinsButton setTitle:YMLocalizedString(@"1.0.37_text_34") forState:UIControlStateNormal];
[_transferCoinsButton setTitleColor:UIColorFromRGB(0xafb1b3) forState:UIControlStateNormal];
[_transferCoinsButton setTitleColor:UIColorFromRGB(0xffffff) forState:UIControlStateSelected];
[_transferCoinsButton setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forState:UIControlStateNormal];
[_transferCoinsButton setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0xff8c03)] forState:UIControlStateSelected];
[_transferCoinsButton setCornerRadius:16];
[_transferCoinsButton addTarget:self action:@selector(didTapTransferCoins) forControlEvents:UIControlEventTouchUpInside];
}
return _transferCoinsButton;
}
- (UILabel *)totalAmountTitleLabel {
if (!_totalAmountTitleLabel) {
_totalAmountTitleLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.37_text_44")
font:kFontMedium(14)
textColor:UIColorFromRGB(0x313131)];
}
return _totalAmountTitleLabel;
}
- (UILabel *)amountLabel {
if (!_amountLabel) {
_amountLabel = [UILabel labelInitWithText:@""
font:kFontSemibold(26)
textColor:UIColorFromRGB(0xFF8C03)];
}
return _amountLabel;
}
- (MoliMoneyLabel *)moliAmountLabel {
if (!_moliAmountLabel) {
_moliAmountLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0xFF8C03)
font:kFontSemibold(26)
moneyPostion:2
moneySize:CGSizeMake(30, 30)];
}
return _moliAmountLabel;
}
- (UITableView *)historyTableView {
if (!_historyTableView) {
_historyTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_historyTableView.delegate = self;
_historyTableView.dataSource = self;
_historyTableView.separatorColor = UIColorFromRGB(0xf4f4f4);
_historyTableView.separatorInset = UIEdgeInsetsMake(0, 15, 0, 15);
_historyTableView.backgroundColor = [UIColor clearColor];
_historyTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
_historyTableView.contentInset = UIEdgeInsetsZero;
[_historyTableView registerClass:[RechargerTransferHistoryCell class] forCellReuseIdentifier:@"RechargerTransferHistoryCell"];
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
_historyTableView.mj_footer = footer;
}
return _historyTableView;
}
@end

View File

@@ -0,0 +1,16 @@
//
// SubRechargersViewController.h
// YuMi
//
// Created by P on 2025/2/25.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SubRechargersViewController : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,323 @@
//
// SubRechargersViewController.m
// YuMi
//
// Created by P on 2025/2/25.
//
#import "SubRechargersViewController.h"
#import "XPMineGiveDiamondPresenter.h"
#import "RechargeUserModel.h"
#import "MoliMoneyLabel.h"
@interface SubRechargersCell : UITableViewCell
@property(nonatomic, strong) SubRechargeUserModel *cellModel;
@property(nonatomic, strong) NetImageView *avatarImageView;
@property(nonatomic, strong) UILabel *nameLabel;
@property(nonatomic, strong) UILabel *idLabel;
@property(nonatomic, strong) UIStackView *starsStack;
@property(nonatomic, strong) UIButton *star_1;
@property(nonatomic, strong) UIButton *star_2;
@property(nonatomic, strong) UIButton *star_3;
@property(nonatomic, strong) UIButton *star_4;
@property(nonatomic, strong) UIButton *star_5;
@property(nonatomic, strong) UILabel *lastTransferDateLabel;
@property(nonatomic, strong) MoliMoneyLabel *totalCostLabel;
@end
@implementation SubRechargersCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
UIView *container = [[UIView alloc] init];
container.backgroundColor = UIColorFromRGB(0xf4f4f4);
[container setCornerRadius:8];
[self.contentView addSubview:container];
[container mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(self.contentView);
make.height.mas_equalTo(80);
}];
[container addSubview:self.avatarImageView];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(13);
make.leading.mas_equalTo(9);
make.size.mas_equalTo(CGSizeMake(55, 55));
}];
[container addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(11);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(12);
make.height.mas_equalTo(24);
}];
[container addSubview:self.idLabel];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nameLabel.mas_bottom);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(12);
make.height.mas_equalTo(18);
}];
[container addSubview:self.starsStack];
[self.starsStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(12);
make.top.mas_equalTo(self.idLabel.mas_bottom).offset(2);
make.height.mas_equalTo(15);
}];
[self.star_1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[self.star_2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[self.star_3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[self.star_4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[self.star_5 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[container addSubview:self.lastTransferDateLabel];
[self.lastTransferDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nameLabel);
make.trailing.mas_equalTo(container).offset(-9);
make.height.mas_equalTo(18);
}];
[container addSubview:self.totalCostLabel];
[self.totalCostLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.avatarImageView);
make.trailing.mas_equalTo(container).offset(-9);
make.height.mas_equalTo(22);
}];
}
return self;
}
- (void)setCellModel:(SubRechargeUserModel *)cellModel {
_cellModel = cellModel;
self.avatarImageView.imageUrl = cellModel.avatar;
self.nameLabel.text = cellModel.nick;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", @(cellModel.uid)];
[self.totalCostLabel updateContent:@(cellModel.totalGiveGold).stringValue];
[self.star_1 setSelected:NO];
[self.star_2 setSelected:NO];
[self.star_3 setSelected:NO];
[self.star_4 setSelected:NO];
[self.star_5 setSelected:NO];
if (cellModel.starLevel > 0) {
[self.star_1 setSelected:YES];
}
if (cellModel.starLevel > 1) {
[self.star_2 setSelected:YES];
}
if (cellModel.starLevel > 2) {
[self.star_3 setSelected:YES];
}
if (cellModel.starLevel > 3) {
[self.star_4 setSelected:YES];
}
if (cellModel.starLevel > 4) {
[self.star_5 setSelected:YES];
}
}
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
_avatarImageView = [[NetImageView alloc] init];
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
[_avatarImageView setCornerRadius:55/2];
}
return _avatarImageView;
}
- (UILabel *)nameLabel {
if (!_nameLabel) {
_nameLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(15) textColor:UIColorFromRGB(0x313131)];
}
return _nameLabel;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x7b7b7d)];
}
return _idLabel;
}
- (UILabel *)lastTransferDateLabel {
if (!_lastTransferDateLabel) {
_lastTransferDateLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.37_text_40")
font:kFontRegular(12)
textColor:UIColorFromRGB(0x7b7b7d)];
}
return _lastTransferDateLabel;
}
- (MoliMoneyLabel *)totalCostLabel {
if (!_totalCostLabel) {
_totalCostLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0xff8c03)
font:kFontSemibold(16)
moneyPostion:2
moneySize:CGSizeMake(22, 22)];
}
return _totalCostLabel;
}
- (UIStackView *)starsStack {
if (!_starsStack) {
_starsStack = [[UIStackView alloc] initWithArrangedSubviews:@[
self.star_1,
self.star_2,
self.star_3,
self.star_4,
self.star_5,
]];
_starsStack.spacing = 4;
}
return _starsStack;
}
- (UIButton *)star_1 {
if (!_star_1) {
_star_1 = [UIButton buttonWithType:UIButtonTypeCustom];
[_star_1 setBackgroundImage:kImage(@"star_white") forState:UIControlStateNormal];
[_star_1 setBackgroundImage:kImage(@"star_yellow") forState:UIControlStateSelected];
}
return _star_1;
}
- (UIButton *)star_2 {
if (!_star_2) {
_star_2 = [UIButton buttonWithType:UIButtonTypeCustom];
[_star_2 setBackgroundImage:kImage(@"star_white") forState:UIControlStateNormal];
[_star_2 setBackgroundImage:kImage(@"star_yellow") forState:UIControlStateSelected];
}
return _star_2;
}
- (UIButton *)star_3 {
if (!_star_3) {
_star_3 = [UIButton buttonWithType:UIButtonTypeCustom];
[_star_3 setBackgroundImage:kImage(@"star_white") forState:UIControlStateNormal];
[_star_3 setBackgroundImage:kImage(@"star_yellow") forState:UIControlStateSelected];
}
return _star_3;
}
- (UIButton *)star_4 {
if (!_star_4) {
_star_4 = [UIButton buttonWithType:UIButtonTypeCustom];
[_star_4 setBackgroundImage:kImage(@"star_white") forState:UIControlStateNormal];
[_star_4 setBackgroundImage:kImage(@"star_yellow") forState:UIControlStateSelected];
}
return _star_4;
}
- (UIButton *)star_5 {
if (!_star_5) {
_star_5 = [UIButton buttonWithType:UIButtonTypeCustom];
[_star_5 setBackgroundImage:kImage(@"star_white") forState:UIControlStateNormal];
[_star_5 setBackgroundImage:kImage(@"star_yellow") forState:UIControlStateSelected];
}
return _star_5;
}
@end
@interface SubRechargersViewController () <UITableViewDelegate, UITableViewDataSource>
@property(nonatomic, copy) NSArray *dataSource;
@property(nonatomic, strong) UITableView *tableView;
@property(nonatomic, strong) UIImageView *emptyImageView;
@end
@implementation SubRechargersViewController
- (XPMineGiveDiamondPresenter *)createPresenter {
return [[XPMineGiveDiamondPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.title = YMLocalizedString(@"1.0.37_text_39");
self.view.backgroundColor = [UIColor whiteColor];
[self setupUI];
[self.presenter subrechargeInfoList];
}
- (void)setupUI {
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view).insets(UIEdgeInsetsMake(18, 15, 18, 15));
}];
[self.view addSubview:self.emptyImageView];
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view).offset(150);
make.centerX.mas_equalTo(self.view);
make.size.mas_equalTo(CGSizeMake(200, 200));
}];
}
#pragma mark - XPMineGiveDiamondProtocol
- (void)loadSubRechargerInfoSuccess:(NSArray <SubRechargeUserModel *>*)infos {
self.dataSource = infos;
[self.tableView reloadData];
if (infos.count == 0) {
self.emptyImageView.hidden = NO;
}
}
#pragma mark - UITableView DataSource & Delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataSource.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 94;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SubRechargersCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SubRechargersCell" forIndexPath:indexPath];
cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row];
return cell;
}
#pragma mark -
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
[_tableView registerClass:[SubRechargersCell class] forCellReuseIdentifier:@"SubRechargersCell"];
}
return _tableView;
}
- (UIImageView *)emptyImageView {
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.hidden = YES;
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder_UFO];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _emptyImageView;
}
@end

View File

@@ -11,7 +11,10 @@
NS_ASSUME_NONNULL_BEGIN
@interface XPMineGiveDiamondVC : MvpViewController
@property (nonatomic,strong) UserInfoModel *userInfo;
- (instancetype)initWithUserModel:(UserInfoModel *)userInfo;
@end
NS_ASSUME_NONNULL_END

Some files were not shown because too many files have changed in this diff Show More