Commit bfbfefee authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent b3e59008
......@@ -12,8 +12,9 @@
#import "ZhiJi-Swift.h"
#import "SDCycleScrollView.h"
#import "ZJDefaultTools.h"
#import "BaseWebViewController.h"
@interface ZJMemberPayViewController ()<SDCycleScrollViewDelegate>
@interface ZJMemberPayViewController ()<SDCycleScrollViewDelegate, UITextViewDelegate>
@property (nonatomic, weak) IBOutlet UITableView * tableView;
......@@ -260,14 +261,33 @@
CGRect rect = [des boundingRectWithSize:CGSizeMake(KScreenWidth-KScaleWidth(20), MAXFLOAT) options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:KFont(12)]} context:nil];
UILabel * desLab = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(10), self.mainScrollView.contentSize.height, KScreenWidth-KScaleWidth(20), rect.size.height)];
desLab.textColor = [UIColor whiteColor];
desLab.text = des;
desLab.numberOfLines = 0;
desLab.font = [UIFont systemFontOfSize:KFont(12)];
[self.mainScrollView addSubview:desLab];
// UILabel * desLab = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(10), self.mainScrollView.contentSize.height, KScreenWidth-KScaleWidth(20), rect.size.height)];
// desLab.textColor = [UIColor whiteColor];
// desLab.text = des;
// desLab.numberOfLines = 0;
// desLab.font = [UIFont systemFontOfSize:KFont(12)];
// [self.mainScrollView addSubview:desLab];
self.mainScrollView.contentSize = CGSizeMake(0, self.mainScrollView.contentSize.height+rect.size.height+KScaleWidth(10));
NSMutableAttributedString * attributeStr = [[NSMutableAttributedString alloc] initWithString:des];
[attributeStr addAttribute:NSLinkAttributeName value:@"user://" range:[des rangeOfString:kLocalizedString(@"setting_service")]];
[attributeStr addAttribute:NSLinkAttributeName value:@"privacy://" range:[des rangeOfString:kLocalizedString(@"setting_privacy")]];
[attributeStr addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:KFont(12)]} range:NSMakeRange(0, attributeStr.length)];
UITextView * textView = [[UITextView alloc] init];
textView.frame = CGRectMake(KScaleWidth(10), self.mainScrollView.contentSize.height, KScreenWidth-KScaleWidth(20), rect.size.height+KScaleWidth(32));
textView.backgroundColor = [UIColor clearColor];
textView.attributedText = attributeStr;
textView.linkTextAttributes = @{NSUnderlineStyleAttributeName:@1, NSUnderlineColorAttributeName:[UIColor whiteColor], NSForegroundColorAttributeName:[UIColor whiteColor]};
textView.delegate = self;
textView.font = [UIFont systemFontOfSize:KFont(12)];
textView.textColor = [UIColor whiteColor];
textView.textAlignment = NSTextAlignmentLeft;
textView.showsHorizontalScrollIndicator = NO;
textView.showsVerticalScrollIndicator = NO;
textView.editable = NO; //必须禁止输入,否则点击将弹出输入键盘
[self.mainScrollView addSubview:textView];
self.mainScrollView.contentSize = CGSizeMake(0, self.mainScrollView.contentSize.height+rect.size.height+KScaleWidth(32));
self.mainScrollView.backgroundColor = kColorFromRGB(0x568EFC);
}
}
......@@ -292,4 +312,35 @@
return 0;
}
#pragma mark textView
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction{
NSDictionary * dic = [ZJUserInfoManager shared].h5_url;
if ([URL.scheme isEqualToString:@"user"]){
NSLog(kLocalizedString(@"setting_service"));
BaseWebViewController * web = [[BaseWebViewController alloc] init];
web.url = [dic objectForKey:@"user"];
web.title = kLocalizedString(@"setting_service");
web.neverRefreshTitle = YES;
BaseNavigationViewController * nav = [[BaseNavigationViewController alloc] initWithRootViewController:web];
[self presentViewController:nav animated:YES completion:nil];
return NO;
}else if ([URL.scheme isEqualToString:@"privacy"]){
NSLog(kLocalizedString(@"setting_privacy"));
BaseWebViewController * web = [[BaseWebViewController alloc] init];
web.url = [dic objectForKey:@"privacy"];
web.title = kLocalizedString(@"setting_privacy");
web.neverRefreshTitle = YES;
BaseNavigationViewController * nav = [[BaseNavigationViewController alloc] initWithRootViewController:web];
[self presentViewController:nav animated:YES completion:nil];
return NO;
}
return YES;
}
@end
......@@ -23,7 +23,7 @@ class ZTPurchaseManager: NSObject {
switch result {
case .success(let product):
print("Purchase Success: \(product.productId)")
let receiptData = SwiftyStoreKit.localReceiptData
let receiptString = receiptData?.base64EncodedString(options: []) ?? ""
print("receiptString: \(receiptString)")
......
......@@ -263,7 +263,6 @@ static ZJUserInfoManager * manager;
[MBProgressHUD showError:[response objectForKey:@"msg"]];
}
} failure:^(NSError * _Nonnull error) {
}];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment