This commit is contained in:
eggmanQQQ
2024-07-11 18:57:34 +08:00
parent 0a973ca4d5
commit 3fbb87be6c
29 changed files with 428 additions and 170 deletions

View File

@@ -531,6 +531,7 @@
548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 548E01C22C3F78360071C83D /* FeedBackViewController.xib */; };
548E01C62C3F78360071C83D /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C42C3F78360071C83D /* FeedBackViewController.m */; };
548E01C92C3F78600071C83D /* FeedBackConfigModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C82C3F78600071C83D /* FeedBackConfigModel.m */; };
548E01CC2C3FB1C70071C83D /* i18nGiftNameMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01CB2C3FB1C70071C83D /* i18nGiftNameMap.m */; };
54C3895C2C215F5100FD47B1 /* XPHomeMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */; };
54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */; };
54C389622C23BD1600FD47B1 /* HomeRankAvatarModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389612C23BD1600FD47B1 /* HomeRankAvatarModel.m */; };
@@ -2606,6 +2607,8 @@
548E01C42C3F78360071C83D /* FeedBackViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FeedBackViewController.m; sourceTree = "<group>"; };
548E01C72C3F78600071C83D /* FeedBackConfigModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeedBackConfigModel.h; sourceTree = "<group>"; };
548E01C82C3F78600071C83D /* FeedBackConfigModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FeedBackConfigModel.m; sourceTree = "<group>"; };
548E01CA2C3FB1C70071C83D /* i18nGiftNameMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = i18nGiftNameMap.h; sourceTree = "<group>"; };
548E01CB2C3FB1C70071C83D /* i18nGiftNameMap.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = i18nGiftNameMap.m; sourceTree = "<group>"; };
54C3895A2C215F5100FD47B1 /* XPHomeMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMineViewController.h; sourceTree = "<group>"; };
54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeMineViewController.m; sourceTree = "<group>"; };
54C3895D2C2189DD00FD47B1 /* XPHomeMinePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMinePresenter.h; sourceTree = "<group>"; };
@@ -9297,6 +9300,8 @@
E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */,
E8D4DE452940473500EC788D /* GiftTwelveStarFirstModel.h */,
E8D4DE462940473500EC788D /* GiftTwelveStarFirstModel.m */,
548E01CA2C3FB1C70071C83D /* i18nGiftNameMap.h */,
548E01CB2C3FB1C70071C83D /* i18nGiftNameMap.m */,
);
path = Model;
sourceTree = "<group>";
@@ -11472,6 +11477,7 @@
9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */,
233423D02AAEFBC300B1253F /* PICandyTreeSetModel.m in Sources */,
E85E7B112A4EB0D200B6D00A /* GuildPersonIncomeRecordModel.m in Sources */,
548E01CC2C3FB1C70071C83D /* i18nGiftNameMap.m in Sources */,
9BD2ECD2288F833B00F5CD9A /* XPMineFootPrintModel.m in Sources */,
E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */,
23D321E22ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m in Sources */,

View File

@@ -137,7 +137,7 @@
self.bgImageView.imageUrl = model.bgURLPath;
self.avatarImageView.imageUrl = model.logoURLPath;
self.gameNameLabel.text = model.title;
self.roundLabel.text = [NSString stringWithFormat:@"%ld局", (long)model.round];
self.roundLabel.text = [NSString stringWithFormat:YMLocalizedString(@"GameOrderContent_20"), (long)model.round];
}
#pragma mark -
@@ -172,7 +172,7 @@
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@"開黑邀請"
_titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_5")
font:kFontMedium(12)
textColor:[UIColor whiteColor]];
}
@@ -181,7 +181,7 @@
- (UILabel *)subTitleLabel {
if (!_subTitleLabel) {
_subTitleLabel = [UILabel labelInitWithText:@"和我一起玩遊戲吧~"
_subTitleLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_16")
font:kFontMedium(11)
textColor:[UIColor colorWithWhite:1 alpha:0.6]];;
}

View File

@@ -259,7 +259,6 @@
[_keyboardManager bindTextView:_inputBarView.inputTextView];
}
- (void)initViews {
[self.view addSubview:self.sessionNavView];
[self.view addSubview:self.headView];
@@ -340,7 +339,7 @@
- (void)getPublicChatHallTopTextSuccess:(MSSessionPublicChatHallTopModel *)model{
self.headView.topModel = model;
if (model == nil) {
if (model == nil || model.recordStatus == 1) {
[self.headView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.sessionNavView.mas_bottom).mas_offset(kGetScaleWidth(0));
make.leading.trailing.equalTo(self.view).inset(kGetScaleWidth(0));

View File

@@ -380,7 +380,9 @@
}
[[NIMSDK sharedSDK].conversationManager markAllMessagesReadInSession:self.session];
[self.presenter getChatLimitReceiverUid:self.session.sessionId];
[self.presenter getUserInfo:self.session.sessionId];
if (![[[ClientConfig shareConfig].configInfo officialAccountUids] containsObject:user.userId]) {
[self.presenter getUserInfo:self.session.sessionId];
}
}
- (BOOL)isExistMessages:(NIMMessage *)message{

View File

@@ -51,6 +51,7 @@
self.coinImageView.hidden = YES;
self.coinBgImageView.hidden = YES;
self.nameLabel.text = @"";
self.addLabel.hidden = NO;
self.bgImageView.image = kImage(@"ms_public_chat_hall_head_bg");
self.contentLabel.text = @"";
@@ -131,15 +132,15 @@
make.centerY.mas_equalTo(self.coinBgImageView);
make.width.height.mas_equalTo(10);
if (isMSRTL()) {
make.left.mas_equalTo(self.coinLabel.mas_right).offset(2);
make.left.mas_equalTo(self.coinLabel.mas_right).offset(4);
} else {
make.right.mas_equalTo(self.coinLabel.mas_left).inset(-2);
make.right.mas_equalTo(self.coinLabel.mas_left).inset(4);
}
}];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).inset(47.5);
make.leading.equalTo(self.nameLabel);
make.leading.equalTo(self.avatarImageView);
make.trailing.bottom.equalTo(self).inset(13);
}];
}
@@ -219,8 +220,6 @@
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 25/2;
_avatarImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_avatarImageView.layer.borderWidth = 1;
_avatarImageView.hidden = YES;
}
return _avatarImageView;

View File

