v2内购
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPIncomeRecordVC.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
#import "YuMi-swift.h"
|
||||
UIKIT_EXTERN NSString *kRequestRicket;
|
||||
|
||||
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
|
||||
@@ -294,11 +295,96 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_My_Refund:{
|
||||
#ifdef DEBUG
|
||||
|
||||
|
||||
UIView *bgView = [[UIView alloc]init];
|
||||
[kWindow addSubview:bgView];
|
||||
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.left.bottom.right.mas_equalTo(0);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hiddenTextVeiw:)];
|
||||
[bgView addGestureRecognizer:tap];
|
||||
bgView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
|
||||
|
||||
UIView *bgView1 = [UIView new];
|
||||
bgView1.layer.cornerRadius = 10;
|
||||
bgView1.layer.masksToBounds = YES;
|
||||
[bgView addSubview:bgView1];
|
||||
bgView1.backgroundColor = [UIColor whiteColor];
|
||||
CGFloat width = KScreenWidth - kGetScaleWidth(60);
|
||||
[bgView1 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.equalTo(bgView);
|
||||
make.width.mas_equalTo(width);
|
||||
make.height.mas_equalTo(kGetScaleWidth(200));
|
||||
}];
|
||||
|
||||
|
||||
UITextField *textf = [[UITextField alloc]init];
|
||||
textf.backgroundColor = UIColorRGBAlpha(0xBBBCCF, 0.1);
|
||||
textf.layer.cornerRadius = kGetScaleWidth(40)/2;
|
||||
textf.layer.masksToBounds = YES;
|
||||
textf.attributedPlaceholder = [[NSMutableAttributedString alloc]initWithString:@" 请输入订单号" attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x2B2D33),NSFontAttributeName:kFontRegular(14)}];
|
||||
textf.textColor = UIColorFromRGB(0x222222);
|
||||
|
||||
textf.font = kFontRegular(14);
|
||||
[bgView1 addSubview:textf];
|
||||
[textf mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(bgView1);
|
||||
make.top.mas_equalTo(kGetScaleWidth(25));
|
||||
make.left.right.equalTo(bgView1).inset(kGetScaleWidth(30));
|
||||
make.height.mas_equalTo(kGetScaleWidth(40));
|
||||
}];
|
||||
textf.tag = 1001;
|
||||
|
||||
UIButton *bnt = [UIButton new];
|
||||
[bnt setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(200), kGetScaleWidth(50))] forState:UIControlStateNormal];
|
||||
[bnt setTitle:@"确定" forState:UIControlStateNormal];
|
||||
[bnt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[bnt addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[bgView1 addSubview:bnt];
|
||||
[bnt mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(bgView1);
|
||||
make.top.equalTo(textf.mas_bottom).mas_offset(kGetScaleWidth(40));
|
||||
make.width.mas_equalTo(kGetScaleWidth(250));
|
||||
make.height.mas_equalTo(kGetScaleWidth(50));
|
||||
}];
|
||||
bnt.layer.cornerRadius = kGetScaleWidth(50)/2;
|
||||
bnt.layer.masksToBounds = YES;
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)hiddenTextVeiw:(UITapGestureRecognizer *)sender{
|
||||
[sender.view removeFromSuperview];
|
||||
|
||||
}
|
||||
- (void)textFieldDidChange:(UIButton *)sender {
|
||||
|
||||
UITextField *textField = [sender.superview viewWithTag:1001];
|
||||
[textField.superview.superview removeFromSuperview];
|
||||
if (textField.text.length == 0) {
|
||||
[self showErrorToast:@"请输入订单号"];
|
||||
return;
|
||||
}
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPPayment *iap = [PIIAPPayment shared];
|
||||
NSUInteger text = [textField.text integerValue];
|
||||
[iap refunRequestWithView:self.view transactionId:text completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)pushWebViewWIthUrl:(NSString *)url {
|
||||
XPWebViewController * webVC = [[XPWebViewController alloc] init];
|
||||
|
Reference in New Issue
Block a user