Commit 99da4460 by 李威

hfx超强模式

parent 3d897f24
......@@ -676,6 +676,7 @@
2DDF3A57856A2F27B92CD379 /* Pods-HJMDrWarter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HJMDrWarter.debug.xcconfig"; path = "Target Support Files/Pods-HJMDrWarter/Pods-HJMDrWarter.debug.xcconfig"; sourceTree = "<group>"; };
390516C52BAA75D000935EDE /* DXHotElecticView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DXHotElecticView.h; sourceTree = "<group>"; };
390516C62BAA75D000935EDE /* DXHotElecticView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DXHotElecticView.m; sourceTree = "<group>"; };
39514C652C5A0A1000D785DC /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
39E082732BB3BA6800786B9D /* DXRDSmartRec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DXRDSmartRec.h; sourceTree = "<group>"; };
39E082742BB3BA6800786B9D /* DXRDSmartRec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DXRDSmartRec.m; sourceTree = "<group>"; };
39E1E5FF031957A0EABCCB00 /* Pods-DJMHomeTY.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeTY.debug.xcconfig"; path = "Target Support Files/Pods-DJMHomeTY/Pods-DJMHomeTY.debug.xcconfig"; sourceTree = "<group>"; };
......@@ -3048,6 +3049,7 @@
children = (
880BFDA729A85D4B00B59CFA /* zh-Hans */,
880BFDAC29A85D4B00B59CFA /* Base */,
39514C652C5A0A1000D785DC /* zh-Hant */,
);
name = Localizable.strings;
sourceTree = "<group>";
......@@ -3171,7 +3173,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
......@@ -3197,7 +3199,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.4;
MARKETING_VERSION = 1.2.8;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......@@ -3217,7 +3219,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageWater;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
......@@ -3243,7 +3245,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.4;
MARKETING_VERSION = 1.2.8;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMDrWater;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......@@ -3263,7 +3265,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageDR;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -3288,7 +3290,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMHomeDR;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......@@ -3308,7 +3310,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImageDR;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PREFIX_HEADER = "$(SRCROOT)/DJMHomeTY/Global/Define/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -3333,7 +3335,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = djm.imoreme.com.DJMHomeDR;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
......
......@@ -7,32 +7,32 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "AA50D0ED-0F14-4D38-9253-455A200313BD"
uuid = "94B0D0F9-380D-4E87-9D9C-DBBCBEB276DF"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DJMHomeTY/Global/Manager/XHHttpRequestManager.m"
filePath = "DJMHomeTY/Global/Base/View/HJVerifyView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "116"
endingLineNumber = "116"
landmarkName = "-postHttpRequestURL1:isJson:parameters:success:fail:networkRequestsFail:"
startingLineNumber = "157"
endingLineNumber = "157"
landmarkName = "-initWithFrame:withScanCommandArr:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "00BDAC4F-446F-445D-A93E-D3B201636F45"
uuid = "E3A5FF1E-EAAA-42DE-B2F0-5177BF64AA18"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DJMHomeTY/Global/Manager/XHHttpRequestManager.m"
filePath = "DJMHomeTY/Page/SetPage/View/XHResetDeviceNameView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "171"
endingLineNumber = "171"
landmarkName = "-postHttpRequestURL:isJson:parameters:success:fail:networkRequestsFail:"
startingLineNumber = "50"
endingLineNumber = "50"
landmarkName = "-createUI"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "护理(未改版) 拷贝 6@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "护理(未改版) 拷贝 6@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -79,6 +79,7 @@ typedef NS_ENUM(NSInteger, TipsTag)
//自动手动点集合
@property (nonatomic,strong) NSMutableArray *outoOrManRecord;
@property (nonatomic,assign)BOOL issupply;//海菲秀是否强效补给
- (void)exitTips;
-(void)hindenActivityIndicator;
......
......@@ -448,7 +448,8 @@
@"verification":self.isOrderCommand?@"1234":@"-1",//@"1234"
@"consumableNumber":[NSString isNull:str]?@"-1":str,
@"deviceid":XHGetDataManager.deviceID,
@"language":[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage]
@"language":[NSString stringWithFormat:@"%d",XHGetDataManager.simparlanguage],
@"model":self.issupply?@"1":@"0"
};
HJSelfWeak;
[SVProgressHUD showWithStatus:HJLocalizedString(@"正在验证,请稍后…")];
......@@ -481,11 +482,16 @@
}else{
messages = [NSString stringWithFormat:@"%@",failMessage[@"msg"]];
}
if (messages.intValue == 13001 || messages.intValue == 13002) {
weakSelf.isVerifySucceed = NO;
}else {
[SVProgressHUD showErrorWithStatus:messages];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
});
}
[SVProgressHUD showErrorWithStatus:messages];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
});
if (self.DevicesuccesedBlock) {
self.DevicesuccesedBlock(true,false);
}
......
......@@ -217,6 +217,7 @@
#define DR05_HE_get_Version @"0500A6330240"//获取版本
#define DR05_HE_send_getUpdateVersion @"0500a63102aa"//发送固件升级
#define DR05_HE_back_Version @"0700A6330140"//返回版本
#define DR05_HE_send_UpdateVersion @"0500613102aa"//返回版本
#define DR05_HE_send_UpdateVersion @"0500613102aa"//升级
#define DR05_HE_send_WaveForm @"0600a6310203"//波形
#endif /* XHCommand_h */
......@@ -10,7 +10,7 @@
#define XHURL_h
//#define DRURL @"https://testdjm.imoreme.com"//测试
#define DRURL @"https://djm.imoreme.com"//正式
//#define URL @"http://192.168.1.168:8080"//luocong
//#define DRURL @"http://192.168.1.168:8080"//luocong
//#define URL @"http://192.168.1.66:9012"//luocong
/** 发送验证码 **/
......
"版本更新" = "版本更新";
"检测到新版本(%@),请及时更新" = "檢測到新版本(%@),請及時更新";
"更新" = "更新";
"取消" = "取消";
"仪器未连接" = "儀器未連接";
"请扫描[精华液瓶]二维码" = "請掃描[精華液瓶]二維碼";
"请扫描[耗材]二维码" = "請掃描[耗材]二維碼";
"查询管控状态失败。" = "查詢管控狀態失敗。";
"正在验证,请稍后…" = "正在驗證,請稍後…";
"验证成功!" = "驗證成功!";
"本次理疗未结束,是否退出?" = "本次理療未結束,是否退出?";
"确定" = "確定";
"知道了" = "知道了";
"提示" = "提示";
"验证" = "驗證";
"工号不能为空!" = "工號不能為空!";
"订单号不能为空!" = "訂單號不能為空!";
"产品号不能为空!" = "產品號不能為空!";
"完成" = "完成";
"请到手机系统的\n【设置】->【隐私】->【定位服务】->【%@】->【使用应用期间】或者【始终】开启定位服务的访问权限" = "請到手機系統的\n【設置】->【隱私】->【定位服務】->【%@】->【使用應用期間】或者【始終】開啟定位服務的訪問權限";
"网络请求失败" = "網路請求失敗";
"登录已过期或失效,请重新登录!" = "登錄已過期或失效,請重新登錄!";
"手机未开启蓝牙,请开启蓝牙重试!" = "手機未開啟藍牙,請開啟藍牙重試!";
"连接成功" = "連接成功";
"断开连接" = "斷開連接";
"方案正在进行中,是否确定退出?" = "方案正在進行中,是否確定退出?";
"已达极限值60W" = "已達極限值60W";
"下额线" = "下額線";
"法令纹" = "法令紋";
"苹果肌" = "蘋果肌";
"眼部" = "眼部";
"额头" = "額頭";
"下额线\n 5mins" = "下額線\n 5分鐘";
"法令纹\n5mins" = "法令紋\n5分鐘";
"苹果肌\n5mins" = "蘋果肌\n5分鐘";
"眼部\n5mins" = "眼部\n5分鐘";
"额头\n5mins" = "額頭\n5分鐘";
"手机未开启蓝牙,请开启蓝牙重试!" = "手機未開啟藍牙,請開啟藍牙重試!";
"连接成功" = "連接成功";
"断开连接" = "斷開連接";
"温度过高" = "溫度過高";
"最佳温度" = "最佳溫度";
"建议本次操作结束后进行设备保养,如因长期未保养导致管道堵塞,造成售后维修属于人为损坏,需自行承担费用" = "建議本次操作結束後進行設備保養,如因長期未保養導致管道堵塞,造成售後維修屬於人為損壞,需自行承擔費用";
"我知道了" = "我知道了";
"正在升级固件" = "正在升級固件";
"已完成" = "已完成";
"请勿断开蓝牙" = "請勿斷開藍牙";
"结束" = "結束";
"请确认精华液已用完" = "請確認精華液已用完";
"护理未开始" = "護理未開始";
"手机未开启蓝牙,请开启蓝牙重试!" = "手機未開啟藍牙,請開啟藍牙重試!";
"请扫描耗材二维码" = "請掃描耗材二維碼";
"更新完成" = "更新完成";
"清洁中..." = "清潔中...";
"请验证耗材有效性" = "請驗證耗材有效性";
"设备清洁已完成,请开始护理洁面" = "設備清潔已完成,請開始護理潔面";
"当前护理已完成,是否继续操作?" = "當前護理已完成,是否繼續操作?";
"护理已完成..." = "護理已完成...";
"有新版本升级" = "有新版本升級";
"正在准备升级..." = "正在準備升級...";
"操作指引" = "操作指引";
"取空瓶灌装 30℃左右的温水,安装在精华液瓶的位置,并安装好废水瓶" = "取空瓶灌裝 30℃左右的溫水,安裝在精華液瓶的位置,並安裝好廢水瓶";
"在手柄上把流量调节到最大,点击“▶”进行保养" = "在手柄上把流量調節到最大,點擊“▶”進行保養";
"清洁件用透明盖子或手指堵住探头,间隔一段时间松开" = "清潔件用透明蓋子或手指堵住探頭,間隔一段時間鬆開";
"50秒后结束保养,请卸下瓶子" = "50秒後結束保養,請卸下瓶子";
"最后,请记得清洗废水瓶" = "最後,請記得清洗廢水瓶";
"45秒后结束保养,请卸下瓶子" = "45秒後結束保養,請卸下瓶子";
"保养已完成,点击确定按钮退出" = "保養已完成,點擊確定按鈕退出";
"建议本次使用结束后进行设备保养" = "建議本次使用結束後進行設備保養";
"① 清洁设备" = "① 清潔設備";
"② 面部护理" = "② 面部護理";
"UV灯" = "UV燈";
"全脸清洁" = "全臉清潔";
"清洁设备不可调节负压、流速" = "清潔設備不可調節負壓、流速";
"负压调节" = "負壓調節";
"精华液流速" = "精華液流速";
"流速以拔起探头不会滴水为佳" = "流速以拔起探頭不會滴水為佳";
"清洁设备不可调节负压、流速" = "清潔設備不可調節負壓、流速";
"自定义模式" = "自訂模式";
"智能模式" = "智能模式";
"当前模式正在进行中,请结束后再切换模式!" = "當前模式正在進行中,請結束後再切換模式!";
"请操作左脸" = "請操作左臉";
"请连接上设备后重试" = "請連接上設備後重試";
"请结束当前方案后再切换" = "請結束當前方案後再切換";
"请暂停后再开始消毒" = "請暫停後再開始消毒";
"即将结束本次服务,结束后可重新选择护理方案" = "即將結束本次服務,結束後可重新選擇護理方案";
"断开连接" = "斷開連接";
"手柄未连接" = "手柄未連接";
"方案正在进行中,是否确定退出?" = "方案正在進行中,是否確定退出?";
"有新版本升级" = "有新版本升級";
"正在准备升级..." = "正在準備升級...";
"调节变频时间 | 5ms" = "調節變頻時間 | 5毫秒";
"调节变频时间 | 7ms" = "調節變頻時間 | 7毫秒";
"调节变频时间" = "調節變頻時間";
"3M 档位" = "3M 檔位";
"3M 强度(W/cm²)" = "3M 強度(W/cm²)";
"10M 档位" = "10M 檔位";
"10M 强度(W/cm²)" = "10M 強度(W/cm²)";
"设备离线" = "設備離線";
"选择护理方案" = "選擇護理方案";
"眼纹" = "眼紋";
"深纹" = "深紋";
"提升" = "提升";
"面部紧致" = "面部緊緻";
"皮肤焕新" = "皮膚焕新";
"敏感性皮肤焕新" = "敏感性皮膚焕新";
"抗衰" = "抗衰";
"辅助面部吸收" = "輔助面部吸收";
"粉刺痤疮" = "粉刺痤疮";
"丘疹脓疱性痤疮" = "丘疹脓疱性痤疮";
"明眸淡纹" = "明眸淡紋";
"抚平舒纹" = "撫平舒紋";
"童颜提拉" = "童顏提拉";
"轮廓紧致" = "輪廓緊緻";
"美肌焕新" = "美肌焕新";
"舒敏焕新" = "舒敏焕新";
"嫩颜促吸" = "嫩顏促吸";
"平痘护肤" = "平痘護膚";
"平痘抑菌" = "平痘抑菌";
"个人中心" = "個人中心";
"设备设置" = "設備設置";
"使用时长:00:14:00" = "使用時長:00:14:00";
"LDM(家居版)" = "LDM(家居版)";
"Dr强效向控旋磁仪" = "Dr強效向控旋磁儀";
"高光水滴仪" = "高光水滴儀";
"添加设备" = "添加設備";
"Dr.水滴高光仪" = "Dr.水滴高光儀";
"Dr.Hi飞秀" = "Dr.Hi飛秀";
"D3果冻仪器" = "D3果凍儀器";
"去连接" = "去連接";
"水滴高光仪" = "水滴高光儀";
"帮助与反馈" = "幫助與反饋";
"关于" = "關於";
"退出登录" = "退出登錄";
"暂未开放此功能,敬请期待!" = "暫未開放此功能,敬請期待!";
"是否确定退出登录?" = "是否確定退出登錄?";
"个人资料" = "個人資料";
"昵称" = "暱稱";
"年龄" = "年齡";
"性别" = "性別";
"男" = "男";
"女" = "女";
"注销账户并清除用户数据" = "注銷賬戶並清除用戶數據";
"是否确定注销账户并清除用户数据?" = "是否確定注銷賬戶並清除用戶數據?";
"修改密码" = "修改密碼";
"修改年龄" = "修改年齡";
"选择性别" = "選擇性別";
"男生" = "男生";
"女生" = "女生";
"修改昵称" = "修改暱稱";
"请输入昵称" = "請輸入暱稱";
"网络请求失败" = "網絡請求失敗";
"发送验证码" = "發送驗證碼";
"登录成功!" = "登錄成功!";
"完善资料" = "完善資料";
"出生日期" = "出生日期";
"请输入邮箱号码" = "請輸入郵箱號碼";
"已阅读并同意" = "已閱讀並同意";
"《用户使用协议》" = "《用戶使用協議》";
"请输入手机号码" = "請輸入手機號碼";
"验证码" = "驗證碼";
"获取验证码" = "獲取驗證碼";
"请阅读并同意用户使用协议" = "請閱讀並同意用戶使用協議";
"请输入正确格式的手机号码" = "請輸入正確格式的手機號碼";
"请设置昵称" = "請設置暱稱";
"下一步" = "下一步";
"图片中未识别到二维码" = "圖片中未識別到二維碼";
"返回" = "返回";
"重试" = "重試";
"正在验证,请稍后…" = "正在驗證,請稍後…";
"验证成功!" = "驗證成功!";
"请到手机系统的\n【设置】->【隐私】->【照片】->【%@】开启照片的访问权限" = "請到手機系統的\n【設置】->【隱私】->【照片】->【%@】開啟照片的訪問權限";
"照片读取权限未开启" = "照片讀取權限未開啟";
"请到手机系统的\n【设置】->【隐私】->【相机】->【%@】开启相机的访问权限" = "請到手機系統的\n【設置】->【隱私】->【相機】->【%@】開啟相機的訪問權限";
"相机权限未开启" = "相機權限未開啟";
"只支持iOS8.0以上系统!" = "只支持iOS8.0以上系統!";
"选择设备型号" = "選擇設備型號";
"查看排行" = "查看排行";
"设置" = "設置";
"设备类型" = "設備類型";
"设置手柄频率" = "設置手柄頻率";
"设备消毒程序" = "設備消毒程序";
"应用程序版本" = "應用程序版本";
"固件版本" = "固件版本";
"自动播放视频" = "自動播放視頻";
"设备id" = "設備id";
"输入密码" = "輸入密碼";
"修改" = "修改";
"密码错误" = "密碼錯誤";
"请完善手柄频率设置" = "請完善手柄頻率設置";
"请输入手柄标签上的初始频率" = "請輸入手柄標簽上的初始頻率";
"暂不设置" = "暫不設置";
"请输入手柄频率" = "請輸入手柄頻率";
"请输入3M手柄上的频率" = "請輸入3M手柄上的頻率";
"请输入10M手柄上的频率" = "請輸入10M手柄上的頻率";
"修改设备名称" = "修改設備名稱";
"选择操作模式" = "選擇操作模式";
......@@ -68,6 +68,15 @@
@property (nonatomic,strong) NSString *extraTimeIsUsed;//额外时间是否使用
@property (nonatomic,strong)NSString *extraTimeValue;//额外时长
@property (nonatomic,strong)UIButton *cleanButton;
@property (nonatomic,strong)UIButton *supplyButton;
@property (nonatomic,strong)UIView *lineView;
@property (nonatomic,assign)NSInteger nursingType;
@property (nonatomic,assign)NSInteger oldcurrentState;
@property (nonatomic,assign) NSInteger supplytotalTime;
/// 超强补给计时器
@property (nonatomic,strong) NSTimer *supplytimer;
@end
@implementation DXHFXVC
......@@ -81,6 +90,7 @@
[self initUI];
[self requestVideoList];
self.ymodemUtil = [[YModemUtil alloc] init:128];
self.navigationItem.titleView = [self switchButtonView];
// self.ymodemUtil.delegate = self;
// [self creatmyNoconnectView];
if(![HJUserDefaults isEqual:[NSNull null]] && !(HJUserDefaults == nil)){
......@@ -96,54 +106,110 @@
self.localIsupkeep = [dic objectForKey:@"isUpkeep"];
self.extraTimeIsUsed = [dic objectForKey:@"extraTimeIsUsed"];
self.extraTimeValue = [dic objectForKey:@"extraTimeValue"];
if (self.totalTime > 0 && self.remaintime > 0 && self.remaintime > self.totalTime) {
if (XHGetDataManager.currentspeed != 0) {
self.currentspeed = XHGetDataManager.currentspeed;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}else{
self.currentspeed = 10;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
self.issupply = [[dic objectForKey:@"issupply"] boolValue];
self.myView.issupply = self.issupply;
if (self.issupply) {
if (self.totalTime > 0 && self.remaintime > 0 && self.remaintime > self.totalTime) {
if (XHGetDataManager.currentspeed != 0) {
self.currentspeed = XHGetDataManager.currentspeed;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}else{
self.currentspeed = 10;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}
[self changePumpSpeedWithSize:self.currentspeed];
self.myView.xdtimeLb.text = [[HJTools shared] minusToTime:self.xdtotalTime];
[self.xdtimer invalidate];
self.xdtimer=nil;
[HJGetBluetoothManager writeStr:[DR04_HFX_send_stop withCrc16Modbus]];
// [self alertXDTipsWithString:@"设备清洁已完成,请开始护理洁面" isPop:NO];
self.myView.timeLb.hidden = NO;
self.myView.xdtimeLb.hidden = YES;
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
self.myView.xdBtn.selected = NO;
self.myView.hlBtn.selected = YES;
// self.myView.xdBtn.imageView.tintColor = XHColorRGB(175, 44, 35);
// self.myView.hlBtn.imageView.tintColor = XHColorRGB(255, 255, 255);
self.myView.decBtn.enabled = NO;
self.myView.addBtn.enabled = YES;
self.myView.stressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.stressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedDecBtn.enabled = YES;
self.myView.speedAddBtn.enabled = YES;
self.myView.speedStressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedStressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.currentState = 2;
[self.myView controlWithItem:self.myView.hlBtn];
self.cleanButton.selected = NO;
self.supplyButton.selected = YES;
[UIView animateWithDuration:0.3 animations:^{
self.lineView.frame = CGRectMake(self.supplyButton.centerX-14, self.supplyButton.bottom, 27, 2);
}];
}else {
self.extraTimeIsUsed = @"0";
self.extraTimeValue = @"300";
}
[self changePumpSpeedWithSize:self.currentspeed];
self.myView.xdtimeLb.text = [[HJTools shared] minusToTime:self.xdtotalTime];
[self.xdtimer invalidate];
self.xdtimer=nil;
[HJGetBluetoothManager writeStr:[DR04_HFX_send_stop withCrc16Modbus]];
// [self alertXDTipsWithString:@"设备清洁已完成,请开始护理洁面" isPop:NO];
self.myView.timeLb.hidden = NO;
self.myView.xdtimeLb.hidden = YES;
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
self.myView.xdBtn.selected = NO;
self.myView.hlBtn.selected = YES;
// self.myView.xdBtn.imageView.tintColor = XHColorRGB(175, 44, 35);
// self.myView.hlBtn.imageView.tintColor = XHColorRGB(255, 255, 255);
self.myView.decBtn.enabled = YES;
self.myView.addBtn.enabled = YES;
self.myView.stressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.stressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedDecBtn.enabled = YES;
self.myView.speedAddBtn.enabled = YES;
self.myView.speedStressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedStressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.currentState = 1;
[self.myView controlWithItem:self.myView.hlBtn];
}else {
if (self.totalTime > 0 && self.remaintime > 0 && self.remaintime > self.totalTime) {
if (XHGetDataManager.currentspeed != 0) {
self.currentspeed = XHGetDataManager.currentspeed;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}else{
self.currentspeed = 10;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}
[self changePumpSpeedWithSize:self.currentspeed];
self.myView.xdtimeLb.text = [[HJTools shared] minusToTime:self.xdtotalTime];
[self.xdtimer invalidate];
self.xdtimer=nil;
[HJGetBluetoothManager writeStr:[DR04_HFX_send_stop withCrc16Modbus]];
// [self alertXDTipsWithString:@"设备清洁已完成,请开始护理洁面" isPop:NO];
self.myView.timeLb.hidden = NO;
self.myView.xdtimeLb.hidden = YES;
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
self.myView.xdBtn.selected = NO;
self.myView.hlBtn.selected = YES;
// self.myView.xdBtn.imageView.tintColor = XHColorRGB(175, 44, 35);
// self.myView.hlBtn.imageView.tintColor = XHColorRGB(255, 255, 255);
self.myView.decBtn.enabled = YES;
self.myView.addBtn.enabled = YES;
self.myView.stressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.stressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedDecBtn.enabled = YES;
self.myView.speedAddBtn.enabled = YES;
self.myView.speedStressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedStressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.issupply = NO;
self.currentState = 1;
[self.myView controlWithItem:self.myView.hlBtn];
}else{
self.extraTimeIsUsed = @"0";
self.extraTimeValue = @"300";
}
}
}else{
self.extraTimeIsUsed = @"0";
self.extraTimeValue = @"300";
}
}else{
self.extraTimeIsUsed = @"0";
self.extraTimeValue = @"300";
}
self.oldcurrentState = self.currentState;
// [self checkDeviceVersionWithResult:^(BOOL isUpdate) {
//
// } binUrl:^(NSString *url) {
......@@ -173,6 +239,17 @@
self.myView.playerView.currentPlayerManager.muted = YES;
}
if ([HJUserDefaults objectForKey:@"videoSwitchIsOn"]) {
NSString *videoVolumeIsOn = [HJUserDefaults objectForKey:@"videoSwitchIsOn"];
if([videoVolumeIsOn isEqualToString:@"1"]){
[self.myView.playerView.currentPlayerManager play];
}else{
[self.myView.playerView.currentPlayerManager pause];
}
}else{
[self.myView.playerView.currentPlayerManager play];
}
// if(![HJUserDefaults isEqual:[NSNull null]] && !(HJUserDefaults == nil)){
// if([HJUserDefaults objectForKey:@"updateDictyDr04"]){
// NSMutableDictionary *dic = [NSMutableDictionary dictionary];
......@@ -233,6 +310,135 @@
/// 后台
[HJNotificationCenter addObserver:self selector:@selector(appDidEnterBackground) name:HJAPPDidEnterBackground object:nil];
}
-(UIView *)switchButtonView {
UIView *titleView = [[UIView alloc] init];
self.cleanButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.cleanButton.frame = CGRectMake(0, 0, 70, 30);
self.cleanButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.cleanButton.selected = YES;
[self.cleanButton setTitle:HJLocalizedString(@"基础清洁") forState:UIControlStateNormal];
[self.cleanButton setTitleColor:XHColorRGB_Alpha(0, 0, 0,0.45) forState:UIControlStateNormal];
[self.cleanButton setTitleColor:XHColorRGB(175, 44, 35) forState:UIControlStateSelected];
[self.cleanButton addTarget:self action:@selector(switchCleanType:) forControlEvents:UIControlEventTouchUpInside];
[titleView addSubview:self.cleanButton];
self.supplyButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.supplyButton.frame = CGRectMake(self.cleanButton.right+25, 0, 70, 30);
self.supplyButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self.supplyButton setTitle:HJLocalizedString(@"强效补给") forState:UIControlStateNormal];
[self.supplyButton setTitleColor:XHColorRGB_Alpha(0, 0, 0,0.45) forState:UIControlStateNormal];
[self.supplyButton setTitleColor:XHColorRGB(175, 44, 35) forState:UIControlStateSelected];
[self.supplyButton addTarget:self action:@selector(switchCleanType:) forControlEvents:UIControlEventTouchUpInside];
[titleView addSubview:self.supplyButton];
self.lineView = [[UIView alloc] initWithFrame:CGRectMake(self.cleanButton.right/2-14+self.cleanButton.left, self.cleanButton.bottom, 27, 2)];
self.lineView.backgroundColor = XHColorRGB(175, 44, 35);
[titleView addSubview:self.lineView];
titleView.frame = CGRectMake(0, 0, self.cleanButton.width+self.supplyButton.width+25, 35);
return titleView;
}
-(void)switchCleanType:(UIButton *)button {
if (self.totalTime>0 || self.supplytotalTime>0) {
[SVProgressHUD showInfoWithStatus:HJLocalizedString(@"请护理完再切换")];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
});
return;
}
if (button.selected) {
return;
}else {
button.selected = !button.selected;
self.myView.issupply = NO;
if (button == self.cleanButton) {
self.issupply = NO;
self.supplyButton.selected = NO;
[UIView animateWithDuration:0.3 animations:^{
self.lineView.frame = CGRectMake(self.cleanButton.centerX-14, self.cleanButton.bottom, 27, 2);
}];
self.currentState = self.oldcurrentState;
if (self.currentspeed == 1) {
if (XHGetDataManager.currentspeed != 0) {
self.currentspeed = XHGetDataManager.currentspeed;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}else{
self.currentspeed = 10;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}
[self changePumpSpeedWithSize:self.currentspeed];
self.myView.xdtimeLb.text = [[HJTools shared] minusToTime:self.xdtotalTime];
[self.xdtimer invalidate];
self.xdtimer=nil;
[HJGetBluetoothManager writeStr:[DR04_HFX_send_stop withCrc16Modbus]];
// [self alertXDTipsWithString:@"设备清洁已完成,请开始护理洁面" isPop:NO];
self.myView.timeLb.hidden = NO;
self.myView.xdtimeLb.hidden = YES;
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
self.myView.xdBtn.selected = NO;
self.myView.hlBtn.selected = YES;
// self.myView.xdBtn.imageView.tintColor = XHColorRGB(175, 44, 35);
// self.myView.hlBtn.imageView.tintColor = XHColorRGB(255, 255, 255);
self.myView.decBtn.enabled = YES;
self.myView.addBtn.enabled = YES;
self.myView.stressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.stressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedDecBtn.enabled = YES;
self.myView.speedAddBtn.enabled = YES;
self.myView.speedStressLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.myView.speedStressTitleLb.textColor = XHColorRGB_Alpha(51, 51, 51, 1);
self.currentState = 1;
[self.myView controlWithItem:self.myView.hlBtn];
}else {
[self.myView controlWithItem:self.myView.xdBtn];
[self.myView.noChangeBtn setTitle:HJLocalizedString(@"清洁设备不可调节负压、流速") forState:UIControlStateNormal];
}
}
if (button == self.supplyButton) {
self.issupply = YES;
self.cleanButton.selected = NO;
self.myView.issupply = YES;
self.currentState = 2;
[UIView animateWithDuration:0.3 animations:^{
self.lineView.frame = CGRectMake(self.supplyButton.centerX-14, self.supplyButton.bottom, 27, 2);
}];
if (self.currentState == 1) {
//self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
[self stopDr04Action];
[self.myView controlWithItem:self.myView.xdBtn];
}else {
[self.myView controlWithItem:self.myView.hlBtn];
}
[self.myView.noChangeBtn setTitle:HJLocalizedString(@"流速以拔起探头不会滴水为佳") forState:UIControlStateNormal];
}
}
}
-(void)creatmyNoconnectView{
self.myNoconnectView = [[XHNoConnectView alloc]initWithFrame:CGRectMake(0, 0, HJScreenWidth, HJScreenHeight)];
[self.view addSubview:self.myNoconnectView];
......@@ -258,7 +464,7 @@
self.currentspeed = 10;
self.myView.currentSpeed = [NSString stringWithFormat:@"%ld",self.currentspeed];
}
self.isNeedUpkeep = NO;
self.isStrengthen = NO;
self.istimeClean = NO;
......@@ -286,6 +492,7 @@
}else{
weakSelf.myView.byBtn.hidden = YES;
weakSelf.myView.startUpkeepBtn.hidden = YES;
}
} fail:^(id failMessage) {
......@@ -325,7 +532,7 @@
weakSelf.videoListModel = [DXHFXVideoModel mj_objectWithKeyValues:responseObject[@"data"]];
NSLog(@"%@",weakSelf.videoListModel);
weakSelf.myView.videoModel = weakSelf.videoListModel;
if (weakSelf.currentState == 1) {
if (weakSelf.currentState == 1 || weakSelf.currentState == 2) {
[weakSelf.myView controlWithItem:weakSelf.myView.hlBtn];
}
......@@ -404,7 +611,10 @@
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
}
self.currentState = 1;
if (self.currentState == 0) {
self.currentState = 1;
}
}
......@@ -477,29 +687,59 @@
case ItemstartOrstop:{
if ([self iSDeviceID]) {
if(self.totalTime>0){
if(self.myView.startBtn.selected){//已经开始了
// 暂停
[self stopDr04Action];
}else{//
[HJGetBluetoothManager writeStr:[DR04_HFX_send_start withCrc16Modbus]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self pumpStart];
});
if (self.currentState == 1 || self.currentState == 0) {
if(self.totalTime>0){
if(self.myView.startBtn.selected){//已经开始了
// 暂停
[self stopDr04Action];
}else{//
[HJGetBluetoothManager writeStr:[DR04_HFX_send_start withCrc16Modbus]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self pumpStart];
});
}
}else{
HJSelfWeak;
[self getUseTimes:^(BOOL getTimesSuccessful) {
HJSelfStrong;
if(getTimesSuccessful == false){
[strongSelf deviceValidTime];
}
}];
}
}else{
HJSelfWeak;
[self getUseTimes:^(BOOL getTimesSuccessful) {
HJSelfStrong;
if(getTimesSuccessful == false){
[strongSelf deviceValidTime];
}else if(self.currentState == 2) {
if(self.totalTime>0){
if(self.myView.startBtn.selected){//已经开始了
// 暂停
[self stopDr04Action];
}else{//
[HJGetBluetoothManager writeStr:[DR04_HFX_send_start withCrc16Modbus]];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self pumpStart];
// });
}
}];
}else{
HJSelfWeak;
[self getUseTimes:^(BOOL getTimesSuccessful) {
HJSelfStrong;
if(getTimesSuccessful == false){
[strongSelf deviceValidTime];
}
}];
}
}
}
}
break;
......@@ -542,18 +782,25 @@
self.totalTime = 0;
// self.extraTimeValue = @"0";
if (self.isStrengthen) {
self.xdtotalTime = 50;
}else{
self.xdtotalTime = 25;
if (self.currentState == 1) {
self.extraTimeValue = @"0";
if (self.isStrengthen) {
self.xdtotalTime = 50;
}else{
self.xdtotalTime = 25;
}
self.guestureId = nil;
self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
self.currentState = 0;
[self.myView controlWithItem:self.myView.xdBtn];
}else {
self.guestureId = nil;
self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
[self.myView controlWithItem:self.myView.hlBtn];
}
self.guestureId = nil;
self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
self.currentState = 0;
[self.myView controlWithItem:self.myView.xdBtn];
//
// if([HJUserDefaults objectForKey:@"updateDictyDr04"]){
// NSMutableDictionary *dic = [NSMutableDictionary dictionary];
// [dic addEntriesFromDictionary:[HJUserDefaults objectForKey:@"updateDictyDr04"]];
......@@ -601,6 +848,9 @@
self.timer=nil;
[self.xdtimer invalidate];
self.xdtimer=nil;
[self.supplytimer invalidate];
self.supplytimer=nil;
}
......@@ -965,6 +1215,8 @@
[paramsDic setObject:self.localIsupkeep?self.localIsupkeep:@"0" forKey:@"isUpkeep"];
[paramsDic setObject:self.extraTimeIsUsed?self.extraTimeIsUsed:@"0" forKey:@"extraTimeIsUsed"];
[paramsDic setObject:self.extraTimeValue?self.extraTimeValue:@"0" forKey:@"extraTimeValue"];
[paramsDic setObject:self.issupply?@"1":@"0" forKey:@"issupply"];
[HJUserDefaults setObject:paramsDic forKey:@"updateDictyDr04"];
[HJUserDefaults synchronize];
}
......@@ -1016,9 +1268,8 @@
return;
}
self.currentStress = 4;
//self.currentStress = 4;
self.myView.currentSpeed = @"10";
if (self.xdtotalTime != 0 && self.xdtotalTime <= 35) {
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
......@@ -1047,7 +1298,7 @@
}
}else{
}else if(self.currentState == 1){
self.isStartted = true;
//发档位
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
......@@ -1079,14 +1330,48 @@
}
if((!self.isUpdate && !self.guestureId) || (self.totalTime == self.remaintime && self.currentState == 1 &&!self.isUpdate && !self.guestureId) ){
[self saveDr04Record];
}else {
self.isStartted = true;
//self.currentStress = 4;
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR04_HFX_send_energy,[[HJTools shared] ToLongHex:self.currentStress withLength:2]] withCrc16Modbus]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[HJGetBluetoothManager writeStr:[DR04_HFX_send_hlMode withCrc16Modbus]];
});
if (self.supplytimer == nil) {
self.supplytimer=[NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:self.supplytimer forMode:NSDefaultRunLoopMode];
}
}
if((!self.isUpdate && !self.guestureId) || (self.totalTime == self.remaintime && self.currentState == 1 &&!self.isUpdate && !self.guestureId) ){
[self saveDr04Record];
}
}
-(void)supplytimerAction {
self.supplytotalTime--;
if (self.supplytotalTime>0) {
}else {
[self.supplytimer invalidate];
self.supplytimer=nil;
}
self.myView.xdtimeLb.text = [[HJTools shared] minusToTime:self.supplytotalTime];
}
- (void)xdtimerAction{
self.xdtotalTime--;
if(self.xdtotalTime>0){
......@@ -1169,73 +1454,76 @@
[self playSoundEffect:@"working.wav"];
}
}else{
if (![self.extraTimeIsUsed boolValue]) {
if ([self.extraTimeValue intValue] != 0) {
_UploadAlert = [[HJAlertView alloc] init];
_UploadAlert.parentView = [UIApplication sharedApplication].keyWindow;
_UploadAlert.title = HJLocalizedString(@"提示");
_UploadAlert.message = HJLocalizedString(@"当前护理已完成,是否继续操作?");
[_UploadAlert setButtonTitles:[NSMutableArray arrayWithObjects:HJLocalizedString(@"取消"),HJLocalizedString(@"确定"), nil]];
[_UploadAlert show];
HJSelfWeak;
_UploadAlert.onButtonTouchUpInside = ^(HJAlertView * _Nonnull alertView, NSInteger buttonIndex) {
if(buttonIndex == 1){
[weakSelf updateDr04Record];
weakSelf.totalTime = [weakSelf.extraTimeValue integerValue];
weakSelf.myView.timeLb.text = [[HJTools shared] minusToTime:[weakSelf.extraTimeValue integerValue]];
weakSelf.extraTimeIsUsed = @"1";
}else{
[weakSelf.UploadAlert close];
weakSelf.myView.timeLb.text = [[HJTools shared] minusToTime:weakSelf.totalTime];
[weakSelf alertXDTipsWithString:HJLocalizedString(@"护理已完成...") isPop:YES];
if (weakSelf.isStrengthen) {
weakSelf.xdtotalTime = 50;
if (self.currentState == 1) {
if (![self.extraTimeIsUsed boolValue]) {
if ([self.extraTimeValue intValue] != 0) {
_UploadAlert = [[HJAlertView alloc] init];
_UploadAlert.parentView = [UIApplication sharedApplication].keyWindow;
_UploadAlert.title = HJLocalizedString(@"提示");
_UploadAlert.message = HJLocalizedString(@"当前护理已完成,是否继续操作?");
[_UploadAlert setButtonTitles:[NSMutableArray arrayWithObjects:HJLocalizedString(@"取消"),HJLocalizedString(@"确定"), nil]];
[_UploadAlert show];
HJSelfWeak;
_UploadAlert.onButtonTouchUpInside = ^(HJAlertView * _Nonnull alertView, NSInteger buttonIndex) {
if(buttonIndex == 1){
[weakSelf updateDr04Record];
weakSelf.totalTime = [weakSelf.extraTimeValue integerValue];
weakSelf.myView.timeLb.text = [[HJTools shared] minusToTime:[weakSelf.extraTimeValue integerValue]];
weakSelf.extraTimeIsUsed = @"1";
}else{
weakSelf.xdtotalTime = 25;
[weakSelf.UploadAlert close];
weakSelf.myView.timeLb.text = [[HJTools shared] minusToTime:weakSelf.totalTime];
[weakSelf alertXDTipsWithString:HJLocalizedString(@"护理已完成...") isPop:YES];
if (weakSelf.isStrengthen) {
weakSelf.xdtotalTime = 50;
}else{
weakSelf.xdtotalTime = 25;
}
[weakSelf pumpStop];
[weakSelf updateDr04Record];
[weakSelf stopDr04Action];
weakSelf.guestureId = nil;
weakSelf.currentState = 0;
[weakSelf.myView controlWithItem:weakSelf.myView.xdBtn];
}
[weakSelf pumpStop];
[weakSelf updateDr04Record];
[weakSelf stopDr04Action];
weakSelf.guestureId = nil;
weakSelf.currentState = 0;
[weakSelf.myView controlWithItem:weakSelf.myView.xdBtn];
}
[alertView close];
};
}
}else{
self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
[self alertXDTipsWithString:HJLocalizedString(@"护理已完成...") isPop:YES];
if (self.isStrengthen) {
self.xdtotalTime = 50;
[alertView close];
};
}
}else{
self.xdtotalTime = 25;
self.myView.timeLb.text = [[HJTools shared] minusToTime:self.totalTime];
[self alertXDTipsWithString:HJLocalizedString(@"护理已完成...") isPop:YES];
if (self.isStrengthen) {
self.xdtotalTime = 50;
}else{
self.xdtotalTime = 25;
}
[self pumpStop];
[self updateDr04Record];
[self stopDr04Action];
self.guestureId = nil;
self.currentState = 0;
[self.myView controlWithItem:self.myView.xdBtn];
}
[self pumpStop];
}else {
[self.supplytimer invalidate];
self.supplytimer=nil;
[self updateDr04Record];
[self stopDr04Action];
self.guestureId = nil;
self.currentState = 0;
[self.myView controlWithItem:self.myView.xdBtn];
}
[self stopDr04Action];
[self stopDr04Action];
}
}
......@@ -1312,6 +1600,22 @@
if (isVerifySucceed) {
self.totalTime = self.remaintime;
self.myView.timeLb.text = [[HJTools shared] minusToTime: self.totalTime];
}else {
_UploadAlert = [[HJAlertView alloc] init];
_UploadAlert.parentView = [UIApplication sharedApplication].keyWindow;
_UploadAlert.title = HJLocalizedString(@"提示");
if (self.issupply) {
_UploadAlert.message = HJLocalizedString(@"请扫描“强效补给”耗材码");
}else {
_UploadAlert.message = HJLocalizedString(@"请扫描“基础清洁”耗材码");
}
[_UploadAlert setButtonTitles:[NSMutableArray arrayWithObjects:HJLocalizedString(@"好的"), nil]];
[_UploadAlert show];
HJSelfWeak;
_UploadAlert.onButtonTouchUpInside = ^(HJAlertView * _Nonnull alertView, NSInteger buttonIndex) {
[weakSelf.UploadAlert close];
};
}
}
-(void)setIsSaveSucceed:(BOOL)isSaveSucceed{
......
......@@ -257,6 +257,21 @@
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR05_HE_send_nengliang,[[HJTools shared] ToLongHex:self.nengliangNum withLength:2]] withCrc16Modbus]];
}
-(void)sendWaveformType:(NSInteger)type {
if (self.isStart) {
[self stopDr05Action];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//获取固件版本
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR05_HE_send_WaveForm,[[HJTools shared] ToLongHex:type+1 withLength:2]] withCrc16Modbus]];
});
}else {
[HJGetBluetoothManager writeStr:[[NSString stringWithFormat:@"%@%@",DR05_HE_send_WaveForm,[[HJTools shared] ToLongHex:type+1 withLength:2]] withCrc16Modbus]];
}
}
-(void)palyOrStopDevice:(UIButton *)button {
......@@ -734,9 +749,9 @@
//
//
if (HJStringNSNotFound(value, DR05_HE_back_Version)){//固件版本
NSInteger versions = strtoul([[value substringWithRange:NSMakeRange(16, 1)] UTF8String],0,16);
NSInteger versions1 = strtoul([[value substringWithRange:NSMakeRange(17, 1)] UTF8String],0,16);
XHGetDataManager.machineVersion = [NSString stringWithFormat:@"V%ld.%ld",versions,versions1];
NSInteger versions = strtoul([[value substringWithRange:NSMakeRange(17, 1)] UTF8String],0,16);
NSInteger versions1 = strtoul([[value substringWithRange:NSMakeRange(19, 1)] UTF8String],0,16);
XHGetDataManager.machineVersion = [NSString stringWithFormat:@"V%ld.%ld",versions1,versions1];
NSLog(@"XHGetDataManager.machineVersion:%@",XHGetDataManager.machineVersion);
if(!self.isChecked){
......@@ -847,19 +862,24 @@
[[XHHttpRequestManager shareManager] getHttpRequestURL:UpdateDeviceVersionURL isJson:NO parameters:paramsDic success:^(id responseObject) {
NSString *severVersion = [[responseObject objectForKey:@"data"] objectForKey:@"versionnum"];
NSString *url = [[responseObject objectForKey:@"data"] objectForKey:@"binURL"];
if([self compareVersion2:severVersion to:version] == 1){
isUpdate(YES);
binUrl(url);
[weakSelf downloadBinWithUrl:url completionHandler:^(BOOL isCompleted) {
if(isCompleted){
[weakSelf showUploadAlert];
}
}];
NSDictionary *dict = [responseObject objectForKey:@"data"];
if (![dict isEqual:[NSNull null]] && dict) {
NSString *severVersion = [[responseObject objectForKey:@"data"] objectForKey:@"versionnum"];
NSString *url = [[responseObject objectForKey:@"data"] objectForKey:@"binURL"];
if([self compareVersion2:severVersion to:version] == 1){
isUpdate(YES);
binUrl(url);
[weakSelf downloadBinWithUrl:url completionHandler:^(BOOL isCompleted) {
if(isCompleted){
[weakSelf showUploadAlert];
}
}];
}
}
NSLog(@"%@",responseObject);
} fail:^(id failMessage) {
......
......@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong) NSMutableArray <DXHFXVideoDetailsModel *>*maintainanceList;
@property (nonatomic,strong) NSMutableArray <DXHFXVideoDetailsModel *>*supplyList;
@end
......
......@@ -15,7 +15,8 @@
{
return @{@"disinfectVideoList" : [DXHFXVideoDetailsModel class],
@"careVideoList" : [DXHFXVideoDetailsModel class],
@"maintainanceList" : [DXHFXVideoDetailsModel class]
@"maintainanceList" : [DXHFXVideoDetailsModel class],
@"supplyList" : [DXHFXVideoDetailsModel class]
};
}
......
......@@ -67,6 +67,8 @@ typedef enum : NSUInteger{
@property (nonatomic,strong) UIButton *xdBtn;
@property (nonatomic,strong) UIButton *hlBtn;
@property (nonatomic,strong) UIButton *supplyBtn;
@property (nonatomic,strong) UIImageView *supplyImg;
@property (nonatomic,strong) UIButton *decBtn;
......@@ -98,7 +100,8 @@ typedef enum : NSUInteger{
@property (nonatomic,strong) UIButton *volumeBtn;
@property (nonatomic,assign) BOOL is041;
@property (nonatomic,strong) UIButton *noChangeBtn;
@property (nonatomic,assign)BOOL issupply;//海菲秀是否强效补给
- (void)controlWithItem:(UIButton *)sender;
@end
......
......@@ -49,7 +49,6 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
@property (nonatomic,strong) NSMutableArray <DXHFXVideoDetailsModel *>*currentVideoList;
@property (nonatomic,strong) UIButton *noChangeBtn;
@property (nonatomic ,strong)DXProgressBarView *progressBarView;
......@@ -163,6 +162,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
});
}
_is041 = is041;
}
- (void)creatUI{
self.backgroundColor = XHColorRGB(247, 247, 247);
......@@ -212,6 +212,38 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
make.left.equalTo(@14);
make.centerY.equalTo(centerLine);
}];
_supplyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//HFX_xdnomal
[_supplyBtn setBackgroundImage:[UIImage imageNamed:@"HFX_xdnomal"] forState:UIControlStateNormal];
[_supplyBtn setBackgroundImage:[UIImage imageNamed:@"HFX_xdselect"] forState:UIControlStateSelected];
[_supplyBtn setTitle:HJLocalizedString(@" 精粹水补充") forState:UIControlStateNormal];
_supplyBtn.userInteractionEnabled = NO;
[_supplyBtn addTarget:self action:@selector(controlWithItem:) forControlEvents:UIControlEventTouchUpInside];
//_supplyBtn.tag = Itemxiaodu;
[_supplyBtn setTitleColor:XHColorRGB(216, 167, 163) forState:UIControlStateNormal];
[_supplyBtn setTitleColor:XHColorRGB(255, 255, 255) forState:UIControlStateSelected];
_supplyBtn.titleLabel.font = XHFontSize(12);
// _xdBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 30, 0, 0);
_supplyBtn.selected = YES;
_supplyBtn.hidden = YES;
[self addSubview:_supplyBtn];
[_supplyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@14);
make.centerY.equalTo(centerLine);
}];
_supplyImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"HFX_supplyImg"]];
_supplyImg.hidden = YES;
[self addSubview:_supplyImg];
[_supplyImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@24);
make.centerY.equalTo(centerLine);
make.size.mas_equalTo(CGSizeMake(23, 38));
}];
_hlBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_hlBtn setBackgroundImage:[UIImage imageNamed:@"HFX_xdnomal"] forState:UIControlStateNormal];
[_hlBtn setBackgroundImage:[UIImage imageNamed:@"HFX_xdselect"] forState:UIControlStateSelected];
......@@ -916,8 +948,69 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
_currentVideoList = self.videoModel.careVideoList;
if (self.issupply) {
_currentVideoList = self.videoModel.supplyList;
// _decBtn.enabled = NO;
// _addBtn.enabled = NO;
// _speedDecBtn.enabled = NO;
// _speedAddBtn.enabled = NO;
// _stressLb.textColor = XHColorRGB_Alpha(198, 195, 195, 1);
// _stressTitleLb.textColor = XHColorRGB_Alpha(198, 195, 195, 1);
_speedStressLb.textColor = XHColorRGB_Alpha(198, 195, 195, 1);
_speedStressTitleLb.textColor = XHColorRGB_Alpha(198, 195, 195, 1);
self.xdBtn.hidden = YES;
self.hlBtn.hidden = YES;
self.supplyBtn.hidden = NO;
_supplyImg.hidden = NO;
dispatch_async(dispatch_get_main_queue(), ^{
self.speedDecBtn.hidden = YES;
self.speedAddBtn.hidden = YES;
self.speedStressLb.hidden = YES;
self.speedStressTitleLb.hidden = YES;
self.centerline.hidden = YES;
[self.decBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@30);
make.top.equalTo(@(80 *IPhone6ScaleHeight));
}];
[self.addBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(@-30);
make.top.equalTo(@(80*IPhone6ScaleHeight));
}];
[self.stressLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(@(88*IPhone6ScaleHeight));
}];
[self.stressTitleLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(self.stressLb.mas_bottom).offset(5*IPhone6ScaleHeight);
}];
[self.timeImg mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.decBtn);
make.top.equalTo(self.decBtn.mas_bottom).offset(60*IPhone6ScaleHeight);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
});
}else {
self.xdBtn.hidden = NO;
self.hlBtn.hidden = NO;
self.supplyBtn.hidden = YES;
_supplyImg.hidden = YES;
_currentVideoList = self.videoModel.careVideoList;
}
[self changePlayVideoWithModel:self.currentVideoList[0]];
[self.timesBtnArray removeAllObjects];
[_timeScrollView removeFromSuperview];
......@@ -928,8 +1021,14 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
self.allfaceBtn.hidden = YES;
[_allfaceBtn setTitle:_currentVideoList[0].detail forState:UIControlStateNormal];
}
[self.collectionView reloadData];
}else if (sender.tag == Itemxiaodu){
self.xdBtn.hidden = NO;
self.hlBtn.hidden = NO;
self.supplyBtn.hidden = YES;
_supplyImg.hidden = YES;
sender.selected = YES;
_hlBtn.selected = NO;
sender.imageView.tintColor = XHColorRGB(175, 44, 35);
......@@ -964,6 +1063,85 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
self.allfaceBtn.hidden = YES;
[_allfaceBtn setTitle:_currentVideoList[0].detail forState:UIControlStateNormal];
}
if (self.is041) {
dispatch_async(dispatch_get_main_queue(), ^{
self.speedDecBtn.hidden = NO;
self.speedAddBtn.hidden = NO;
self.speedStressLb.hidden = NO;
self.speedStressTitleLb.hidden = NO;
self.centerline.hidden = NO;
[self.decBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@30);
make.top.equalTo(@(40 *IPhone6ScaleHeight));
}];
[self.addBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(@-30);
make.top.equalTo(@(40*IPhone6ScaleHeight));
}];
[self.stressLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(@(48*IPhone6ScaleHeight));
}];
[self.stressTitleLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(self.stressLb.mas_bottom).offset(5*IPhone6ScaleHeight);
}];
[self.timeImg mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.decBtn);
make.top.equalTo(self.speedDecBtn.mas_bottom).offset(30*IPhone6ScaleHeight);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
});
}else {
dispatch_async(dispatch_get_main_queue(), ^{
self.speedDecBtn.hidden = YES;
self.speedAddBtn.hidden = YES;
self.speedStressLb.hidden = YES;
self.speedStressTitleLb.hidden = YES;
self.centerline.hidden = YES;
[self.decBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@30);
make.top.equalTo(@(80 *IPhone6ScaleHeight));
}];
[self.addBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(@-30);
make.top.equalTo(@(80*IPhone6ScaleHeight));
}];
[self.stressLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(@(88*IPhone6ScaleHeight));
}];
[self.stressTitleLb mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bottomView);
make.top.equalTo(self.stressLb.mas_bottom).offset(5*IPhone6ScaleHeight);
}];
[self.timeImg mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.decBtn);
make.top.equalTo(self.decBtn.mas_bottom).offset(60*IPhone6ScaleHeight);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
});
}
[self.collectionView reloadData];
}else if (sender.tag == Itemuvchange){
sender.selected = !sender.selected;
......@@ -1025,9 +1203,25 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
HJSelfWeak;
self.playerView.playerDidToEnd = ^(id _Nonnull asset) {
weakSelf.playerView.assetURL = proxyURL;
};
if (weakSelf.playerView.currentPlayerManager.playState) {
[weakSelf.playerView.currentPlayerManager play];
if ([HJUserDefaults objectForKey:@"videoSwitchIsOn"]) {
NSString *videoVolumeIsOn = [HJUserDefaults objectForKey:@"videoSwitchIsOn"];
if([videoVolumeIsOn isEqualToString:@"1"]){
[weakSelf.playerView.currentPlayerManager play];
}else{
[weakSelf.playerView.currentPlayerManager pause];
}
}else{
}
}
}
......
......@@ -31,6 +31,8 @@ typedef enum : NSUInteger{
-(void)palyOrStopDevice:(UIButton *)button;
-(void)deviceNoConnected;
-(void)clearTime;
-(void)sendWaveformType:(NSInteger)type;
@end
@interface DXHotElecticView : UIView
......
......@@ -46,6 +46,8 @@
@property (nonatomic,assign) CGFloat wdSlidermax;
@property (nonatomic,assign) CGFloat nlSliderMin;
@property (nonatomic,assign) CGFloat nlSlidermax;
@property (nonatomic,strong)UIButton *selectButton;
@property (nonatomic,strong)UIButton *nextButton;
@end
@implementation DXHotElecticView
......@@ -396,12 +398,49 @@
make.bottom.equalTo(_nlSlider.mas_top).offset(-10);
}];
NSArray *array11 = @[@"水电泳",@"模式 M",@"模式 M3",@"模式 M6",@"预留波形"];
for (int i = 0; i<5; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:[NSString stringWithFormat:@" %@ ",[array11 objectAtIndex:i]] forState:UIControlStateNormal];
if (i == 0) {
[button setBackgroundColor:XHColorRGB(175, 44, 35)];
button.selected = YES;
self.selectButton = button;
}else {
[button setBackgroundColor:XHColorRGB(255, 255, 255)];
}
[button setTitleColor:XHColorRGB(175, 44, 35) forState:UIControlStateNormal];
[button setTitleColor:XHColorRGB(255, 255, 255) forState:UIControlStateSelected];
button.tag = 10000+i;
button.layer.cornerRadius = 5;
button.layer.borderWidth = 1;
button.titleLabel.font = [UIFont systemFontOfSize:13];
button.layer.borderColor = XHColorRGB(175, 44, 35).CGColor;
[button addTarget:self action:@selector(selectModelType:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button];
if (i == 0) {
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.equalTo(self.xdBtn.mas_bottom).offset(30*IPhone6ScaleHeight);
make.height.mas_equalTo(30);
}];
}else {
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.nextButton.mas_right).offset(15);
make.top.equalTo(self.xdBtn.mas_bottom).offset(30*IPhone6ScaleHeight);
make.height.mas_equalTo(30);
}];
}
self.nextButton = button;
}
_timeImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"HFX_time"]];
[bottomView addSubview:_timeImg];
[_timeImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(65);
make.top.equalTo(self.xdBtn.mas_bottom).offset(55*IPhone6ScaleHeight);
make.top.equalTo(self.xdBtn.mas_bottom).offset(75*IPhone6ScaleHeight);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
......@@ -611,7 +650,7 @@
if (self.nlSlider == slider) {
float value = _nlSlider.value;
_nengliangNum = 100*value;
_nlNumLabel.text = [NSString stringWithFormat:@"%.f%%",value*100];
_nlNumLabel.text = [NSString stringWithFormat:@"%.f%%",(float)_nengliangNum];
if (self.delegate && [self.delegate respondsToSelector:@selector(sendNengLangValue:)]) {
[self.delegate sendNengLangValue:_nengliangNum];
......@@ -619,7 +658,7 @@
}else {
float value = _wdSlider.value;
_wenduNum = 100*value;
_wdNumLabel.text = [NSString stringWithFormat:@"%.f%%",value*100];
_wdNumLabel.text = [NSString stringWithFormat:@"%.f%%",(float)_wenduNum];
if (self.delegate && [self.delegate respondsToSelector:@selector(sendwenduValue:)]) {
[self.delegate sendwenduValue:_wenduNum];
......@@ -746,6 +785,31 @@
_playerManager.shouldAutoPlay = YES;
}
}
-(void)selectModelType:(UIButton *)button {
if (button == self.selectButton) {
if (self.delegate && [self.delegate respondsToSelector:@selector(sendWaveformType:)]) {
[self.delegate sendWaveformType:button.tag-10000];
}
return;
}
if (self.isConnected) {
[button setBackgroundColor:XHColorRGB(175, 44, 35)];
[self.selectButton setBackgroundColor:XHColorRGB(255, 255, 255)];
button.selected = !button.selected;
self.selectButton.selected = !self.selectButton.selected;
self.selectButton = button;
if (self.delegate && [self.delegate respondsToSelector:@selector(sendWaveformType:)]) {
[self.delegate sendWaveformType:button.tag-10000];
}
}else {
if (self.delegate && [self.delegate respondsToSelector:@selector(deviceNoConnected)]) {
[self.delegate deviceNoConnected];
}
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
......
......@@ -36,7 +36,7 @@
[self.view endEditing:true];
NSDictionary *dic;
NSLog(@"XHGetDataManager.languageName1:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5 || TargetType == 4)){
dic = @{@"email":self.dic[@"email"],@"nickName":str};
}else{//简体中文 c
dic = @{@"phone":self.dic[@"phone"],@"code":self.dic[@"code"],@"nickName":str};
......
......@@ -37,7 +37,7 @@
- (void)SureBtnAction:(NSString *)str{
NSDictionary *dic;
NSLog(@"XHGetDataManager.languageName2:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5 || TargetType == 4)){
dic = @{@"email":self.myDic[@"email"],@"nickName":self.myDic[@"nickName"],@"sex":str};
}else{//简体中文
dic = @{@"phone":self.myDic[@"phone"],@"code":self.myDic[@"code"],@"nickName":self.myDic[@"nickName"],@"sex":str};
......
......@@ -38,7 +38,7 @@
NSDictionary *dic;
[SVProgressHUD show];
NSLog(@"XHGetDataManager.languageName3:%d",XHGetDataManager.simparlanguage);//中文
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5)){
if((XHGetDataManager.simparlanguage==1 ||XHGetDataManager.simparlanguage==2 )&&(TargetType==5 || TargetType == 4)){
dic = @{@"email":self.myThirdDic[@"email"],
@"nickName":self.myThirdDic[@"nickName"],
@"sex":@([self.myThirdDic[@"sex"] integerValue]),
......
......@@ -54,10 +54,10 @@
if ([XHGetDataManager.languageName rangeOfString:@"Hans"].location != NSNotFound) {
[XHDataManager sharedManager].simparlanguage = 0; // 简体中文
} else { // zh-Hant\zh-HK\zh-TW
[XHDataManager sharedManager].simparlanguage = 2; // 繁体
[XHDataManager sharedManager].simparlanguage = 1; // 繁体
}
}else{
[XHDataManager sharedManager].simparlanguage = 2; // 英文
[XHDataManager sharedManager].simparlanguage = 1; // 英文
}
NSLog(@"XHGetDataManager.languageName:%d:%d:%@",XHGetDataManager.simparlanguage,([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound),languageName);//中文
if((TargetType == 5)&&([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文// /Hans-CN
......@@ -263,163 +263,274 @@
}
}
-(void)creatMyUI1{
UIImageView *logoImg = [UIImageView myUIImageViewSuperView:self withImageName:@"DR_DeviceListTopImage"];
NSArray *Arr = @[@"personal_buy_logo",@"personal_buy_logo_Home",@"personal_buy_logo_Home",@"DR_DeviceListTopImage",@"DrTY_Logo",@"Seyo_login_image",@"Seyo_login_image"];
UIImageView *logoImg = [UIImageView myUIImageViewSuperView:self withImageName:Arr[TargetType-1]];
[logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self).offset(55.5*IPhone6ScaleHeight);
}];
UIView *phonebgV = [UIView myUIViewSuperView:self withBackgroundColor:XHColorHex(0xF6F6F6)];
// phonebgV.backgroundColor = [UIColor redColor];
phonebgV.layer.cornerRadius = 22.5*IPhone6ScaleHeight;
[phonebgV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(HJPX(60));
make.right.mas_equalTo(HJPX(-60));
make.top.mas_equalTo(self).offset(219*IPhone6ScaleHeight);
make.height.mas_equalTo(45*IPhone6ScaleHeight);
}];
NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
// NSString *languageName = [appLanguages objectAtIndex:0];
// NSArray *languageArry = [NSLocale preferredLanguages];
// NSString *languageName = languageArry.firstObject;
NSString *languageName = [[[NSBundle mainBundle] preferredLocalizations] firstObject];
// XHGetDataManager.simparlanguage = ([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound);
UIView *phoneImgBg = [UIView myUIViewSuperView:phonebgV withBackgroundColor:[UIColor whiteColor]];
phoneImgBg.layer.cornerRadius =17.5*IPhone6ScaleHeight;
[phoneImgBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV.mas_left).offset(5.5*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phonebgV);
make.width.mas_equalTo(48*IPhone6ScaleWidth);
make.height.mas_equalTo(35*IPhone6ScaleHeight);
}];
UIImageView *phoneImg = [UIImageView myUIImageViewSuperView:self withImageName:@"login_user_personal_phone"];
[phoneImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.centerX.mas_equalTo(phoneImgBg);
}];
UILabel *lb = [UILabel myUILabelSuperView:self withNSTextAlignment:NSTextAlignmentCenter withContent:HJLocalizedString(@"+86") withFont:XHFontSize(16) withTextColor:XHColorHex(0x323232) withResize:true];
[lb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phoneImgBg.mas_right).offset(10*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phoneImg);
make.height.mas_equalTo(12.5*IPhone6ScaleHeight);
}];
self.phoneTF = [UITextField myUITextFieldSuperView:self
withDelegate:self
withFont:XHFontSize(HJPX(30))
withTextFieldColor:XHTextFieldTextColor
withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入手机号码")
withPlaceholderColor:XHTextFieldTextPlaceholderColor
withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
self.phoneTF.keyboardType = UIKeyboardTypeNumberPad;
self.phoneTF.tintColor = XHTextFieldTextColor;
[self.phoneTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(lb.mas_right).offset(HJPX(23.5));
make.width.mas_equalTo(260*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phoneImg);
}];
self.phoneTF.text = XHGetDataManager.phoneNum;
[self.phoneTF addTarget:self action:@selector(textFieldValueChange:) forControlEvents:UIControlEventEditingChanged];
UIView *phonebgV1 = [UIView myUIViewSuperView:self withBackgroundColor:XHColorHex(0xF6F6F6)];
phonebgV1.layer.cornerRadius = 22.5*IPhone6ScaleHeight;
[phonebgV1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.centerX.mas_equalTo(phonebgV);
make.top.mas_equalTo(phonebgV.mas_bottom).offset(HJPX(50));
}];
UIView *phoneImgBg1 = [UIView myUIViewSuperView:phonebgV1 withBackgroundColor:[UIColor whiteColor]];
phoneImgBg1.layer.cornerRadius =17.5*IPhone6ScaleHeight;
[phoneImgBg1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV1.mas_left).offset(5.5*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phonebgV1);
make.width.height.mas_equalTo(phoneImgBg);
}];
UIImageView *passwordImg = [UIImageView myUIImageViewSuperView:self withImageName:@"login_user_personal_account"];
[passwordImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(phoneImgBg1);
make.centerX.mas_equalTo(phoneImgBg1);
}];
self.passwordTF = [UITextField myUITextFieldSuperView:self
withDelegate:self
withFont:XHFontSize(16)
withTextFieldColor:XHTextFieldTextColor
withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入验证码")
withPlaceholderColor:XHTextFieldTextPlaceholderColor
withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
[self.passwordTF addTarget:self action:@selector(textFieldValueChange:) forControlEvents:UIControlEventEditingChanged];
self.passwordTF.keyboardType = UIKeyboardTypeNumberPad;
self.passwordTF.tintColor = XHTextFieldTextColor;
[self.passwordTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(lb);
make.centerY.mas_equalTo(passwordImg);
make.width.mas_equalTo(160*IPhone6ScaleWidth);
}];
self.codeBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(sendCodeBtnTouchUpInside) withTag:1 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"获取验证码") withFont:XHFontSize(16) withTitleNormalColor:XHColorHex(0xffffff) withTitleSelectedColor:XHColorHex(0xffffff)];
self.codeBtn.backgroundColor = XHColorHex(0xABABAB);
self.codeBtn.layer.cornerRadius = 17.5*IPhone6ScaleHeight;
self.codeBtn.layer.masksToBounds = YES;
self.codeBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
self.codeBtn.enabled = false;
self.codeBtn.alpha = 0.5;
[self.codeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(phonebgV1.mas_right).offset(HJPX(-11));
make.centerY.mas_equalTo(self.passwordTF);
make.width.mas_equalTo(100.5*IPhone6ScaleWidth);
make.height.mas_equalTo(35*IPhone6ScaleHeight);
}];
[self.codeBtn.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.codeBtn);
make.right.mas_equalTo(self.codeBtn);
}];
self.loginBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(loginBtnTouchUpInside) withTag:0 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"确定") withFont:XHFontSize(20) withTitleNormalColor:XHColorHex(0xffffff) withTitleSelectedColor:XHColorHex(0xffffff)];
self.loginBtn.backgroundColor = XHBtnColor;
self.loginBtn.layer.cornerRadius = 8.0f;
self.loginBtn.userInteractionEnabled = false;
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV1.mas_left);
make.right.mas_equalTo(phonebgV1.mas_right);
make.height.mas_equalTo(HJPX(86));
make.top.mas_equalTo(phonebgV1.mas_bottom).offset(45*IPhone6ScaleHeight);
}];
XHGetDataManager.languageName = languageName;
self.agreeBtn = [UIButton myUIButtonSuperView:self
withUIButtonType:UIButtonTypeCustom
withTarget:self
withBction:@selector(agreeBtnTouchUpInside:)
withTag:0
withNormalImg:nil
withSelectedImg:nil
withHighlightedImg:nil
withTitle:HJLocalizedString(@"已阅读并同意")
withFont:XHFontSize(HJPX(22))
withTitleNormalColor:XHColorHex(0X999999)
withTitleSelectedColor:nil];
if(TargetType == 2){
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s") forState:UIControlStateSelected];
}else if(TargetType == 4){
[self.agreeBtn setImage:HJSetImg(@"DR01_Sex_Select_Nor") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"DR01_Sex_Select_Sel") forState:UIControlStateSelected];
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 = 1; // 繁体
}
}else{
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n_r") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s_r") forState:UIControlStateSelected];
[XHDataManager sharedManager].simparlanguage = 1; // 英文
}
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(100*IPhone6ScaleWidth);
make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(89.5*IPhone6ScaleHeight);
}];
[self.agreeBtn layoutButtonWithEdgeInsetsStyle:HJButtonEdgeInsetsStyleLeft imageTitleSpace:9];
self.agreeBtn.selected = YES;
UIButton *agreementBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(agreementBtnTouchUpInside) withTag:1 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"《用户使用协议》") withFont:XHFontSize(HJPX(22)) withTitleNormalColor:XHColorHex(0XEC694A) withTitleSelectedColor:XHColorHex(0XEC694A)];
[agreementBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.agreeBtn.mas_right).offset(2);
make.centerY.mas_equalTo(self.agreeBtn);
}];
if((TargetType == 4)&&([languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文// /Hans-CN
UIImageView *emailImg = [UIImageView myUIImageViewSuperView:self withImageName:@"邮件_mail (1)"];
[emailImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(HJPX(82));
make.top.mas_equalTo(self).offset(227.5*IPhone6ScaleHeight);
}];
self.emailTF = [UITextField myUITextFieldSuperView:self
withDelegate:self
withFont:XHFontSize(HJPX(30))
withTextFieldColor:XHTextFieldTextColor
withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入邮箱号码")
withPlaceholderColor:XHTextFieldTextPlaceholderColor
withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
self.emailTF.keyboardType = UIKeyboardTypeEmailAddress;
self.emailTF.tintColor = XHTextFieldTextColor;
[self.emailTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(emailImg.mas_right).offset(HJPX(24));
make.width.mas_equalTo(260*IPhone6ScaleWidth);
make.centerY.mas_equalTo(emailImg);
}];
// self.emailTF.text = XHGetDataManager.phoneNum;
[self.emailTF addTarget:self action:@selector(textFieldValueChange:) forControlEvents:UIControlEventEditingChanged];
UIView *emailLine = [UIView myUIViewSuperView:self withBackgroundColor:XHColorHex(0xABABAB)];
[emailLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(HJPX(60));
make.right.mas_equalTo(HJPX(-60));
make.top.mas_equalTo(emailImg.mas_bottom).offset(HJPX(16));
make.height.mas_equalTo(0.5);
}];
self.loginBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(loginBtnTouchUpInside) withTag:0 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"确定") withFont:XHFontSize(20) withTitleNormalColor:XHColorHex(0xffffff) withTitleSelectedColor:XHColorHex(0xffffff)];
self.loginBtn.backgroundColor = XHBtnColor;
self.loginBtn.layer.cornerRadius = 8.0f;
self.loginBtn.userInteractionEnabled = false;
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(emailLine.mas_left);
make.right.mas_equalTo(emailLine.mas_right);
make.height.mas_equalTo(HJPX(86));
make.top.mas_equalTo(emailLine.mas_bottom).offset(45*IPhone6ScaleHeight);
}];
self.agreeBtn = [UIButton myUIButtonSuperView:self
withUIButtonType:UIButtonTypeCustom
withTarget:self
withBction:@selector(agreeBtnTouchUpInside:)
withTag:0
withNormalImg:nil
withSelectedImg:nil
withHighlightedImg:nil
withTitle:HJLocalizedString(@"已阅读并同意")
withFont:XHFontSize(HJPX(22))
withTitleNormalColor:XHColorHex(0X999999)
withTitleSelectedColor:nil];
if(TargetType == 2){
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s") forState:UIControlStateSelected];
}else{
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n_r") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s_r") forState:UIControlStateSelected];
}
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(100*IPhone6ScaleWidth);
make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(89.5*IPhone6ScaleHeight);
}];
[self.agreeBtn layoutButtonWithEdgeInsetsStyle:HJButtonEdgeInsetsStyleLeft imageTitleSpace:9];
self.agreeBtn.selected = YES;
UIButton *agreementBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(agreementBtnTouchUpInside) withTag:1 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"《用户使用协议》") withFont:XHFontSize(HJPX(22)) withTitleNormalColor:XHColorHex(0XEC694A) withTitleSelectedColor:XHColorHex(0XEC694A)];
[agreementBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.agreeBtn.mas_right).offset(2);
make.centerY.mas_equalTo(self.agreeBtn);
}];
}else {
UIImageView *logoImg = [UIImageView myUIImageViewSuperView:self withImageName:@"DR_DeviceListTopImage"];
[logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self).offset(55.5*IPhone6ScaleHeight);
}];
UIView *phonebgV = [UIView myUIViewSuperView:self withBackgroundColor:XHColorHex(0xF6F6F6)];
// phonebgV.backgroundColor = [UIColor redColor];
phonebgV.layer.cornerRadius = 22.5*IPhone6ScaleHeight;
[phonebgV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(HJPX(60));
make.right.mas_equalTo(HJPX(-60));
make.top.mas_equalTo(self).offset(219*IPhone6ScaleHeight);
make.height.mas_equalTo(45*IPhone6ScaleHeight);
}];
UIView *phoneImgBg = [UIView myUIViewSuperView:phonebgV withBackgroundColor:[UIColor whiteColor]];
phoneImgBg.layer.cornerRadius =17.5*IPhone6ScaleHeight;
[phoneImgBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV.mas_left).offset(5.5*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phonebgV);
make.width.mas_equalTo(48*IPhone6ScaleWidth);
make.height.mas_equalTo(35*IPhone6ScaleHeight);
}];
UIImageView *phoneImg = [UIImageView myUIImageViewSuperView:self withImageName:@"login_user_personal_phone"];
[phoneImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.centerX.mas_equalTo(phoneImgBg);
}];
UILabel *lb = [UILabel myUILabelSuperView:self withNSTextAlignment:NSTextAlignmentCenter withContent:HJLocalizedString(@"+86") withFont:XHFontSize(16) withTextColor:XHColorHex(0x323232) withResize:true];
[lb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phoneImgBg.mas_right).offset(10*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phoneImg);
make.height.mas_equalTo(12.5*IPhone6ScaleHeight);
}];
[NSString localizedString:@""];
self.phoneTF = [UITextField myUITextFieldSuperView:self
withDelegate:self
withFont:XHFontSize(HJPX(30))
withTextFieldColor:XHTextFieldTextColor
withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入手机号码")
withPlaceholderColor:XHTextFieldTextPlaceholderColor
withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
self.phoneTF.keyboardType = UIKeyboardTypeNumberPad;
self.phoneTF.tintColor = XHTextFieldTextColor;
[self.phoneTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(lb.mas_right).offset(HJPX(23.5));
make.width.mas_equalTo(260*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phoneImg);
}];
self.phoneTF.text = XHGetDataManager.phoneNum;
[self.phoneTF addTarget:self action:@selector(textFieldValueChange:) forControlEvents:UIControlEventEditingChanged];
UIView *phonebgV1 = [UIView myUIViewSuperView:self withBackgroundColor:XHColorHex(0xF6F6F6)];
phonebgV1.layer.cornerRadius = 22.5*IPhone6ScaleHeight;
[phonebgV1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.centerX.mas_equalTo(phonebgV);
make.top.mas_equalTo(phonebgV.mas_bottom).offset(HJPX(50));
}];
UIView *phoneImgBg1 = [UIView myUIViewSuperView:phonebgV1 withBackgroundColor:[UIColor whiteColor]];
phoneImgBg1.layer.cornerRadius =17.5*IPhone6ScaleHeight;
[phoneImgBg1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV1.mas_left).offset(5.5*IPhone6ScaleWidth);
make.centerY.mas_equalTo(phonebgV1);
make.width.height.mas_equalTo(phoneImgBg);
}];
UIImageView *passwordImg = [UIImageView myUIImageViewSuperView:self withImageName:@"login_user_personal_account"];
[passwordImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(phoneImgBg1);
make.centerX.mas_equalTo(phoneImgBg1);
}];
self.passwordTF = [UITextField myUITextFieldSuperView:self
withDelegate:self
withFont:XHFontSize(16)
withTextFieldColor:XHTextFieldTextColor
withNSTextAlignment:NSTextAlignmentLeft
withPlaceholder:HJLocalizedString(@"请输入验证码")
withPlaceholderColor:XHTextFieldTextPlaceholderColor
withVerticalAlignment:UIControlContentVerticalAlignmentCenter];
[self.passwordTF addTarget:self action:@selector(textFieldValueChange:) forControlEvents:UIControlEventEditingChanged];
self.passwordTF.keyboardType = UIKeyboardTypeNumberPad;
self.passwordTF.tintColor = XHTextFieldTextColor;
[self.passwordTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(lb);
make.centerY.mas_equalTo(passwordImg);
make.width.mas_equalTo(160*IPhone6ScaleWidth);
}];
self.codeBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(sendCodeBtnTouchUpInside) withTag:1 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"获取验证码") withFont:XHFontSize(16) withTitleNormalColor:XHColorHex(0xffffff) withTitleSelectedColor:XHColorHex(0xffffff)];
self.codeBtn.backgroundColor = XHColorHex(0xABABAB);
self.codeBtn.layer.cornerRadius = 17.5*IPhone6ScaleHeight;
self.codeBtn.layer.masksToBounds = YES;
self.codeBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
self.codeBtn.enabled = false;
self.codeBtn.alpha = 0.5;
[self.codeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(phonebgV1.mas_right).offset(HJPX(-11));
make.centerY.mas_equalTo(self.passwordTF);
make.width.mas_equalTo(100.5*IPhone6ScaleWidth);
make.height.mas_equalTo(35*IPhone6ScaleHeight);
}];
[self.codeBtn.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.codeBtn);
make.right.mas_equalTo(self.codeBtn);
}];
self.loginBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(loginBtnTouchUpInside) withTag:0 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"确定") withFont:XHFontSize(20) withTitleNormalColor:XHColorHex(0xffffff) withTitleSelectedColor:XHColorHex(0xffffff)];
self.loginBtn.backgroundColor = XHBtnColor;
self.loginBtn.layer.cornerRadius = 8.0f;
self.loginBtn.userInteractionEnabled = false;
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(phonebgV1.mas_left);
make.right.mas_equalTo(phonebgV1.mas_right);
make.height.mas_equalTo(HJPX(86));
make.top.mas_equalTo(phonebgV1.mas_bottom).offset(45*IPhone6ScaleHeight);
}];
self.agreeBtn = [UIButton myUIButtonSuperView:self
withUIButtonType:UIButtonTypeCustom
withTarget:self
withBction:@selector(agreeBtnTouchUpInside:)
withTag:0
withNormalImg:nil
withSelectedImg:nil
withHighlightedImg:nil
withTitle:HJLocalizedString(@"已阅读并同意")
withFont:XHFontSize(HJPX(22))
withTitleNormalColor:XHColorHex(0X999999)
withTitleSelectedColor:nil];
if(TargetType == 2){
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s") forState:UIControlStateSelected];
}else if(TargetType == 4){
[self.agreeBtn setImage:HJSetImg(@"DR01_Sex_Select_Nor") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"DR01_Sex_Select_Sel") forState:UIControlStateSelected];
}else{
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_n_r") forState:UIControlStateNormal];
[self.agreeBtn setImage:HJSetImg(@"Set_Slect_model_s_r") forState:UIControlStateSelected];
}
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(100*IPhone6ScaleWidth);
make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(89.5*IPhone6ScaleHeight);
}];
[self.agreeBtn layoutButtonWithEdgeInsetsStyle:HJButtonEdgeInsetsStyleLeft imageTitleSpace:9];
self.agreeBtn.selected = YES;
UIButton *agreementBtn = [UIButton myUIButtonSuperView:self withUIButtonType:UIButtonTypeCustom withTarget:self withBction:@selector(agreementBtnTouchUpInside) withTag:1 withNormalImg:nil withSelectedImg:nil withHighlightedImg:nil withTitle:HJLocalizedString(@"《用户使用协议》") withFont:XHFontSize(HJPX(22)) withTitleNormalColor:XHColorHex(0XEC694A) withTitleSelectedColor:XHColorHex(0XEC694A)];
[agreementBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.agreeBtn.mas_right).offset(2);
make.centerY.mas_equalTo(self.agreeBtn);
}];
}
}
#pragma mark - 登录
-(void)loginBtnTouchUpInside{
if((TargetType == 5)&&([XHGetDataManager.languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文
if((TargetType == 5 || TargetType == 4)&&([XHGetDataManager.languageName rangeOfString:@"zh-Hans"].location ==NSNotFound)){//非简体中文
if (![NSString isNull:self.emailTF.text] && self.agreeBtn.selected == YES ) {
NSDictionary *dic=@{@"email":self.emailTF.text,
@"appType":@(TargetType)
......
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