@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger inning;
@property (nonatomic, assign) NSInteger income;
@property (nonatomic, assign) NSInteger price;
@property (nonatomic, assign) NSInteger toErBanNo;
@property (nonatomic, assign) NSInteger fromErBanNo;
@end
@@ -47,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger price;
@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, copy) NSString *proficiency;
@property (nonatomic, assign) NSInteger inning;
//@property (nonatomic, copy) NSArray <XPMineGamePartnerInfoTagModel*>* tags;
+ (XPMineGamePartnerInfoModel *)modelFromRecord:(XPMineGameOrderRecoredModel *)record;

View File

@@ -35,6 +35,7 @@
model.pic = record.gamePic;
model.price = record.price;
model.uid = record.toUid;
model.inning = record.inning;
return model;
}
@end

View File

@@ -113,7 +113,6 @@
[Api requestGamePartnerInfoList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSArray *models = [XPMineGamePartnerInfoModel modelsWithArray:data.data];
// XPMineGamePartnerInfoModel *model = [XPMineGamePartnerInfoModel modelWithDictionary:data.data];
if (success) {
success(models);
}

View File

@@ -41,16 +41,16 @@
self.levelLabel.text = cellModel.proficiency;
self.orderButton.hidden = cellModel.uid == [AccountInfoStorage instance].getUid.integerValue;
[self updatePriceContent];
self.priceLabel.text = @(self.cellModel.price).stringValue;
// [self updatePriceContent];
}
- (void)updatePriceContent {
NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init];
coinAttachment.image = kImage(@"mine_game_gold_icon");
coinAttachment.bounds = CGRectMake(2, -0.5, 9, 9);
coinAttachment.bounds = CGRectMake(0, -0.5, 9, 9);
NSAttributedString *coin = [NSAttributedString attributedStringWithAttachment:coinAttachment];
NSAttributedString *price = [[NSAttributedString alloc] initWithString:@(self.cellModel.price).stringValue
NSAttributedString *price = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ ", @(self.cellModel.price)]
attributes:@{
NSFontAttributeName: self.priceLabel.font,
NSForegroundColorAttributeName: self.priceLabel.textColor
@@ -107,14 +107,25 @@
}
}];
UIStackView *priceStack = [[UIStackView alloc] init];
priceStack.spacing = 1;
priceStack.distribution = UIStackViewDistributionFill;
priceStack.alignment = UIStackViewAlignmentCenter;
UIImageView *coinIcon = [[UIImageView alloc] initWithImage:kImage(@"mine_game_gold_icon")];
coinIcon.frame = CGRectMake(0, 0, 12, 12);
[priceStack addArrangedSubview:self.priceLabel];
[priceStack addArrangedSubview:coinIcon];
UIStackView *titleStack = [[UIStackView alloc] init];
titleStack.axis = UILayoutConstraintAxisVertical;
titleStack.alignment = UIStackViewAlignmentLeading;
titleStack.distribution = UIStackViewDistributionEqualSpacing;
titleStack.spacing = 4;
[titleStack addArrangedSubview:[self titleLabel:@"遊戲名稱"]];
[titleStack addArrangedSubview:[self titleLabel:@"熟練度"]];
[titleStack addArrangedSubview:[self titleLabel:@"下單價格"]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_1")]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_2")]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_3")]];
[mainStack addArrangedSubview:titleStack];
UIStackView *informationStack = [[UIStackView alloc] init];
@@ -124,7 +135,7 @@
informationStack.spacing = 4;
[informationStack addArrangedSubview:self.nameLabel];
[informationStack addArrangedSubview:self.levelLabel];
[informationStack addArrangedSubview:self.priceLabel];
[informationStack addArrangedSubview:priceStack];
[mainStack addArrangedSubview:informationStack];
[self.contentView addSubview:self.orderButton];
@@ -134,8 +145,9 @@
make.left.mas_equalTo(12);
} else {
make.right.mas_equalTo(-12);
make.width.mas_greaterThanOrEqualTo(72.5);
}
make.width.mas_equalTo(72.5);
make.height.mas_equalTo(27);
}];
}
@@ -201,6 +213,8 @@
_priceLabel = [UILabel labelInitWithText:@""
font:kFontMedium(13)
textColor:[UIColor whiteColor]];
[_priceLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_priceLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}
return _priceLabel;
}
@@ -208,7 +222,7 @@
- (UIButton *)orderButton {
if (!_orderButton) {
_orderButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_orderButton setTitle:@"下單" forState:UIControlStateNormal];
[_orderButton setTitle:YMLocalizedString(@"GameOrderContent_4") forState:UIControlStateNormal];
[_orderButton addTarget:self
action:@selector(didTapOrderButton:)
forControlEvents:UIControlEventTouchUpInside];
@@ -218,6 +232,16 @@
[_orderButton.titleLabel setFont:kFontBold(13)];
_orderButton.titleEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
[_orderButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_orderButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
_orderButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 10);
_orderButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 5);
_orderButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_orderButton.titleLabel.adjustsFontSizeToFitWidth = YES;
_orderButton.titleLabel.minimumScaleFactor = 0.5;
}
return _orderButton;
}

View File

