(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
[[Singleton sharedInstance] setMapViewPage:MAP_VIEW_MAIN];
//预约订单视图初始化,解决iphone 4s显示不全预约订单图层控件问题
// servicingView.delegte=self;
//由于接单按钮图层出来时,会调用viewWillDisappear
// if(![[Singleton sharedInstance] getShowNoticecarview])
// {
[[Singleton sharedInstance] setShowNoticecarview : NO];
_mapView.delegate = self;
//
//
//
//
// }
if (_isBookingServicing)
{
[self ReceiveBookingServiceStart];
_isBookingServicing = NO;
}
_mapView.customizeUserLocationAccuracyCircleRepresentation = YES; if(!_bShowed) { if(PROCESSING_ORDER_STATE_IMMEDIATELY_ARRIVE == [GlobalShare getGlobalShare].user.processingOrderStat) { _orderDict = [[Singleton sharedInstance] getOrderDetail]; [[Singleton sharedInstance] setProcessingOrderId:-1]; newDict = nil;
// _haveProcessingOrder = NO;
[[Singleton sharedInstance] setHaveProcessingOrder:YES];
[self initWithServicingStatus]; [servicingView SetValueWithDictionary:[[GlobalShare getGlobalShare]GetCurrentOrderDictionaryFromSandBox]]; } else if(PROCESSING_ORDER_STATE_WAIT_START_CHARGING == [GlobalShare getGlobalShare].user.processingOrderStat) { _orderDict = [[Singleton sharedInstance] getOrderDetail]; [[Singleton sharedInstance] setProcessingOrderId:-1]; newDict = nil; [[Singleton sharedInstance] setHaveProcessingOrder:YES]; [self notifinotionCostumerTheCarWillArrive]; [servicingView SetValueWithDictionary:[[GlobalShare getGlobalShare]GetCurrentOrderDictionaryFromSandBox]]; self.navigationItem.title = @"服务中"; // [self painAction:nil]; } else if(PROCESSING_ORDER_STATE_WAIT_END_CHARGING == [GlobalShare getGlobalShare].user.processingOrderStat) { [self drawPolyline]; _orderDict = [[Singleton sharedInstance] getOrderDetail]; [[Singleton sharedInstance] setReLoadOrderId:[[_orderDict objectForKey:@"id"] intValue]]; [[Singleton sharedInstance] setHaveProcessingOrder:YES]; [self StartBilling]; [servicingView SetValueWithDictionary:[[GlobalShare getGlobalShare]GetCurrentOrderDictionaryFromSandBox]]; // [self painAction:nil]; } else if(PROCESSING_ORDER_STATE_WAIT_FEE_SETTLEMENT == [GlobalShare getGlobalShare].user.processingOrderStat) { MoneyAccountViewController *moneyVC = [[MoneyAccountViewController alloc] init]; newDict = nil; moneyVC.priceDict = [[GlobalShare getGlobalShare] GetCurrentCheckDictionaryFromSandBox]; [[Singleton sharedInstance] setHaveProcessingOrder:YES]; [self.navigationController pushViewController:moneyVC animated:YES]; FLDDLogDebug(@"下线"); } else if(PROCESSING_ORDER_STATE_INIT == [GlobalShare getGlobalShare].user.processingOrderStat || PROCESSING_ORDER_STATE_WAIT_NEW_ORDER == [GlobalShare getGlobalShare].user.processingOrderStat) { FLDDLogDebug(@"[GlobalShare getGlobalShare].user.processingOrderStat:%d", [GlobalShare getGlobalShare].user.processingOrderStat); [GlobalShare getGlobalShare].user.processingOrderStat = PROCESSING_ORDER_STATE_WAIT_NEW_ORDER; [[GlobalShare getGlobalShare] saveinfo:[GlobalShare getGlobalShare].user]; FLDDLogDebug(@"[GlobalShare getGlobalShare].user.processingOrderStat:%d", [GlobalShare getGlobalShare].user.processingOrderStat); [[Singleton sharedInstance] setProcessingOrderId:-1]; newDict = nil; [[Singleton sharedInstance] setHaveProcessingOrder:NO]; } _bookingButtonView.frame = CGRectMake(0, -40, kControlWidth, 40); FLDDLogDebug(@"_bookingButtonView.getBookShowFlag:%d", _bookingButtonView.getBookShowFlag); } else { [self initMap]; if((PROCESSING_ORDER_STATE_WAIT_NEW_ORDER == [GlobalShare getGlobalShare].user.processingOrderStat) || (PROCESSING_ORDER_STATE_INIT == [GlobalShare getGlobalShare].user.processingOrderStat)) { [GlobalShare getGlobalShare].user.processingOrderStat = PROCESSING_ORDER_STATE_WAIT_NEW_ORDER; [[GlobalShare getGlobalShare] saveinfo:[GlobalShare getGlobalShare].user]; [[Singleton sharedInstance] clearOrderCountData]; [[Singleton sharedInstance] setProcessingOrderId:-1]; newDict = nil; [[Singleton sharedInstance] setHaveProcessingOrder:NO]; //清除之前的画线 if (commonPolyline!=nil) { [_mapView removeOverlay:commonPolyline]; } } else { [self drawPolyline]; } } _bShowed = YES;
}
由于iphone4s处理速度和渲染慢的问题,会出现进入地图页面,再显示前直接跳转到其它页面,但是加载出来的这个页面出现混乱的问题。iphone5及以上都正常。所以为了兼容iphone4还时别经过地图页面直接跳到其它页面吧。
MoneyAccountViewController *moneyVC = [[MoneyAccountViewController alloc] init];
newDict = nil;
moneyVC.priceDict = [[GlobalShare getGlobalShare] GetCurrentCheckDictionaryFromSandBox];
[[Singleton sharedInstance] setHaveProcessingOrder:YES];
[self.navigationController pushViewController:moneyVC animated:YES]; FLDDLogDebug(@"下线");