Commit 1e27b6a7 authored by Sandy's avatar Sandy

万科bug fix

parent f1ff0e9a
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
,(long)dateComponents.weekOfYear]; ,(long)dateComponents.weekOfYear];
}else{ }else{
yearWeek = [NSString stringWithFormat:@"%ld-%ld", (long)[year integerValue] yearWeek = [NSString stringWithFormat:@"%ld-%ld", (long)[year integerValue]
,(long)dateComponents.weekOfYear]; ,(long)dateComponents.weekOfYear - 1];
} }
return yearWeek; return yearWeek;
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.5.8</string> <string>1.5.10</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.5.8</string> <string>1.5.10</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
-(void) route:(BeeMessage *)msg { -(void) route:(BeeMessage *)msg {
if (self.sending) if (self.sending)
{ {
[self http_get:@"/ipapk"].PARAM(@"type", @"ipa").TIMEOUT(10); [self http_get:@"ipapk"].PARAM(@"type", @"ipa").TIMEOUT(10);
} }
else if (self.succeed) else if (self.succeed)
{ {
......
#import "VankeMainBoard_iPhone.h" #import "GEToast.h"
#import "VankeFloorListBoard_iPhone.h" #import "VankeAppBoard_iPhone.h"
#import "VankeFloorListBoardCell_iPhone.h" #import "VankeFloorListBoardCell_iPhone.h"
#import "VankeFloorListBoard_iPhone.h"
#import "VankeMainBoard_iPhone.h"
#import "VankeServiceDashBoard_iPhone.h" #import "VankeServiceDashBoard_iPhone.h"
#import "VankeAppBoard_iPhone.h"
#import "VankeUtil.h" #import "VankeUtil.h"
#import "GEToast.h"
@interface VankeMainBoard_iPhone () @interface VankeMainBoard_iPhone ()
@property (strong, nonatomic) VankeServiceDashBoard_iPhone *currDashBoard; @property (strong, nonatomic) VankeServiceDashBoard_iPhone *currDashBoard;
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
#pragma mark - #pragma mark -
@interface VankeMainBoard_iPhone () @interface VankeMainBoard_iPhone () {
{
NSInteger _curTopMenuIndex; NSInteger _curTopMenuIndex;
NSMutableDictionary *tabCache; NSMutableDictionary *tabCache;
} }
...@@ -23,15 +22,15 @@ ...@@ -23,15 +22,15 @@
@implementation VankeMainBoard_iPhone @implementation VankeMainBoard_iPhone
SUPPORT_AUTOMATIC_LAYOUT( YES ) SUPPORT_AUTOMATIC_LAYOUT(YES)
SUPPORT_RESOURCE_LOADING( YES ) SUPPORT_RESOURCE_LOADING(YES)
DEF_OUTLET( VankeWeatherCell_iPhone, weatherBoard ); DEF_OUTLET(VankeWeatherCell_iPhone, weatherBoard);
DEF_OUTLET( VankeTopMenuBoardCell_iPhone, topMenu ); DEF_OUTLET(VankeTopMenuBoardCell_iPhone, topMenu);
DEF_OUTLET( BeeUIView, serviceDashBoardView ); DEF_OUTLET(BeeUIView, serviceDashBoardView);
DEF_OUTLET( BeeUISearchBar, searchBar); DEF_OUTLET(BeeUISearchBar, searchBar);
DEF_MODEL( VankeProjectSummaryModel, summaryModel ); DEF_MODEL(VankeProjectSummaryModel, summaryModel);
- (void)load - (void)load
{ {
...@@ -48,43 +47,43 @@ DEF_MODEL( VankeProjectSummaryModel, summaryModel ); ...@@ -48,43 +47,43 @@ DEF_MODEL( VankeProjectSummaryModel, summaryModel );
#pragma mark - Signal #pragma mark - Signal
ON_CREATE_VIEWS( signal ) ON_CREATE_VIEWS(signal)
{ {
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
// [self addLeftIconToTextField:_txtQuery icon:@"search"]; // [self addLeftIconToTextField:_txtQuery icon:@"search"];
[_weatherBoard reloadLocationAndWeather]; [_weatherBoard reloadLocationAndWeather];
self.view.swipeble = YES; self.view.swipeble = YES;
self.view.swipeDirection = UISwipeGestureRecognizerDirectionLeft; self.view.swipeDirection = UISwipeGestureRecognizerDirectionLeft;
//去掉搜索框背景 //去掉搜索框背景
float version = [[[ UIDevice currentDevice ] systemVersion ] floatValue ]; float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if ([ _searchBar respondsToSelector : @selector (barTintColor)]) { if ([_searchBar respondsToSelector:@selector(barTintColor)]) {
float iosversion7_1 = 7.1 ; float iosversion7_1 = 7.1;
if (version >= iosversion7_1) { if (version >= iosversion7_1) {
//iOS7.1 // iOS7.1
[[[[ _searchBar.subviews objectAtIndex : 0 ] subviews] objectAtIndex : 0 ] removeFromSuperview ]; [[[[_searchBar.subviews objectAtIndex:0] subviews] objectAtIndex:0] removeFromSuperview];
[ _searchBar setBackgroundColor :[ UIColor clearColor ]]; [_searchBar setBackgroundColor:[UIColor clearColor]];
} else { } else {
//iOS7.0 // iOS7.0
[ _searchBar setBarTintColor :[ UIColor clearColor ]]; [_searchBar setBarTintColor:[UIColor clearColor]];
[ _searchBar setBackgroundColor :[ UIColor clearColor ]]; [_searchBar setBackgroundColor:[UIColor clearColor]];
} }
} else { } else {
//iOS7.0 以下 // iOS7.0 以下
[[ _searchBar . subviews objectAtIndex : 0 ] removeFromSuperview ]; [[_searchBar.subviews objectAtIndex:0] removeFromSuperview];
[ _searchBar setBackgroundColor :[ UIColor clearColor ]]; [_searchBar setBackgroundColor:[UIColor clearColor]];
} }
} }
ON_DELETE_VIEWS( signal ) ON_DELETE_VIEWS(signal)
{ {
} }
ON_LAYOUT_VIEWS( signal ) ON_LAYOUT_VIEWS(signal)
{ {
} }
ON_WILL_APPEAR( signal ) ON_WILL_APPEAR(signal)
{ {
[BeeUIRouter sharedInstance].view.pannable = NO; [BeeUIRouter sharedInstance].view.pannable = NO;
self.navigationBarShown = NO; self.navigationBarShown = NO;
...@@ -93,93 +92,101 @@ ON_WILL_APPEAR( signal ) ...@@ -93,93 +92,101 @@ ON_WILL_APPEAR( signal )
[_summaryModel reload]; [_summaryModel reload];
} }
ON_DID_APPEAR( signal ) ON_DID_APPEAR(signal)
{ {
// 如果没有设置当前tab,则默认为第一页 // 如果没有设置当前tab,则默认为第一页
// if (nil == _currDashBoard) { // if (nil == _currDashBoard) {
// [self showTab: 0]; // [self showTab: 0];
// } // }
} }
ON_WILL_DISAPPEAR( signal ) ON_WILL_DISAPPEAR(signal)
{ {
[BeeUIRouter sharedInstance].view.pannable = NO; [BeeUIRouter sharedInstance].view.pannable = NO;
} }
ON_DID_DISAPPEAR( signal ) ON_DID_DISAPPEAR(signal)
{ {
} }
ON_SIGNAL3( VankeMainBoard_iPhone, searchBar, signal ) ON_SIGNAL3(VankeMainBoard_iPhone, searchBar, signal)
{ {
if ([signal is:BeeUISearchBar.SEARCH]) { if ([signal is:BeeUISearchBar.SEARCH]) {
[self showListView: CELL_TYPE_FLOOR]; [self showListView:CELL_TYPE_FLOOR];
} }
} }
#pragma VankeWeatherCell_iPhone #pragma VankeWeatherCell_iPhone
ON_SIGNAL3( VankeWeatherCell_iPhone, btnMask, signal ) ON_SIGNAL3(VankeWeatherCell_iPhone, btnMask, signal)
{ {
[_weatherBoard reloadLocationAndWeather: YES]; [_weatherBoard reloadLocationAndWeather:YES];
} }
#pragma VankeTopMenuBoardCell_iPhone #pragma VankeTopMenuBoardCell_iPhone
ON_SIGNAL3( VankeTopMenuBoardCell_iPhone, menuCommunity, signal ) { ON_SIGNAL3(VankeTopMenuBoardCell_iPhone, menuCommunity, signal)
{
ProjectSummaryResponse *resp = [_summaryModel getServerResp]; ProjectSummaryResponse *resp = [_summaryModel getServerResp];
if (![resp hasClassification:@"社区2049"]) { if (![resp hasClassification:@"社区2049"]) {
[GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f]; [GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f];
return; return;
} }
[self showTab: 0]; [self showTab:0];
} }
ON_SIGNAL3( VankeTopMenuBoardCell_iPhone, menuCenter, signal ) { ON_SIGNAL3(VankeTopMenuBoardCell_iPhone, menuCenter, signal)
{
ProjectSummaryResponse *resp = [_summaryModel getServerResp]; ProjectSummaryResponse *resp = [_summaryModel getServerResp];
if (![resp hasClassification:@"万科中心"]) { if (![resp hasClassification:@"万科中心"]) {
[GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f]; [GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f];
return; return;
} }
[self showTab: 1]; [self showTab:1];
} }
ON_SIGNAL3( VankeTopMenuBoardCell_iPhone, menuSqure, signal ) { ON_SIGNAL3(VankeTopMenuBoardCell_iPhone, menuSqure, signal)
{
ProjectSummaryResponse *resp = [_summaryModel getServerResp]; ProjectSummaryResponse *resp = [_summaryModel getServerResp];
if (![resp hasClassification:@"万科广场"]) { if (![resp hasClassification:@"万科广场"]) {
[GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f]; [GEToast showWithText:@"缺少权限,请联系管理员" bottomOffset:50.0f duration:1.0f];
return; return;
} }
[self showTab: 2]; [self showTab:2];
} }
#pragma mark - VankeServiceSaleCell_iPhone #pragma mark - VankeServiceSaleCell_iPhone
ON_SIGNAL3( VankeServiceSaleCell_iPhone, mask, signal ) { ON_SIGNAL3(VankeServiceSaleCell_iPhone, mask, signal)
{
[[VankeAppBoard_iPhone sharedInstance] hideMenu]; [[VankeAppBoard_iPhone sharedInstance] hideMenu];
[self showListView: CELL_TYPE_FLOOR]; [self showListView:CELL_TYPE_FLOOR];
} }
ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) { 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]; UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIDatePicker *picker = [[UIDatePicker alloc] init]; UIDatePicker *picker = [[UIDatePicker alloc] init];
picker.datePickerMode = UIDatePickerModeDate; picker.datePickerMode = UIDatePickerModeDate;
NSDate *yesterday = [[NSDate alloc]initWithTimeIntervalSinceNow:-24*60*60]; NSDate *yesterday = [[NSDate alloc] initWithTimeIntervalSinceNow:-24 * 60 * 60];
picker.maximumDate = yesterday; picker.maximumDate = yesterday;
picker.locale = [NSLocale localeWithLocaleIdentifier:@"zh-Hans"]; picker.locale = [NSLocale localeWithLocaleIdentifier:@"zh-Hans"];
[picker setDatePickerMode:UIDatePickerModeDate]; [picker setDatePickerMode:UIDatePickerModeDate];
[alertController.view addSubview:picker]; [alertController.view addSubview:picker];
[alertController addAction:({ [alertController addAction:({
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
if (nil != _currDashBoard) { if (nil != _currDashBoard) {
NSDateFormatter *df = [[NSDateFormatter alloc] init]; NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd"]; [df setDateFormat:@"yyyy-MM-dd"];
NSString *dateStr = [df stringFromDate:picker.date]; NSString *dateStr = [df stringFromDate:picker.date];
_currDashBoard.salesInfo.lblDate.text = dateStr; _currDashBoard.salesInfo.lblDate.text = dateStr;
_currDashBoard.salesInfo.lblTitle.text = [NSString stringWithFormat:@"%@ 销售",dateStr];
_summaryModel.salesDate = dateStr; _summaryModel.salesDate = dateStr;
_summaryModel.passengerDate = dateStr; _summaryModel.passengerDate = dateStr;
_summaryModel.trafficDate = dateStr; _summaryModel.trafficDate = dateStr;
...@@ -203,27 +210,30 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) { ...@@ -203,27 +210,30 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) {
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];
} }
ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) { ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal)
{
// [[VankeAppBoard_iPhone sharedInstance] hideMenu]; // [[VankeAppBoard_iPhone sharedInstance] hideMenu];
// [self showListView: CELL_TYPE_FLOOR]; // [self showListView: CELL_TYPE_FLOOR];
// VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell; // VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell;
// if ([@"昨日客流" eq:[cell name]]) { // if ([@"昨日客流" eq:[cell name]]) {
// [[VankeAppBoard_iPhone sharedInstance] hideMenu]; // [[VankeAppBoard_iPhone sharedInstance] hideMenu];
// [self showListView: CELL_TYPE_PASSENGER]; // [self showListView: CELL_TYPE_PASSENGER];
// } else { // } else {
// [GEToast showWithText:@"正在研发中..." bottomOffset:50.0f duration:1.0f]; // [GEToast showWithText:@"正在研发中..." bottomOffset:50.0f duration:1.0f];
// } // }
} }
#pragma mark - VankeProjectSummaryModel #pragma mark - VankeProjectSummaryModel
ON_SIGNAL3(VankeProjectSummaryModel, RELOADING, signal) { ON_SIGNAL3(VankeProjectSummaryModel, RELOADING, signal)
{
[GEToast showProgress:self.serviceDashBoardView]; [GEToast showProgress:self.serviceDashBoardView];
} }
ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal)
{
[GEToast hideProgress]; [GEToast hideProgress];
if (![_summaryModel isOk]) { if (![_summaryModel isOk]) {
...@@ -250,7 +260,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -250,7 +260,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
} }
} }
-(void) addLeftIconToTextField: (BeeUITextField*) textField icon: (NSString*) icon { - (void)addLeftIconToTextField:(BeeUITextField *)textField icon:(NSString *)icon
{
UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:icon]]; UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:icon]];
img.frame = CGRectMake(0, 0, 30, 25); img.frame = CGRectMake(0, 0, 30, 25);
img.contentMode = UIViewContentModeCenter; img.contentMode = UIViewContentModeCenter;
...@@ -258,7 +269,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -258,7 +269,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
textField.leftViewMode = UITextFieldViewModeAlways; textField.leftViewMode = UITextFieldViewModeAlways;
} }
-(void) showTab: (int) tabIndex { - (void)showTab:(int)tabIndex
{
if (tabIndex == _curTopMenuIndex) { if (tabIndex == _curTopMenuIndex) {
return; return;
} }
...@@ -273,7 +285,7 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -273,7 +285,7 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
// 查找或创建新的tab页 // 查找或创建新的tab页
NSString *key = [NSString stringWithFormat:@"%d", tabIndex]; NSString *key = [NSString stringWithFormat:@"%d", tabIndex];
VankeServiceDashBoard_iPhone *targetTab = (VankeServiceDashBoard_iPhone*) [tabCache objectForKey:key]; VankeServiceDashBoard_iPhone *targetTab = (VankeServiceDashBoard_iPhone *)[tabCache objectForKey:key];
if (nil == targetTab) { if (nil == targetTab) {
targetTab = [VankeServiceDashBoard_iPhone dashBoardByIndex:tabIndex]; targetTab = [VankeServiceDashBoard_iPhone dashBoardByIndex:tabIndex];
[tabCache setObject:targetTab forKey:key]; [tabCache setObject:targetTab forKey:key];
...@@ -288,22 +300,22 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -288,22 +300,22 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
// 显示目标页 // 显示目标页
targetTab.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); targetTab.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
targetTab.right = 0.0f; targetTab.right = 0.0f;
// if (tabIndex > _curTopMenuIndex) { // if (tabIndex > _curTopMenuIndex) {
// targetTab.right = 0.0f; // targetTab.right = 0.0f;
// } else { // } else {
// targetTab.left = frame.size.width; // targetTab.left = frame.size.width;
// } // }
[UIView animateWithDuration:0.3f // 动画时长 [UIView animateWithDuration:0.3f // 动画时长
delay:0.0 // 动画延迟 delay:0.0 // 动画延迟
options:UIViewAnimationOptionCurveLinear // 动画过渡效果 options:UIViewAnimationOptionCurveLinear// 动画过渡效果
animations:^{ animations:^{
targetTab.right += frame.size.width; targetTab.right += frame.size.width;
// if (tabIndex > _curTopMenuIndex) { // if (tabIndex > _curTopMenuIndex) {
// targetTab.right += frame.size.width; // targetTab.right += frame.size.width;
// } else { // } else {
// targetTab.left -= frame.size.width; // targetTab.left -= frame.size.width;
// } // }
targetTab.hidden = NO; targetTab.hidden = NO;
[self.serviceDashBoardView addSubview:targetTab]; [self.serviceDashBoardView addSubview:targetTab];
} }
...@@ -316,8 +328,9 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -316,8 +328,9 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
}]; }];
} }
-(void) showListView: (CellType) type { - (void)showListView:(CellType)type
VankeFloorListBoard_iPhone * board = [VankeFloorListBoard_iPhone boardWithType:type]; {
VankeFloorListBoard_iPhone *board = [VankeFloorListBoard_iPhone boardWithType:type];
if (nil != _currDashBoard) { if (nil != _currDashBoard) {
board.projectCategory = _currDashBoard.name; board.projectCategory = _currDashBoard.name;
board.theme = _currDashBoard.theme; board.theme = _currDashBoard.theme;
...@@ -332,13 +345,14 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) { ...@@ -332,13 +345,14 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
#pragma VankeMainBoard_iPhone #pragma VankeMainBoard_iPhone
ON_SWIPE_LEFT( signal ) { ON_SWIPE_LEFT(signal)
// if (_curTopMenuIndex < 2) { {
// [self showTab:_curTopMenuIndex + 1]; // if (_curTopMenuIndex < 2) {
// } else { // [self showTab:_curTopMenuIndex + 1];
// _curTopMenuIndex = -1; // } else {
// [self showTab:_curTopMenuIndex + 1]; // _curTopMenuIndex = -1;
// } // [self showTab:_curTopMenuIndex + 1];
// }
} }
@end @end
...@@ -59,7 +59,7 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint ); ...@@ -59,7 +59,7 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint );
- (void)load - (void)load
{ {
self.salesInfo.imgRightBg.backgroundColor = [UIColor colorWithRed:237/255.0 green:27/255.0 blue:35/255.0 alpha:1]; self.salesInfo.imgRightBg.backgroundColor = [UIColor colorWithRed:237/255.0 green:27/255.0 blue:35/255.0 alpha:1];
[self.passenger loadDefaults:@"people.png" title:@"昨日客流" bgColor:[UIColor colorWithRed:0 green:195/255.0 blue:230/255.0 alpha:1] unit:@"人" defValue:[NSNumber numberWithInt:0]]; [self.passenger loadDefaults:@"people.png" title:@"客流" bgColor:[UIColor colorWithRed:0 green:195/255.0 blue:230/255.0 alpha:1] unit:@"人" defValue:[NSNumber numberWithInt:0]];
[self.traffic loadDefaults:@"car.png" title:@"车流" bgColor:[UIColor colorWithRed:79/255.0 green:143/255.0 blue:248/255.0 alpha:1] unit:@"次" defValue:[NSNumber numberWithInt:0]]; [self.traffic loadDefaults:@"car.png" title:@"车流" bgColor:[UIColor colorWithRed:79/255.0 green:143/255.0 blue:248/255.0 alpha:1] unit:@"次" defValue:[NSNumber numberWithInt:0]];
[self.energy loadDefaults:@"energy.png" title:@"日坪效" bgColor:[UIColor colorWithRed:149/255.0 green:200/255.0 blue:8/255.0 alpha:1] unit:@"元" [self.energy loadDefaults:@"energy.png" title:@"日坪效" bgColor:[UIColor colorWithRed:149/255.0 green:200/255.0 blue:8/255.0 alpha:1] unit:@"元"
defValue:[NSNumber numberWithFloat:0.00]]; defValue:[NSNumber numberWithFloat:0.00]];
......
...@@ -16,5 +16,5 @@ AS_OUTLET( BeeUILabel, lblAmount ); ...@@ -16,5 +16,5 @@ AS_OUTLET( BeeUILabel, lblAmount );
AS_OUTLET( BeeUILabel, lblAmountUnit ); AS_OUTLET( BeeUILabel, lblAmountUnit );
AS_OUTLET( BeeUIButton, btnHistoryMask ); AS_OUTLET( BeeUIButton, btnHistoryMask );
AS_OUTLET( BeeUILabel, lblDate ); AS_OUTLET( BeeUILabel, lblDate );
AS_OUTLET( BeeUILabel, lblTitle );
@end @end
...@@ -19,7 +19,7 @@ DEF_OUTLET( BeeUILabel, lblAmount ); ...@@ -19,7 +19,7 @@ DEF_OUTLET( BeeUILabel, lblAmount );
DEF_OUTLET( BeeUILabel, lblAmountUnit ); DEF_OUTLET( BeeUILabel, lblAmountUnit );
DEF_OUTLET( BeeUIButton, btnHistoryMask ); DEF_OUTLET( BeeUIButton, btnHistoryMask );
DEF_OUTLET( BeeUILabel, lblDate ); DEF_OUTLET( BeeUILabel, lblDate );
DEF_OUTLET( BeeUILabel, lblTitle );
- (void)load - (void)load
{ {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<image class="indictor" /> <image class="indictor" />
<linear orientation="v" class="label"> <linear orientation="v" class="label">
<label class="title">昨日销售</label> <label id="lblTitle" class="title">昨日销售</label>
</linear> </linear>
<linear orientation="h" class="detl"> <linear orientation="h" class="detl">
......
...@@ -137,7 +137,7 @@ ON_CREATE_VIEWS( signal ) ...@@ -137,7 +137,7 @@ ON_CREATE_VIEWS( signal )
NSInteger week = [date getWeekOfYear]; NSInteger week = [date getWeekOfYear];
NSString *year = [date yearString]; NSString *year = [date yearString];
self.scopeType = [NSString stringWithFormat:@"%@-%ld",year, (long)week]; self.scopeType = [NSString stringWithFormat:@"%@-%ld",year, (long)week - 1];
[self getDataFromServer]; [self getDataFromServer];
} }
...@@ -239,6 +239,7 @@ ON_CREATE_VIEWS( signal ) ...@@ -239,6 +239,7 @@ ON_CREATE_VIEWS( signal )
} }
self.compass = com; self.compass = com;
self.compass.dateScopeType = self.dayType;
[self setValueInScrollView]; [self setValueInScrollView];
}else{ }else{
[IBTLoadingView showTips:message]; [IBTLoadingView showTips:message];
......
...@@ -117,11 +117,17 @@ static NSString *saleHeaderIdentify = @"saleHeaderIdentify"; ...@@ -117,11 +117,17 @@ static NSString *saleHeaderIdentify = @"saleHeaderIdentify";
return animation; return animation;
} }
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
return 50;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
return [SaleViewCell cellHeight]; return [SaleViewCell cellHeight];
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":indexPath}]; [[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":indexPath}];
} }
......
...@@ -67,10 +67,11 @@ ...@@ -67,10 +67,11 @@
self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.centerLabel.left, self.centerLabel.bottom,self.width-self.centerLabel.left, ContentHeight)]; self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.centerLabel.left, self.centerLabel.bottom,self.width-self.centerLabel.left, ContentHeight * 2.1)];
self.dateLabel.textColor = [UIColor lightGrayColor]; self.dateLabel.textColor = [UIColor lightGrayColor];
self.dateLabel.font = GXF_THREETEENTH_SIZE; self.dateLabel.font = GXF_THREETEENTH_SIZE;
self.dateLabel.textAlignment = NSTextAlignmentLeft; self.dateLabel.textAlignment = NSTextAlignmentLeft;
self.dateLabel.numberOfLines = 3;
[self addSubview:self.dateLabel]; [self addSubview:self.dateLabel];
CGFloat bottomWidth = (SCREEN_WIDTH - 20)/3; CGFloat bottomWidth = (SCREEN_WIDTH - 20)/3;
...@@ -164,8 +165,33 @@ ...@@ -164,8 +165,33 @@
if ([IBTCommon convertToDateFrom:compass.dataScope]) { if ([IBTCommon convertToDateFrom:compass.dataScope]) {
weekday = [IBTCommon weekdayStringFromDate:[IBTCommon convertToDateFrom:compass.dataScope]]; weekday = [IBTCommon weekdayStringFromDate:[IBTCommon convertToDateFrom:compass.dataScope]];
} }
NSString *title;
NSString *year = [compass.dataScope substringWithRange:NSMakeRange(0, 4)];
NSString *requestUrl;
if ([compass.dateScopeType isEqualToString:@"week"]) {
NSString *week = [compass.dataScope substringFromIndex:5];
requestUrl = [NSString stringWithFormat:@"salesdata/getWeekStartAndEndDate/%@/%@",year,week];
WS(weakSelf);
[[ICRHTTPController sharedController] getUrl:requestUrl params:nil success:^(id data) {
NSString *start = data[@"data"][@"startDate"];
NSString *end = data[@"data"][@"endDate"];
NSString *title = [NSString stringWithFormat:@"第%@周 累计销售额\n%@~%@", week,start, end];
weakSelf.dateLabel.text = [NSString stringWithFormat:@"%@\n",title];
} failure:^(id data) {
}];
}else if ([compass.dateScopeType isEqualToString:@"day"]){
NSString *month = [compass.dataScope substringWithRange:NSMakeRange(5, 2)];
NSString *day = [compass.dataScope substringFromIndex:8];
// title = [NSString stringWithFormat:@"%@年 %@月 %@日", year, month, day];
title = compass.dataScope;
}else if ([compass.dateScopeType isEqualToString:@"month"]){
NSString *month = [compass.dataScope substringFromIndex:5];
title = [NSString stringWithFormat:@"%@年 %@月",year, month];
}
self.dateLabel.text = [NSString stringWithFormat:@"%@累计销售额",title];
self.dateLabel.text = [NSString stringWithFormat:@"%@累计销售额",compass.dataScope];
//销售额 //销售额
NSString *strSales = [CalculateHelper getMoneyStringFrom:compass.sales Lenth:0 isSeparate:YES]; NSString *strSales = [CalculateHelper getMoneyStringFrom:compass.sales Lenth:0 isSeparate:YES];
......
...@@ -458,7 +458,7 @@ ON_WILL_APPEAR( signal ) ...@@ -458,7 +458,7 @@ ON_WILL_APPEAR( signal )
case SalesInputViewControllerTypeInput: { case SalesInputViewControllerTypeInput: {
//利用字典key的唯一性,保存每个cell上的数据 //利用字典key的唯一性,保存每个cell上的数据
if (![self.cellDataDic objectForKey:indextPath]) { if (![self.cellDataDic objectForKey:indextPath]) {
[self.cellDataDic setObject:@[@""] forKey:indextPath]; [self.cellDataDic setObject:@[@"0"] forKey:indextPath];
} }
break; break;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- (void)cellWithArray:(NSArray *)array { - (void)cellWithArray:(NSArray *)array {
self.textFieldAmount.text = array[0]; self.textFieldAmount.text = array[0] ? array[0] : @"0";
// self.txtfieldSum.text = [array[1] isEqualToString:@"0"] ? @"" : array[0]; // self.txtfieldSum.text = [array[1] isEqualToString:@"0"] ? @"" : array[0];
} }
......
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