@@ -51,7 +51,7 @@
if (code == 200) {
@kStrongify(self);
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
self.currentCoin = model.golds;
self.currentCoin = model.diamonds.integerValue;
self.balanceLabel.text = @(self.currentCoin).stringValue;
[self updateBalanceContent];
}
@@ -60,24 +60,27 @@
- (void)setInfoModel:(XPMineGamePartnerInfoModel *)infoModel {
_infoModel = infoModel;
self.round = MAX(1, _infoModel.inning);
self.logoImageView.imageUrl = infoModel.pic;
self.numberLabel.text = @(self.round).stringValue;
[self updatePriceContent];
}
- (void)updatePriceContent {
NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init];
coinAttachment.image = kImage(@"mine_game_gold_icon");
coinAttachment.bounds = CGRectMake(2, -0.5, 12, 12);
NSAttributedString *coin = [NSAttributedString attributedStringWithAttachment:coinAttachment];
NSAttributedString *price = [[NSAttributedString alloc] initWithString:@(self.infoModel.price * self.round).stringValue
attributes:@{
NSFontAttributeName: self.priceLabel.font,
NSForegroundColorAttributeName: self.priceLabel.textColor
}];
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:coin];
[mutableAttributedString insertAttributedString:price atIndex:0];
self.priceLabel.attributedText = mutableAttributedString.copy;
self.priceLabel.text = @(self.infoModel.price * self.round).stringValue;
// NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init];
// coinAttachment.image = kImage(@"mine_game_gold_icon");
// coinAttachment.bounds = CGRectMake(2, -0.5, 12, 12);
// NSAttributedString *coin = [NSAttributedString attributedStringWithAttachment:coinAttachment];
// NSAttributedString *price = [[NSAttributedString alloc] initWithString:@(self.infoModel.price * self.round).stringValue
// attributes:@{
// NSFontAttributeName: self.priceLabel.font,
// NSForegroundColorAttributeName: self.priceLabel.textColor
// }];
// NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:coin];
// [mutableAttributedString insertAttributedString:price atIndex:0];
// self.priceLabel.attributedText = mutableAttributedString.copy;
}
- (void)updateBalanceContent {
@@ -85,7 +88,7 @@
coinAttachment.image = kImage(@"mine_game_gold_icon");
coinAttachment.bounds = CGRectMake(2, -0.5, 10, 10);
NSAttributedString *coin = [NSAttributedString attributedStringWithAttachment:coinAttachment];
NSAttributedString *price = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"余额%ld", (long)self.currentCoin]
NSAttributedString *price = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%ld", YMLocalizedString(@"GameOrderContent_21"),(long)self.currentCoin]
attributes:@{
NSFontAttributeName: self.balanceLabel.font,
NSForegroundColorAttributeName: self.balanceLabel.textColor
@@ -102,7 +105,7 @@
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(300, 280));
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 38*2, 280));
make.center.mas_equalTo(self);
}];
@@ -121,7 +124,7 @@
}
}];
UILabel *titleLabel = [UILabel labelInitWithText:@"開黑邀請"
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_5")
font:kFontBold(20)
textColor:UIColorFromRGB(0x563c1f)];
titleLabel.clipsToBounds = NO;
@@ -136,11 +139,11 @@
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(titleLabel.mas_bottom).offset(17.5);
make.centerX.mas_equalTo(self.bgImageView);
make.size.mas_equalTo(CGSizeMake(223, 95));
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 38*4, 95));
}];
UILabel *subTitleLabel_1 = [UILabel labelInitWithText:@"開黑橘樹" font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
UILabel *subTitleLabel_2 = [UILabel labelInitWithText:@"合計:" font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
UILabel *subTitleLabel_1 = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_19") font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
UILabel *subTitleLabel_2 = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_7") font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
UIStackView *subTitleStack = [[UIStackView alloc] init];
subTitleStack.axis = UILayoutConstraintAxisVertical;
subTitleStack.alignment = UIStackViewAlignmentTop;
@@ -190,8 +193,17 @@
}
}];
[self addSubview:self.priceLabel];
[self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
UIStackView *priceStack = [[UIStackView alloc] init];
priceStack.spacing = 1;
priceStack.distribution = UIStackViewDistributionFill;
priceStack.alignment = UIStackViewAlignmentCenter;
UIImageView *coinIcon = [[UIImageView alloc] initWithImage:kImage(@"mine_game_gold_icon")];
coinIcon.frame = CGRectMake(0, 0, 12, 12);
[priceStack addArrangedSubview:self.priceLabel];
[priceStack addArrangedSubview:coinIcon];
[self addSubview:priceStack];
[priceStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.numberLabel);
make.top.mas_equalTo(self.increaseButton.mas_bottom).offset(12);
}];
@@ -199,8 +211,8 @@
UIImageView *line = [[UIImageView alloc] initWithImage:kImage(@"mine_game_order_line")];
[self addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(220.5, 0.5));
make.left.right.mas_equalTo(self.logoImageView);
make.height.mas_equalTo(0.5);
make.bottom.mas_equalTo(self.bgImageView).offset(-46);
make.top.mas_equalTo(self.priceLabel.mas_bottom).offset(15);
}];
@@ -216,16 +228,19 @@
}];
[self addSubview:self.rechargeButton];
[self addSubview:self.payButton];
[self.rechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.balanceLabel);
if (isMSRTL()) {
make.right.mas_equalTo(self.balanceLabel.mas_left).offset(-8.5);
// make.left.mas_equalTo(self.payButton.mas_right).offset(8.5);
} else {
make.left.mas_equalTo(self.balanceLabel.mas_right).offset(8.5);
// make.right.mas_equalTo(self.payButton.mas_left).offset(-8.5);
}
}];
[self addSubview:self.payButton];
[self.payButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.balanceLabel);
make.size.mas_equalTo(CGSizeMake(65, 26));
@@ -243,9 +258,7 @@
self.round = 1;
}
self.numberLabel.text = @(self.round).stringValue;
if (self.infoModel) {
self.priceLabel.text = @(self.round * self.infoModel.price).stringValue;
}
[self updatePriceContent];
}
@@ -329,13 +342,15 @@
_priceLabel = [UILabel labelInitWithText:@"0"
font:kFontMedium(13)
textColor:UIColorFromRGB(0x471606)];
[_priceLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_priceLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}
return _priceLabel;
}
- (UILabel *)balanceLabel {
if (!_balanceLabel) {
_balanceLabel = [UILabel labelInitWithText:@"餘額0"
_balanceLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_21")
font:kFontMedium(12)
textColor:UIColorFromRGB(0x471606)];
}
@@ -345,12 +360,14 @@
- (UIButton *)rechargeButton {
if (!_rechargeButton) {
_rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_rechargeButton setTitle:@"充值 >" forState:UIControlStateNormal];
[_rechargeButton setTitle:[NSString stringWithFormat:@"%@ >", YMLocalizedString(@"XPGiftBarView1")] forState:UIControlStateNormal];
[_rechargeButton.titleLabel setFont:kFontMedium(12)];
[_rechargeButton setTitleColor:UIColorFromRGB(0xff433a) forState:UIControlStateNormal];
[_rechargeButton addTarget:self
action:@selector(didTapRechargeButton:)
forControlEvents:UIControlEventTouchUpInside];
_rechargeButton.titleLabel.adjustsFontSizeToFitWidth = YES;
_rechargeButton.titleLabel.minimumScaleFactor = 0.5; //
}
return _rechargeButton;
}
@@ -358,7 +375,7 @@
- (UIButton *)payButton {
if (!_payButton) {
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_payButton setTitle:@"支付" forState:UIControlStateNormal];
[_payButton setTitle:YMLocalizedString(@"GameOrderContent_22") forState:UIControlStateNormal];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x57e193),UIColorFromRGB(0x14d2a6)]
gradientType:GradientTypeLeftToRight
imgSize:CGSizeMake(65, 26)];

