Commit fd3782f5 authored by Achilles's avatar Achilles

首页允许切换日期

parent cb899c68
...@@ -43,11 +43,6 @@ ...@@ -43,11 +43,6 @@
_trafficDate = [self today:df]; _trafficDate = [self today:df];
} }
// TODO for debug
// _salesDate = @"2015-09-21";
// _passengerDate = @"2015-09-21";
// _trafficDate = @"2015-09-21";
api.salesDate = _salesDate; api.salesDate = _salesDate;
api.passengerDate = _passengerDate; api.passengerDate = _passengerDate;
api.trafficDate = _trafficDate; api.trafficDate = _trafficDate;
......
...@@ -144,6 +144,37 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, mask, signal ) { ...@@ -144,6 +144,37 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, mask, signal ) {
[self showListView: CELL_TYPE_FLOOR]; [self showListView: CELL_TYPE_FLOOR];
} }
ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIDatePicker *picker = [[UIDatePicker alloc] init];
picker.datePickerMode = UIDatePickerModeDate;
NSDate *yesterday = [[NSDate alloc]initWithTimeIntervalSinceNow:-24*60*60];
picker.maximumDate = yesterday;
picker.locale = [NSLocale localeWithLocaleIdentifier:@"zh-Hans"];
[picker setDatePickerMode:UIDatePickerModeDate];
[alertController.view addSubview:picker];
[alertController addAction:({
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
if (nil != _currDashBoard) {
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd"];
NSString *dateStr = [df stringFromDate:picker.date];
_currDashBoard.salesInfo.lblDate.text = dateStr;
_summaryModel.salesDate = dateStr;
_summaryModel.passengerDate = dateStr;
_summaryModel.trafficDate = dateStr;
[_summaryModel reload];
}
}];
action;
})];
UIPopoverPresentationController *popoverController = alertController.popoverPresentationController;
popoverController.sourceView = self.view;
popoverController.sourceRect = [self.view bounds];
[self presentViewController:alertController animated:YES completion:nil];
}
ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) { ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) {
VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell; VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell;
if ([@"昨日客流" eq:[cell name]]) { if ([@"昨日客流" eq:[cell name]]) {
......
...@@ -14,10 +14,7 @@ AS_OUTLET( BeeUIImageView, imgLeftIcon ); ...@@ -14,10 +14,7 @@ AS_OUTLET( BeeUIImageView, imgLeftIcon );
AS_OUTLET( BeeUIImageView, imgAmountIcon ); AS_OUTLET( BeeUIImageView, imgAmountIcon );
AS_OUTLET( BeeUILabel, lblAmount ); AS_OUTLET( BeeUILabel, lblAmount );
AS_OUTLET( BeeUILabel, lblAmountUnit ); AS_OUTLET( BeeUILabel, lblAmountUnit );
AS_OUTLET( BeeUIButton, btnHistoryMask );
//- (void) redTheme; AS_OUTLET( BeeUILabel, lblDate );
//- (void) purpleTheme;
//- (void) orangeTheme;
//- (void) setAmount: (float) amount;
@end @end
...@@ -17,6 +17,8 @@ DEF_OUTLET( BeeUIImageView, imgLeftIcon ); ...@@ -17,6 +17,8 @@ DEF_OUTLET( BeeUIImageView, imgLeftIcon );
DEF_OUTLET( BeeUIImageView, imgAmountIcon ); DEF_OUTLET( BeeUIImageView, imgAmountIcon );
DEF_OUTLET( BeeUILabel, lblAmount ); DEF_OUTLET( BeeUILabel, lblAmount );
DEF_OUTLET( BeeUILabel, lblAmountUnit ); DEF_OUTLET( BeeUILabel, lblAmountUnit );
DEF_OUTLET( BeeUIButton, btnHistoryMask );
DEF_OUTLET( BeeUILabel, lblDate );
- (void)load - (void)load
......
...@@ -3,17 +3,18 @@ ...@@ -3,17 +3,18 @@
<ui namespace="VankeServiceSaleCell_iPhone"> <ui namespace="VankeServiceSaleCell_iPhone">
<linear orientation="h" class="wrapper"> <linear orientation="h" class="wrapper">
<image class="bg" /> <image class="bg" />
<button id="mask" class="mask" />
<linear orientation="v" class="left-wrapper"> <linear orientation="v" class="left-wrapper">
<button id="btnHistoryMask" class="mask" />
<image id="imgLeftBg" class="bg" /> <image id="imgLeftBg" class="bg" />
<linear orientation="v" class="inner" > <linear orientation="v" class="inner" >
<image id="imgLeftIcon" class="icon red" /> <image id="imgLeftIcon" class="icon red" />
<label class="lbl">查看详情</label> <label id="lblDate" class="lbl">查看历史</label>
</linear> </linear>
</linear> </linear>
<linear orientation="v" class="right-wrapper"> <linear orientation="v" class="right-wrapper">
<button id="mask" class="mask" />
<image id="imgRightBg" class="bg red" /> <image id="imgRightBg" class="bg red" />
<image class="indictor" /> <image class="indictor" />
......
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