diff --git a/vanke.xcodeproj/project.pbxproj b/vanke.xcodeproj/project.pbxproj index da4bd0994f75dc024780d9b9cb549016dd83a185..a49de91103e3a03393a6c19597b23074d7e9fc97 100644 --- a/vanke.xcodeproj/project.pbxproj +++ b/vanke.xcodeproj/project.pbxproj @@ -19,6 +19,10 @@ 19000E911CC71DD200DF8D71 /* MyToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 19000E901CC71DD200DF8D71 /* MyToolBar.m */; }; 19000E941CC74DB000DF8D71 /* SalesInputTotalVIew.m in Sources */ = {isa = PBXBuildFile; fileRef = 19000E931CC74DB000DF8D71 /* SalesInputTotalVIew.m */; }; 19000E961CC74DC800DF8D71 /* SalesInputTotalView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19000E951CC74DC800DF8D71 /* SalesInputTotalView.xib */; }; + 190AFD9C1CF41798002698FC /* VankeFloorDetailWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 190AFD9A1CF41798002698FC /* VankeFloorDetailWebViewController.m */; }; + 190AFD9D1CF41798002698FC /* VankeFloorDetailWebViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 190AFD9B1CF41798002698FC /* VankeFloorDetailWebViewController.xib */; }; + 190AFDA41CF4434F002698FC /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 190AFDA31CF4434F002698FC /* WebKit.framework */; }; + 190AFDAC1CF55F30002698FC /* ScrollMultipleWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 190AFDAB1CF55F30002698FC /* ScrollMultipleWebView.m */; }; 1912FCDD1CCDDF4B004CF976 /* VankeShopModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1912FCDC1CCDDF4B004CF976 /* VankeShopModel.m */; }; 1912FCE01CCDE0C4004CF976 /* LoginShopsInstance.m in Sources */ = {isa = PBXBuildFile; fileRef = 1912FCDF1CCDE0C4004CF976 /* LoginShopsInstance.m */; }; 1912FCE31CCDECF8004CF976 /* PaymentTypeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1912FCE21CCDECF8004CF976 /* PaymentTypeModel.m */; }; @@ -744,6 +748,12 @@ 19000E921CC74DB000DF8D71 /* SalesInputTotalVIew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputTotalVIew.h; sourceTree = "<group>"; }; 19000E931CC74DB000DF8D71 /* SalesInputTotalVIew.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SalesInputTotalVIew.m; sourceTree = "<group>"; }; 19000E951CC74DC800DF8D71 /* SalesInputTotalView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SalesInputTotalView.xib; sourceTree = "<group>"; }; + 190AFD991CF41798002698FC /* VankeFloorDetailWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VankeFloorDetailWebViewController.h; sourceTree = "<group>"; }; + 190AFD9A1CF41798002698FC /* VankeFloorDetailWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VankeFloorDetailWebViewController.m; sourceTree = "<group>"; }; + 190AFD9B1CF41798002698FC /* VankeFloorDetailWebViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VankeFloorDetailWebViewController.xib; sourceTree = "<group>"; }; + 190AFDA31CF4434F002698FC /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + 190AFDAA1CF55F30002698FC /* ScrollMultipleWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollMultipleWebView.h; sourceTree = "<group>"; }; + 190AFDAB1CF55F30002698FC /* ScrollMultipleWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollMultipleWebView.m; sourceTree = "<group>"; }; 1912FCDB1CCDDF4B004CF976 /* VankeShopModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VankeShopModel.h; sourceTree = "<group>"; }; 1912FCDC1CCDDF4B004CF976 /* VankeShopModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VankeShopModel.m; sourceTree = "<group>"; }; 1912FCDE1CCDE0C4004CF976 /* LoginShopsInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginShopsInstance.h; sourceTree = "<group>"; }; @@ -1962,6 +1972,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 190AFDA41CF4434F002698FC /* WebKit.framework in Frameworks */, C1D58B2C1BB1BC9200D297FE /* QuartzCore.framework in Frameworks */, C1D58B241BB1BC9200D297FE /* CoreMedia.framework in Frameworks */, C1D58B201BB1BC9200D297FE /* AVFoundation.framework in Frameworks */, @@ -2058,6 +2069,8 @@ C10F180D1BF7ACA80065F18C /* Macro */, C1E0AD791C12FC7200DE6BB9 /* SRMonthPicker */, C1555F981C04D39600C80B55 /* UIPopoverList */, + 190AFDAA1CF55F30002698FC /* ScrollMultipleWebView.h */, + 190AFDAB1CF55F30002698FC /* ScrollMultipleWebView.m */, ); path = 3rd; sourceTree = "<group>"; @@ -2596,6 +2609,9 @@ C19BBC0B1BBE861700831290 /* VankeFloorDetailBoardPhoto_iPhone.h */, C19BBC0C1BBE861700831290 /* VankeFloorDetailBoardPhoto_iPhone.m */, C19BBC0D1BBE861700831290 /* VankeFloorDetailBoardPhoto_iPhone.xml */, + 190AFD991CF41798002698FC /* VankeFloorDetailWebViewController.h */, + 190AFD9A1CF41798002698FC /* VankeFloorDetailWebViewController.m */, + 190AFD9B1CF41798002698FC /* VankeFloorDetailWebViewController.xib */, C16BA6201BD393B7001ACB26 /* VankePassengerDetailBoard_iPhone.h */, C16BA6211BD393B7001ACB26 /* VankePassengerDetailBoard_iPhone.m */, C16BA6221BD393B7001ACB26 /* VankePassengerDetailBoard_iPhone.xml */, @@ -2684,6 +2700,7 @@ C1D58B181BB1BC9200D297FE /* Frameworks */ = { isa = PBXGroup; children = ( + 190AFDA31CF4434F002698FC /* WebKit.framework */, C1D58B191BB1BC9200D297FE /* UIKit.framework */, C1D58B1B1BB1BC9200D297FE /* Foundation.framework */, C1D58B1D1BB1BC9200D297FE /* CoreGraphics.framework */, @@ -4380,6 +4397,7 @@ C19ADE401BC8147800206213 /* search@2x.png in Resources */, C1A06A0E1BE10B080082006F /* sale_input@2x.png in Resources */, C19AC8A81C1735E600DE260E /* wave_line@2x.png in Resources */, + 190AFD9D1CF41798002698FC /* VankeFloorDetailWebViewController.xib in Resources */, C11786501C0B3A5900DB7E4B /* red_point@2x.png in Resources */, 19000E8A1CC6215000DF8D71 /* HistoryTopView.xib in Resources */, C1A06A091BE10B080082006F /* bill.png in Resources */, @@ -4765,6 +4783,7 @@ C1D598841BB44B2000D297FE /* CSSParser.m in Sources */, C1D5987C1BB44B2000D297FE /* UITextView+BeeUIStyle.m in Sources */, C1D599181BB44B2100D297FE /* UIScrollView+XMLParser.m in Sources */, + 190AFDAC1CF55F30002698FC /* ScrollMultipleWebView.m in Sources */, C16BA62A1BD3952E001ACB26 /* VankePassengerFlowAPI.m in Sources */, C10F18131BF7ACA80065F18C /* NSMutableArray+SafeInsert.m in Sources */, C1D5995F1BB44B2100D297FE /* Bee_HTTPResponse2.m in Sources */, @@ -4781,6 +4800,7 @@ C1D598BB1BB44B2000D297FE /* UIView+LifeCycle.m in Sources */, C1D5996C1BB44B2100D297FE /* Bee_Reachability.m in Sources */, C1D598EE1BB44B2000D297FE /* UIView+LayoutParser.m in Sources */, + 190AFD9C1CF41798002698FC /* VankeFloorDetailWebViewController.m in Sources */, C1D599421BB44B2100D297FE /* NSDictionary+BeeExtension.mm in Sources */, C1D5991F1BB44B2100D297FE /* Bee_Cache.mm in Sources */, C1D5992E1BB44B2100D297FE /* BeeDatabase+BeeActiveRecord.m in Sources */, @@ -5238,8 +5258,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = NO; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = NO; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COMPRESS_PNG_FILES = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_PREFIX_HEADER = vanke/vanke.pch; @@ -5265,8 +5285,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = NO; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = NO; - CODE_SIGN_IDENTITY = "iPhone Developer: Fanfan Cui (7S27LB84E2)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Fanfan Cui (7S27LB84E2)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COMPRESS_PNG_FILES = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_PREFIX_HEADER = vanke/vanke.pch; diff --git a/vanke/3rd/ScrollMultipleWebView.h b/vanke/3rd/ScrollMultipleWebView.h new file mode 100644 index 0000000000000000000000000000000000000000..afb13dba5c1d404abcc5f89cf8f7d323d35fd9d1 --- /dev/null +++ b/vanke/3rd/ScrollMultipleWebView.h @@ -0,0 +1,17 @@ +// +// ScrollMultipleWebView.h +// vanke +// +// Created by Z on 16/5/25. +// Copyright © 2016å¹´ gomore. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface ScrollMultipleWebView : UIScrollView +- (instancetype)initWithFrame:(CGRect)frame webViewUrls:(NSArray *)arrUrls; +- (void)updateUrls:(NSArray *)arrUrls; + +/** 设置pagecontrol颜色 必须调用,且必须在addSubview之åŽè°ƒç”¨ï¼Œå¯ä»¥ä¸ºnil, */ +- (void)setPageControlBackgroundColor:(UIColor *)bgColor; +@end diff --git a/vanke/3rd/ScrollMultipleWebView.m b/vanke/3rd/ScrollMultipleWebView.m new file mode 100644 index 0000000000000000000000000000000000000000..105ad2d0830047651ddc9ed077c401d08fbd251a --- /dev/null +++ b/vanke/3rd/ScrollMultipleWebView.m @@ -0,0 +1,142 @@ +// +// ScrollMultipleWebView.m +// vanke +// +// Created by Z on 16/5/25. +// Copyright © 2016å¹´ gomore. All rights reserved. +// + +#import "ScrollMultipleWebView.h" +#import <WebKit/WebKit.h> + +@interface ScrollMultipleWebView ()<WKNavigationDelegate, UIScrollViewDelegate> +@property (nonatomic, strong) NSArray *arrUrls; +@property (nonatomic, strong) NSMutableArray *arrWebViews; +@property (nonatomic, strong) NSMutableArray *arrReqs; +@property (nonatomic, strong) NSMutableDictionary *dicFlag; +@property (nonatomic, strong) NSURLRequest *currentReq; +@property (nonatomic, strong) UIPageControl *pageCtrl; + + + + + +@end +@implementation ScrollMultipleWebView + +- (instancetype)initWithFrame:(CGRect)frame webViewUrls:(NSArray *)arrUrls +{ + self = [super initWithFrame:frame]; + if (self) { + self.arrUrls = arrUrls; + self.delegate = self; + self.contentSize = CGSizeMake(arrUrls.count * frame.size.width, 0); + self.pagingEnabled = YES; + self.showsVerticalScrollIndicator = NO; + CGFloat width = frame.size.width; + CGFloat height = frame.size.height; + for (int i = 0; i < arrUrls.count; i++) { + + NSString *jScript; + if (SCREEN_WIDTH != 320) { + jScript = @"var meta = document.createElement('meta');meta.setAttribute('name', 'viewport');meta.setAttribute('content', 'width=device-width, maximum-scale=2.0, user-scalable=no');document.getElementsByTagName('head')[0].appendChild(meta);"; + }else{ + jScript = @"var meta = document.createElement('meta');meta.setAttribute('name', 'viewport');meta.setAttribute('content', 'width=410, maximum-scale=2.0, user-scalable=no');document.getElementsByTagName('head')[0].appendChild(meta);"; + } + WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; + WKUserContentController *wkUController = [[WKUserContentController alloc] init]; + [wkUController addUserScript:wkUScript]; + + WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init]; + wkWebConfig.userContentController = wkUController; + + WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(i * frame.size.width, 0, frame.size.width, frame.size.height) + configuration:wkWebConfig + ]; + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:arrUrls[i]]]; + [self.arrReqs addObject:request]; + [self.arrWebViews addObject:webView]; + if (i == 0){ + [webView loadRequest:request]; + self.currentReq = request; + }; + [self addSubview:webView]; + + } + + } + return self; +} + +- (void)setPageControlBackgroundColor:(UIColor *)bgColor +{ + self.pageCtrl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 20, self.superview.width, 20)]; + NSLog(@"superview.width = %f, screen.width = %f", self.superview.width,SCREEN_WIDTH); + + self.pageCtrl.numberOfPages = self.arrUrls.count; + self.pageCtrl.currentPage = 0; + self.pageCtrl.currentPageIndicatorTintColor = [UIColor colorWithWhite:0.500 alpha:0.407]; + self.pageCtrl.pageIndicatorTintColor = [UIColor grayColor]; + if (bgColor) { + self.pageCtrl.backgroundColor = bgColor; + } + + [self.superview addSubview:self.pageCtrl]; +} + +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { + NSInteger index = scrollView.contentOffset.x / SCREEN_WIDTH; + self.pageCtrl.currentPage = index; + NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:self.arrUrls[index]]]; + WKWebView *webView = self.arrWebViews[index]; + self.currentReq = req; + [webView loadRequest:req]; + +} + +- (void)updateUrls:(NSArray *)arrUrls{ + self.arrUrls = arrUrls; + + for (int i = 0; i < arrUrls.count; i++) { + NSURLRequest *req = self.arrReqs[i]; + if ([req isEqual:self.currentReq]) { + WKWebView *web = self.arrWebViews[i]; + + [web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:arrUrls[i]]]]; + } + } + +} + +- (NSMutableArray *)arrWebViews { + if (!_arrWebViews) { + _arrWebViews = [NSMutableArray array]; + } + return _arrWebViews; +} + +- (NSMutableArray *)arrReqs { + if (!_arrReqs) { + _arrReqs = [NSMutableArray array]; + } + return _arrReqs; +} +- (NSMutableDictionary *)dicFlag { + if (!_dicFlag) { + _dicFlag = [NSMutableDictionary dictionary]; + } + return _dicFlag; +} +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + [webView sizeToFit]; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +@end diff --git a/vanke/Info.plist b/vanke/Info.plist index b508c4ecba67ca6bf0cd80aad84824066ea7ff6b..a40aa5962bddc42ad8e9d5a0ed17cb1d362bea9a 100755 --- a/vanke/Info.plist +++ b/vanke/Info.plist @@ -17,11 +17,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>1.2.1</string> + <string>1.2.2</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>1.2.1</string> + <string>1.2.2</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> diff --git a/vanke/VankeConfig.h b/vanke/VankeConfig.h index 279e59d04673af8680a1cc1d3590ff01c60ab028..df9d42feb887b5def8dd26eb16d0ce87022f68d7 100755 --- a/vanke/VankeConfig.h +++ b/vanke/VankeConfig.h @@ -21,16 +21,20 @@ // 百度天气æœåŠ¡åœ°å€ #define VANKE_BAIDU_WEATHER_SERVER_URL @"http://api.map.baidu.com/telematics/v3/weather" -// åŽå°æœåŠ¡åŸºå‡†åœ°å€ -//#define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" +// æ£å¼çŽ¯å¢ƒ +//#define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" //æ£å¼ // 测试环境 -//#define VANKE_SERVER_BASE_URL @"http://218.244.151.129:7580/wanke-server/rest" -#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:8080/wanke-server/rest" +#define VANKE_SERVER_BASE_URL @"http://218.244.151.129:7580/wanke-server/rest" +//#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:8080/wanke-server/rest" // åŽå°å¤šåª’ä½“æ–‡ä»¶åŸºå‡†åœ°å€ -#define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" +//#define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" //æ£å¼ +#define VANKE_SERVER_MEDIA_BASE_URL @"http://192.168.199.198:8080" //å·å“¥çŽ¯å¢ƒ + +//#define VANKE_SERVER_MEDIA_BASE_URL @"http://218.244.151.129:7580" + // åŽå°æœåŠ¡ä¼ä¸šè®¤è¯ç #define VANKE_AUTHENTI_CODE @"211534962" diff --git a/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.h b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.h new file mode 100644 index 0000000000000000000000000000000000000000..34225ce645828bdf3cadb54d151abccec6dfa89a --- /dev/null +++ b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.h @@ -0,0 +1,16 @@ +// +// VankeFloorDetailWebViewController.h +// vanke +// +// Created by Z on 16/5/24. +// Copyright © 2016å¹´ gomore. All rights reserved. +// + +#import "IBTUIViewController.h" +#import "VankeFloorListBoardCell_iPhone.h" + +@interface VankeFloorDetailWebViewController : IBTUIViewController + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil FloorValue:(FloorCellValue *)value date:(NSString *)date; + +@end diff --git a/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.m b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.m new file mode 100644 index 0000000000000000000000000000000000000000..5a0a9e53a3f02628b70efb1065e43fabccc92d3b --- /dev/null +++ b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.m @@ -0,0 +1,140 @@ +// +// VankeFloorDetailWebViewController.m +// vanke +// +// Created by Z on 16/5/24. +// Copyright © 2016å¹´ gomore. All rights reserved. +// + +#import "VankeFloorDetailWebViewController.h" +#import "VankeConfig.h" +#import "UIImageView+WebCache.h" +#import "VankeCommonModel.h" +#import "ScrollMultipleWebView.h" +#import <WebKit/WebKit.h> +@interface VankeFloorDetailWebViewController ()<WKNavigationDelegate> +@property (strong, nonatomic) IBOutlet UIImageView *imgViewTop; +@property (strong, nonatomic) IBOutlet UILabel *labelProjectName; +@property (weak, nonatomic) IBOutlet UILabel *labelDate; +@property (nonatomic, strong) FloorCellValue *floorValue; +@property (nonatomic, strong) NSString *strSelectDate; +@property (nonatomic, strong) ScrollMultipleWebView *webView; +@property (nonatomic, strong) UIDatePicker *datePicker; + + + +@end + +@implementation VankeFloorDetailWebViewController + + + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil FloorValue:(FloorCellValue *)value date:(NSString *)date { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + self.floorValue = value; + self.strSelectDate = date; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.view.backgroundColor = [UIColor whiteColor]; + self.title = self.floorValue.project.projectName; + self.labelProjectName.text = self.floorValue.project.projectName; + NSString *imgUrl = [NSString stringWithFormat:@"%@/%@", VANKE_SERVER_MEDIA_BASE_URL, self.floorValue.project.picture]; + [self.imgViewTop sd_setImageWithURL:[NSURL URLWithString:imgUrl] placeholderImage:[UIImage imageNamed:@"floor-def"]]; + UIBarButtonItem *btnRightBar = [[UIBarButtonItem alloc] initWithTitle:@"日期" style:UIBarButtonItemStyleDone target:self action:@selector(actionSelectDate)]; + btnRightBar.tintColor = [UIColor whiteColor]; + self.navigationItem.rightBarButtonItem = btnRightBar; + + + [self setUpWebView]; + + // Do any additional setup after loading the view from its nib. +} + + +/** 选择日期 */ +- (void)actionSelectDate { + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; + UIDatePicker *picker; + [alertController.view addSubview:self.datePicker]; + [alertController addAction:({ + UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + + NSDateFormatter *df = [[NSDateFormatter alloc] init]; + [df setDateFormat:@"yyyy-MM-dd"]; + NSString *dateStr = [df stringFromDate:self.datePicker.date]; + + self.strSelectDate = dateStr; + + [self.webView updateUrls:[self getUrlArr]]; + + }]; + action; + })]; + UIPopoverPresentationController *popoverController = alertController.popoverPresentationController; + popoverController.sourceView = self.view; + popoverController.sourceRect = [self.view bounds]; + [self presentViewController:alertController animated:YES completion:nil]; +} + +- (UIDatePicker *)datePicker { + if (!_datePicker) { + _datePicker = [[UIDatePicker alloc] init]; + _datePicker.datePickerMode = UIDatePickerModeDate; + NSDate *yesterday = [[NSDate alloc]initWithTimeIntervalSinceNow:-24*60*60]; + _datePicker.maximumDate = yesterday; + _datePicker.locale = [NSLocale localeWithLocaleIdentifier:@"zh-Hans"]; + [_datePicker setDatePickerMode:UIDatePickerModeDate]; + } + return _datePicker; +} + +- (void)setUpWebView { + [self.webView removeFromSuperview]; + self.labelDate.text = self.strSelectDate; + + NSArray *urls = [self getUrlArr]; + self.webView = [[ScrollMultipleWebView alloc] initWithFrame:CGRectMake(0, 190.0 + 64, SCREEN_WIDTH, SCREEN_HEIGHT - (190 + 64)) webViewUrls:urls]; + [self.view addSubview:self.webView]; + + [self.webView setPageControlBackgroundColor:nil]; +} + + +- (NSArray *)getUrlArr { + NSString *formatdischart = [NSString stringWithFormat:@"%@/wanke-web/chart/formatdischart.thor?projectid=%@", VANKE_SERVER_MEDIA_BASE_URL,self.floorValue.project.projectId]; + NSString *passengersaleschart = [NSString stringWithFormat:@"%@/wanke-web/chart/passengersaleschart.thor?projectid=%@&passengerflowdate=%@",VANKE_SERVER_MEDIA_BASE_URL, self.floorValue.project.projectId, self.strSelectDate]; + NSString *flow = [NSString stringWithFormat:@"%@/wanke-web/chart/formatflowchart.thor?projectEquals=%@&salesDateEquals=%@&dimensionTypeEquals=flow", VANKE_SERVER_MEDIA_BASE_URL,self.floorValue.project.projectId,self.strSelectDate]; + NSString *sale = [NSString stringWithFormat:@"%@/wanke-web/chart/formatflowchart.thor?projectEquals=%@&salesDateEquals=%@&dimensionTypeEquals=sale", VANKE_SERVER_MEDIA_BASE_URL,self.floorValue.project.projectId,self.strSelectDate]; + + return @[formatdischart, passengersaleschart, flow, sale]; +} + +- (void)viewDidLayoutSubviews { +// self.imgViewTop.frame = CGRectMake(0, 64, SCREEN_WIDTH, 220.0 * (SCREEN_WIDTH / 375.0)); + + +} + + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.xib b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.xib new file mode 100644 index 0000000000000000000000000000000000000000..213960736bfc0ee1c96987a61b63f60d96ceb39d --- /dev/null +++ b/vanke/view_iPhone/templates/VankeFloorDetailWebViewController.xib @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VankeFloorDetailWebViewController"> + <connections> + <outlet property="imgViewTop" destination="8hJ-MZ-YSk" id="BuS-2N-lZW"/> + <outlet property="labelDate" destination="MCn-rG-VxR" id="5kq-g3-lXB"/> + <outlet property="labelProjectName" destination="CIS-IL-rau" id="2jV-Ze-K6r"/> + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="8hJ-MZ-YSk"> + <rect key="frame" x="0.0" y="64" width="375" height="190"/> + <constraints> + <constraint firstAttribute="height" constant="190" id="hcr-zq-dSd"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MCn-rG-VxR"> + <rect key="frame" x="329" y="227" width="38" height="18"/> + <fontDescription key="fontDescription" type="system" pointSize="15"/> + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2049@æµ·ä¸Šä¼ å¥‡" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CIS-IL-rau"> + <rect key="frame" x="8" y="224" width="125" height="21"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> + <constraints> + <constraint firstItem="CIS-IL-rau" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="8" id="BCc-K4-Dv6"/> + <constraint firstItem="8hJ-MZ-YSk" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="64" id="C2j-1J-Ufe"/> + <constraint firstItem="MCn-rG-VxR" firstAttribute="bottom" secondItem="CIS-IL-rau" secondAttribute="bottom" id="D9L-FE-887"/> + <constraint firstItem="CIS-IL-rau" firstAttribute="top" secondItem="8hJ-MZ-YSk" secondAttribute="bottom" constant="-30" id="Mb6-AS-ged"/> + <constraint firstAttribute="trailing" secondItem="MCn-rG-VxR" secondAttribute="trailing" constant="8" id="NFj-6i-Nyg"/> + <constraint firstItem="8hJ-MZ-YSk" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="f8v-jO-Akg"/> + <constraint firstAttribute="trailing" secondItem="8hJ-MZ-YSk" secondAttribute="trailing" id="hon-Bc-82v"/> + </constraints> + <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/> + <point key="canvasLocation" x="308.5" y="69.5"/> + </view> + </objects> +</document> diff --git a/vanke/view_iPhone/templates/floor-list/VankeFloorListBoard_iPhone.m b/vanke/view_iPhone/templates/floor-list/VankeFloorListBoard_iPhone.m index cee2224f56d19dee29a12d09b50ad723dfae993f..c7fdb08f99179d59790724015b8b3d2e94d628ba 100755 --- a/vanke/view_iPhone/templates/floor-list/VankeFloorListBoard_iPhone.m +++ b/vanke/view_iPhone/templates/floor-list/VankeFloorListBoard_iPhone.m @@ -11,7 +11,7 @@ #import "VankeFloorListBoardCell_iPhone.h" #import "VankePassengerDetailBoard_iPhone.h" #import "VankePassengerListBoardCell_iPhone.h" - +#import "VankeFloorDetailWebViewController.h" @interface VankeFloorListBoard_iPhone () <UISearchBarDelegate> @end @@ -183,7 +183,11 @@ ON_SIGNAL3( VankeFloorListBoard_iPhone, searchBar, signal ) ON_SIGNAL3( VankeFloorListBoardCell_iPhone, mask, signal ) { FloorCellValue *cellValue = signal.sourceCell.data; - [self showDetailView:cellValue]; +// [self showDetailView:cellValue]; + + VankeFloorDetailWebViewController *detailWebVC = [[VankeFloorDetailWebViewController alloc] initWithNibName:@"VankeFloorDetailWebViewController" bundle:nil FloorValue:cellValue date:_salesDate]; + [self.navigationController pushViewController:detailWebVC animated:YES]; + } #pragma mark VankePassengerListBoardCell_iPhone diff --git a/vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m b/vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m index f1a006addd733ccf48d78ba1d985c15424f10769..bfb000b13c50f2e93603508ae08d3f409ccde24f 100755 --- a/vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m +++ b/vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m @@ -177,13 +177,17 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) { } ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) { - VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell; - if ([@"昨日客æµ" eq:[cell name]]) { - [[VankeAppBoard_iPhone sharedInstance] hideMenu]; - [self showListView: CELL_TYPE_PASSENGER]; - } else { - [GEToast showWithText:@"æ£åœ¨ç ”å‘ä¸..." bottomOffset:50.0f duration:1.0f]; - } + + [[VankeAppBoard_iPhone sharedInstance] hideMenu]; + [self showListView: CELL_TYPE_FLOOR]; + +// VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell; +// if ([@"昨日客æµ" eq:[cell name]]) { +// [[VankeAppBoard_iPhone sharedInstance] hideMenu]; +// [self showListView: CELL_TYPE_PASSENGER]; +// } else { +// [GEToast showWithText:@"æ£åœ¨ç ”å‘ä¸..." bottomOffset:50.0f duration:1.0f]; +// } } #pragma mark - VankeProjectSummaryModel diff --git a/vanke/view_iPhone/templates/salesInput/Controller/SalesInputViewController.m b/vanke/view_iPhone/templates/salesInput/Controller/SalesInputViewController.m index ff2ef67368cdb930a6e666fda0f697b433af617e..4d9022771da251c1bad6effa164c7b3326641c31 100644 --- a/vanke/view_iPhone/templates/salesInput/Controller/SalesInputViewController.m +++ b/vanke/view_iPhone/templates/salesInput/Controller/SalesInputViewController.m @@ -45,10 +45,6 @@ self.cellDataDic = [NSMutableDictionary dictionary]; self.view.backgroundColor = [UIColor whiteColor]; - if ([LoginShopsInstance shareInstance].arrShops.count > 0) { - self.shop = [LoginShopsInstance shareInstance].arrShops[0]; - - } [self setUpNavigationBar]; [self setUpTopView]; @@ -152,9 +148,9 @@ ON_WILL_APPEAR( signal ) NSString *strTime = [df stringFromDate:[NSDate date]]; topView.textfieldDate.text = strTime; - + WS(weakSelf) topView.nameTapActionBlock = ^{ - [self chooseShopAction]; + [weakSelf chooseShopAction]; }; [self.view addSubview:topView]; @@ -297,6 +293,7 @@ ON_WILL_APPEAR( signal ) [self.navigationController pushViewController:history animated:YES]; } +//èŽ·å–æ”¯ä»˜æ–¹å¼ - (void)setUpData { ICRHTTPController *httpCtrl = [ICRHTTPController sharedController]; @@ -321,6 +318,8 @@ ON_WILL_APPEAR( signal ) - (void)submit { if (self.shop == nil) { + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"æç¤º" message:@"请选择店铺ï¼" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; + [alertView show]; }else{