View File

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) XPMineGameOrderRecoredModel *model;
@property (nonatomic, assign) NSInteger type; // 0 = 我發起的
@property (nonatomic, copy) void(^didTapChat)(XPMineGameOrderRecoredModel *model);
@property (nonatomic, copy) void(^didTapChat)(XPMineGameOrderRecoredModel *model, NSInteger type);
@property (nonatomic, copy) void(^didTapPlayAgain)(XPMineGameOrderRecoredModel *model);
@end

View File

@@ -37,20 +37,21 @@
self.gameNameLabel.text = model.gameName;
self.timeLabel.text = model.orderTime;
self.orderIDLabel.text = model.orderNo;
[self updatePriceContent];
// [self updateOrderContent];
self.gamePriceLabel.text = @(self.model.amount).stringValue;
// [self updatePriceContent];
}
- (void)setType:(NSInteger)type {
_type = type;
if (type == 0) {
self.avatarImageView.imageUrl = self.model.toAvatar;
self.nameLabel.text = self.model.toNick;
self.userIDLabel.text = @(self.model.toUid).stringValue;
self.userIDLabel.text = @(self.model.toErBanNo).stringValue;
self.againButton.hidden = NO;
} else {
self.avatarImageView.imageUrl = self.model.fromAvatar;
self.nameLabel.text = self.model.fromNick;
self.userIDLabel.text = @(self.model.fromUid).stringValue;
self.userIDLabel.text = @(self.model.fromErBanNo).stringValue;
self.againButton.hidden = YES;
}
}
@@ -65,9 +66,16 @@
NSFontAttributeName: self.gamePriceLabel.font,
NSForegroundColorAttributeName: self.gamePriceLabel.textColor
}];
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:coin];
[mutableAttributedString insertAttributedString:price atIndex:0];
self.gamePriceLabel.attributedText = mutableAttributedString.copy;
if (isMSRTL()) {
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:price];
[mutableAttributedString insertAttributedString:coin atIndex:0];
self.gamePriceLabel.attributedText = mutableAttributedString.copy;
} else {
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:coin];
[mutableAttributedString insertAttributedString:price atIndex:0];
self.gamePriceLabel.attributedText = mutableAttributedString.copy;
}
[self.contentView layoutIfNeeded];
}
@@ -155,82 +163,104 @@
}];
UIStackView *nameStack = [self horizontalStack];
[nameStack addArrangedSubview:[self titleLabel:@"遊戲名稱:"]];
[nameStack addArrangedSubview:self.gameNameLabel];
// UIStackView *nameStack = [self horizontalStack];
// [nameStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_11")]];
// [nameStack addArrangedSubview:self.gameNameLabel];
//
UIStackView *priceStack = [self horizontalStack];
[priceStack addArrangedSubview:[self titleLabel:@"消費金額:"]];
// [priceStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_12")]];
// [priceStack addArrangedSubview:self.gamePriceLabel];
UIImageView *coinIcon = [[UIImageView alloc] initWithImage:kImage(@"mine_game_gold_icon")];
coinIcon.contentMode = UIViewContentModeScaleAspectFit;
[coinIcon setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[coinIcon setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
coinIcon.frame = CGRectMake(0, 0, 10, 10);
[priceStack addArrangedSubview:self.gamePriceLabel];
[priceStack addArrangedSubview:coinIcon];
UIStackView *orderTimeStack = [self horizontalStack];
[orderTimeStack addArrangedSubview:[self titleLabel:@"下單時間:"]];
[orderTimeStack addArrangedSubview:self.timeLabel];
// UIStackView *orderTimeStack = [self horizontalStack];
// [orderTimeStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_13")]];
// [orderTimeStack addArrangedSubview:self.timeLabel];
//
UIStackView *orderIdStack = [self horizontalStack];
[orderIdStack addArrangedSubview:[self titleLabel:@"訂單編號:"]];
[orderIdStack addArrangedSubview:self.orderIDLabel];
// [orderIdStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_14")]];
// icon layout stack
UIImageView *copyIcon = [[UIImageView alloc] initWithImage:kImage(@"user_card_copy_id1")];
copyIcon.contentMode = UIViewContentModeScaleAspectFit;
[copyIcon setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[copyIcon setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
copyIcon.frame = CGRectMake(0, 0, 14, 14);
[orderIdStack addArrangedSubview:copyIcon];
copyIcon.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(didTapOrderLabel)];
[copyIcon addGestureRecognizer:tap];
UIStackView *contentStack = [[UIStackView alloc] initWithArrangedSubviews:@[
nameStack,
priceStack,
orderTimeStack,
orderIdStack
]];
contentStack.axis = UILayoutConstraintAxisVertical;
contentStack.distribution = UIStackViewDistributionFill;
contentStack.alignment = UIStackViewAlignmentTop;
contentStack.spacing = 8;
[container addSubview:contentStack];
[contentStack mas_makeConstraints:^(MASConstraintMaker *make) {
[orderIdStack addArrangedSubview:self.orderIDLabel];
[orderIdStack addArrangedSubview:copyIcon];
//
// UIStackView *contentStack = [[UIStackView alloc] initWithArrangedSubviews:@[
// nameStack,
// priceStack,
// orderTimeStack,
// orderIdStack
// ]];
// contentStack.axis = UILayoutConstraintAxisVertical;
// contentStack.distribution = UIStackViewDistributionFill;
// contentStack.alignment = UIStackViewAlignmentTop;
// contentStack.spacing = 8;
// [container addSubview:contentStack];
// [contentStack mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.mas_equalTo(line.mas_bottom).offset(13.5);
// if (isMSRTL()) {
// make.right.mas_equalTo(self.avatarImageView);
// make.left.mas_equalTo(container).offset(11.5 + 6);
// } else {
// make.left.mas_equalTo(self.avatarImageView);
// make.right.mas_equalTo(container).offset(-11.5 - 6);
// }
// }];
UIStackView *titleStack = [[UIStackView alloc] init];
titleStack.axis = UILayoutConstraintAxisVertical;
titleStack.distribution = UIStackViewDistributionFill;
titleStack.alignment = UIStackViewAlignmentTop;
titleStack.spacing = 8;
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_11")]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_12")]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_13")]];
[titleStack addArrangedSubview:[self titleLabel:YMLocalizedString(@"GameOrderContent_14")]];
[container addSubview:titleStack];
[titleStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(line.mas_bottom).offset(13.5);
if (isMSRTL()) {
make.right.mas_equalTo(self.avatarImageView);
make.left.mas_equalTo(container).offset(11.5 + 6);
make.right.mas_equalTo(self.avatarImageView).offset(-11.5);
} else {
make.left.mas_equalTo(self.avatarImageView);
make.right.mas_equalTo(container).offset(-11.5 - 6);
make.left.mas_equalTo(self.avatarImageView).offset(11.5);
}
}];
UIStackView *informationStack = [[UIStackView alloc] init];
informationStack.axis = UILayoutConstraintAxisVertical;
informationStack.distribution = UIStackViewDistributionFill;
informationStack.alignment = UIStackViewAlignmentTop;
informationStack.spacing = 8;
[informationStack addArrangedSubview:self.gameNameLabel];
[informationStack addArrangedSubview:priceStack];
[informationStack addArrangedSubview:self.timeLabel];
[informationStack addArrangedSubview:orderIdStack];
[container addSubview:informationStack];
[informationStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(line.mas_bottom).offset(13.5);
if (isMSRTL()) {
make.right.mas_equalTo(titleStack.mas_left).offset(-8);
make.left.mas_equalTo(container).offset(8);
} else {
make.left.mas_equalTo(titleStack.mas_right).offset(8);
make.right.mas_equalTo(container).offset(-8);
}
}];
// UIStackView *titleStack = [[UIStackView alloc] init];
// titleStack.axis = UILayoutConstraintAxisVertical;
// titleStack.distribution = UIStackViewDistributionFill;
// titleStack.alignment = UIStackViewAlignmentTop;
// titleStack.spacing = 8;
// [titleStack addArrangedSubview:[self titleLabel:@"遊戲名稱:"]];
// [titleStack addArrangedSubview:[self titleLabel:@"消費金額:"]];
// [titleStack addArrangedSubview:[self titleLabel:@"下單時間:"]];
// [titleStack addArrangedSubview:[self titleLabel:@"訂單編號:"]];
// [container addSubview:titleStack];
// [titleStack mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.mas_equalTo(line.mas_bottom).offset(13.5);
// make.left.mas_equalTo(self.avatarImageView).offset(11.5);
// }];
//
// UIStackView *informationStack = [[UIStackView alloc] init];
// informationStack.axis = UILayoutConstraintAxisVertical;
// informationStack.distribution = UIStackViewDistributionFill;
// informationStack.alignment = UIStackViewAlignmentTop;
// informationStack.spacing = 8;
// [informationStack addArrangedSubview:self.gameNameLabel];
// [informationStack addArrangedSubview:self.gamePriceLabel];
// [informationStack addArrangedSubview:self.timeLabel];
// [informationStack addArrangedSubview:self.orderIDLabel];
// [container addSubview:informationStack];
// [informationStack mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.mas_equalTo(line.mas_bottom).offset(13.5);
// make.left.mas_equalTo(titleStack.mas_right).offset(8);
// make.right.mas_equalTo(container).offset(-8);
// }];
UIView *line_2 = [[UIView alloc] init];
line_2.backgroundColor = UIColorFromRGB(0xF4F4F4);
@@ -250,7 +280,11 @@
[buttonsStack addArrangedSubview:self.messageButton];
[container addSubview:buttonsStack];
[buttonsStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-13);
if (isMSRTL()) {
make.left.mas_equalTo(13);
} else {
make.right.mas_equalTo(-13);
}
make.top.mas_equalTo(line_2.mas_bottom);
make.bottom.mas_equalTo(container).offset(-13.5);
}];
@@ -274,7 +308,7 @@
}
- (UILabel *)titleLabel:(NSString *)content {
UILabel *label = [UILabel labelInitWithText:content
UILabel *label = [UILabel labelInitWithText:[NSString stringWithFormat:@"%@", content]
font:kFontMedium(13)
textColor:UIColorFromRGB(0x242335)];
[label setContentHuggingPriority:UILayoutPriorityDefaultHigh
@@ -292,7 +326,7 @@
-(IBAction)didTapMessageButton:(id)sender {
if (self.didTapChat) {
self.didTapChat(self.model);
self.didTapChat(self.model, self.type);
}
}
@@ -348,6 +382,8 @@
_gamePriceLabel = [UILabel labelInitWithText:@"0"
font:kFontMedium(14)
textColor:UIColorFromRGB(0x242335)];
[_gamePriceLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_gamePriceLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}
return _gamePriceLabel;
}
@@ -367,6 +403,7 @@
font:kFontMedium(14)
textColor:UIColorFromRGB(0x242335)];
_orderIDLabel.userInteractionEnabled = YES;
_orderIDLabel.adjustsFontSizeToFitWidth = YES;
_orderIDLabel.minimumScaleFactor = 0.5;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(didTapOrderLabel)];
@@ -378,17 +415,24 @@
- (UIButton *)againButton {
if (!_againButton) {
_againButton = [UIButton buttonWithType:UIButtonTypeCustom];
_againButton.frame = CGRectMake(0, 0, 65, 26);
[_againButton setTitle:@"再次支付" forState:UIControlStateNormal];
// _againButton.frame = CGRectMake(0, 0, 65, 26);
[_againButton setTitle:YMLocalizedString(@"GameOrderContent_15") forState:UIControlStateNormal];
[_againButton addTarget:self
action:@selector(didTapAgainButton:)
forControlEvents:UIControlEventTouchUpInside];
// [_againButton setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.4]];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFED118),UIColorFromRGB(0xFDB719)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(65, 26)];
[_againButton setBackgroundImage:image forState:UIControlStateNormal];
_againButton.layer.cornerRadius = 13;
_againButton.layer.masksToBounds = YES;
[_againButton.titleLabel setFont:kFontBold(13)];
[_againButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_againButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
_againButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 10);
_againButton.titleLabel.adjustsFontSizeToFitWidth = YES;
_againButton.titleLabel.minimumScaleFactor = 0.5; //
}
return _againButton;
}
@@ -396,17 +440,24 @@
- (UIButton *)messageButton {
if (!_messageButton) {
_messageButton = [UIButton buttonWithType:UIButtonTypeCustom];
_messageButton.frame = CGRectMake(0, 0, 65, 26);
[_messageButton setTitle:@"私信" forState:UIControlStateNormal];
// _messageButton.frame = CGRectMake(0, 0, 65, 26);
[_messageButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController8") forState:UIControlStateNormal];
[_messageButton addTarget:self
action:@selector(didTapMessageButton:)
forControlEvents:UIControlEventTouchUpInside];
// [_messageButton setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.4]];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x70e9e7),UIColorFromRGB(0x41d4f6)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(65, 26)];
[_messageButton setBackgroundImage:image forState:UIControlStateNormal];
_messageButton.layer.cornerRadius = 13;
_messageButton.layer.masksToBounds = YES;
[_messageButton.titleLabel setFont:kFontBold(13)];
[_messageButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_messageButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
_messageButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 10);
_messageButton.titleLabel.adjustsFontSizeToFitWidth = YES;
_messageButton.titleLabel.minimumScaleFactor = 0.5; //
}
return _messageButton;
}

View File

@@ -132,13 +132,15 @@
} else {
self.timeLabel.text = YMLocalizedString(@"XPMineHeadwearTableViewCell1");
}
self.headWearImageView.hidden = YES;
self.headWearSVGAImageView.hidden = YES;
[self.headWearSVGAImageView clear];
self.giveImageView.hidden =!_headwearModel.isGive;
NSString * headurl = _headwearModel.effect.length > 0 ? _headwearModel.effect : _headwearModel.pic;
if (headurl.length == 0) {
self.headWearImageView.hidden = YES;
self.headWearSVGAImageView.hidden = YES;
} else {
if (headurl.length > 0) {
if (_headwearModel.type == 1) {
self.headWearSVGAImageView.hidden = NO;
[self.headWearSVGAImageView setImageName:headurl];
} else {
self.headWearImageView.hidden = NO;

View File

@@ -222,7 +222,7 @@ typedef enum : NSUInteger {
[self showLoading];
[self.presenter submitOrder:^{
@kStrongify(self);
[self showSuccessToast:@"下单成功~"];
[self showSuccessToast:YMLocalizedString(@"GameOrderContent_18")];
if (self.delegate) {
[self.delegate dismissGameOrderView];
}
@@ -639,7 +639,7 @@ typedef enum : NSUInteger {
- (XPMineUserSectionHeader *)gameMateHeader {
if (!_gameMateHeader) {
_gameMateHeader = [[XPMineUserSectionHeader alloc] init];
_gameMateHeader.title = @"組隊開黑嘿嘿嘿嘿";//YMLocalizedString(@"QinputPhotoView1");
_gameMateHeader.title = YMLocalizedString(@"GameOrderContent_0");
_gameMateHeader.hasMore = NO;
}
return _gameMateHeader;

View File

@@ -39,7 +39,7 @@
[super viewDidLoad];
self.type = 0;
self.title = @"點單紀錄";
self.title = YMLocalizedString(@"GameOrderContent_8");
self.myOrders = @[].mutableCopy;
self.acceptOrders = @[].mutableCopy;
self.tab_1_button.selected = YES;
@@ -50,7 +50,6 @@
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear: animated];
[self headerRefresh];
}
- (__kindof id)createPresenter {
@@ -148,15 +147,23 @@
UIStackView *topStack = [[UIStackView alloc] init];
topStack.axis = UILayoutConstraintAxisHorizontal;
topStack.distribution = UIStackViewDistributionFill;
topStack.alignment = UIStackViewAlignmentLeading;
if (isMSRTL()) {
topStack.alignment = UIStackViewAlignmentTrailing;
} else {
topStack.alignment = UIStackViewAlignmentLeading;
}
topStack.spacing = 30;
[topStack addArrangedSubview:self.tab_1_button];
[topStack addArrangedSubview:self.tab_2_button];
[self.view addSubview:topStack];
self.topStack = topStack;
[topStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(13);
make.height.mas_equalTo(36);
if (isMSRTL()) {
make.top.right.mas_equalTo(-13);
} else {
make.top.left.mas_equalTo(13);
}
}];
[topStack addSubview:self.underLine];
@@ -166,19 +173,14 @@
make.size.mas_equalTo(CGSizeMake(14, 3));
}];
[self.view addSubview:self.myOrderTableView];
[self.myOrderTableView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(14);
// make.right.mas_equalTo(-14);
make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(topStack.mas_bottom);
}];
[self.view addSubview:self.acceptOrderTableView];
[self.acceptOrderTableView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(14);
// make.right.mas_equalTo(-14);
make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(topStack.mas_bottom);
}];
@@ -252,12 +254,11 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone;
@kWeakify(self);
cell.didTapChat = ^(XPMineGameOrderRecoredModel * _Nonnull model) {
cell.didTapChat = ^(XPMineGameOrderRecoredModel * _Nonnull model, NSInteger type) {
@kStrongify(self);
// NSInteger uid = cell.type == 0 ? model.toUid : model.fromUid;
NIMSession * session = [NIMSession session:@(model.fromUid).stringValue type:NIMSessionTypeP2P];
NSInteger uid = type == 0 ? model.toUid : model.fromUid;
NIMSession * session = [NIMSession session:@(uid).stringValue type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:sessionVC animated:YES];
};
@@ -275,10 +276,11 @@
@kStrongify(view);
XPMineUserDataPresenter *udp = [[XPMineUserDataPresenter alloc] init];
[udp submitOrder:^{
[self showSuccessToast:YMLocalizedString(@"GameOrderContent_18")];
[view removeFromSuperview];
} failure:^(NSString * _Nonnull msg) {
}
[self showErrorToast:msg];
}
gameId:view.infoModel.gameId
gameUid:view.infoModel.uid
inning:round];
@@ -321,7 +323,7 @@
- (UIButton *)tab_1_button {
if (!_tab_1_button) {
_tab_1_button = [UIButton buttonWithType:UIButtonTypeCustom];
[_tab_1_button setTitle:@"我發起的" forState:UIControlStateNormal];
[_tab_1_button setTitle:YMLocalizedString(@"GameOrderContent_9") forState:UIControlStateNormal];
[_tab_1_button.titleLabel setFont:kFontBold(14)];
[_tab_1_button setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
[_tab_1_button setTitleColor:[UIColor colorWithWhite:0 alpha:0.4] forState:UIControlStateNormal];
@@ -333,7 +335,7 @@
- (UIButton *)tab_2_button {
if (!_tab_2_button) {
_tab_2_button = [UIButton buttonWithType:UIButtonTypeCustom];
[_tab_2_button setTitle:@"我接受的" forState:UIControlStateNormal];
[_tab_2_button setTitle:YMLocalizedString(@"GameOrderContent_10") forState:UIControlStateNormal];
[_tab_2_button.titleLabel setFont:kFontBold(14)];
[_tab_2_button setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
[_tab_2_button setTitleColor:[UIColor colorWithWhite:0 alpha:0.4] forState:UIControlStateNormal];

View File

@@ -63,17 +63,22 @@
[room sendCompleted];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[user sendError:nil];
if(code == 500 && [msg containsString:@"你已屏蔽該房間"]){
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.actionStyle = TTAlertActionConfirmStyle;
config.title = YMLocalizedString(@"XPRoomSettingViewController3");
config.message = YMLocalizedString(@"XPRoomViewController19");
[TTPopup alertWithConfig:config confirmHandler:^{
} cancelHandler:^{
}];
}
[TTPopup alertWithMessage:msg confirmHandler:^{
} cancelHandler:^{
}];
// if(code == 500 && [msg containsString:@"你已屏蔽該房間"]){
// TTAlertConfig *config = [[TTAlertConfig alloc]init];
// config.actionStyle = TTAlertActionConfirmStyle;
// config.title = YMLocalizedString(@"XPRoomSettingViewController3");
// config.message = YMLocalizedString(@"XPRoomViewController19");
// [TTPopup alertWithConfig:config confirmHandler:^{
//
// } cancelHandler:^{
//
// }];
// }
} showLoading:NO errorToast:NO] uid:roomUid intoUid:uid];
}

View File

@@ -192,10 +192,21 @@
self.senderAvatarView.imageUrl = _broadcastModel.sendUserAvatar;
sendUserNick = sendUserNick.length > 6 ? [NSString stringWithFormat:@"%@...",[sendUserNick substringToIndex:6]] : sendUserNick;
recvUserNick = recvUserNick.length > 6 ? [NSString stringWithFormat:@"%@...",[recvUserNick substringToIndex:6]] : recvUserNick;
NSString *giftName = [NSString stringWithFormat:@"%@ %@ %@ %@",sendUserNick,YMLocalizedString(@"XPRoomYearActivityView0"),recvUserNick,_broadcastModel.giftName];
NSMutableAttributedString *giftNameAtt = [[NSMutableAttributedString alloc]initWithString:giftName attributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:[UIColor whiteColor]}];
[giftNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:UIColorFromRGB(0xFFE468)} range:[giftName rangeOfString:sendUserNick]];
[giftNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:UIColorFromRGB(0xFFE468)} range:[giftName rangeOfString:recvUserNick]];
NSString *giftName = _broadcastModel.giftName;
if (isMSRTL() && _broadcastModel.i18nGiftNameMap.ar.length > 0) {
giftName = _broadcastModel.i18nGiftNameMap.ar;
} else if (isMSEN() && _broadcastModel.i18nGiftNameMap.en.length > 0) {
giftName = _broadcastModel.i18nGiftNameMap.en;
} else if (isMSZH() && _broadcastModel.i18nGiftNameMap.zh.length > 0) {
giftName = _broadcastModel.i18nGiftNameMap.zh;
}
NSString *message = [NSString stringWithFormat:@"%@ %@ %@ %@",sendUserNick,YMLocalizedString(@"XPRoomYearActivityView0"),recvUserNick,giftName];
NSMutableAttributedString *giftNameAtt = [[NSMutableAttributedString alloc]initWithString:message attributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:[UIColor whiteColor]}];
[giftNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:UIColorFromRGB(0xFFE468)} range:[message rangeOfString:sendUserNick]];
[giftNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:UIColorFromRGB(0xFFE468)} range:[message rangeOfString:recvUserNick]];
self.pi_contentView.attributedText = giftNameAtt;
self.giftImageView.imageUrl = _broadcastModel.giftUrl;
self.roomNameLabel.text = _broadcastModel.roomTitle;

