Commit 872cd0cf authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent f94730fe
......@@ -13,7 +13,6 @@
@property (nonatomic, weak) IBOutlet UIImageView * giftHeaderImv;
@property (nonatomic, weak) IBOutlet UIView * bgView;
@property (nonatomic, weak) IBOutlet UIView * giftBgView;
@property (nonatomic, strong) CAGradientLayer * gradientLayer;
@property (nonatomic, weak) IBOutlet UICollectionView * collectionView;
@property (nonatomic, strong) NSMutableArray * dataSource;
......@@ -26,6 +25,7 @@
self.hidden = YES;
self.bgView.backgroundColor = [UIColor clearColor];
self.giftBgView.backgroundColor = [UIColor clearColor];
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
// UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
// flowLayout.sectionInset=UIEdgeInsetsMake(0, 0, 0, 0);
......@@ -44,28 +44,10 @@
if (@available(iOS 11.0, *)) {
_collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
// gradient
_gradientLayer = [CAGradientLayer layer];
_gradientLayer.frame = _giftBgView.bounds;
_gradientLayer.startPoint = CGPointMake(0.5, 0.53);
_gradientLayer.endPoint = CGPointMake(0.5, 1);
_gradientLayer.colors = @[(__bridge id)[UIColor colorWithRed:249/255.0 green:234/255.0 blue:192/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:255/255.0 green:251/255.0 blue:240/255.0 alpha:1.0].CGColor];
_gradientLayer.locations = @[@(0), @(1.0f)];
_giftBgView.layer.cornerRadius = 10;
_giftBgView.layer.shadowColor = [UIColor colorWithRed:171/255.0 green:94/255.0 blue:26/255.0 alpha:0.3].CGColor;
_giftBgView.layer.shadowOffset = CGSizeMake(0,2);
_giftBgView.layer.shadowOpacity = 1;
_giftBgView.layer.shadowRadius = 4;
[_gradientLayer removeFromSuperlayer];
[_giftBgView.layer addSublayer:_gradientLayer];
}
- (void)layoutSubviews{
[super layoutSubviews];
_gradientLayer.frame = _giftBgView.bounds;
}
- (void)setBoxModel:(GYOpenBoxModel *)boxModel{
......@@ -147,6 +129,8 @@
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0, 0.0, 1.0)]];
animation.values = values;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[_bgView.layer addAnimation:animation forKey:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
......
......@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
......@@ -18,13 +19,16 @@
<rect key="frame" x="16.5" y="243" width="381" height="410"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_bg" translatesAutoresizingMaskIntoConstraints="NO" id="wec-0m-x6P">
<rect key="frame" x="5" y="86" width="371" height="334"/>
<rect key="frame" x="5" y="77.5" width="371" height="342.5"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LPX-8e-GMj">
<rect key="frame" x="18" y="106" width="345" height="219.5"/>
<rect key="frame" x="18" y="97.5" width="345" height="228"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_mask" translatesAutoresizingMaskIntoConstraints="NO" id="KPA-TL-pwU">
<rect key="frame" x="-5" y="5" width="355" height="228"/>
</imageView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="3gA-JC-WLJ">
<rect key="frame" x="0.0" y="50" width="345" height="169.5"/>
<rect key="frame" x="0.0" y="50" width="345" height="178"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="e4W-tH-xOm">
<size key="itemSize" width="128" height="128"/>
......@@ -36,8 +40,12 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="KPA-TL-pwU" firstAttribute="leading" secondItem="LPX-8e-GMj" secondAttribute="leading" constant="-5" id="BPz-MQ-Uzb"/>
<constraint firstAttribute="trailing" secondItem="KPA-TL-pwU" secondAttribute="trailing" constant="-5" id="aXr-aV-Ywu"/>
<constraint firstItem="3gA-JC-WLJ" firstAttribute="top" secondItem="LPX-8e-GMj" secondAttribute="top" constant="50" id="h1D-Cd-Nu2"/>
<constraint firstItem="3gA-JC-WLJ" firstAttribute="leading" secondItem="LPX-8e-GMj" secondAttribute="leading" id="k3m-hV-cua"/>
<constraint firstItem="KPA-TL-pwU" firstAttribute="top" secondItem="LPX-8e-GMj" secondAttribute="top" constant="5" id="nLd-QD-Kyf"/>
<constraint firstAttribute="bottom" secondItem="KPA-TL-pwU" secondAttribute="bottom" constant="-5" id="ncY-xC-XgS"/>
<constraint firstAttribute="bottom" secondItem="3gA-JC-WLJ" secondAttribute="bottom" id="wH8-WX-BiD"/>
<constraint firstAttribute="trailing" secondItem="3gA-JC-WLJ" secondAttribute="trailing" id="zXM-rR-nSh"/>
</constraints>
......@@ -109,6 +117,7 @@
<image name="gift_bg" width="335" height="334"/>
<image name="gift_cancel" width="32" height="32"/>
<image name="gift_confirm" width="284" height="46"/>
<image name="gift_mask" width="317" height="228"/>
<image name="order_header" width="353" height="155"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......
......@@ -16,7 +16,6 @@
@property (nonatomic, weak) IBOutlet UIView * bgView;
@property (nonatomic, weak) IBOutlet UIView * giftBgView;
@property (nonatomic, weak) IBOutlet UIButton * confirmBtn;
@property (nonatomic, strong) CAGradientLayer * gradientLayer;
@property (nonatomic, weak) IBOutlet UICollectionView * collectionView;
@property (nonatomic, strong) NSMutableArray * dataSource;
@property (nonatomic, weak) IBOutlet UILabel * orderDetailsLab;
......@@ -29,6 +28,7 @@
[super awakeFromNib];
self.hidden = YES;
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
_giftBgView.backgroundColor = [UIColor clearColor];
_bgView.backgroundColor = [UIColor clearColor];
// UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
// flowLayout.sectionInset=UIEdgeInsetsMake(0, 0, 0, 0);
......@@ -47,24 +47,6 @@
if (@available(iOS 11.0, *)) {
_collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
// gradient
_gradientLayer = [CAGradientLayer layer];
_gradientLayer.frame = _giftBgView.bounds;
_gradientLayer.startPoint = CGPointMake(0.5, 0.53);
_gradientLayer.endPoint = CGPointMake(0.5, 1);
_gradientLayer.colors = @[(__bridge id)[UIColor colorWithRed:249/255.0 green:234/255.0 blue:192/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:255/255.0 green:251/255.0 blue:240/255.0 alpha:1.0].CGColor];
_gradientLayer.locations = @[@(0), @(1.0f)];
_gradientLayer.cornerRadius = 10;
_giftBgView.layer.cornerRadius = 10;
_giftBgView.layer.shadowColor = [UIColor colorWithRed:171/255.0 green:94/255.0 blue:26/255.0 alpha:0.3].CGColor;
_giftBgView.layer.shadowOffset = CGSizeMake(0,2);
_giftBgView.layer.shadowOpacity = 1;
_giftBgView.layer.shadowRadius = 4;
[_gradientLayer removeFromSuperlayer];
[_giftBgView.layer addSublayer:_gradientLayer];
}
- (void)setModel:(GYOrderInfoModel *)model{
......@@ -88,7 +70,6 @@
- (void)layoutSubviews{
[super layoutSubviews];
_gradientLayer.frame = _giftBgView.bounds;
}
- (void)refreshDataSource{
......@@ -96,11 +77,6 @@
NSDictionary * orderDic = [[response objectForKey:@"result"] objectForKey:@"data"];
if ([[response objectForKey:@"status"] integerValue] == 200) {
NSData *data = [NSJSONSerialization dataWithJSONObject:orderDic options:NSJSONWritingFragmentsAllowed error:nil];
NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
GYOrderInfoModel * model = [[GYOrderInfoModel alloc] init];
[model setValuesForKeysWithDictionary:orderDic];
model.orderDetailModels = [NSMutableArray new];
......@@ -125,9 +101,9 @@
[[CGNetworkTools shared] postWithAction:DrawOrder parameters:@{} success:^(id _Nonnull response) {
[(AppDelegate*)[UIApplication sharedApplication].delegate ios_getOrderData];
[self refreshDataSource];
// [self dismiss];
// [(AppDelegate*)[UIApplication sharedApplication].delegate ios_getOrderData];
// [self refreshDataSource];
[self dismiss];
} failure:^(NSError * _Nonnull error) {
}];
......@@ -159,6 +135,8 @@
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0, 0.0, 1.0)]];
animation.values = values;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[_bgView.layer addAnimation:animation forKey:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
......
......@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
......@@ -23,13 +24,16 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lxp-qG-vhw">
<rect key="frame" x="24" y="77.5" width="333" height="390"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_mask" translatesAutoresizingMaskIntoConstraints="NO" id="uiT-rR-pXv">
<rect key="frame" x="-5" y="-5" width="343" height="410"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XsE-NZ-ege">
<rect key="frame" x="46" y="50" width="241.5" height="36"/>
<rect key="frame" x="44.5" y="50" width="244.5" height="36"/>
<attributedString key="attributedText">
<fragment content="完成当前订单将获得">
<attributes>
<color key="NSColor" red="0.5607843137254902" green="0.29803921568627451" blue="0.0039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" size="21" name=".PingFangSC-Regular"/>
<font key="NSFont" metaFont="system" size="21"/>
</attributes>
</fragment>
<fragment content="12">
......@@ -41,7 +45,7 @@
<fragment content="元">
<attributes>
<color key="NSColor" red="0.5607843137254902" green="0.29803921568627451" blue="0.0039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" size="21" name=".PingFangSC-Regular"/>
<font key="NSFont" metaFont="system" size="21"/>
</attributes>
</fragment>
</attributedString>
......@@ -64,8 +68,12 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="uiT-rR-pXv" secondAttribute="bottom" constant="-15" id="5vf-FC-Nw9"/>
<constraint firstItem="XsE-NZ-ege" firstAttribute="centerX" secondItem="Lxp-qG-vhw" secondAttribute="centerX" id="ID6-Bp-dyo"/>
<constraint firstAttribute="trailing" secondItem="uiT-rR-pXv" secondAttribute="trailing" constant="-5" id="IQu-z8-A9H"/>
<constraint firstItem="uiT-rR-pXv" firstAttribute="top" secondItem="Lxp-qG-vhw" secondAttribute="top" constant="-5" id="Itd-Ro-7jT"/>
<constraint firstAttribute="bottom" secondItem="tw6-yx-5Z1" secondAttribute="bottom" constant="10" id="Shp-hl-5x4"/>
<constraint firstItem="uiT-rR-pXv" firstAttribute="leading" secondItem="Lxp-qG-vhw" secondAttribute="leading" constant="-5" id="mjI-Rc-e8d"/>
<constraint firstItem="tw6-yx-5Z1" firstAttribute="top" secondItem="XsE-NZ-ege" secondAttribute="bottom" constant="9" id="ndH-SW-o4o"/>
<constraint firstItem="XsE-NZ-ege" firstAttribute="top" secondItem="Lxp-qG-vhw" secondAttribute="top" constant="50" id="okA-MP-KQM"/>
<constraint firstAttribute="trailing" secondItem="tw6-yx-5Z1" secondAttribute="trailing" constant="30" id="tF7-L2-orQ"/>
......@@ -87,9 +95,10 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A5E-Ea-tdS">
<rect key="frame" x="48.5" y="476.5" width="284" height="52.5"/>
<rect key="frame" x="49" y="476.5" width="283" height="52.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="A5E-Ea-tdS" secondAttribute="height" multiplier="248:46" id="JFt-2h-US1"/>
<constraint firstAttribute="height" constant="52.5" id="Rnd-Cb-rta"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<state key="normal" title="继续种植完成订单" backgroundImage="gift_confirm"/>
......@@ -147,6 +156,7 @@
<resources>
<image name="gift_cancel" width="32" height="32"/>
<image name="gift_confirm" width="284" height="46"/>
<image name="gift_mask" width="317" height="228"/>
<image name="order_bg" width="335" height="486"/>
<image name="order_header" width="353" height="155"/>
<systemColor name="systemBackgroundColor">
......
......@@ -63,6 +63,8 @@
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0, 0.0, 1.0)]];
animation.values = values;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[_bgView.layer addAnimation:animation forKey:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.31 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "矩形@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "矩形@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -23,9 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSDictionary *)h5_url;
- (NSDictionary *)open1close0;
- (NSDictionary *)config;
- (NSDictionary *)appSwitch;
- (BOOL)isShowSplashAd;
......
......@@ -63,12 +63,8 @@ static CGUserManager * manager;
return [[_data Read] objectForKey:@"urlInfo"];
}
- (NSDictionary *)open1close0{
return [[_data Read] objectForKey:@"open1close0"];
}
- (NSDictionary *)config{
return [[_data Read] objectForKey:@"config"];
- (NSDictionary *)appSwitch{
return [[_data Read] objectForKey:@"switch"];
}
- (BOOL)isMember {
......@@ -180,17 +176,12 @@ static CGUserManager * manager;
if ([[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"h5_url"]) {
[self.data WirteDic:[[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"h5_url"] Key:@"urlInfo"];
} else {
[self.data removeDicForKey:@"urlInfo"];
// [self.data removeDicForKey:@"urlInfo"];
}
if ([[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"config"]) {
[self.data WirteDic:[[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"config"] Key:@"config"];
if ([[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"switch"]) {
[self.data WirteDic:[[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"switch"] Key:@"switch"];
} else {
// [self.data removeDicForKey:@"config"];
}
if ([[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"open1close0"]) {
[self.data WirteDic:[[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"open1close0"] Key:@"open1close0"];
} else {
// [data removeDicForKey:@"open1close0"];
}
success ? success() : nil;
}else{
......
......@@ -41,14 +41,14 @@
[UINavigationBar appearance].translucent = YES;
}
- (void)viewWillDisappear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:true animated:true];
self.navigationController.navigationBar.tintColor = tintColor;
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:titleColor};
self.navigationController.navigationBar.barTintColor = barTintColor;
[UINavigationBar appearance].translucent = YES;
}
//- (void)viewWillDisappear:(BOOL)animated{
// [self.navigationController setNavigationBarHidden:true animated:true];
//
// self.navigationController.navigationBar.tintColor = tintColor;
// self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:titleColor};
// self.navigationController.navigationBar.barTintColor = barTintColor;
// [UINavigationBar appearance].translucent = YES;
//}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -94,9 +94,12 @@
cell.titleLab.text = _dataSourceArray[indexPath.row];
cell.detailsLab.text = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
cell.detailsLab.hidden = indexPath.row != 1;
if (indexPath.row == 0) {
cell.detailsLab.text = [NSString stringWithFormat:@"官方@@:%@", [[CGUserManager shared].appSwitch objectForKey:@"qq"]];
}else if (indexPath.row == 1) {
cell.detailsLab.text = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
}
cell.detailsLab.hidden = !(indexPath.row == 1 || indexPath.row == 0);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
......@@ -135,8 +138,9 @@
GYWebViewController * web = [[GYWebViewController alloc] init];
web.url = urlStr;
web.webTitle = _dataSourceArray[indexPath.row];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:web];
[self presentViewController:nav animated:YES completion:nil];
web.showNav = YES;
// UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:web];
[self.navigationController pushViewController:web animated:YES];
}
......
......@@ -13,7 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface GYWebViewController : UIViewController
@property (nonatomic, copy) NSString * url;
@property (nonatomic, copy) NSString *webTitle;
@property (nonatomic, copy) NSString * webTitle;
@property (nonatomic, assign) bool showNav;
@end
......
......@@ -8,6 +8,7 @@
#import "GYWebViewController.h"
#import <WebKit/WebKit.h>
#import "GYSettingViewController.h"
@interface GYWebViewController ()<WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler>
......@@ -19,6 +20,11 @@
@implementation GYWebViewController
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:!_showNav animated:true];
}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -37,6 +43,7 @@
// Fallback on earlier versions
}
[webViewConfig.userContentController addScriptMessageHandler:self name:@"backTrack"];
[webViewConfig.userContentController addScriptMessageHandler:self name:@"settingCallBack"];
//屏蔽底部黑框
self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) configuration:webViewConfig];
......@@ -69,16 +76,23 @@
// backButton.frame = CGRectMake(0, 0, 50, 44);
// [backButton setImage:[UIImage imageNamed:@"back_black"] forState:UIControlStateNormal];
// [backButton addTarget:self action:@selector(goBackController) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(goBackController)];
// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(goBackController)];
if (!_showNav){
if (@available(iOS 11.0, *)) {
self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
}
}
- (void)onBack:(UIButton *)button{
[self goBackController];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:false animated: true];
- (void)goSetting{
GYSettingViewController * setting = [[UIStoryboard storyboardWithName:@"GYNative" bundle:nil] instantiateViewControllerWithIdentifier:@"GYSettingViewController"];
[self.navigationController pushViewController:setting animated:YES];
}
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation{
......@@ -179,6 +193,7 @@
- (void)dealloc {
[_webView removeObserver:self forKeyPath:@"estimatedProgress"];
[_webView.configuration.userContentController removeScriptMessageHandlerForName:@"backTrack"];
[_webView.configuration.userContentController removeScriptMessageHandlerForName:@"settingCallBack"];
}
......@@ -189,6 +204,11 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf goBackController];
});
}else if ([message.name isEqualToString:@"settingCallBack"]){
__weak typeof(self) weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf goSetting];
});
}
}
......
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