diff --git a/YuMi/Modules/YMMine/View/IncomeRecord/Presenter/XPIncomeRecordPresent.m b/YuMi/Modules/YMMine/View/IncomeRecord/Presenter/XPIncomeRecordPresent.m index 9f8f08b0..ac116eb1 100644 --- a/YuMi/Modules/YMMine/View/IncomeRecord/Presenter/XPIncomeRecordPresent.m +++ b/YuMi/Modules/YMMine/View/IncomeRecord/Presenter/XPIncomeRecordPresent.m @@ -40,10 +40,15 @@ } -(void)getExchangeDiamondInformation{ + @kWeakify(self); [Api getExchangeDiamondInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + @kStrongify(self); XPExchangeDiamondsModel *model = [XPExchangeDiamondsModel modelWithDictionary:data.data]; - [[self getView]getExchangeDiamondInformation:model]; - } showLoading:YES]]; + XPExchangeDiamondsModel *tempModel = [XPExchangeDiamondsModel modelWithDictionary:data.data]; + model.golds = tempModel.diamonds; + model.diamonds = tempModel.golds; + [[self getView] getExchangeDiamondInformation:model]; + } showLoading:YES]]; } -(void)confirmExchangeDiamondWithGoldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency{ [Api confirmExchangeDiamond:[self createHttpCompletion:^(BaseModel * _Nonnull data) { diff --git a/YuMi/Modules/YMMine/View/IncomeRecord/XPExchangeDiamondsView.m b/YuMi/Modules/YMMine/View/IncomeRecord/XPExchangeDiamondsView.m index 4db1216c..bad73e9c 100644 --- a/YuMi/Modules/YMMine/View/IncomeRecord/XPExchangeDiamondsView.m +++ b/YuMi/Modules/YMMine/View/IncomeRecord/XPExchangeDiamondsView.m @@ -36,15 +36,12 @@ #pragma mark - Private Method - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; - - - + [self addSubview:self.myGoldView]; [self addSubview:self.myDiamondsView]; [self addSubview:self.confirmBtn]; - - - @kWeakify(self) + + @kWeakify(self) self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) { @kStrongify(self) if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){ @@ -118,7 +115,7 @@ } if(self.diamondNum.doubleValue > self.model.maxDiamonds){ [XNDJTDDLoadingTool showErrorWithMessage:[NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsView4"),self.model.maxDiamonds]]; - return; + return; } [self.myGoldView resignResponder]; [self.myDiamondsView resignResponder]; @@ -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]; }