View File

@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#import "GiftNobleInfoModel.h"
#import "XPWeekStarRankUserModel.h"
#import "i18nGiftNameMap.h"
NS_ASSUME_NONNULL_BEGIN
//礼物类型
@@ -124,7 +125,7 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) {
@property(nonatomic,copy) NSString *bannerUrl;
@property(nonatomic,copy) NSString *skipUrl;
@property (nonatomic, copy) NSDictionary *i18nGiftNameMap;
@property (nonatomic, strong) i18nGiftNameMap *i18nGiftNameMap;
@end

View File

@@ -7,6 +7,7 @@
#import "GiftInfoModel.h"
#import "MJExtension.h"
@implementation GiftInfoModel
MJCodingImplementation
@end

View File

@@ -7,6 +7,7 @@
#import <Foundation/Foundation.h>
#import "GiftInfoModel.h"
#import "WalletInfoModel.h"
typedef NS_ENUM(NSInteger, BroadCastLevel) {
BroadCastLevel_Normal = 1,
BroadCastLevel_Middle = 2,
@@ -127,6 +128,8 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,strong)WalletInfoModel * userPurse;
@property (nonatomic, strong) i18nGiftNameMap *i18nGiftNameMap;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,20 @@
//
// i18nGiftNameMap.h
// YuMi
//
// Created by P on 2024/7/11.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface i18nGiftNameMap : PIBaseModel
@property (nonatomic, copy) NSString *zh;
@property (nonatomic, copy) NSString *en;
@property (nonatomic, copy) NSString *ar;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// i18nGiftNameMap.m
// YuMi
//
// Created by P on 2024/7/11.
//
#import "i18nGiftNameMap.h"
@implementation i18nGiftNameMap
@end

View File

@@ -127,13 +127,16 @@
if (roomUid.length <=0) {
roomUid = @"";
}
@kWeakify(self);
[Api requestSendGift:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
GiftReceiveInfoModel *receive = [GiftReceiveInfoModel modelWithJSON:data.data];
receive.sourceType = giftSource;
receive.roomSendGiftType = roomSendType;
NSArray * array = [targetUids componentsSeparatedByString:@","];
[self.getView sendGiftSuccess:receive originDic:data.data uidCount:array.count];
}fail:^(NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
[[self getView] sendGiftFailWithCode:code msg:msg];
}] targetUids:targetUids giftNum:giftNum sendType:giftSendTypeStr giftId:giftId giftSource:giftSourceStr giftType:giftTypeStr roomUid:roomUid msg:msg uid:uid];
}

