Commit a9537a66 authored by 曹云霄's avatar 曹云霄

no message

parent 633804e3
...@@ -756,8 +756,8 @@ ...@@ -756,8 +756,8 @@
baseConfigurationReference = 2A3092547F488EFD2FBE5F24 /* Pods.debug.xcconfig */; baseConfigurationReference = 2A3092547F488EFD2FBE5F24 /* Pods.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/Palmwms/Tools/Macro/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/Palmwms/Tools/Macro/PrefixHeader.pch";
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
...@@ -780,7 +780,7 @@ ...@@ -780,7 +780,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.palmwms; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.palmwms;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "3f85aed4-daef-463f-be40-80512d051d3a";
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
...@@ -791,8 +791,8 @@ ...@@ -791,8 +791,8 @@
baseConfigurationReference = B94AB6672F835AEC7D22B9F4 /* Pods.release.xcconfig */; baseConfigurationReference = B94AB6672F835AEC7D22B9F4 /* Pods.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/Palmwms/Tools/Macro/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/Palmwms/Tools/Macro/PrefixHeader.pch";
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
...@@ -815,7 +815,7 @@ ...@@ -815,7 +815,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.palmwms; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.palmwms;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "3f85aed4-daef-463f-be40-80512d051d3a";
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "BNCoreServices.h" #import "BNCoreServices.h"
@interface AppDelegate () @interface AppDelegate ()
{ {
BMKMapManager* _mapManager; BMKMapManager* _mapManager;
...@@ -112,6 +113,8 @@ ...@@ -112,6 +113,8 @@
- (void)applicationDidEnterBackground:(UIApplication *)application { - (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"ONCENOPROMPT"];
[[NSUserDefaults standardUserDefaults] synchronize];
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
......
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
*/ */
- (void)showSheetViewWithMessage:(NSString *)message complete:(void(^)())finish; - (void)showSheetViewWithMessage:(NSString *)message complete:(void(^)())finish;
/**
* 下载离线地图
*/
- (void)downLoadLocationCityMaps;
#pragma mark -获取当前时间之前或之后的时间 #pragma mark -获取当前时间之前或之后的时间
- (NSString *)getTimeby:(NSInteger)day; - (NSString *)getTimeby:(NSInteger)day;
......
...@@ -11,7 +11,15 @@ ...@@ -11,7 +11,15 @@
#import "OfflineMapsManager.h" #import "OfflineMapsManager.h"
#import "AppDelegate.h" #import "AppDelegate.h"
NSString *const DOWNLOAD_MAP = @"MAP"; /**
* 永远不在提示
*/
NSString *const DOWNLOAD_MAP = @"NOPROMPT";
/**
* 本次不再提示
*/
NSString *const ONCEDOWNLOAD_MAP = @"ONCENOPROMPT";
@interface BaseViewController ()<OfflineMapsManagerDelegate> @interface BaseViewController ()<OfflineMapsManagerDelegate>
...@@ -63,7 +71,6 @@ NSString *const DOWNLOAD_MAP = @"MAP"; ...@@ -63,7 +71,6 @@ NSString *const DOWNLOAD_MAP = @"MAP";
[super viewDidLoad]; [super viewDidLoad];
[self customAppStyle]; [self customAppStyle];
[self addUserInformationKVO];
} }
#pragma mark - 自定义风格 #pragma mark - 自定义风格
...@@ -79,23 +86,24 @@ NSString *const DOWNLOAD_MAP = @"MAP"; ...@@ -79,23 +86,24 @@ NSString *const DOWNLOAD_MAP = @"MAP";
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectionUpdateVersion) name:UPLOADVERSION object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectionUpdateVersion) name:UPLOADVERSION object:nil];
} }
#pragma mark - 观察属性<driverAddress>以确定是否下载离线地图
- (void)addUserInformationKVO
{
[[UserInforMation manager] addObserver:self forKeyPath:@"driverAddress" options:NSKeyValueObservingOptionNew context:nil];
}
#pragma mark -KVO #pragma mark -下载定位城市离线地图
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context - (void)downLoadLocationCityMaps
{ {
WS(weakSelf);
if ([self.offline isDownloadMaps]) { if ([self.offline isDownloadMaps]) {
if (SHARED_APPDELEGATE.isWIFI) { if (SHARED_APPDELEGATE.isWIFI) {
if (![[NSUserDefaults standardUserDefaults] boolForKey:DOWNLOAD_MAP]) { if (![[NSUserDefaults standardUserDefaults] boolForKey:DOWNLOAD_MAP]) {
if (self.offline.downLoadState != 1 && self.offline.downLoadState != 2) { if (![[NSUserDefaults standardUserDefaults] boolForKey:ONCEDOWNLOAD_MAP]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:ONCEDOWNLOAD_MAP];
[[NSUserDefaults standardUserDefaults] synchronize];
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"是否下载当前城市离线地图以节省流量?" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"是否下载当前城市离线地图以节省流量?" preferredStyle:UIAlertControllerStyleActionSheet];
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]]; [alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self.offline startDownloadOfflineMaps:^(BOOL boolValue) { [weakSelf.offline startDownloadOfflineMaps:^(BOOL boolValue) {
if (!boolValue) {
[weakSelf SHOWPrompttext:@"启动下载失败"];
}
}]; }];
}]]; }]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"不再提示" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"不再提示" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
...@@ -141,6 +149,8 @@ NSString *const DOWNLOAD_MAP = @"MAP"; ...@@ -141,6 +149,8 @@ NSString *const DOWNLOAD_MAP = @"MAP";
{ {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self SHOWPrompttext:@"离线地图下载成功"]; [self SHOWPrompttext:@"离线地图下载成功"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:DOWNLOAD_MAP];
[[NSUserDefaults standardUserDefaults] synchronize];
} }
break; break;
case 5://校验失败 case 5://校验失败
...@@ -238,7 +248,6 @@ NSString *const DOWNLOAD_MAP = @"MAP"; ...@@ -238,7 +248,6 @@ NSString *const DOWNLOAD_MAP = @"MAP";
{ {
NSLog(@"取消下载"); NSLog(@"取消下载");
[self.offline pauseDownloadOfflineMaps]; [self.offline pauseDownloadOfflineMaps];
// [self RemoveMBProgressHUDLoding];
} }
#pragma mark -移除MBProgressHUD等待视图 #pragma mark -移除MBProgressHUD等待视图
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
*/ */
- (void)didFailToLocateUserWithError:(NSError *)error - (void)didFailToLocateUserWithError:(NSError *)error
{ {
[self SHOWPrompttext:@"定位失败"]; // [self SHOWPrompttext:@"定位失败"];
} }
...@@ -232,8 +232,6 @@ ...@@ -232,8 +232,6 @@
} }
#pragma mark - 释放 #pragma mark - 释放
- (void)dealloc { - (void)dealloc {
if (_mapView) { if (_mapView) {
......
...@@ -136,7 +136,6 @@ ...@@ -136,7 +136,6 @@
_locService.delegate = self; _locService.delegate = self;
_routesearch.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放 _routesearch.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放
_geographicSearch.delegate = self; _geographicSearch.delegate = self;
[self.locService startUserLocationService];
[self queryOrderBillDatasAndDepotInforMation]; [self queryOrderBillDatasAndDepotInforMation];
} }
...@@ -191,9 +190,11 @@ ...@@ -191,9 +190,11 @@
*/ */
- (void)onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error - (void)onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
{ {
NSLog(@"反地理编码成功"); NSLog(@"反地理编码成功----%p",[UserInforMation manager]);
[UserInforMation manager].driverAddress = result.addressDetail; BMKAddressComponent *content = result.addressDetail;
[UserInforMation manager].city = content.city;
[UserInforMation manager].address = result.address; [UserInforMation manager].address = result.address;
[self downLoadLocationCityMaps];
} }
/** /**
...@@ -203,7 +204,7 @@ ...@@ -203,7 +204,7 @@
*/ */
- (void)didFailToLocateUserWithError:(NSError *)error - (void)didFailToLocateUserWithError:(NSError *)error
{ {
[self SHOWPrompttext:@"定位失败"]; // [self SHOWPrompttext:@"定位失败"];
} }
#pragma mark -自定义用户大头针 #pragma mark -自定义用户大头针
...@@ -256,7 +257,7 @@ ...@@ -256,7 +257,7 @@
//起点 //起点
BMKPlanNode* start = [[BMKPlanNode alloc]init]; BMKPlanNode* start = [[BMKPlanNode alloc]init];
start.name = user.address; start.name = user.address;
start.cityName = user.driverAddress.city; start.cityName = user.city;
start.pt = CLLocationCoordinate2DMake(user.depotLatitude, user.depotLongitude); start.pt = CLLocationCoordinate2DMake(user.depotLatitude, user.depotLongitude);
//途径点 //途径点
NSMutableArray *array = [NSMutableArray array]; NSMutableArray *array = [NSMutableArray array];
...@@ -265,7 +266,7 @@ ...@@ -265,7 +266,7 @@
BusbillDtl *model = (BusbillDtl *)object; BusbillDtl *model = (BusbillDtl *)object;
BMKPlanNode* wayPointItem = [[BMKPlanNode alloc]init]; BMKPlanNode* wayPointItem = [[BMKPlanNode alloc]init];
wayPointItem.name = model.customerName; wayPointItem.name = model.customerName;
wayPointItem.cityName = user.driverAddress.city; wayPointItem.cityName = user.city;
CLLocationCoordinate2D pt = CLLocationCoordinate2DMake([model.customerLat doubleValue], [model.customerLng doubleValue]); CLLocationCoordinate2D pt = CLLocationCoordinate2DMake([model.customerLat doubleValue], [model.customerLng doubleValue]);
wayPointItem.pt = pt; wayPointItem.pt = pt;
[array addObject:wayPointItem]; [array addObject:wayPointItem];
......
...@@ -95,10 +95,14 @@ ...@@ -95,10 +95,14 @@
if (editingStyle == UITableViewCellEditingStyleDelete) { if (editingStyle == UITableViewCellEditingStyleDelete) {
BusbillDtl *model = self.orderDetails[indexPath.row]; BusbillDtl *model = self.orderDetails[indexPath.row];
if (![model.customerLng length]&& ![model.customerLat length]) {
[self SHOWPrompttext:@"该门店暂不支持导航"];
}else{
NaviManager *manager = [NaviManager manager]; NaviManager *manager = [NaviManager manager];
manager.delegate = self; manager.delegate = self;
[manager planningRouteBeforeStartNaviEndNodePoint:CLLocationCoordinate2DMake([model.customerLat doubleValue], [model.customerLng doubleValue])]; [manager planningRouteBeforeStartNaviEndNodePoint:CLLocationCoordinate2DMake([model.customerLat doubleValue], [model.customerLng doubleValue])];
} }
}
} }
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
{ {
NSArray *cityArray = [self.offlineMap getOfflineCityList]; NSArray *cityArray = [self.offlineMap getOfflineCityList];
for (BMKOLSearchRecord *model in cityArray) { for (BMKOLSearchRecord *model in cityArray) {
if ([model.cityName isEqualToString:[UserInforMation manager].driverAddress.city]) { if ([model.cityName isEqualToString:[UserInforMation manager].city]) {
return YES; return YES;
} }
} }
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
- (void)startDownloadOfflineMaps:(void (^)(BOOL))startState - (void)startDownloadOfflineMaps:(void (^)(BOOL))startState
{ {
//根据城市名获取城市信息,得到cityID //根据城市名获取城市信息,得到cityID
NSArray* city = [_offlineMap searchCity:[UserInforMation manager].driverAddress.city]; NSArray* city = [_offlineMap searchCity:[UserInforMation manager].city];
if (city.count > 0) { if (city.count > 0) {
BMKOLSearchRecord* oneCity = [city objectAtIndex:0]; BMKOLSearchRecord* oneCity = [city objectAtIndex:0];
self.locationCityId = oneCity.cityID; self.locationCityId = oneCity.cityID;
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
WS(weakSelf); WS(weakSelf);
[self showSheetViewWithMessage:@"请确认是否注销账号?" complete:^{ [self showSheetViewWithMessage:@"请确认是否注销账号?" complete:^{
[[weakSelf class] deleteAccountAndPassWord]; [[weakSelf class] deleteAccountAndPassWord];
[[UserInforMation manager] releaseSingleton];
self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
}]; }];
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "BMKGeocodeType.h" #import "BMKGeocodeType.h"
@class newData,newDriver; @class newData,newDriver;
@interface UserInforMation : NSObject @interface UserInforMation : NSObject
...@@ -20,6 +19,11 @@ ...@@ -20,6 +19,11 @@
*/ */
+ (UserInforMation *)manager; + (UserInforMation *)manager;
/**
* 释放单例
*/
- (void)releaseSingleton;
/** /**
* 用户名 * 用户名
...@@ -57,9 +61,9 @@ ...@@ -57,9 +61,9 @@
@property (nonatomic,assign) double depotLongitude; @property (nonatomic,assign) double depotLongitude;
/** /**
* 司机位置信息层次 * 司机位置城市
*/ */
@property (nonatomic,strong) BMKAddressComponent *driverAddress; @property (nonatomic,copy) NSString *city;
/** /**
* 司机位置全称 * 司机位置全称
......
...@@ -12,22 +12,23 @@ ...@@ -12,22 +12,23 @@
static UserInforMation *user = nil; static UserInforMation *user = nil;
static dispatch_once_t onceToken;
+ (UserInforMation *)manager + (UserInforMation *)manager
{ {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
user = [[UserInforMation alloc]init]; user = [[UserInforMation alloc]init];
}); });
return user; return user;
} }
+ (id)allocWithZone:(struct _NSZone *)zone
/**
* 释放单例
*/
- (void)releaseSingleton
{ {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
user = [super allocWithZone:zone];
});
return user;
} }
@end @end
......
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