Commit 720de45f by 路少雄

1.部分更新

parent df583735
...@@ -3197,7 +3197,7 @@ ...@@ -3197,7 +3197,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.4; MARKETING_VERSION = 1.2.7;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater; PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
...@@ -3243,7 +3243,7 @@ ...@@ -3243,7 +3243,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.4; MARKETING_VERSION = 1.2.7;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater; PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......
...@@ -167,26 +167,41 @@ ...@@ -167,26 +167,41 @@
[SVProgressHUD dismiss]; [SVProgressHUD dismiss];
NSLog(@"responseObject:\n%@===%@",responseObject,responseObject[@"msg"]); NSLog(@"responseObject:\n%@===%@",responseObject,responseObject[@"msg"]);
XHGetDataManager.giftLink = responseObject[@"data"]; NSString *giftL = responseObject[@"data"];
if (XHGetDataManager.token) {
XHGetDataManager.giftLink = [NSString stringWithFormat:@"%@?token=%@",giftL,XHGetDataManager.token];
}
// XHGetDataManager.giftLink = responseObject[@"data"];
dispatch_async(self.main_queue_t, ^{ dispatch_async(self.main_queue_t, ^{
[weakSelf setAppWindows]; [weakSelf setAppWindows];
[weakSelf setRootViewController]; [weakSelf setRootViewController];
}); });
} fail:^(id failMessage) { } fail:^(id failMessage) {
dispatch_async(self.main_queue_t, ^{
[weakSelf setAppWindows];
[weakSelf setRootViewController];
});
}networkRequestsFail:^(id networkFail) { }networkRequestsFail:^(id networkFail) {
dispatch_async(self.main_queue_t, ^{
[weakSelf setAppWindows];
[weakSelf setRootViewController];
});
}]; }];
} }
-(void)LoginSuccess{ -(void)LoginSuccess{
HJSelfWeak; HJSelfWeak;
dispatch_async(self.main_queue_t, ^{ if ([XHDataManager sharedManager].simparlanguage == 0) {
[weakSelf setAppWindows]; [self requestGiftLink];
[weakSelf setRootViewController]; }else{
}); dispatch_async(self.main_queue_t, ^{
[self requestGiftLink]; [weakSelf setAppWindows];
[weakSelf setRootViewController];
});
}
}// }//
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.navigationController.interactivePopGestureRecognizer.enabled = NO;
} }
// self.delegate = self; self.delegate = self;
XHTabBar *tabBar = [[XHTabBar alloc] init]; XHTabBar *tabBar = [[XHTabBar alloc] init];
tabBar.tabBarDelegate = self; tabBar.tabBarDelegate = self;
[self setValue:tabBar forKeyPath:@"tabBar"]; [self setValue:tabBar forKeyPath:@"tabBar"];
...@@ -279,15 +279,27 @@ ...@@ -279,15 +279,27 @@
{ {
// NSLog(@"%@%@",tabBar,item); // NSLog(@"%@%@",tabBar,item);
// XHUINavigationController *bannerNav = self.viewControllers[1];
//
// DXBannerVC *banner = bannerNav.viewControllers[0];
// banner.url = XHGetDataManager.giftLink;
// banner.hidesBottomBarWhenPushed = YES; // banner.hidesBottomBarWhenPushed = YES;
// [weakSelf.tabBarController setSelectedIndex:1]; // [weakSelf.tabBarController setSelectedIndex:1];
} }
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
if ([XHDataManager sharedManager].simparlanguage == 0) {
if (viewController == tabBarController.viewControllers[1]) {
XHUINavigationController *bannerNav = self.viewControllers[1];
DXBannerVC *banner = bannerNav.viewControllers[0];
banner.url = XHGetDataManager.giftLink;
}else{
}
}
return YES;
}
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#ifndef XHURL_h #ifndef XHURL_h
#define XHURL_h #define XHURL_h
#define DRURL @"https://testdjm.imoreme.com"//测试 //#define DRURL @"https://testdjm.imoreme.com"//测试
//#define DRURL @"https://djm.imoreme.com"//正式 #define DRURL @"https://djm.imoreme.com"//正式
//#define URL @"http://192.168.1.168:8080"//luocong //#define URL @"http://192.168.1.168:8080"//luocong
//#define URL @"http://192.168.1.66:9012"//luocong //#define URL @"http://192.168.1.66:9012"//luocong
......
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
if (!self.url || [self.url isEqualToString:@""]) { if (!self.url || [self.url isEqualToString:@""]) {
// self.url = XHGetDataManager.giftLink; // self.url = XHGetDataManager.giftLink;
self.url = [NSString stringWithFormat:@"%@?token=%@",XHGetDataManager.giftLink,XHGetDataManager.token]; // self.url = [NSString stringWithFormat:@"%@?token=%@",XHGetDataManager.giftLink,XHGetDataManager.token];
self.url = [NSString stringWithFormat:@"%@",XHGetDataManager.giftLink];
self.navigationController.navigationBar.hidden = YES; self.navigationController.navigationBar.hidden = YES;
}else{ }else{
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
...@@ -86,6 +87,7 @@ ...@@ -86,6 +87,7 @@
- (void)setUrl:(NSString *)url{ - (void)setUrl:(NSString *)url{
// url = @"https://www.baidu.com"; // url = @"https://www.baidu.com";
_url = url; _url = url;
NSURL *url1 = [NSURL URLWithString:url]; NSURL *url1 = [NSURL URLWithString:url];
// 根据URL创建请求 // 根据URL创建请求
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url1]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url1];
......
...@@ -79,10 +79,11 @@ ...@@ -79,10 +79,11 @@
if (!self.url || [self.url isEqualToString:@""]) { if (!self.url || [self.url isEqualToString:@""]) {
// self.url = XHGetDataManager.giftLink; // self.url = XHGetDataManager.giftLink;
self.url = [NSString stringWithFormat:@"%@?token=%@",XHGetDataManager.giftLink,XHGetDataManager.token]; // self.url = [NSString stringWithFormat:@"%@?token=%@",XHGetDataManager.giftLink,XHGetDataManager.token];
self.url = [NSString stringWithFormat:@"%@",XHGetDataManager.giftLink];
self.navigationController.navigationBar.hidden = YES; self.navigationController.navigationBar.hidden = YES;
}else{ }else{
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = YES;
} }
//http://djmfa.imoreme.com/#/pages/goshop/goshop?token= //http://djmfa.imoreme.com/#/pages/goshop/goshop?token=
...@@ -98,6 +99,11 @@ ...@@ -98,6 +99,11 @@
- (void)setUrl:(NSString *)url{ - (void)setUrl:(NSString *)url{
// url = @"https://www.baidu.com"; // url = @"https://www.baidu.com";
_url = url; _url = url;
// if ([url isEqualToString:XHGetDataManager.giftLink]) {
// url = [NSString stringWithFormat:@"%@?token=%@",XHGetDataManager.giftLink,XHGetDataManager.token];
// }
NSURL *url1 = [NSURL URLWithString:url]; NSURL *url1 = [NSURL URLWithString:url];
// 根据URL创建请求 // 根据URL创建请求
...@@ -106,7 +112,7 @@ ...@@ -106,7 +112,7 @@
// NSURLRequest *request = [NSURLRequest requestWithURL:url1]; // NSURLRequest *request = [NSURLRequest requestWithURL:url1];
// WKWebView加载请求 // WKWebView加载请求
[self.webView loadRequest:request]; [self.webView loadRequest:request];
[self.webView reload]; // [self.webView reload];
} }
#pragma mark --委托代理 #pragma mark --委托代理
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
...@@ -118,36 +124,39 @@ ...@@ -118,36 +124,39 @@
NSURL *url = (NSURL *)change[NSKeyValueChangeNewKey]; NSURL *url = (NSURL *)change[NSKeyValueChangeNewKey];
// https://map.qq.com/nav/drive#routes/page?eword=%E6%B5%8B&epointx=113.93041&epointy=22.53332&noback=&referer=groupActivity&ch=mc_h5marker // https://map.qq.com/nav/drive#routes/page?eword=%E6%B5%8B&epointx=113.93041&epointy=22.53332&noback=&referer=groupActivity&ch=mc_h5marker
// dispatch_async(dispatch_get_main_queue(), ^{ // dispatch_async(dispatch_get_main_queue(), ^{
if ([url.absoluteString rangeOfString:@"map.qq.com/m/mqq/nav/"].location != NSNotFound) { if (![url isKindOfClass:[NSNull class]]) {
if ([url.absoluteString rangeOfString:@"map.qq.com/m/mqq/nav/"].location != NSNotFound) {
NSString *pattern = @"eword=([^&]+).*?epointx=([^&]+).*?epointy=([^&]+)";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
// 在 URL 字符串中搜索匹配的内容
NSTextCheckingResult *result = [regex firstMatchInString:url.absoluteString options:0 range:NSMakeRange(0, url.absoluteString.length)];
// 如果找到匹配项,则提取相应的值
NSString *eword = [url.absoluteString substringWithRange:[result rangeAtIndex:1]];
NSString *epointx = [url.absoluteString substringWithRange:[result rangeAtIndex:2]];
NSString *epointy = [url.absoluteString substringWithRange:[result rangeAtIndex:3]];
// 打印提取到的值
NSLog(@"eword: %@", eword);
NSLog(@"epointx: %@", epointx);
NSLog(@"epointy: %@", epointy);
// 创建一个MKPlacemark对象,表示目标位置的地标 NSString *pattern = @"eword=([^&]+).*?epointx=([^&]+).*?epointy=([^&]+)";
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:CLLocationCoordinate2DMake([epointy doubleValue], [epointx doubleValue])]; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
// 创建一个MKMapItem对象,表示要在地图中显示的位置 // 在 URL 字符串中搜索匹配的内容
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark]; NSTextCheckingResult *result = [regex firstMatchInString:url.absoluteString options:0 range:NSMakeRange(0, url.absoluteString.length)];
[mapItem setName:[eword stringByRemovingPercentEncoding]]; // 设置地点的名称,可选
// 如果找到匹配项,则提取相应的值
NSString *eword = [url.absoluteString substringWithRange:[result rangeAtIndex:1]];
NSString *epointx = [url.absoluteString substringWithRange:[result rangeAtIndex:2]];
NSString *epointy = [url.absoluteString substringWithRange:[result rangeAtIndex:3]];
// 打印提取到的值
NSLog(@"eword: %@", eword);
NSLog(@"epointx: %@", epointx);
NSLog(@"epointy: %@", epointy);
// 创建一个MKPlacemark对象,表示目标位置的地标
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:CLLocationCoordinate2DMake([epointy doubleValue], [epointx doubleValue])];
// 创建一个MKMapItem对象,表示要在地图中显示的位置
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem setName:[eword stringByRemovingPercentEncoding]]; // 设置地点的名称,可选
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsShowsTrafficKey: [NSNumber numberWithBool:YES]}];
// 使用mapItem打开苹果地图应用
// [mapItem openInMapsWithLaunchOptions:nil];
}
}
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsShowsTrafficKey: [NSNumber numberWithBool:YES]}];
// 使用mapItem打开苹果地图应用
// [mapItem openInMapsWithLaunchOptions:nil];
}
// }); // });
......
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