Commit 075c5a33 by 刘卓鑫

test

parent 64eb0052
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
1CA7E88B229E8E310014E95F /* JDSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1CA7E889229E8E310014E95F /* JDSDK.bundle */; }; 1CA7E88B229E8E310014E95F /* JDSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1CA7E889229E8E310014E95F /* JDSDK.bundle */; };
1CA7E88C229E8E310014E95F /* JDSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CA7E88A229E8E310014E95F /* JDSDK.framework */; }; 1CA7E88C229E8E310014E95F /* JDSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CA7E88A229E8E310014E95F /* JDSDK.framework */; };
1CB10F1C233C63C900F94688 /* ZXAdViewService.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB10F1B233C63C900F94688 /* ZXAdViewService.m */; }; 1CB10F1C233C63C900F94688 /* ZXAdViewService.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB10F1B233C63C900F94688 /* ZXAdViewService.m */; };
1CB10F3C233D9C0B00F94688 /* ZXAlimamaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB10F3B233D9C0B00F94688 /* ZXAlimamaViewController.m */; };
1CB3AC062304E195006F1724 /* ZXMePageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC052304E195006F1724 /* ZXMePageCollectionViewCell.m */; }; 1CB3AC062304E195006F1724 /* ZXMePageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC052304E195006F1724 /* ZXMePageCollectionViewCell.m */; };
1CB3AC092304E369006F1724 /* ZXMePageMenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC082304E369006F1724 /* ZXMePageMenuModel.m */; }; 1CB3AC092304E369006F1724 /* ZXMePageMenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC082304E369006F1724 /* ZXMePageMenuModel.m */; };
1CB3AC0C2305321D006F1724 /* ZXBindTelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC0B2305321D006F1724 /* ZXBindTelViewController.m */; }; 1CB3AC0C2305321D006F1724 /* ZXBindTelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CB3AC0B2305321D006F1724 /* ZXBindTelViewController.m */; };
...@@ -901,6 +902,8 @@ ...@@ -901,6 +902,8 @@
1CA7E88A229E8E310014E95F /* JDSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JDSDK.framework; sourceTree = "<group>"; }; 1CA7E88A229E8E310014E95F /* JDSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JDSDK.framework; sourceTree = "<group>"; };
1CB10F1A233C63C900F94688 /* ZXAdViewService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXAdViewService.h; sourceTree = "<group>"; }; 1CB10F1A233C63C900F94688 /* ZXAdViewService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXAdViewService.h; sourceTree = "<group>"; };
1CB10F1B233C63C900F94688 /* ZXAdViewService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXAdViewService.m; sourceTree = "<group>"; }; 1CB10F1B233C63C900F94688 /* ZXAdViewService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXAdViewService.m; sourceTree = "<group>"; };
1CB10F3A233D9C0B00F94688 /* ZXAlimamaViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXAlimamaViewController.h; sourceTree = "<group>"; };
1CB10F3B233D9C0B00F94688 /* ZXAlimamaViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXAlimamaViewController.m; sourceTree = "<group>"; };
1CB3AC042304E195006F1724 /* ZXMePageCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXMePageCollectionViewCell.h; sourceTree = "<group>"; }; 1CB3AC042304E195006F1724 /* ZXMePageCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXMePageCollectionViewCell.h; sourceTree = "<group>"; };
1CB3AC052304E195006F1724 /* ZXMePageCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXMePageCollectionViewCell.m; sourceTree = "<group>"; }; 1CB3AC052304E195006F1724 /* ZXMePageCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXMePageCollectionViewCell.m; sourceTree = "<group>"; };
1CB3AC072304E369006F1724 /* ZXMePageMenuModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXMePageMenuModel.h; sourceTree = "<group>"; }; 1CB3AC072304E369006F1724 /* ZXMePageMenuModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXMePageMenuModel.h; sourceTree = "<group>"; };
...@@ -2433,6 +2436,15 @@ ...@@ -2433,6 +2436,15 @@
path = customViews; path = customViews;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1CB10F39233D9BF600F94688 /* demo */ = {
isa = PBXGroup;
children = (
1CB10F3A233D9C0B00F94688 /* ZXAlimamaViewController.h */,
1CB10F3B233D9C0B00F94688 /* ZXAlimamaViewController.m */,
);
path = demo;
sourceTree = "<group>";
};
1CB3AC1023053BE0006F1724 /* CropImage */ = { 1CB3AC1023053BE0006F1724 /* CropImage */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -4014,6 +4026,7 @@ ...@@ -4014,6 +4026,7 @@
A7DECC542079F0E20039EC22 /* Classes */ = { A7DECC542079F0E20039EC22 /* Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1CB10F39233D9BF600F94688 /* demo */,
1C39412F230BD0FD005048EB /* HomePage(首页) */, 1C39412F230BD0FD005048EB /* HomePage(首页) */,
1C3940FB230BC9D5005048EB /* Found(发现) */, 1C3940FB230BC9D5005048EB /* Found(发现) */,
917B7EC31F3C663100390AE5 /* MineView(个人中心) */, 917B7EC31F3C663100390AE5 /* MineView(个人中心) */,
...@@ -5267,6 +5280,7 @@ ...@@ -5267,6 +5280,7 @@
22E36CAA1F558D9800073AC2 /* EquipmentModel.m in Sources */, 22E36CAA1F558D9800073AC2 /* EquipmentModel.m in Sources */,
1C3AE7F822F18B4C0045C969 /* ZXHomePageSingleCell.m in Sources */, 1C3AE7F822F18B4C0045C969 /* ZXHomePageSingleCell.m in Sources */,
A7DECC9E2079F0E30039EC22 /* ZXWebLoadingView.m in Sources */, A7DECC9E2079F0E30039EC22 /* ZXWebLoadingView.m in Sources */,
1CB10F3C233D9C0B00F94688 /* ZXAlimamaViewController.m in Sources */,
1C3AE7C622F0482D0045C969 /* SGQRCodeScanView.m in Sources */, 1C3AE7C622F0482D0045C969 /* SGQRCodeScanView.m in Sources */,
A7F3E16521B5330F00010E23 /* GCDAsyncSocket.m in Sources */, A7F3E16521B5330F00010E23 /* GCDAsyncSocket.m in Sources */,
1CC15429230D5B7400582EC1 /* ZXAimiWalletAlertView.m in Sources */, 1CC15429230D5B7400582EC1 /* ZXAimiWalletAlertView.m in Sources */,
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
// [kAppWindow addSubview:fps]; // [kAppWindow addSubview:fps];
//默认配置 //默认配置
[self defaultLauchConfigAndIsOpenPreventCrashManager:NO]; [self defaultLauchConfigAndIsOpenPreventCrashManager:YES];
//防止蓝牙洗浴后台运行被系统中断 //防止蓝牙洗浴后台运行被系统中断
......
// //
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
} }
for (NSArray *arr in [dic allValues]) { for (NSArray *arr in [dic allValues]) {
for (NSString *url in arr) { for (NSString *url in arr) {
[[self sharedManager] GET:url parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { [[self sharedManager] GET:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
NSLog(@"xx"); NSLog(@"xx");
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"xx"); NSLog(@"xx");
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
return; return;
} }
for (NSString *url in arr) { for (NSString *url in arr) {
[[self sharedManager] GET:url parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {}]; [[self sharedManager] GET:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {}];
} }
} }
+(AFHTTPSessionManager *)sharedManager +(AFHTTPSessionManager *)sharedManager
......
// //
...@@ -92,14 +92,14 @@ ...@@ -92,14 +92,14 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeUserNameAction:) name:@"changeUserNameNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeUserNameAction:) name:@"changeUserNameNotification" object:nil];
//测试按钮 //测试按钮
// UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, kScreenHeight - 150, 80, 80)]; UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, kScreenHeight - 150, 80, 80)];
// [self.view addSubview:btn]; [self.view addSubview:btn];
// btn.backgroundColor = [UIColor orangeColor]; btn.backgroundColor = [UIColor orangeColor];
// [[btn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) { [[btn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
// UIViewController *vc = [[NSClassFromString(@"DC_ZXWashTabbarViewController") alloc] init]; UIViewController *vc = [[NSClassFromString(@"ZXAlimamaViewController") alloc] init];
// vc.hidesBottomBarWhenPushed = YES; vc.hidesBottomBarWhenPushed = YES;
// [self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
// }]; }];
} }
- (void)viewWillLayoutSubviews { - (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews]; [super viewWillLayoutSubviews];
......
// //
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
//初始化socket //初始化socket
self.clientSocket = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; self.clientSocket = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
//开始建立连接 //开始建立连接
[self.clientSocket connectToHost:[kUserDefaults objectForKey:@"BATHSocketUrl"] onPort:[[kUserDefaults objectForKey:@"BATHSocketPort"] integerValue] viaInterface:nil withTimeout:-1 error:nil]; //[self.clientSocket connectToHost:[kUserDefaults objectForKey:@"BATHSocketUrl"] onPort:[[kUserDefaults objectForKey:@"BATHSocketPort"] integerValue] viaInterface:nil withTimeout:-1 error:nil];
NSLog(@"😇😇😇😇😇😇 socket开始连接---%@", [ZXTool getTimeNow]); //NSLog(@"😇😇😇😇😇😇 socket开始连接---%@", [ZXTool getTimeNow]);
@weakify(self); @weakify(self);
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) { [[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
...@@ -385,7 +385,14 @@ ...@@ -385,7 +385,14 @@
self.startDrink.enabled = NO;//按钮不可点击 self.startDrink.enabled = NO;//按钮不可点击
[self reConnect];//重连操作 [self reConnect];//重连操作
//开始搜索设备的时候触发 //开始搜索设备的时候触发
[self checkBluetoothConectStatus]; if (self.clientSocket.isConnected == NO) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self checkBluetoothConectStatus];
});
} else {
[self checkBluetoothConectStatus];
}
[SVProgressHUD showWithStatus:@"蓝牙连接中..."]; [SVProgressHUD showWithStatus:@"蓝牙连接中..."];
} }
...@@ -393,9 +400,12 @@ ...@@ -393,9 +400,12 @@
- (void) checkBluetoothConectStatus { - (void) checkBluetoothConectStatus {
// [ZXTool showLoadingAnimation]; // [ZXTool showLoadingAnimation];
NSInteger times = 5; NSInteger times = 0.1;
if (!self.clientSocket.isConnected) {
times += 0.5;
}
if (self.currentBluetooth.isOnlyBluetooth) { if (self.currentBluetooth.isOnlyBluetooth) {
times = 10; times = 5;
} }
//5s之后查询蓝牙连接状态 //5s之后查询蓝牙连接状态
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(times * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(times * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
...@@ -484,6 +494,8 @@ ...@@ -484,6 +494,8 @@
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
ZXBluetoothModel *m = [ZXBluetoothModel mj_objectWithKeyValues:common.data]; ZXBluetoothModel *m = [ZXBluetoothModel mj_objectWithKeyValues:common.data];
[ZXBluetoothModel clearTable]; [ZXBluetoothModel clearTable];
self.currentPeripheralName = m.code;
[self sendDeviceInfoToSocketByTimes:3];
[m save]; [m save];
self.numberLabel.text = [NSString stringWithFormat:@"设备名称:%@", m.code]; self.numberLabel.text = [NSString stringWithFormat:@"设备名称:%@", m.code];
self.addressLabel.text = [NSString stringWithFormat:@"设备地址:%@", m.position]; self.addressLabel.text = [NSString stringWithFormat:@"设备地址:%@", m.position];
...@@ -768,7 +780,7 @@ ...@@ -768,7 +780,7 @@
//初始化socket //初始化socket
self.clientSocket = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; self.clientSocket = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
} }
if (self.isSocketConnected == NO) { if (self.isSocketConnected == NO || self.clientSocket.isConnected == NO) {
//开始建立连接 //开始建立连接
[self.clientSocket connectToHost:[kUserDefaults objectForKey:@"BATHSocketUrl"] onPort:[[kUserDefaults objectForKey:@"BATHSocketPort"] integerValue] viaInterface:nil withTimeout:-1 error:nil]; [self.clientSocket connectToHost:[kUserDefaults objectForKey:@"BATHSocketUrl"] onPort:[[kUserDefaults objectForKey:@"BATHSocketPort"] integerValue] viaInterface:nil withTimeout:-1 error:nil];
} }
......
//
// ZXAlimamaViewController.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/9/27.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXAlimamaViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// ZXAlimamaViewController.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/9/27.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAlimamaViewController.h"
@interface ZXAlimamaViewController ()
@end
@implementation ZXAlimamaViewController
- (void)viewDidLoad {
[super viewDidLoad];
//
// 27963012
// f924dd754677f4651edcf03a938619b3
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
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