View File

@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *nick;
///
@property (nonatomic,copy) NSString *headWearUrl;
@property (nonatomic, assign) NSInteger headWearType;
///
@property (nonatomic,assign) BOOL vipMic;
///麦位光圈链接

View File

@@ -1039,6 +1039,7 @@
extModel.uid = userInfo.uid;
extModel.nick = userInfo.nick;
extModel.headWearUrl = userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic;
extModel.headWearType = userInfo.headwearType;
extModel.micCircle = userInfo.micCircle;
extModel.micNickColor = userInfo.micNickColor;
extModel.preventKick = userInfo.userVipInfoVO.preventKick;

View File

@@ -3853,7 +3853,6 @@ ineHeadView12" = "الحمل";
"XPRoomTypeSelectionViewController4" = "نوع الغرفة";
"XPRoomTypeSelectionViewController5" = "قيد الاستخدام";
"FeedBackViewController0" = "اختر نوع المشكلة";
"FeedBackViewController1" = "صف المشكلة";
"FeedBackViewController2" = "تحميل لقطة شاشة";
@@ -3861,3 +3860,27 @@ ineHeadView12" = "الحمل";
"FeedBackViewController4" = "من فضلك ادخل";
"FeedBackViewController5" = " رقم الهاتف او البريد الالكتروني";
"FeedBackViewController6" = "تم الإرسال بنجاح";
"GameOrderContent_0" = "لعب الالعاب كفريق واحد";
"GameOrderContent_1" = "اسم اللعبة";
"GameOrderContent_2" = "درجة الكفاءة";
"GameOrderContent_3" = "سعر الطلب";
"GameOrderContent_4" = "تقديم الطلب";
"GameOrderContent_5" = "دعوة الفريق";
"GameOrderContent_6" = "عدد جولات الفريق:";
"GameOrderContent_7" = "المجموع:";
"GameOrderContent_8" = "تسجيل الطلب";
"GameOrderContent_9" = "لقد بدأت";
"GameOrderContent_10" = "لقد استلمت";
"GameOrderContent_11" = "اسم اللعبة:";
"GameOrderContent_12" = "كمية الاستهلاك:";
"GameOrderContent_13" = "وقت الطلب:";
"GameOrderContent_14" = "رقم الطلب:";
"GameOrderContent_15" = "الدفع مرة اخري";
"GameOrderContent_16" = "العب اللعبة معي";
"GameOrderContent_17" = "%@الجولات";
"GameOrderContent_18" = "تم تقديم الطلب بنجاح";
"GameOrderContent_19" = "مدة اللعبة (ساعة):";
"GameOrderContent_20" = "%ld ساعة";
"GameOrderContent_21" = "الرصيد";
"GameOrderContent_22" = "يدفع";

