Feature: 完成金币兑换 UX 调整

This commit is contained in:
edwinQQQ
2025-03-07 11:03:35 +08:00
parent 9d3f08c9b3
commit e152d0f8a1
5 changed files with 61 additions and 28 deletions

View File

@@ -47,21 +47,6 @@
[self addSubview:self.confirmBtn];
@kWeakify(self)
// self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
// @kStrongify(self)
// if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){
// self.confirmBtn.enabled = NO;
// self.myGoldView.text = @"";
// self.myDiamondsView.text = @"";
// return;
// }
// self.chooseType = IncomeRecord_Gold;
// self.confirmBtn.enabled = YES;
// self.goldNum = goldNum;
// self.diamondNum = diamondNum;
// self.myDiamondsView.count = diamondNum;
//
// };
self.myDiamondsView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
@kStrongify(self)
if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){
@@ -71,12 +56,12 @@
return;
}
self.confirmBtn.enabled = YES;
self.confirmBtn.enabled = diamondNum.integerValue > 0;
self.goldNum = goldNum;
self.diamondNum = diamondNum;
self.myGoldView.count = diamondNum;
self.chooseType = IncomeRecord_Diamond;
};
}
@@ -113,10 +98,6 @@
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPExchangeDiamondsView2")];
return;
}
// if(self.diamondNum.doubleValue < self.model.minDiamonds){
// [XNDJTDDLoadingTool showErrorWithMessage:[NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsView3"),self.model.minDiamonds]];
// return;
// }
if(self.diamondNum.doubleValue > self.model.maxDiamonds){
[XNDJTDDLoadingTool showErrorWithMessage:[NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsView4"),self.model.maxDiamonds]];
return;
@@ -267,14 +248,10 @@
}
NSInteger count = textField.text.integerValue;
// if(self.type == IncomeRecord_Gold){
// NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(count / _model.rate)];
// if(self.inputCounthandle){
// self.inputCounthandle(goldNum, textField.text);
// }
// return;
// }
NSString *diamondNum = [NSString stringWithFormat:@"%.0f",floorf(count * _model.rate)];
if (count < 1000) {
diamondNum = @"0";
}
if(self.inputCounthandle){
self.inputCounthandle(textField.text,diamondNum);
}

View File

@@ -0,0 +1,16 @@
//
// ShareHelder.h
// YuMi
//
// Created by P on 2025/3/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShareHelder : NSObject
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// ShareHelder.m
// YuMi
//
// Created by P on 2025/3/6.
//
#import "ShareHelder.h"
@implementation ShareHelder
@end

View File

@@ -0,0 +1,16 @@
//
// ShareProvider.h
// YuMi
//
// Created by P on 2025/3/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShareProvider : UIActivityItemProvider
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// ShareProvider.m
// YuMi
//
// Created by P on 2025/3/6.
//
#import "ShareProvider.h"
@implementation ShareProvider
@end