Commit 53ecd4ee by 路少雄

1.2.2线上版本

parent 56ee1736
...@@ -3105,7 +3105,7 @@ ...@@ -3105,7 +3105,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8Z4G7AGK6D; DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -3130,7 +3130,7 @@ ...@@ -3130,7 +3130,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.1; MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater; PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
...@@ -3150,7 +3150,7 @@ ...@@ -3150,7 +3150,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8Z4G7AGK6D; DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -3175,7 +3175,7 @@ ...@@ -3175,7 +3175,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.1; MARKETING_VERSION = 1.2.2;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater; PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......
...@@ -31,9 +31,32 @@ ...@@ -31,9 +31,32 @@
NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]; NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
NSString *languageName = [appLanguages objectAtIndex:0]; // NSString *languageName = [appLanguages objectAtIndex:0];
// NSArray *languageArry = [NSLocale preferredLanguages];
// NSString *languageName = languageArry.firstObject;
NSString *languageName = [[[NSBundle mainBundle] preferredLocalizations] firstObject];
XHGetDataManager.languageName = languageName; XHGetDataManager.languageName = languageName;
[XHDataManager sharedManager].simparlanguage = ([XHGetDataManager.languageName rangeOfString:@"zh-Hans"].location ==NSNotFound);
// [XHDataManager sharedManager].simparlanguage = ([XHGetDataManager.languageName rangeOfString:@"zh-Hans"].location ==NSNotFound);
if ([XHGetDataManager.languageName hasPrefix:@"zh"]) {
if ([XHGetDataManager.languageName rangeOfString:@"Hans"].location != NSNotFound) {
[XHDataManager sharedManager].simparlanguage = 0; // 简体中文
} else { // zh-Hant\zh-HK\zh-TW
[XHDataManager sharedManager].simparlanguage = 2; // 繁体
}
}else{
[XHDataManager sharedManager].simparlanguage = 2; // 英文
}
NSLog(@"=--==--==-:%d:%@",XHGetDataManager.simparlanguage,XHGetDataManager.languageName); NSLog(@"=--==--==-:%d:%@",XHGetDataManager.simparlanguage,XHGetDataManager.languageName);
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "drmianling_Logo1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "drmianling_Logo1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import "HJVerifyView.h" #import "HJVerifyView.h"
#import <AudioToolbox/AudioToolbox.h> #import <AudioToolbox/AudioToolbox.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "MCSoundBoard.h" #import "MCSoundBoard.h"
#import "HJScanVC.h" #import "HJScanVC.h"
...@@ -22,13 +23,14 @@ ...@@ -22,13 +23,14 @@
#import "XHMineVC.h" #import "XHMineVC.h"
#import "XHSetHomeVC.h" #import "XHSetHomeVC.h"
#import "HJLocation.h" #import "HJLocation.h"
@interface XHParentVC ()<UIGestureRecognizerDelegate,VerifyViewDelegate,TipsViewDelegate,LocationDelegate> @interface XHParentVC ()<UIGestureRecognizerDelegate,VerifyViewDelegate,TipsViewDelegate,LocationDelegate,CBCentralManagerDelegate>
{ {
BOOL _tipDisplay; BOOL _tipDisplay;
} }
@property (nonatomic,strong) HJVerifyView *verifyView; @property (nonatomic,strong) HJVerifyView *verifyView;
@property (nonatomic, strong) UIActivityIndicatorView * activityIndicator; @property (nonatomic, strong) UIActivityIndicatorView * activityIndicator;
@property (nonatomic,strong) XHSetOrPersonalView *myView; @property (nonatomic,strong) XHSetOrPersonalView *myView;
@property (nonatomic, strong) CBCentralManager *centralManager;
@end @end
@implementation XHParentVC @implementation XHParentVC
...@@ -64,7 +66,40 @@ ...@@ -64,7 +66,40 @@
[self addNotification]; [self addNotification];
[self initNavView]; [self initNavView];
[self startLocation1]; [self startLocation1];
self.centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
}
- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
if (central.state == CBManagerStatePoweredOff) {
// 蓝牙未开启,显示提醒弹窗
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"手机蓝牙未开启" message:@"请前往设置开启手机蓝牙" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:settingsURL]) {
[[UIApplication sharedApplication] openURL:settingsURL options:@{} completionHandler:nil];
}
}];
CBManagerState state;
[alertController addAction:cancelAction];
[alertController addAction:settingsAction];
[self presentViewController:alertController animated:YES completion:nil];
} else if (central.state == CBManagerStateUnauthorized)
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"APP蓝牙未授权" message:@"请前往设置授权APP蓝牙权限" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:settingsURL]) {
[[UIApplication sharedApplication] openURL:settingsURL options:@{} completionHandler:nil];
}
}];
CBManagerState state;
[alertController addAction:cancelAction];
[alertController addAction:settingsAction];
[self presentViewController:alertController animated:YES completion:nil];
NSLog(@"设备未授权状态");
}
} }
-(void)startLocation1{ -(void)startLocation1{
__block NSString *string; __block NSString *string;
...@@ -401,19 +436,19 @@ ...@@ -401,19 +436,19 @@
-(void)Verify:(NSString*)str{ -(void)Verify:(NSString*)str{
if (self.isConnected) { if (self.isConnected) {
NSString *language; // NSString *language;
if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) { // if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) {
language = @"0"; // language = @"0";
}else{ // }else{
language = @"1"; // language = @"1";
} // }
//@"1234",@"DJM92050474" //@"1234",@"DJM92050474"
NSDictionary *updateDic = @{@"employeeNumber":[NSString isNull:XHGetDataManager.uniqueNumber]?@"-1":XHGetDataManager.uniqueNumber, NSDictionary *updateDic = @{@"employeeNumber":[NSString isNull:XHGetDataManager.uniqueNumber]?@"-1":XHGetDataManager.uniqueNumber,
@"verification":self.isOrderCommand?@"1234":@"-1",//@"1234" @"verification":self.isOrderCommand?@"1234":@"-1",//@"1234"
@"consumableNumber":[NSString isNull:str]?@"-1":str, @"consumableNumber":[NSString isNull:str]?@"-1":str,
@"deviceid":XHGetDataManager.deviceID, @"deviceid":XHGetDataManager.deviceID,
@"language":language @"language":[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage]
}; };
HJSelfWeak; HJSelfWeak;
[SVProgressHUD showWithStatus:HJLocalizedString(@"正在验证,请稍后…")]; [SVProgressHUD showWithStatus:HJLocalizedString(@"正在验证,请稍后…")];
...@@ -471,6 +506,7 @@ ...@@ -471,6 +506,7 @@
HJSelfWeak; HJSelfWeak;
[[XHHttpRequestManager shareManager] postHttpRequestURL1:GetConLimitNumURL isJson:true parameters:@{@"deviceid":XHGetDataManager.deviceID} success:^(id responseObject) { [[XHHttpRequestManager shareManager] postHttpRequestURL1:GetConLimitNumURL isJson:true parameters:@{@"deviceid":XHGetDataManager.deviceID} success:^(id responseObject) {
NSLog(@"1responseObjectresponseObjectresponseObject:%@",responseObject); NSLog(@"1responseObjectresponseObjectresponseObject:%@",responseObject);
if([XHCommonMethods isEmptyOrNull:[NSString stringWithFormat:@"%@",responseObject[@"data"][@"availNumber"]]]){ if([XHCommonMethods isEmptyOrNull:[NSString stringWithFormat:@"%@",responseObject[@"data"][@"availNumber"]]]){
GetUseTimessuccesedBlock(false); GetUseTimessuccesedBlock(false);
}else{ }else{
......
...@@ -139,7 +139,10 @@ ...@@ -139,7 +139,10 @@
#define GetRecordPageURL [NSString stringWithFormat:@"%@%@",URL,@"/record/getGestationRecordByDeviceid"] #define GetRecordPageURL [NSString stringWithFormat:@"%@%@",URL,@"/record/getGestationRecordByDeviceid"]
/*获取使用剩余次数*/ /*获取使用剩余次数*/
#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getConLimitNum"] //#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getConLimitNum"]
/*获取使用剩余次数*/
#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getConLimitNum"]
/*获取设备状态Dr-02-1 获取设备模单机或蓝牙*/ /*获取设备状态Dr-02-1 获取设备模单机或蓝牙*/
#define GetDeviceStausURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getSpecialConf"] #define GetDeviceStausURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getSpecialConf"]
......
...@@ -217,6 +217,7 @@ static HJBluetoothManager *sharedinstance = nil; ...@@ -217,6 +217,7 @@ static HJBluetoothManager *sharedinstance = nil;
} }
if (central.state == CBCentralManagerStatePoweredOff) if (central.state == CBCentralManagerStatePoweredOff)
{ {
NSLog(@"设备关闭状态"); NSLog(@"设备关闭状态");
[self stopScanning]; [self stopScanning];
_servicePeripheral = nil; _servicePeripheral = nil;
......
...@@ -138,8 +138,12 @@ ...@@ -138,8 +138,12 @@
// [manager requestAlwaysAuthorization]; // [manager requestAlwaysAuthorization];
[_manager requestWhenInUseAuthorization];//使用的时候获取定位信息 [_manager requestWhenInUseAuthorization];//使用的时候获取定位信息
} }
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (appName == nil || appName.length == 0) {
appName = @"DJMsp2";
}
if([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied){ if([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied){
UIAlertView *alvertView=[[UIAlertView alloc]initWithTitle:HJLocalizedString(@"提示") message:HJLocalizedString(@"请到手机系统的\n【设置】->【隐私】->【定位服务】->【%@】->【使用应用期间】或者【始终】开启定位服务的访问权限") delegate:nil cancelButtonTitle:HJLocalizedString(@"确定") otherButtonTitles: nil]; UIAlertView *alvertView=[[UIAlertView alloc]initWithTitle:HJLocalizedString(@"提示") message:[NSString stringWithFormat:HJLocalizedString(@"请到手机系统的\n【设置】->【隐私】->【定位服务】->【%@】->【使用应用期间】或者【始终】开启定位服务的访问权限"),appName ] delegate:nil cancelButtonTitle:HJLocalizedString(@"确定") otherButtonTitles: nil];
[alvertView show]; [alvertView show];
} }
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
@property (nonatomic, assign) BOOL isBind; @property (nonatomic, assign) BOOL isBind;
/// 当前语言环境 /// 当前语言环境
@property (nonatomic,copy) NSString *languageName; @property (nonatomic,copy) NSString *languageName;
/// 当前语言是否为非简体中文 0 是 1 非 /// 当前语言0简中 1英文 2繁体
@property (nonatomic,assign) BOOL simparlanguage; @property (nonatomic,assign) int simparlanguage;
/// 是否 第一次进入 /// 是否 第一次进入
@property (nonatomic, assign) BOOL isFirstInto; @property (nonatomic, assign) BOOL isFirstInto;
......
...@@ -285,12 +285,14 @@ ...@@ -285,12 +285,14 @@
return [[[self userDefaults] objectForKey:IsBind] boolValue]; return [[[self userDefaults] objectForKey:IsBind] boolValue];
} }
- (void)setSimparlanguage:(BOOL)simparlanguage{ - (void)setSimparlanguage:(int)simparlanguage{
[[self userDefaults] setObject:[NSNumber numberWithBool:simparlanguage] forKey:@"simparlanguage"]; [[self userDefaults] setObject:[NSNumber numberWithInt:simparlanguage] forKey:@"simparlanguage"];
[[self userDefaults] synchronize]; [[self userDefaults] synchronize];
NSLog(@"%d",simparlanguage);
} }
- (BOOL)simparlanguage{ - (int)simparlanguage{
return [[[self userDefaults] objectForKey:@"simparlanguage"] boolValue]; NSLog(@"%d",[[[self userDefaults] objectForKey:@"simparlanguage"] intValue]);
return [[[self userDefaults] objectForKey:@"simparlanguage"] intValue];
} }
#pragma mark ------当前语言 #pragma mark ------当前语言
-(void)setLanguageName:(NSString *)languageName{ -(void)setLanguageName:(NSString *)languageName{
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
manager.responseSerializer = [AFJSONResponseSerializer serializer]; manager.responseSerializer = [AFJSONResponseSerializer serializer];
} }
manager.requestSerializer.timeoutInterval = 50; manager.requestSerializer.timeoutInterval = 50;
[manager.requestSerializer setValue:[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage] forHTTPHeaderField:@"Accept-Language"];
NSLog(@"%d",XHGetDataManager.simparlanguage );
[manager GET:url parameters:updateDic headers:nil progress:^(NSProgress * _Nonnull downloadProgress) { [manager GET:url parameters:updateDic headers:nil progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
...@@ -62,7 +66,7 @@ ...@@ -62,7 +66,7 @@
// [manager.requestSerializer setValue:XHGetDataManager.token forHTTPHeaderField:@"Authorization"];//Headers // [manager.requestSerializer setValue:XHGetDataManager.token forHTTPHeaderField:@"Authorization"];//Headers
[manager.requestSerializer setValue:XHGetDataManager.token forHTTPHeaderField:@"token"]; [manager.requestSerializer setValue:XHGetDataManager.token forHTTPHeaderField:@"token"];
NSLog(@"%@",XHGetDataManager.token );
[manager.requestSerializer setValue:[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage] forHTTPHeaderField:@"Accept-Language"]; [manager.requestSerializer setValue:[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage] forHTTPHeaderField:@"Accept-Language"];
...@@ -77,6 +81,11 @@ ...@@ -77,6 +81,11 @@
success(responseObject); success(responseObject);
} }
} }
// else if ([responseObject[@"code"] integerValue] == 12024){
// if (success) {
// success(responseObject);
// }
// }
// if ([responseObject[@"code"] integerValue] == 200) { // if ([responseObject[@"code"] integerValue] == 200) {
// if (success) { // if (success) {
// success(responseObject); // success(responseObject);
...@@ -171,18 +180,18 @@ ...@@ -171,18 +180,18 @@
} }
#pragma mark ========== 验证并获取时间 ========== #pragma mark ========== 验证并获取时间 ==========
-(void)getVerifyTimeWithConsumableNumber:(NSString *)consumableNumber isFailTips:(BOOL)isTips withSuccess:(HttpRequestSuccessBlock)success withFail:(HttpRequestFailBlock)fail networkRequestsFail:(NetworkRequestsFail)networkFail{ -(void)getVerifyTimeWithConsumableNumber:(NSString *)consumableNumber isFailTips:(BOOL)isTips withSuccess:(HttpRequestSuccessBlock)success withFail:(HttpRequestFailBlock)fail networkRequestsFail:(NetworkRequestsFail)networkFail{
NSString *language; // NSString *language;
if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) { // if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) {
language = @"0"; // language = @"0";
}else{ // }else{
language = @"1"; // language = @"1";
} // }
NSDictionary *uploadDic = @{@"employeeNumber":[NSString isNull:XHGetDataManager.uniqueNumber]?@"-1":XHGetDataManager.uniqueNumber, NSDictionary *uploadDic = @{@"employeeNumber":[NSString isNull:XHGetDataManager.uniqueNumber]?@"-1":XHGetDataManager.uniqueNumber,
@"verification":@"1234",// @"verification":@"1234",//
@"consumableNumber":consumableNumber, @"consumableNumber":consumableNumber,
@"deviceid":XHGetDataManager.deviceID, @"deviceid":XHGetDataManager.deviceID,
@"language":language}; @"language":[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage]};
[SVProgressHUD show]; [SVProgressHUD show];
[self postHttpRequestURL:VerifyURL isJson:true parameters:uploadDic success:^(id responseObject) { [self postHttpRequestURL:VerifyURL isJson:true parameters:uploadDic success:^(id responseObject) {
......
...@@ -5,3 +5,12 @@ ...@@ -5,3 +5,12 @@
Created by 1688 on 2018/6/7. Created by 1688 on 2018/6/7.
Copyright © 2018年 黄箭. All rights reserved. Copyright © 2018年 黄箭. All rights reserved.
*/ */
NSAppleMusicUsageDescription = "我们需要您的許可才能訪問相冊。";
NSBluetoothPeripheralUsageDescription = "我們需要您的藍牙來啟動外设。";
NSBluetoothAlwaysUsageDescription = "我們需要您的藍牙來与周围的设备进行通信。";
NSCameraUsageDescription = "我们需要您的許可才能訪問相機,您的相機將用於掃描DJM設備相關二維碼,從而對設備進行操控。";
NSLocationAlwaysUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSLocationUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSLocationWhenInUseUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSPhotoLibraryAddUsageDescription = "我们需要您的許可才能訪問這些與DJM設備相關的照片,並通過這些DJM相關的照片獲取DJM設備的操控所需信息。";
NSPhotoLibraryUsageDescription = "我们需要您的許可才能訪問這些與DJM設備相關的照片,並通過這些DJM相關的照片獲取DJM設備的操控所需信息。";
...@@ -6,12 +6,23 @@ ...@@ -6,12 +6,23 @@
Copyright © 2018年 黄箭. All rights reserved. Copyright © 2018年 黄箭. All rights reserved.
*/ */
NSAppleMusicUsageDescription = "We need your permission to access the album."; //NSAppleMusicUsageDescription = "We need your permission to access the album.";
NSBluetoothPeripheralUsageDescription = "We need your bluetooth to start device."; //NSBluetoothPeripheralUsageDescription = "We need your bluetooth to start device.";
NSBluetoothAlwaysUsageDescription = "We need to communicate with peripherals via Bluetooth"; //NSBluetoothAlwaysUsageDescription = "We need to communicate with peripherals via Bluetooth";
NSCameraUsageDescription = "We needs your permission to access the camera. Your camera will be used to scan the QR code of the DJM device to control the DJM device."; //NSCameraUsageDescription = "We needs your permission to access the camera. Your camera will be used to scan the QR code of the DJM device to control the DJM device.";
NSLocationAlwaysUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information."; //NSLocationAlwaysUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information.";
NSLocationUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information."; //NSLocationUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information.";
NSLocationWhenInUseUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information."; //NSLocationWhenInUseUsageDescription = "We need your permission to communicate with surrounding DJM devices via location information.";
NSPhotoLibraryAddUsageDescription = "We needs your permission to access these DJM-related photos, and obtain the information required for the operation of the DJM equipment through these DJM-related photos."; //NSPhotoLibraryAddUsageDescription = "We needs your permission to access these DJM-related photos, and obtain the information required for the operation of the DJM equipment through these DJM-related photos.";
NSPhotoLibraryUsageDescription = "We needs your permission to access these DJM-related photos, and obtain the information required for the operation of the DJM equipment through these DJM-related photos."; //NSPhotoLibraryUsageDescription = "We needs your permission to access these DJM-related photos, and obtain the information required for the operation of the DJM equipment through these DJM-related photos.";
NSAppleMusicUsageDescription = "我们需要您的許可才能訪問相冊。";
NSBluetoothPeripheralUsageDescription = "我們需要您的藍牙來啟動外设。";
NSBluetoothAlwaysUsageDescription = "我們需要您的藍牙來与周围的设备进行通信。";
NSCameraUsageDescription = "我们需要您的許可才能訪問相機,您的相機將用於掃描DJM設備相關二維碼,從而對設備進行操控。";
NSLocationAlwaysUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSLocationUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSLocationWhenInUseUsageDescription = "我们需要您的允许通过定位信息与周围的设备进行通信。";
NSPhotoLibraryAddUsageDescription = "我们需要您的許可才能訪問這些與DJM設備相關的照片,並通過這些DJM相關的照片獲取DJM設備的操控所需信息。";
NSPhotoLibraryUsageDescription = "我们需要您的許可才能訪問這些與DJM設備相關的照片,並通過這些DJM相關的照片獲取DJM設備的操控所需信息。";
...@@ -320,6 +320,9 @@ ...@@ -320,6 +320,9 @@
weakSelf.videoListModel = [DXHFXVideoModel mj_objectWithKeyValues:responseObject[@"data"]]; weakSelf.videoListModel = [DXHFXVideoModel mj_objectWithKeyValues:responseObject[@"data"]];
NSLog(@"%@",weakSelf.videoListModel); NSLog(@"%@",weakSelf.videoListModel);
weakSelf.myView.videoModel = weakSelf.videoListModel; weakSelf.myView.videoModel = weakSelf.videoListModel;
if (weakSelf.currentState == 1) {
[weakSelf.myView controlWithItem:weakSelf.myView.hlBtn];
}
} fail:^(id failMessage) { } fail:^(id failMessage) {
......
...@@ -64,7 +64,12 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -64,7 +64,12 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
self.navigationController.navigationBar.shadowImage=[UIImage new]; self.navigationController.navigationBar.shadowImage=[UIImage new];
UIImageView *img = [UIImageView myUIImageViewSuperView:self.navigationController.navigationBar withImageName:(TargetType==4?@"DR_DeviceListTopImage":@"Main_Logo")]; UIImageView *img = [UIImageView myUIImageViewSuperView:self.navigationController.navigationBar withImageName:(TargetType==4?@"DR_DeviceListTopImage":@"Main_Logo")];
if(TargetType == 5){ if(TargetType == 5){
if ([XHDataManager sharedManager].simparlanguage == 0) {
img.image = [UIImage imageNamed:@"drmianling_Logo"]; img.image = [UIImage imageNamed:@"drmianling_Logo"];
}else{
img.image = [UIImage imageNamed:@"drmianling_Logo1"];
}
} }
[img mas_makeConstraints:^(MASConstraintMaker *make) { [img mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(self.navigationController.navigationBar); make.centerX.centerY.mas_equalTo(self.navigationController.navigationBar);
...@@ -80,7 +85,10 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -80,7 +85,10 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
break; break;
case 5: case 5:
[self initDataDr02]; [self initDataDr02];
if ([XHDataManager sharedManager].simparlanguage == 0) {
[self requestBannerList]; [self requestBannerList];
}
[self updateApp]; [self updateApp];
break; break;
default: default:
......
...@@ -100,13 +100,28 @@ ...@@ -100,13 +100,28 @@
} }
#pragma mark - 使用协议 #pragma mark - 使用协议
-(void)agreementBtnAction{ -(void)agreementBtnAction{
NSArray *htmlArr = @[@"https://djm.imoreme.com/static/html/djm_tyldm_agreement_magnifier.html",
NSArray *htmlArr;
if (XHGetDataManager.simparlanguage == 0) {
htmlArr = @[@"https://djm.imoreme.com/static/html/djm_tyldm_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmps2_agreement_magnifier.html", @"https://djm.imoreme.com/static/html/djm_djmps2_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmhome_agreement_magnifier.html", @"https://djm.imoreme.com/static/html/djm_djmhome_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_drfacialage_agreement_magnifier.html", @"https://djm.imoreme.com/static/html/djm_drfacialage_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_drwater_agreement_magnifier.html", @"https://djm.imoreme.com/static/html/djm_drwater_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_seyoap_agreement_magnifier.html", @"https://djm.imoreme.com/static/html/djm_seyoap_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmbangyan_agreement_magnifier.html"]; @"https://djm.imoreme.com/static/html/djm_djmbangyan_agreement_magnifier.html"];
}else{
htmlArr = @[@"https://djm.imoreme.com/static/html/djm_tyldm_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmps2_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmhome_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_drfacialage_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_drwater_agreement_magnifier_002.html",
@"https://djm.imoreme.com/static/html/djm_seyoap_agreement_magnifier.html",
@"https://djm.imoreme.com/static/html/djm_djmbangyan_agreement_magnifier.html"];
}
XHAgreementVC *vc = [[XHAgreementVC alloc]init]; XHAgreementVC *vc = [[XHAgreementVC alloc]init];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen; vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
vc.htmlStr = htmlArr[TargetType-1]; vc.htmlStr = htmlArr[TargetType-1];
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
[self.view endEditing:true]; [self.view endEditing:true];
NSDictionary *dic; NSDictionary *dic;
NSLog(@"XHGetDataManager.languageName1:%d",XHGetDataManager.simparlanguage);//中文 NSLog(@"XHGetDataManager.languageName1:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1)&&(TargetType==6)){ if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
dic = @{@"email":self.dic[@"email"],@"nickName":str}; dic = @{@"email":self.dic[@"email"],@"nickName":str};
}else{//简体中文 c }else{//简体中文 c
dic = @{@"phone":self.dic[@"phone"],@"code":self.dic[@"code"],@"nickName":str}; dic = @{@"phone":self.dic[@"phone"],@"code":self.dic[@"code"],@"nickName":str};
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
- (void)SureBtnAction:(NSString *)str{ - (void)SureBtnAction:(NSString *)str{
NSDictionary *dic; NSDictionary *dic;
NSLog(@"XHGetDataManager.languageName2:%d",XHGetDataManager.simparlanguage);//中文 NSLog(@"XHGetDataManager.languageName2:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1)&&(TargetType==6)){ if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
dic = @{@"email":self.myDic[@"email"],@"nickName":self.myDic[@"nickName"],@"sex":str}; dic = @{@"email":self.myDic[@"email"],@"nickName":self.myDic[@"nickName"],@"sex":str};
}else{//简体中文 }else{//简体中文
dic = @{@"phone":self.myDic[@"phone"],@"code":self.myDic[@"code"],@"nickName":self.myDic[@"nickName"],@"sex":str}; dic = @{@"phone":self.myDic[@"phone"],@"code":self.myDic[@"code"],@"nickName":self.myDic[@"nickName"],@"sex":str};
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
NSDictionary *dic; NSDictionary *dic;
[SVProgressHUD show]; [SVProgressHUD show];
NSLog(@"XHGetDataManager.languageName3:%d",XHGetDataManager.simparlanguage);//中文 NSLog(@"XHGetDataManager.languageName3:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1)&&(TargetType==6)){ if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
dic = @{@"email":self.myThirdDic[@"email"], dic = @{@"email":self.myThirdDic[@"email"],
@"nickName":self.myThirdDic[@"nickName"], @"nickName":self.myThirdDic[@"nickName"],
@"sex":@([self.myThirdDic[@"sex"] integerValue]), @"sex":@([self.myThirdDic[@"sex"] integerValue]),
......
...@@ -40,11 +40,27 @@ ...@@ -40,11 +40,27 @@
make.top.mas_equalTo(self).offset(55.5*IPhone6ScaleHeight); make.top.mas_equalTo(self).offset(55.5*IPhone6ScaleHeight);
}]; }];
NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]; NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
NSString *languageName = [appLanguages objectAtIndex:0]; // NSString *languageName = [appLanguages objectAtIndex:0];
XHGetDataManager.simparlanguage = ([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound); // NSArray *languageArry = [NSLocale preferredLanguages];
// NSString *languageName = languageArry.firstObject;
NSString *languageName = [[[NSBundle mainBundle] preferredLocalizations] firstObject];
// XHGetDataManager.simparlanguage = ([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound);
XHGetDataManager.languageName = languageName; XHGetDataManager.languageName = languageName;
if ([XHGetDataManager.languageName hasPrefix:@"zh"]) {
if ([XHGetDataManager.languageName rangeOfString:@"Hans"].location != NSNotFound) {
[XHDataManager sharedManager].simparlanguage = 0; // 简体中文
} else { // zh-Hant\zh-HK\zh-TW
[XHDataManager sharedManager].simparlanguage = 2; // 繁体
}
}else{
[XHDataManager sharedManager].simparlanguage = 2; // 英文
}
NSLog(@"XHGetDataManager.languageName:%d:%d:%@",XHGetDataManager.simparlanguage,([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound),languageName);//中文 NSLog(@"XHGetDataManager.languageName:%d:%d:%@",XHGetDataManager.simparlanguage,([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound),languageName);//中文
if((TargetType == 6)&&([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文// /Hans-CN if((TargetType == 5)&&([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文// /Hans-CN
UIImageView *emailImg = [UIImageView myUIImageViewSuperView:self withImageName:@"邮件_mail (1)"]; UIImageView *emailImg = [UIImageView myUIImageViewSuperView:self withImageName:@"邮件_mail (1)"];
[emailImg mas_makeConstraints:^(MASConstraintMaker *make) { [emailImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(HJPX(82)); make.left.mas_equalTo(HJPX(82));
...@@ -403,7 +419,7 @@ ...@@ -403,7 +419,7 @@
} }
#pragma mark - 登录 #pragma mark - 登录
-(void)loginBtnTouchUpInside{ -(void)loginBtnTouchUpInside{
if((TargetType == 6)&&([XHGetDataManager.languageName rangeOfString:@"Hans-CN"].location ==NSNotFound)){//非简体中文 if((TargetType == 5)&&([XHGetDataManager.languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文
if (![NSString isNull:self.emailTF.text] && self.agreeBtn.selected == YES ) { if (![NSString isNull:self.emailTF.text] && self.agreeBtn.selected == YES ) {
NSDictionary *dic=@{@"email":self.emailTF.text, NSDictionary *dic=@{@"email":self.emailTF.text,
@"appType":@(TargetType) @"appType":@(TargetType)
......
...@@ -353,18 +353,18 @@ ...@@ -353,18 +353,18 @@
} }
-(void)verify{ -(void)verify{
if (![NSString isNull:XHGetDataManager.deviceID]) { if (![NSString isNull:XHGetDataManager.deviceID]) {
NSString *language; // NSString *language;
if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) { // if ( [XHGetDataManager.languageName rangeOfString:@"zh-H"].location !=NSNotFound) {
language = @"0"; // language = @"0";
}else{ // }else{
language = @"1"; // language = @"1";
} // }
NSDictionary *updateDic = @{@"employeeNumber":XHGetDataManager.employeeNum, NSDictionary *updateDic = @{@"employeeNumber":XHGetDataManager.employeeNum,
@"verification":self.order, @"verification":self.order,
@"consumableNumber":self.product, @"consumableNumber":self.product,
@"deviceid":XHGetDataManager.deviceID, @"deviceid":XHGetDataManager.deviceID,
@"language":language @"language":[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage]
}; };
NSLog(@"%@",updateDic); NSLog(@"%@",updateDic);
HJSelfWeak; HJSelfWeak;
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
withDelegate:self withDelegate:self
withFont:XHFontSize(15) withFont:XHFontSize(15)
withTextFieldColor:XHTextFieldTextColor withNSTextAlignment:NSTextAlignmentLeft withTextFieldColor:XHTextFieldTextColor withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入设备名称") withPlaceholder:HJLocalizedString(@"请输入设备名称")
withPlaceholderColor:XHTextFieldTextPlaceholderColor withVerticalAlignment:UIControlContentVerticalAlignmentCenter]; withPlaceholderColor:XHTextFieldTextPlaceholderColor withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
self.tf_Name.clearButtonMode = UITextFieldViewModeWhileEditing; self.tf_Name.clearButtonMode = UITextFieldViewModeWhileEditing;
// self.tf_Name.keyboardType = UIKeyboardTypeNumberPad; // self.tf_Name.keyboardType = UIKeyboardTypeNumberPad;
......
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