View File

@@ -3660,3 +3660,27 @@
"FeedBackViewController4" = "Please enter...";
"FeedBackViewController5" = "Mobile phone number or email";
"FeedBackViewController6" = "Submitted successfully";
"GameOrderContent_0" = "Play games as a team";
"GameOrderContent_1" = "Game name";
"GameOrderContent_2" = "Proficiency";
"GameOrderContent_3" = "Order price";
"GameOrderContent_4" = "Place an order";
"GameOrderContent_5" = "Team invitation";
"GameOrderContent_6" = "Number of team rounds:";
"GameOrderContent_7" = "Total:";
"GameOrderContent_8" = "Order record";
"GameOrderContent_9" = "I initiated";
"GameOrderContent_10" = "I received";
"GameOrderContent_11" = "Game name:";
"GameOrderContent_12" = "Amount of consumption:";
"GameOrderContent_13" = "Order time :";
"GameOrderContent_14" = "Order number:";
"GameOrderContent_15" = "Pay again";
"GameOrderContent_16" = "Come play games with me~";
"GameOrderContent_17" = "%@rounds";
"GameOrderContent_18" = "Successfully ordered";
"GameOrderContent_19" = "Game duration (H):";
"GameOrderContent_20" = "%ld Hour";
"GameOrderContent_21" = "Balance";
"GameOrderContent_22" = "Pay";

