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

启动图片

parent a494486d
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
[[NSNotificationCenter defaultCenter] postNotificationName:UPLOADVERSION object:nil];
} }
- (void)applicationDidBecomeActive:(UIApplication *)application { - (void)applicationDidBecomeActive:(UIApplication *)application {
......
{ {
"images" : [ "images" : [
{ {
"size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "Icon-Small.png",
"scale" : "1x"
},
{
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "iphone",
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"idiom" : "iphone",
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "iphone",
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "57x57",
"idiom" : "iphone", "idiom" : "iphone",
"size" : "60x60", "filename" : "Icon.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
self.navigationController.navigationBar.translucent = NO; self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.barTintColor = MainColor; self.navigationController.navigationBar.barTintColor = MainColor;
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor whiteColor]}]; [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[self detectionUpdateVersion];
//版本更新
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectionUpdateVersion) name:UPLOADVERSION object:nil];
} }
...@@ -199,6 +203,40 @@ ...@@ -199,6 +203,40 @@
} }
} }
#pragma mark - 检测更新
- (void)detectionUpdateVersion
{
NSString *path = [[NSBundle mainBundle]pathForResource:@"Info" ofType:@"plist"];
NSDictionary* content =[NSDictionary dictionaryWithContentsOfFile:path];
NSString *version = [content valueForKey:@"CFBundleShortVersionString"];
//获取服务端版本大小
WS(weakSelf);
NSString *string = [NSString stringWithFormat:@"driver/getUpgrade?apptype=ios&version=%@",version];
NSLog(@"%@",SERVERREQUESTURL(string));
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(string) WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSDictionary *dict = returnValue[@"data"];
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:[NSString stringWithFormat:@"发现新版本%@,快去更新吧!",dict[@"version"]] preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"我知道了" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:dict[@"url"]]];
}]];
//是否强制更新
if (![dict[@"forceupdate"] isEqualToString:@"yes"]) {
[alertVC addAction:[UIAlertAction actionWithTitle:@"以后再说" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[alertVC dismissViewControllerAnimated:YES completion:nil];
}]];
}
[weakSelf presentViewController:alertVC animated:YES completion:nil];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:@"网络不可用,请检查网络连接"];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
[self.userNameTextField addTarget:self action:@selector(userNameTextFieldInput:) forControlEvents:UIControlEventEditingDidBegin | UIControlEventEditingChanged]; [self.userNameTextField addTarget:self action:@selector(userNameTextFieldInput:) forControlEvents:UIControlEventEditingDidBegin | UIControlEventEditingChanged];
[self.passWordTextField addTarget:self action:@selector(userNameTextFieldInput:) forControlEvents:UIControlEventEditingDidBegin | UIControlEventEditingChanged]; [self.passWordTextField addTarget:self action:@selector(userNameTextFieldInput:) forControlEvents:UIControlEventEditingDidBegin | UIControlEventEditingChanged];
[self.loginButton addTarget:self action:@selector(loginButtonClickAction:) forControlEvents:UIControlEventTouchUpInside]; [self.loginButton addTarget:self action:@selector(loginButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
} }
...@@ -132,4 +133,5 @@ ...@@ -132,4 +133,5 @@
@end @end
...@@ -2,23 +2,22 @@ ...@@ -2,23 +2,22 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "Unknown.jpg", "filename" : "headerBackground.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "headerBackground@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "headerBackground@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
"info" : { "info" : {
"version" : 1, "version" : 1,
"author" : "xcode" "author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "original"
} }
} }
\ No newline at end of file
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "titleBackground.png", "filename" : "paopao.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "titleBackground@2x.png", "filename" : "paopao@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "titleBackground@3x.png", "filename" : "paopao@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key>
<string>旺盛</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
...@@ -13,7 +11,7 @@ ...@@ -13,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>旺盛</string> <string>物流移动平台</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
......
...@@ -128,17 +128,13 @@ static NetworkRequestClassManager *manager = nil; ...@@ -128,17 +128,13 @@ static NetworkRequestClassManager *manager = nil;
errorCodeBlock(BROKENNETWORK); errorCodeBlock(BROKENNETWORK);
return; return;
} }
if (requestType == 0) { if (requestType == 0) {
[manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
successBlock(responseObject); successBlock(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failureBlock(error); failureBlock(error);
}]; }];
}else if (requestType == 1){ }else if (requestType == 1){
......
...@@ -27,4 +27,10 @@ ...@@ -27,4 +27,10 @@
#define CHANGEPASSWORD @"driver/modifyPassword" #define CHANGEPASSWORD @"driver/modifyPassword"
/**
* 更新版本通知
*/
#define UPLOADVERSION @"uploadVersion"
#endif /* urlInformation_h */ #endif /* urlInformation_h */
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