Commit 906f91c3 by 刘卓鑫

优化蓝牙连接提示 ,修复ios蓝牙连接失败问题。优化全局接口错误信息提示(改成确认弹窗)

parent 8d5a5d6d
......@@ -4850,6 +4850,9 @@
com.apple.Push = {
enabled = 1;
};
com.apple.SafariKeychain = {
enabled = 1;
};
};
};
9142D2D21F35C84E004F90CF = {
......
......@@ -62,7 +62,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......
......@@ -84,7 +84,7 @@
// [kAppWindow addSubview:fps];
//默认配置
[self defaultLauchConfigAndIsOpenPreventCrashManager:YES];
[self defaultLauchConfigAndIsOpenPreventCrashManager:NO];
//防止蓝牙洗浴后台运行被系统中断
......
//
//
......@@ -18,7 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
//单例化
kSINGLETON_FOR_HEADER(APIManager)
@property (nonatomic, assign) ZXColorfulSchoolEnvironmentType lauchEnvironment;
......
//
//
......@@ -190,7 +190,7 @@
if (error != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[self.myTableView.mj_header endRefreshing];
});
}
......@@ -384,7 +384,7 @@
if (error != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
......
//
//
......@@ -209,7 +209,7 @@
[ZXTool hideLoadingAnimation];
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXBathConfig clearTable];
[ZXBlance clearTable];
} else {
......@@ -256,7 +256,7 @@
@strongify(self);
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
if ([common.data integerValue] == 0) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"您将授权使用第三方的精图教育服务,精图提供教资、考研、国考等精选课程;授权后精图将使用您的多彩相关信息!" preferredStyle:UIAlertControllerStyleAlert];
......
//
//
......@@ -731,7 +731,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:@"changeIconNotification" object:nil];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:responseObject[@"msg"]];
[ZXTool showErrorMsg:responseObject[@"msg"]];
});
}
dispatch_async(dispatch_get_main_queue(), ^{
......@@ -739,7 +739,7 @@
});
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error.userInfo[@"NSLocalizedDescription"]];
[ZXTool showErrorMsg:error.userInfo[@"NSLocalizedDescription"]];
});
}];
}
......
//
//
......@@ -24,7 +24,6 @@
self.backgroundColor = [UIColor clearColor];
UIImage *img1 = [UIImage imageNamed:@"ic_qipaos_bg"];
UIImageView *imageView1 = [[UIImageView alloc] init];
[self addSubview:imageView1];
......@@ -62,15 +61,7 @@
make.centerY.equalTo(child);
make.width.height.mas_equalTo(15 * k6Scale);
}];
@weakify(self);
[[deleteBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
@strongify(self);
self.hidden = YES;
//[self removeFromSuperview];
if (self.deleteAction) {
self.deleteAction();
}
}];
deleteBtn.userInteractionEnabled = NO;
self.contentLabel = [[UILabel alloc] init];
[self addSubview:self.contentLabel];
......@@ -81,18 +72,6 @@
make.right.equalTo(deleteBtn.mas_left).offset(-10 * k6Scale);
make.centerY.equalTo(child);
}];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
[self addGestureRecognizer:tap];
kWeakSelf(self);
[[tap rac_gestureSignal] subscribeNext:^(id x) {
kStrongSelf(self);
if (self.clickAction) {
self.clickAction();
}
}];
}
return self;
}
......@@ -112,5 +91,19 @@
self.contentLabel.text = _order.orderTitle;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
CGPoint clickPoint = [[touches anyObject] locationInView:self];
if (clickPoint.x < self.frame.size.width - 64 * k6Scale) {
if (self.clickAction) {
self.clickAction();
}
} else {
self.hidden = YES;
//[self removeFromSuperview];
if (self.deleteAction) {
self.deleteAction();
}
}
}
@end
//
//
......@@ -250,6 +250,17 @@
_userName = userName;
self.userNameLabel.text = _userName;
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *view = [super hitTest:point withEvent:event];
if (view == nil) {
for (UIView *subView in self.subviews) {
CGPoint tp = [subView convertPoint:point fromView:self];
if (CGRectContainsPoint(subView.bounds, tp)) {
view = subView;
}
}
}
return view;
}
@end
//
//
......@@ -45,7 +45,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/home/module/rank?customerId=%@&publishClient=%@", [self url], CacheUserId?CacheUserId:@"", @"2"] para:nil completed:^(CommonModel *common, NSString *error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
completed(NO);
});
......@@ -105,7 +105,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/home/module/notice?customerId=%@&publishClient=%@", [self url], CacheUserId?CacheUserId:@"", @"2"] para:nil completed:^(CommonModel *common, NSString *error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
completed(NO);
});
......@@ -126,7 +126,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/home/module/item/detail?itemCode=%@", [kUserDefaults objectForKey:@"HomePage"], itemCode] para:nil completed:^(CommonModel *common, NSString *error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
});
} else {
......@@ -178,7 +178,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/home/module/notice/detail?noticeCode=%@&customerId=%@", [kUserDefaults objectForKey:@"HomePage"], noticeCode, CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
});
} else {
......
//
//
......@@ -305,7 +305,7 @@
@strongify(self);
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
[kUserDefaults setObject:common.data forKey:@"idBar"];
self.barcodeView.image = [self createBarCode:CacheidBar width:self.barcodeView.frame.size.width height:self.barcodeView.frame.size.height];
......
//
//
......@@ -52,7 +52,7 @@ typedef void(^completedBlock)(id response, NSString *error);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
return;
}
......@@ -102,7 +102,7 @@ typedef void(^completedBlock)(id response, NSString *error);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
return;
}
......@@ -134,7 +134,7 @@ typedef void(^completedBlock)(id response, NSString *error);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
return;
}
......@@ -187,7 +187,7 @@ typedef void(^completedBlock)(id response, NSString *error);
[self requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(id response, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
} else {
@strongify(self);
......@@ -229,7 +229,7 @@ typedef void(^completedBlock)(id response, NSString *error);
[self requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"http://api.zhuishushenqi.com/book/fuzzy-search?query=%@", searchText] para:nil completed:^(id response, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
} else {
@strongify(self);
......@@ -309,7 +309,7 @@ typedef void(^completedBlock)(id response, NSString *error);
[self requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(id response, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed(NO);
} else {
@strongify(self);
......@@ -437,7 +437,7 @@ typedef void(^completedBlock)(id response, NSString *error);
[self requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"http://api.zhuishushenqi.com/ranking/%@", rankId] para:nil completed:^(id response, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
} else {
@strongify(self);
......@@ -480,7 +480,7 @@ typedef void(^completedBlock)(id response, NSString *error);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
return;
}
......@@ -499,7 +499,7 @@ typedef void(^completedBlock)(id response, NSString *error);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
completed();
return;
}
......
//
//
......@@ -58,7 +58,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
ZXDrinkMerthinModel *m = [ZXDrinkMerthinModel mj_objectWithKeyValues:common.data];
......@@ -75,7 +75,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"customerName":[kUserDefaults valueForKey:@"username"], @"customerPhone":[kUserDefaults valueForKey:@"account"],@"campusId":[kUserDefaults valueForKey:@"campusId"]} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
[ZXTool hideLoadingAnimation];
......@@ -91,7 +91,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"customerName":[kUserDefaults valueForKey:@"username"], @"customerPhone":[kUserDefaults valueForKey:@"account"]} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
[ZXTool hideLoadingAnimation];
......@@ -128,7 +128,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
[ZXTool hideLoadingAnimation];
......@@ -147,7 +147,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
[self.useDeviceList removeAllObjects];
completed();
......
//
//
......@@ -35,7 +35,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
NSString *jtUrl = common.data[@"url"];
self.cookie = common.data[@"PHPSESSID"];
......
......@@ -51,7 +51,7 @@
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
completed(NO);
});
......@@ -124,7 +124,7 @@
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
completed(NO);
});
......@@ -147,7 +147,7 @@
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/shower/appointment/appointResult/%ld?userId=%@&recordId=%ld", [kUserDefaults valueForKey:@"AppointBATH"], (long)recordId,CacheUserId, (long)recordId] para:nil completed:^(CommonModel *common, NSString *error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
//[ZXTool hideLoadingAnimation];
completed(NO);
});
......@@ -184,7 +184,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
if ([common.data integerValue] == 3) {
completed(YES);
......@@ -202,7 +202,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/shower/controllerConfigs?customerId=%@&campusId=%@", [kUserDefaults valueForKey:@"AppointBATH"], CacheUserId, CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXBathConfig clearTable];
[ZXBlance clearTable];
} else {
......
//
//
......@@ -65,8 +65,6 @@
//是否收到socket服务器的回应(设备号)
@property (nonatomic, assign) BOOL isReciveDeviceInfo;
@end
......@@ -114,17 +112,7 @@
}
}];
//MARK:观察是否收到socket反馈设备信息
// [RACObserve(self, isReciveDeviceInfo) subscribeNext:^(id _Nullable x) {
// @strongify(self);
// if ([x integerValue]) {
// //开始洗浴
// if (self.isBegingBath == NO) {
// self.isBegingBath = YES;
// [self startBathByBluetooth];//调用接口
// }
// }
// }];
}
#pragma mark - ==========读取本地缓存数据==========
......@@ -216,7 +204,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
if (isShow) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
}
[ZXTool hideLoadingAnimation];
} else {
......@@ -345,13 +333,12 @@
make.top.equalTo(header.mas_bottom);
}];
}
}
#pragma mark - ==========开始洗浴按钮事件==========
- (void) startBath {
self.isBegingBath = NO;//标记为no
self.isReciveDeviceInfo = NO;//标记为未接收到消息
@weakify(self);
[ZXAppointBathService dealAccountActionWithOperationMode:self.currentBluetooth.operationMode isBlueBath:YES completed:^{
@strongify(self);
......@@ -392,13 +379,13 @@
[self.view addSubview:a];
return;
}
[self sendMessage:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]];
self.isServiceCut = NO;//标记为开始
self.startDrink.enabled = NO;//按钮不可点击
[self reConnect];//重连操作
//开始搜索设备的时候触发
[self checkBluetoothConectStatus];
//[SVProgressHUD showWithStatus:@"蓝牙连接中..."];
[SVProgressHUD showWithStatus:@"蓝牙连接中..."];
}
#pragma mark - ==========点击了开始按钮 5s后检测蓝牙连接状态==========
......@@ -433,13 +420,14 @@
#pragma mark - ==========开始洗浴接口调用==========
- (void) startBathByBluetooth {
//[SVProgressHUD showSuccessWithStatus:@"设备开启中..."];
[SVProgressHUD showSuccessWithStatus:@"设备开启中..."];
NSString *url = [NSString stringWithFormat:@"%@/dcxy/api/shower/devices/%@/beginning", [kUserDefaults valueForKey:@"BATH"], self.currentPeripheralName];
@weakify(self);
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"customerName":[kUserDefaults valueForKey:@"username"], @"customerPhone":[kUserDefaults valueForKey:@"account"],@"campusId":[kUserDefaults valueForKey:@"campusId"]} completed:^(CommonModel *common, NSString *error) {
@strongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[SVProgressHUD dismiss];
if (error) {
[SVProgressHUD showErrorWithStatus:error];
[self cutBluetoothAndSocketConnect];
......@@ -663,10 +651,10 @@
#pragma mark - ==========蓝牙连接成功 发送设备号给socket==========
- (void) sendDeviceInfoToSocketByTimes:(int) times {
//执行三次
if (times < 4 && self.isReciveDeviceInfo == NO) {
if (times < 4) {
NSLog(@"//蓝牙连接成功---发送设备号给socket");
[self sendMessage:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self sendDeviceInfoToSocketByTimes:(times + 1)];
});
}
......@@ -677,24 +665,14 @@
#pragma mark - ==========蓝牙连接成功==========
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error {
NSLog(@"=========================蓝牙连接成功=========================");
//[SVProgressHUD showSuccessWithStatus:@"蓝牙连接成功"];
[self sendMessage:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]];
[SVProgressHUD showSuccessWithStatus:@"蓝牙连接成功"];
[self sendDeviceInfoToSocketByTimes:1];
//开始洗浴
if (self.isBegingBath == NO) {
self.isBegingBath = YES;
[self startBathByBluetooth];//调用接口
}
// [self sendDeviceInfoToSocketByTimes:1];
// //三秒之后查看状态 如果还是没有收到 直接cancel掉所有连接 提示错误信息
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// if (self.isReciveDeviceInfo == NO) {
// [ZXTool hideLoadingAnimation];
// [SVProgressHUD showErrorWithStatus:@"未收到socket服务器响应的设备信息,请稍后再试!"];
// }
// });
for (CBCharacteristic *characteristic in service.characteristics) {
[peripheral setNotifyValue:YES forCharacteristic:characteristic];
......@@ -881,7 +859,7 @@
} else if ([text isEqualToString:@"[]"]) {
} else if ([text isEqualToString:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]]) {
self.isReciveDeviceInfo = YES;
NSLog(@"=============收到服务器返回的设备号");
} else {
//发送给蓝牙
......
//
//
......@@ -74,7 +74,7 @@
[self.offlineList removeAllObjects];
}
completedBlock(YES);
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
});
} else {
......@@ -203,7 +203,7 @@
@strongify(self);
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[self.allMerthinList removeAllObjects];
[self.allMerthinList addObjectsFromArray:[ZXWashLocationModel findAll]];
completedBlock(YES);
......
//
//
......@@ -62,7 +62,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
[ZXTool hideLoadingAnimation];
......@@ -80,7 +80,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
//提示之后 重新回归扫码状态
[[NSNotificationCenter defaultCenter] postNotificationName:@"reStartScan_wash" object:nil];
} else {
......@@ -98,7 +98,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
//提示之后 重新回归扫码状态
[[NSNotificationCenter defaultCenter] postNotificationName:@"reStartScan_wash" object:nil];
} else {
......@@ -115,7 +115,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:dic completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
completed(common.data);
......@@ -137,7 +137,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
[ZXTool hideLoadingAnimation];
......@@ -153,7 +153,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
//提示之后 重新回归扫码状态
[[NSNotificationCenter defaultCenter] postNotificationName:@"reStartScan_wash" object:nil];
......@@ -219,7 +219,7 @@
[ZXTool requestDataWithType:kXMHTTPMethodGET url:url para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
completed();
} else {
......
//
//
......@@ -37,7 +37,7 @@
@strongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
[ZXTool hideLoadingAnimation];
} else {
ZXNewPayConfirmPayTypeModel *model = [ZXNewPayConfirmPayTypeModel mj_objectWithKeyValues:common.data];
......@@ -191,18 +191,18 @@
[ZXNotPay clearTable];
[ZXTool hideLoadingAnimation];
[self paySuccessAndBackToRoot];
[ZXTool showText:responseObject[@"msg"]];
[ZXTool showErrorMsg:responseObject[@"msg"]];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:responseObject[@"msg"]];
[ZXTool showErrorMsg:responseObject[@"msg"]];
});
}
} onFailure:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:error.userInfo[@"NSLocalizedDescription"]];
[ZXTool showErrorMsg:error.userInfo[@"NSLocalizedDescription"]];
});
} onFinished:^(id responseObject, NSError *error) {
}];
......
//
//
......@@ -28,7 +28,7 @@
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
ZXNewPayOrder *order = [ZXNewPayOrder mj_objectWithKeyValues:common.data];
self.order = order;
......
//
//
......@@ -88,7 +88,7 @@
[self.myTableView.mj_header endRefreshing];
[self.myTableView.mj_footer endRefreshing];
if (error) {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
} else {
if ([self.lastOrderId isEqualToString:@""]) {
[ZXNewPayOrder clearTable];
......
//
//
......@@ -109,7 +109,7 @@
[self.myTableView reloadData];
});
} else {
[ZXTool showText:error];
[ZXTool showErrorMsg:error];
}
});
}];
......
//
//
......@@ -72,7 +72,7 @@
[wxLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(36 * k6Scale);
make.centerX.equalTo(self.view);
make.bottom.equalTo(self.view.mas_bottom).offset(-30 * k6Scale);
make.bottom.equalTo(self.view.mas_bottom).offset(-40 * k6Scale);
}];
UILabel *label3 = [[UILabel alloc] init];
[self.view addSubview:label3];
......@@ -103,6 +103,17 @@
make.centerY.equalTo(label3.mas_centerY);
}];
[wxLoginBtn addTarget:self action:@selector(wxLogin:) forControlEvents:UIControlEventTouchUpInside];
UILabel *versionLabel = [[UILabel alloc] init];
[self.view addSubview:versionLabel];
versionLabel.text = [NSString stringWithFormat:@"v %@", APPversion];
versionLabel.textColor = kTopicColor;
versionLabel.font = kFontSize(13 * k6Scale);
[versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.view.mas_bottom).offset(-10 * k6Scale);
make.centerX.equalTo(self.view);
}];
}
- (void) keyboardWillHide:(NSNotification *) nof {
......
//
//
......@@ -21,7 +21,8 @@ typedef void(^checkIsOldCustomer)(BOOL isOld);
/*show alertText*/
+(void) showText:(NSString *) text;
//显示错误信息
+(void) showErrorMsg:(NSString *) msg;
+(void) showCustomMsg:(NSString *) msg;
+(void) showCustomMsg:(NSAttributedString *) msg
......
//
//
......@@ -12,7 +12,7 @@
#import "UserCenterModel.h"
#import "MBProgressHUD+ShowTextMessage.h"
#import "ZXMallViewController.h"
#import "ShowMsgView.h"
#import "ZXWebViewManager.h"
#import <CommonCrypto/CommonDigest.h>
#import <Accelerate/Accelerate.h>
......@@ -98,6 +98,16 @@ static ZXLoading *uploading = nil;
});
}
+(void) showErrorMsg:(NSString *) msg {
if ([msg isEqualToString:@"似乎已断开与互联网的连接。"]) {
msg = @"网络不可用,请检查网络设置重试~";
}
ShowMsgView *show = [[ShowMsgView alloc] initWithFrame:[UIScreen mainScreen].bounds msg:msg];
[show show];
}
+(void) showAlertText:(NSString *) text {
if (text == nil || [text isKindOfClass:[NSNull class]] || [text isEqualToString:@"<null>"]||[text isEqualToString:@""] ) {
......@@ -862,7 +872,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
NSData *data = [[NSData alloc]initWithBase64EncodedString:base64String options:NSDataBase64DecodingIgnoreUnknownCharacters];
NSString *string = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
return string;
}
......
......@@ -4,6 +4,10 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:https://www.dcrym.com/checktomcatstatus/</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.pxkjformal.parallelcampus</string>
......
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.9.0</string>
<string>3.9.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
......
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