View File

@@ -3323,3 +3323,27 @@
"FeedBackViewController4" = "請輸入…";
"FeedBackViewController5" = "手機號或郵箱";
"FeedBackViewController6" = "反饋成功";
"GameOrderContent_0" = "組隊開黑";
"GameOrderContent_1" = "遊戲名稱";
"GameOrderContent_2" = "熟練度";
"GameOrderContent_3" = "下單價格";
"GameOrderContent_4" = "下單";
"GameOrderContent_5" = "開黑邀請";
"GameOrderContent_6" = "開黑局數:";
"GameOrderContent_7" = "合計:";
"GameOrderContent_8" = "點單記錄";
"GameOrderContent_9" = "我發起的";
"GameOrderContent_10" = "我接收的";
"GameOrderContent_11" = "遊戲名稱:";
"GameOrderContent_12" = "消費金額:";
"GameOrderContent_13" = "下單時間:";
"GameOrderContent_14" = "訂單編號:";
"GameOrderContent_15" = "再次支付";
"GameOrderContent_16" = "和我一起玩遊戲吧~";
"GameOrderContent_17" = "%@局";
"GameOrderContent_18" = "下单成功~";
"GameOrderContent_19" = "开黑时长H";
"GameOrderContent_20" = "%ld 小时";
"GameOrderContent_21" = "餘額";
"GameOrderContent_22" = "支付";

View File

@@ -3313,3 +3313,27 @@
"FeedBackViewController4" = "請輸入…";
"FeedBackViewController5" = "手機號或郵箱";
"FeedBackViewController6" = "反饋成功";
"GameOrderContent_0" = "組隊開黑";
"GameOrderContent_1" = "遊戲名稱";
"GameOrderContent_2" = "熟練度";
"GameOrderContent_3" = "下單價格";
"GameOrderContent_4" = "下單";
"GameOrderContent_5" = "開黑邀請";
"GameOrderContent_6" = "開黑局數:";
"GameOrderContent_7" = "合計:";
"GameOrderContent_8" = "點單記錄";
"GameOrderContent_9" = "我發起的";
"GameOrderContent_10" = "我接收的";
"GameOrderContent_11" = "遊戲名稱:";
"GameOrderContent_12" = "消費金額:";
"GameOrderContent_13" = "下單時間:";
"GameOrderContent_14" = "訂單編號:";
"GameOrderContent_15" = "再次支付";
"GameOrderContent_16" = "和我一起玩遊戲吧~";
"GameOrderContent_17" = "%@局";
"GameOrderContent_18" = "下单成功~";
"GameOrderContent_19" = "开黑时长H";
"GameOrderContent_20" = "%ld 小时";
"GameOrderContent_21" = "餘額";
"GameOrderContent_22" = "支付";