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

no message

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