修复兑换钻石时,本地使用了金币数判断问题

This commit is contained in:
eggmanQQQ
2024-06-09 16:43:52 +08:00
parent 3e9181e60b
commit 8123b81811
2 changed files with 13 additions and 11 deletions

View File

@@ -40,8 +40,13 @@
}
-(void)getExchangeDiamondInformation{
@kWeakify(self);
[Api getExchangeDiamondInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
XPExchangeDiamondsModel *model = [XPExchangeDiamondsModel modelWithDictionary:data.data];
XPExchangeDiamondsModel *tempModel = [XPExchangeDiamondsModel modelWithDictionary:data.data];
model.golds = tempModel.diamonds;
model.diamonds = tempModel.golds;
[[self getView] getExchangeDiamondInformation:model];
} showLoading:YES]];
}

View File

@@ -37,13 +37,10 @@
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.myGoldView];
[self addSubview:self.myDiamondsView];
[self addSubview:self.confirmBtn];
@kWeakify(self)
self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
@kStrongify(self)
@@ -228,12 +225,12 @@
-(void)setModel:(XPExchangeDiamondsModel *)model{
_model = model;
if(self.type == IncomeRecord_Gold){
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView0"),@(_model.diamonds)];
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView0"),@(_model.golds)];
UIImage *image = [UIImage imageNamed:@"ms_exchange_coin_icon"];
[_iconView setImage:image forState:UIControlStateNormal];
}else{
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView1"),_model.golds];
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView1"),_model.diamonds];
UIImage *image = [UIImage imageNamed:@"exchange_new_diamonds_icon"];
[_iconView setImage:image forState:UIControlStateNormal];
}