Kaynağa Gözat

修改链接鞋子界面

leon 2 yıl önce
ebeveyn
işleme
5c94876718
100 değiştirilmiş dosya ile 1005 ekleme ve 3658 silme
  1. BIN
      .DS_Store
  2. BIN
      DanceGame/.DS_Store
  3. 1 2
      DanceGame/Classes/FitfunTool/FitfunHead_C.h
  4. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store
  5. 1 1
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataAnalysis.h
  6. 6 7
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataAnalysis.mm
  7. 5 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.h
  8. 319 196
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.mm
  9. 3 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataSend.h
  10. 36 7
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataSend.m
  11. 2 2
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/LEONBLManager.h
  12. 16 20
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/LEONBLManager.m
  13. 2 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Entity /ShoesInfo.h
  14. 7 2
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/HTTP/HTTPDataProcession.h
  15. 12 12
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/HTTP/HTTPDataProcession.m
  16. 8 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.h
  17. 12 8
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.mm
  18. 1 3
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.m
  19. 1 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m
  20. 1 19
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/AlgorithmTool.m
  21. 40 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/BugTool.m
  22. 9 1
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/CacheTool.h
  23. 101 3
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/CacheTool.m
  24. 8 103
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.h
  25. 16 1325
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.m
  26. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/.DS_Store
  27. 0 286
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/AnimationView.m
  28. 5 8
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/MainLoadingView.h
  29. 116 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/MainLoadingView.m
  30. 4 8
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/ViceLoadingView.h
  31. 116 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/ViceLoadingView.m
  32. 0 41
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.h
  33. 0 403
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.m
  34. 0 28
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.h
  35. 0 111
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.m
  36. 0 73
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.xib
  37. 0 20
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCellModel.h
  38. 0 15
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCellModel.m
  39. 0 25
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.h
  40. 0 99
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.m
  41. 0 86
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.xib
  42. 0 33
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselView.h
  43. 0 338
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselView.m
  44. 0 22
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselViewLayout.h
  45. 0 174
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselViewLayout.m
  46. 7 11
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/DebugView.h
  47. 88 77
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/DebugView.mm
  48. 2 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.h
  49. 57 88
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m
  50. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /.DS_Store
  51. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112.png
  52. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112@2x.png
  53. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112@3x.png
  54. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close.png
  55. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close@2x.png
  56. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close@3x.png
  57. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes.png
  58. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes@2x.png
  59. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes@3x.png
  60. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine.png
  61. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine@2x.png
  62. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine@3x.png
  63. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes.png
  64. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes@2x.png
  65. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes@3x.png
  66. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow.png
  67. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow@2x.png
  68. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow@3x.png
  69. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes.png
  70. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes@2x.png
  71. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes@3x.png
  72. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes.png
  73. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes@2x.png
  74. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes@3x.png
  75. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow.png
  76. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow@2x.png
  77. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow@3x.png
  78. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search.png
  79. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search@2x.png
  80. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search@3x.png
  81. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes.png
  82. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes@2x.png
  83. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes@3x.png
  84. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /loading.png
  85. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_circle.png
  86. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_circle@3x.png
  87. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_shoes.png
  88. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_shoes@3x.png
  89. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45.png
  90. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45@2x.png
  91. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45@3x.png
  92. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24.png
  93. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24@2x.png
  94. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24@3x.png
  95. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25.png
  96. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25@2x.png
  97. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25@3x.png
  98. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoe_sdk_c/.DS_Store
  99. 3 1
      DanceGame/Classes/UnityAppController.mm
  100. BIN
      DanceGame/Data/.DS_Store

BIN
.DS_Store


BIN
DanceGame/.DS_Store


+ 1 - 2
DanceGame/Classes/FitfunTool/FitfunHead_C.h

@@ -25,7 +25,6 @@ extern "C"{
     {
         if ( 0 == string )
             return 0;
-        
         unsigned long nLengh = strlen(string);
         char* res = (char*)malloc( nLengh + 1);
         strcpy(res, string);
@@ -299,7 +298,7 @@ extern "C"{
     {
 //        NSString *appidStr = [NSString stringWithUTF8String:appid];
 //        NSString *isTestStr = [NSString stringWithUTF8String:isTest];
-        NSLog(@"FitfunHead_C==FitFuninitYvIm appid:%@, isTest:%@", appidStr, isTestStr);
+//        NSLog(@"FitfunHead_C==FitFuninitYvIm appid:%@, isTest:%@", appidStr, isTestStr);
         
         [FitfunYDManager  ff_initYvimSDK];
     }

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store


+ 1 - 1
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataAnalysis.h

@@ -9,6 +9,6 @@
 #import "MYFactoryManager.h"
 
 @interface BTDataAnalysis : NSObject
--(void)analysisCharacteristic:(NSData*)characteristic deviceType:(DEVICE_TYPE)deviceType;
+-(void)analysisCharacteristic:(NSData*)characteristic peripheral:(CBPeripheral*)peripheral;
 @end
 

+ 6 - 7
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataAnalysis.mm

@@ -10,7 +10,7 @@
 @implementation BTDataAnalysis
 
 #pragma mark ===============================================>> 校验 & 报文数据解析
--(void)analysisCharacteristic:(NSData*)characteristic deviceType:(DEVICE_TYPE)deviceType{
+-(void)analysisCharacteristic:(NSData*)characteristic peripheral:(CBPeripheral*)peripheral{
         
 ////    NSLog(@"接收到的数据data = %@",characteristic);
 //    int frameHead = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(0, 1)]];//帧头数据aa
@@ -100,13 +100,12 @@
 //
 //        }else if (dataType == -95 && characteristic.length == 26){//获取的是查询的数据 char-->int a1 = -95
            //A1+1 >> 1: 设备数据(左鞋,右鞋)  aa 14 eb a1 01 64 00 1a 0000981d 64 00 17 00000000 f9
-    
-//        NSLog(@"主设备 读取特征的报文 硬件信息 %ld dataType = -95 %@ %ld",(long)deviceType,characteristic,characteristic.length);
-    
+    //        NSLog(@"主设备 读取特征的报文 硬件信息 %ld dataType = -95 %@ %ld",(long)deviceType,characteristic,characteristic.length);
+
                 int leftElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(5, 1)]];
                 int rightElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(15, 1)]];//龙哥新协议
                 
-                if (deviceType==DEVICETYPE_MAIN && LEManager.peripheral!=nil){//主设备
+                if (peripheral==LEManager.peripheral && LEManager.peripheral!=nil){//主设备
 //                    NSLog(@"主设备 接收到 鞋子硬件数据: %@  电量 %d %d %@ %@",characteristic,leftElectricity,rightElectricity,LEManager.peripheral.name,LEManager.peripheral.identifier.UUIDString);
                     //主 设备定时器 60秒调一次   /******************ios call unity*****************/
                      [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_MAIN
@@ -114,8 +113,8 @@
                                               address:LEManager.peripheral.identifier.UUIDString
                                                status:CONNECT_ED
                                           electricity:leftElectricity<=rightElectricity?leftElectricity:rightElectricity];
-             
-                }else if (deviceType==DEVICETYPE_VICE && LEManager.vicePeripheral!=nil){//副设备
+                    
+                }else if (peripheral==LEManager.vicePeripheral && LEManager.vicePeripheral!=nil){//副设备
 //                    NSLog(@"副设备 接收到 鞋子硬件数据: %@  电量 %d %d",characteristic,leftElectricity,rightElectricity);
                     //副 设备定时器 60秒调一次   /******************ios call unity*****************/
                      [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_VICE

+ 5 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.h

@@ -18,6 +18,9 @@ typedef NS_ENUM(NSInteger, BLETOOTH_STUTAS){
 
 @interface BTDataProcess : NSObject
 
+@property(assign,nonatomic)BOOL main_manuallyDisconnect;//是否是认为手动断开主设备链接
+@property(assign,nonatomic)BOOL vice_manuallyDisconnect;//是否是认为手动断开副设备链接
+
 @property(assign,nonatomic)int nativeAttX;
 
 //单例->初始化蓝牙
@@ -27,6 +30,8 @@ typedef NS_ENUM(NSInteger, BLETOOTH_STUTAS){
 -(void)startWithUrl:(NSURL*)url;
 //unity call 打开弹窗
 -(void)searchBLEAction:(int)type;
+//
+-(void)disConnedctBle:(int)type;
 
 //监听通知开始游戏
 -(void)gameStartInitData;

+ 319 - 196
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.mm

@@ -23,9 +23,6 @@ Game *game;
 Game *viceDeviceGame;
 }
 
-//ios_sdk
-@property (nonatomic,strong)IOSPlatformSDK * sdk;
-
 //蓝牙弹窗
 @property (strong, nonatomic)SearchDeviceViewController * searchDeviceVC;
 //蓝牙外设数据源
@@ -33,11 +30,15 @@ Game *viceDeviceGame;
 
 //定时查询设备状态
 @property(nonatomic,weak)NSTimer * timer;
+
 //鞋子信息
 @property(nonatomic,strong)ShoesInfo * shoes_info;
 //当局游戏信息
 @property(nonatomic,strong)GameInfo * game_info;
 
+//
+@property(nonatomic,assign)BOOL isPopUp;
+
 @end
 
 @implementation BTDataProcess
@@ -69,11 +70,11 @@ static BTDataProcess* instance = nil;
     
     self.shoes_info = [ShoesInfo new];
     self.shoes_info.gameModel = NO; //默认游戏模式关
-    self.shoes_info.timestamp = [AlgorithmTool returnTimestamp];//跳转游戏时候的时间戳
+    self.shoes_info.timestamp = [AlgorithmTool returnTimestamp];//跳转游戏时候刷新一个新的时间戳
     
     self.game_info = [GameInfo new];
     self.game_info.isBackGround = NO; //后台模式
-//    NSLog(@"self.game_info = %d %d %d %d %d %d %d",self.game_info.step,self.game_info.jump,self.game_info.crouch,self.game_info.tick,self.game_info.paper,self.game_info.scissors,self.game_info.rock);
+    NSLog(@"self.game_info = %d %d %d %d %d %d %d",self.game_info.step,self.game_info.jump,self.game_info.crouch,self.game_info.tick,self.game_info.paper,self.game_info.scissors,self.game_info.rock);
     
     
     //监听 趣动 app group 消息 ==>> 好友邀请信息
@@ -106,21 +107,53 @@ static BTDataProcess* instance = nil;
 }
 
 -(void)willEnterForeground{
+    
     NSLog(@"leon UIApplicationWillEnterForegroundNotification");
+    
+    // 发送app group通知
+    NSString * notificaitonName = @"GAME_ENTERFOREGROUND";
+    CFStringRef strRef = (__bridge CFStringRef)notificaitonName;
+    CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter ();
+    CFNotificationCenterPostNotification(notification, strRef, NULL,NULL, YES);
+    
     self.game_info.isBackGround = NO;
-    NSLog(@"程序从后台返回 重连蓝牙 peripheral.state = %ld",LEManager.peripheral.state);
-    [self initCBCentralManager];
+    
+    NSLog(@"程序从后台返回 重连蓝牙 peripheral.state = %ld %ld",LEManager.peripheral.state,LEManager.vicePeripheral.state);
+    
+    //mac
+    self.shoes_info.macAddress = [CacheTool getGameMac];
+//    self.shoes_info.viceMacAddress = @"";
+
+    //开启自动重连
+    [self newCentralManagerOrScan];
+
 }
 
+//返回趣动同时断开主副设备链接
 void disConnectBle (CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){
-    [instance disConnedctBle];
+    NSLog(@"趣动 通知断开蓝牙");
+    [instance disConnedctBle:0];
+    [instance disConnedctBle:1];
 }
 
-//趣动 ==>> 断开蓝牙
--(void)disConnedctBle{
-    NSLog(@"趣动 call 断开蓝牙");
-    [LEManager cancelPeripheralConnection];
+//趣动or点击游戏内断开按钮 ==>> 断开蓝牙
+-(void)disConnedctBle:(int)type{
+    
+    //是点击button主动断开
+    if (type == 0){
+        
+        self.shoes_info.macAddress = @"";
+
+    }else if (type == 1){
+        
+        self.shoes_info.viceMacAddress = @"";
+
+    }
+    
+    [LEManager cancelPeripheralConnection:type];
+    
 }
+
 //趣动 ==>> 通知邀请好友
 void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){
         
@@ -172,14 +205,13 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
   
     //主副设备:deviceType  游戏种类:game_type  mac地址:macAddress
     self.game_info.deviceType = DEVICETYPE_MAIN;
-    self.game_info.game_type = (GAME_TYPE)[[MYFactoryManager getGameType] intValue];
-    self.shoes_info.macAddress = [MYFactoryManager getGameMac];
+    self.game_info.game_type = (GAME_TYPE)[[CacheTool getGameType] intValue];
+    //重置mac
+    self.shoes_info.macAddress = [CacheTool getGameMac];
+    self.shoes_info.viceMacAddress = @"";
     
     //链接蓝牙
-    [self initCBCentralManager];
-    
-    //链接动画
-    [[AnimationView shanreAnimationView] addAnimation];
+    [self newCentralManagerOrScan];
     
 }
 
@@ -187,48 +219,65 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 -(void)searchBLEAction:(int)type{
     
     //初始化蓝牙CBCentralManager
-    [self initCBCentralManager];
+    [self newCentralManagerOrScan];
 
     //搜索蓝牙外设弹窗
-    self.searchDeviceVC = [SearchDeviceViewController  new];
+    if (self.searchDeviceVC!=nil) {
+        self.searchDeviceVC=nil;
+    }
+    self.searchDeviceVC = [SearchDeviceViewController new];
     [[UIApplication sharedApplication].keyWindow addSubview:self.searchDeviceVC.view];
+    
+    self.isPopUp = YES;
 
     //点击searchVC的tableViewCell链接选中的蓝牙
     __weak __typeof(self)weakself = self;
     self.searchDeviceVC.connectDeviceBlock = ^(CBPeripheral * peripheral){
         //主副设备:deviceType  游戏种类:game_type  mac地址:macAddress
-        weakself.game_info.game_type = (GAME_TYPE)[[MYFactoryManager getGameType] intValue];
+        weakself.game_info.game_type = (GAME_TYPE)[[CacheTool getGameType] intValue];
         weakself.game_info.deviceType = (DEVICE_TYPE)type;
-        weakself.shoes_info.macAddress = peripheral.identifier.UUIDString;
-        [weakself connectPeripheral:peripheral];
-        //链接动画
-        [[AnimationView shanreAnimationView] addAnimation];
+        if (type == 0) {
+            weakself.shoes_info.macAddress = peripheral.identifier.UUIDString;
+        }else if (type ==1){
+            weakself.shoes_info.viceMacAddress = peripheral.identifier.UUIDString;
+        }
+        [weakself connectBLEManagerData:peripheral];
+    };
+    
+    self.searchDeviceVC.closeBlock = ^{
+        weakself.isPopUp = NO;
     };
     
 }
 
 //每重新开始一局游戏
 -(void)gameStartInitData{
-    
-    //当局游戏时间
+        
+    //当局游戏持续时间
     self.game_info.firstTime = [NSDate date];
 
     //游戏模式 ==>> 回调剑波sdk数据
     self.shoes_info.gameModel = YES;
+    
     //读写到特征后 添加测试弹窗
     dispatch_async(dispatch_get_main_queue(), ^{
-        [DebugViewInstance initTestLabel];
+        [DebugViewInstance notificationStartGame];
     });
     
 }
 
 //每结束一局游戏
 -(void)gameEndInitData{
-//    self.shoes_info.gameModel = NO;
+    self.shoes_info.gameModel = NO;
     //jb
+#if DEBUG
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(),^{
         [DebugViewInstance uploadpPlistFile];
     });
+#endif
+    
+//#if
+ 
 }
 
 //监听通知震动
@@ -238,17 +287,17 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 
 
 #pragma mark ===============================================>> leon Ble manager
-//测试自己封装的蓝牙类
--(void)initCBCentralManager{
+//自己封装的蓝牙类
+-(void)newCentralManagerOrScan{
     
     if (LEManager.centralManager == nil && LEManager.peripheral == nil && LEManager.vicePeripheral == nil){
-        [LEManager initCBCentralManager];
         NSLog(@" ====================>> 未初始化 centralManager 直接开始初始化");
+        [LEManager initCBCentralManager];
     }else{
-        [LEManager scanForPeripheralsWithServices:nil options:nil];
-        NSLog(@" ====================>> 已初始化 centralManager 直接开扫描");
+        [self ifHasLinks];
     }
     
+    //每次 initCBCentralManager 走以下回调
     LEManager.stateUpdateBlock = ^(CBCentralManager *  central){
         switch(central.state){
             case 0:
@@ -266,7 +315,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
             case 4:{
                 NSLog(@"当前的蓝牙状态 ===>> 蓝牙已关闭");
                 if (LEManager.peripheral!=nil){
-                    [self.sdk bridgingDeviceAction:DEVICETYPE_MAIN
+                    [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_MAIN
                                                 name:LEManager.peripheral.name
                                              address:LEManager.peripheral.identifier.UUIDString
                                               status:CONNECT_LOST
@@ -274,7 +323,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
                 }
                 
                 if (LEManager.vicePeripheral!=nil){
-                    [self.sdk bridgingDeviceAction:DEVICETYPE_VICE
+                    [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_VICE
                                                 name:LEManager.vicePeripheral.name
                                              address:LEManager.vicePeripheral.identifier.UUIDString
                                               status:CONNECT_LOST
@@ -285,7 +334,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
                 break;
             case 5:{
                 NSLog(@"当前的蓝牙状态 ===>> 蓝牙已开启");//蓝牙已开启
-                [LEManager scanForPeripheralsWithServices:nil options:nil];
+                [self ifHasLinks];
             }
                 break;
             default:
@@ -295,6 +344,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     };
     
     [self.deviceArray removeAllObjects];
+    
     //发现蓝牙
     LEManager.discoverPeripheralBlock = ^(CBCentralManager * _Nonnull central, CBPeripheral * _Nonnull peripheral, NSDictionary * _Nonnull advertisementData, NSNumber * _Nonnull RSSI){
         //        NSLog(@"扫描发现蓝牙设备advertisementData =  %@",advertisementData);
@@ -303,15 +353,15 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
                 peripheral.advertiseName = advertiseName;
 
                 if ([advertiseName hasPrefix:@"SH_"]){//SH_DANCE BLE_LOOP  Shoes_4530 Shoes_2A74
-                    
+
 //                    NSLog(@"主设备扫描发现有效的蓝牙设备 =============== %@   identifier == %@",peripheral.name,peripheral.identifier.UUIDString);
 
                     if (self.deviceArray.count == 0){//数据源为0
                             [self.deviceArray addObject:peripheral];
                             //判断扫描到外设之后是否要链接蓝牙
-                            [self ifAppJumpWithIdentifier:peripheral];
+                            [self judgeConnect:peripheral];
                     }else{
-                        
+
                             BOOL isExist = NO;
                             for (int i = 0; i < self.deviceArray.count; i++){
                                 CBPeripheral *per = [self.deviceArray objectAtIndex:i];
@@ -323,75 +373,129 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
                             if (!isExist){
                                 [self.self.deviceArray addObject:peripheral];
                                 //判断扫描到外设之后是否要链接蓝牙
-                                [self ifAppJumpWithIdentifier:peripheral];
+                                [self judgeConnect:peripheral];
                             }
                     }
-                                        
+
                     //数据回调给 搜索蓝牙弹窗
                     self.searchDeviceVC.deviceArray = self.deviceArray;
                     [self.searchDeviceVC reloadData];
 
             }
-        
+
      };
 
 }
 
 #pragma mark ===============================================>>  主设备蓝牙数据
-//是否是app跳转传参 区分app跳转和弹窗搜索 type=0的时候才会执行该方法 type=0的时候才会执行该方法 当时弹框的时候type==1 不执行该方法
--(void)ifAppJumpWithIdentifier:(CBPeripheral*)peripheral{
+//扫描还是直链
+-(void)ifHasLinks{
     
-//    NSLog(@"self.shoes_info.macAddress = %@  peripheral.identifier.UUIDString = %@",self.shoes_info.macAddress,peripheral.identifier.UUIDString);
-    if (self.shoes_info.macAddress!=nil && [peripheral.identifier.UUIDString isEqualToString:self.shoes_info.macAddress]){//app跳转过来 主动链接蓝牙
-        [self connectPeripheral:peripheral];
-    }
+    [LEManager stopScan];
     
-}
+//    //已经被系统或者其他APP连接上的设备数组
+//    NSArray *arr = [LEManager.centralManager retrieveConnectedPeripheralsWithServices:@[[CBUUID UUIDWithString:@"6E400001-B5A3-F393-E0A9-E50E24DCCA9E"]]];
+//
+//    if (arr.count>0) {//已经链了一双鞋子了
+//
+//        NSLog(@" ====================>> 已初始化 centralManager 有已经链接的鞋子");
+//        //UUID是外设的服务UUID,满足UUID 的外设就会放在数组中
+//        [arr enumerateObjectsUsingBlock:^(CBPeripheral *peripheral, NSUInteger idx, BOOL *stop){
+//
+//            if ([peripheral.name hasPrefix:@"SH_"]){//SH_DANCE BLE_LOOP  Shoes_4530 Shoes_2A74
+//
+//              NSLog(@"主设备 已经链接到的 蓝牙设备 =============== %@   identifier == %@",peripheral.name,peripheral.identifier.UUIDString);
+//
+//                LEManager.peripheral = peripheral;
+//
+//                [self connectPeripheral:LEManager.peripheral];
+//
+//            }
+//
+//        }];
+//
+//    }else{
 
-#pragma mark ===============================================>> public 链接蓝牙
-//app跳转或选中tableview 链接蓝牙
--(void)connectPeripheral:(CBPeripheral*)peripheral{
-    
-    if(instance!=NULL && peripheral!=NULL){
-       
-        NSLog(@"BTDataProcess connectPeripheral self.game_info.deviceType ==>> %ld  self.game_info.game_type ==>> %d   mac ==>>  %@",(long)self.game_info.deviceType,self.game_info.game_type,self.shoes_info.macAddress);
+        NSLog(@" ====================>> 已初始化 centralManager 直接开扫描");
+        [LEManager scanForPeripheralsWithServices:nil options:nil];
         
-        //蓝牙数据经过sdk数据转换后 ios call unity
-        self.sdk = [IOSPlatformSDK sharedInstance];
+//    }
+    
+}
 
-        //建立socket链接
-        SocketRocketUtility * install = [SocketRocketUtility sharedInstance];
-        [install SRWebSocketOpen];
-        
-        //初始化实时时间戳
-        DebugViewInstance.currentTS = -1;
-        
-        //初始化运轨sdk
-        if (self.game_info.deviceType==DEVICETYPE_MAIN){
-            LEManager.peripheral = peripheral;
-            game = new Game(self.game_info.game_type);
-        }else if (self.game_info.deviceType == DEVICETYPE_VICE){
-            LEManager.vicePeripheral = peripheral;
-            viceDeviceGame = new Game(self.game_info.game_type);
-        }
-        
-        //根据ios_sdk传入deviceType 链接 主/副 设备
-        [self connectBLEManagerData:peripheral deviceType:self.game_info.deviceType];
+//app跳转 断线重连 从后台返回
+-(void)judgeConnect:(CBPeripheral*)peripheral{
     
+//    NSLog(@"self.shoes_info.macAddress = %@  peripheral.identifier.UUIDString = %@",self.shoes_info.macAddress,peripheral.identifier.UUIDString);
+    if (self.shoes_info.macAddress.length>12 && [peripheral.identifier.UUIDString isEqualToString:self.shoes_info.macAddress]){
+        self.game_info.deviceType = DEVICETYPE_MAIN;
+        [self connectBLEManagerData:peripheral];
     }
     
+    if (self.shoes_info.viceMacAddress.length>12 && [peripheral.identifier.UUIDString isEqualToString:self.shoes_info.viceMacAddress]){
+        self.game_info.deviceType = DEVICETYPE_VICE;
+        [self connectBLEManagerData:peripheral];
+    }//
+    
 }
 
-//链接主副设备 + 绑定特征
--(void)connectBLEManagerData:(CBPeripheral*)peripheral deviceType:(DEVICE_TYPE)deviceType{
+#pragma mark ===============================================>> public 链接蓝牙
+//搜索弹窗 点击
+//链接蓝牙
+-(void)connectBLEManagerData:(CBPeripheral*)peripheral{
     
+    NSLog(@"peripheral.name ==>>  %@",peripheral.name);
+    
+    if(instance == NULL || peripheral == NULL){return;}
+   
+    NSLog(@"BTDataProcess connectPeripheral self.game_info.deviceType ==>> %ld  self.game_info.game_type ==>> %d   mac ==>>  %@",(long)self.game_info.deviceType,self.game_info.game_type,self.shoes_info.macAddress);
+                    
+    //初始化运轨sdk
+    if (self.game_info.deviceType==DEVICETYPE_MAIN){
+        
+        LEManager.peripheral = peripheral;
+        game = new Game(self.game_info.game_type);
+        //开始链接动画
+        [[MainLoadingView shanreAnimationView] addAnimation];
+        
+    }else if (self.game_info.deviceType == DEVICETYPE_VICE){
         
+        LEManager.vicePeripheral = peripheral;
+        viceDeviceGame = new Game(self.game_info.game_type);
+        //开始链接动画
+        [[ViceLoadingView shanreAnimationView] addAnimation];
+
+    }
+            
     //链接蓝牙 此时 LEManager.peripheral || LEManager.vicePeripheral 还未init
     [LEManager connectPeripheral:peripheral options:nil];
     
     //蓝牙连接成功
     LEManager.successfulBlock = ^(CBPeripheral * _Nonnull peripheral){
-        NSLog(@"蓝牙链接成功");
+        
+        if (self.shoes_info.macAddress.length>12 && self.shoes_info.viceMacAddress.length == 0){//有主没副
+            
+            if (LEManager.peripheral.state == CBPeripheralStateConnected){//主设备已经连接上后 停止扫描
+                NSLog(@"主设备蓝牙链接成功");
+                [LEManager stopScan];
+            }
+            
+        }else if(self.shoes_info.macAddress.length == 0 && self.shoes_info.viceMacAddress.length >12){//没主有副
+            
+            if (LEManager.vicePeripheral.state == CBPeripheralStateConnected){//副设备已经连接上后 停止扫描
+                NSLog(@"副设备蓝牙链接成功");
+                [LEManager stopScan];
+            }
+            
+        }else if(self.shoes_info.macAddress.length>12 && self.shoes_info.viceMacAddress.length > 12){//有主有副
+            
+            if (LEManager.peripheral.state == CBPeripheralStateConnected && LEManager.vicePeripheral.state == CBPeripheralStateConnected){//主和副设备都已经连接上后 停止扫描
+                NSLog(@"主设备 和 副设备 蓝牙链接成功");
+                [LEManager stopScan];
+            }
+            
+        }
+        
     };
 
     //蓝牙连接失败
@@ -401,38 +505,59 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 
     //蓝牙连接丢失
     LEManager.disConnectBlock = ^(CBPeripheral * _Nonnull peripheral, NSError * _Nonnull error){
-        NSLog(@"蓝牙链接丢失");
-        if (LEManager.peripheral!=nil&&peripheral == LEManager.peripheral){
-            [self.sdk bridgingDeviceAction:DEVICETYPE_MAIN
+              
+        if (LEManager.peripheral!=nil && peripheral==LEManager.peripheral){
+            [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_MAIN
                                         name:LEManager.peripheral.name
                                      address:LEManager.peripheral.identifier.UUIDString
                                       status:CONNECT_LOST
                                  electricity:0];
+            
+                if (self.shoes_info.macAddress.length>12){
+                    NSLog(@"主设备 蓝牙链接断开 被动断开 需要重连");
+                    [self newCentralManagerOrScan];
+                }else{
+                    NSLog(@"主设备 蓝牙链接断开 主动断开 不需重连");
+                }
+            
         }
         
-        if (LEManager.vicePeripheral!=nil&&peripheral == LEManager.vicePeripheral){
-            [self.sdk bridgingDeviceAction:DEVICETYPE_VICE
+        if (LEManager.vicePeripheral!=nil && peripheral==LEManager.vicePeripheral){
+            [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_VICE
                                         name:LEManager.vicePeripheral.name
                                      address:LEManager.vicePeripheral.identifier.UUIDString
                                       status:CONNECT_LOST
                                  electricity:0];
-        }
-        //断线重连
-        [self initCBCentralManager];
+            
+                //副设备 断线 手动断开的话不用重连,自动断开的要重连
+                if (self.shoes_info.viceMacAddress.length>12){
+                    NSLog(@"副设备 蓝牙链接断开 被动断开 需要重连");
+                    [self newCentralManagerOrScan];
+                }else{
+                    NSLog(@"副设备 蓝牙链接断开 主动断开 不需重连");
+                }
+            
+          }
+     
     };
     
     //发现服务和特征
     LEManager.discoverCharacteristicsBlock = ^(CBPeripheral * _Nonnull peripheral, CBService * _Nonnull service, NSArray * _Nonnull characteristics, NSError * _Nonnull error){
         
-        if (peripheral==LEManager.peripheral&&deviceType==DEVICETYPE_MAIN){//主设备
+        if (peripheral==LEManager.peripheral){//主设备
             
             for (CBCharacteristic * cha in service.characteristics){
                 
                 if (cha.properties == 12){//写
                     
                     LEManager.write = cha;
-                    [self initGameAction:deviceType];
+                    //获取到写的特征后才能向 主设备 蓝牙对象写入数据
+                    [self startGameModeAndQueryDevideInfo];
+                    //链接成功震动一次
+                    [BTDataSendInstance vibration:DEVICETYPE_MAIN duration:400];
 
+                    [self initTimer];
+                    
                 }else if (cha.properties == 16){//读
                     
                     LEManager.read  = cha;
@@ -443,14 +568,17 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 
             }
 
-        }else if (peripheral==LEManager.vicePeripheral&&deviceType==DEVICETYPE_VICE){//副设备
+        }else if (peripheral==LEManager.vicePeripheral){//副设备
 
             for (CBCharacteristic * cha in service.characteristics){
                 
                 if (cha.properties == 12){//写
 
                     LEManager.viceWrite = cha;
-                    [self initGameAction:deviceType];
+                    //获取到写的特征后才能向 副设备 蓝牙对象写入数据
+                    [self startGameModeAndQueryDevideInfo];
+                    //链接成功震动一次
+                    [BTDataSendInstance vibration:DEVICETYPE_VICE duration:400];
 
                 }else if (cha.properties == 16){//读
 
@@ -464,11 +592,11 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     };
     
     //读取特征的报文数据
-    LEManager.readValueForCharacteristicBlock = ^(CBPeripheral * _Nonnull peripheral, CBCharacteristic * _Nonnull characteristic, NSData * _Nonnull value, NSError * _Nonnull error, DEVICE_TYPE type){
-        //            NSLog(@"characteristic.UUID.UUIDString = %@",characteristic.UUID.UUIDString);
-//        NSLog(@"characteristic.value = %@",characteristic.value);
+    LEManager.readValueForCharacteristicBlock = ^(CBPeripheral * _Nonnull peripheral, CBCharacteristic * _Nonnull characteristic, NSData * _Nonnull value, NSError * _Nonnull error){
+//        NSLog(@"characteristic.value = %@ characteristic.UUID.UUIDString = %@",characteristic.value,characteristic.UUID.UUIDString);
 
-        if ([characteristic.UUID.UUIDString isEqualToString:@"6E400003-B5A3-F393-E0A9-E50E24DCCA9E"]){//判断是不是我们设备的特征值
+        if ([characteristic.UUID.UUIDString isEqualToString:@"6E400003-B5A3-F393-E0A9-E50E24DCCA9E"]){//判断是不是我们设备
+            
             //每收到数据包读取一次蓝牙RSSI 无论1秒内请求多少次rssi值,原生api每秒都最多返回一次RSSI
             [peripheral readRSSI];
             
@@ -476,39 +604,34 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
             if ([AlgorithmTool verificationRusult:characteristic.value]==YES){
                 
                 int dataType = [AlgorithmTool dataToChar:[characteristic.value subdataWithRange:NSMakeRange(3, 1)]];//cmd类型
-//                char dataType_char = [AlgorithmTool dataToChar:[characteristic.value subdataWithRange:NSMakeRange(3, 1)]];//cmd类型
                 
                   if (dataType == 4){//鞋子游戏数据
                       
-                          if (characteristic.value.length < 64){
-                              return;
-                          }
-                      
-                          //成功打开游戏模式 隐藏加载框
-                          [[AnimationView shanreAnimationView] stopAnimation];
+                          if (characteristic.value.length < 64){ return; }
 
                           //数据丢给算法计算轨迹
-                          if (type == DEVICETYPE_MAIN&&LEManager.main_read == 0){
+                          if (peripheral==LEManager.peripheral&&LEManager.main_read == 0){
+                              
 //                              NSLog(@"LEManager.main_read = %d",LEManager.main_read);
 //                              NSLog(@"主设备 读取特征的报文 游戏数据 %ld dataType = %d %@",(long)type,dataType,characteristic.value);
+                              [[MainLoadingView shanreAnimationView] stopAnimation];
                               LEManager.main_read = 1;
                               [self shoseSDK:characteristic.value];
-                          }else if (type == DEVICETYPE_VICE&&LEManager.vice_read == 0){
-//                              NSLog(@"LEManager.vice_read = %d",LEManager.main_read);
-//                              NSLog(@"副设备 读取特征的报文 游戏数据 %ld dataType = %d %@",(long)type,dataType,characteristic.value);
+                              
+                          }else if (peripheral==LEManager.vicePeripheral&&LEManager.vice_read == 0){
+
+                              [[ViceLoadingView shanreAnimationView] stopAnimation];
                               LEManager.vice_read = 1;
                               [self viceShoseSDK:characteristic.value];
+                              
                           }
                       
                   }else if(dataType == -95){//鞋子状态信息
                       
-                          if (characteristic.value.length<30){
-                              return;
-                          }
-                      
+                          if (characteristic.value.length<30){ return; }
                           //嵌入式原始数据解析 --->> 回调蓝牙状态/电量给unity
                           BTDataAnalysis * anly = [BTDataAnalysis new];
-                          [anly analysisCharacteristic:characteristic.value deviceType:type];
+                          [anly analysisCharacteristic:characteristic.value peripheral:peripheral];
                       
                   }
                       
@@ -518,46 +641,39 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
         
     };
 
-    //写入数据的回调 暂时用不到
-    LEManager.writeToCharacteristicBlock = ^(CBPeripheral * _Nonnull peripheral,CBCharacteristic * _Nonnull characteristic, NSError * _Nonnull error, DEVICE_TYPE type){
-    };
-    
     //蓝牙更新RSSI
     LEManager.rssiBlock = ^(NSNumber * _Nonnull RSSI){
         LEManager.RSSI = RSSI;
-//        NSLog(@"self.RSSI  = %@",self.RSSI);
     };
     
-
 }
 
 #pragma mark ===============================================>> 读取特征后 鞋子打开游戏模式 & 激光开关 &查询鞋子蓝牙状态 & 主设备初始化缓存游戏步数
--(void)initGameAction:(DEVICE_TYPE)deviceType{
-    
-    //开启游戏模式&查询设备信息 初始化步数数据 (防止读取到的读写为空 延迟2s)
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(),^{
-        [self timingDataTransmission:@"dispatch_after"];
-    });
-    
+//init定时器
+-(void)initTimer{
     //定时开启游戏模式 & 查询设备信息 & 开启激光检测下蹲
     if (self.timer!=nil){
         [self.timer invalidate];
         self.timer = nil;
     }
-    self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(timingDataTransmission:) userInfo:nil repeats:YES];
+    self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(startGameModeAndQueryDevideInfo) userInfo:nil repeats:YES];
     [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
-
 }
 
 //定时发送数据
--(void)timingDataTransmission:(NSString*)style{
+-(void)startGameModeAndQueryDevideInfo{
     
-    if (self.game_info.isBackGround){//程序在后台
-    }else{//程序在前台
-        [BTDataSendInstance startGameModel];
-    }
-    [BTDataSendInstance queryDevideInfo];
+    //开启游戏模式&查询设备信息 初始化步数数据 (防止读取到的读写为空 延迟0.5s)
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(),^{
+        if (self.game_info.isBackGround){//程序在后台
+        }else{//程序在前台
+            [BTDataSendInstance startGameModel];
+            [BTDataSendInstance queryDevideInfo];
+            [BTDataSendInstance keepConnect];
 
+        }
+    });
+    
 }
 
 #pragma mark ===============================================>> 主设备 报文数据解析后 -- 调用蓝牙鞋子SDK装换数据 -- ios call unity 更新游戏动作
@@ -577,7 +693,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
             [DebugViewInstance debugMessage:message shoesInfo:self.shoes_info];
             
             /******************左右脚动作数据处理 + 回调*****************/
-            int length = 4;
+            int length = 10;
             int result[length];
             game->getGameResult(result);
         //   NSLog(@"result == %d %d %d %d \n",result[0],result[1],result[2],result[3]);
@@ -586,10 +702,10 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
             int motionJump = result[2];//jump
             int motionDown = result[3];//down
             
-            //无效动作
-            if (motionLeft==-1 && motionRight == -1&& motionJump == -1&& motionDown == -1){
-                return;
-            }else{
+//            //无效动作 过滤无效动作会导致步频加速无效
+//            if (motionLeft==-1 && motionRight == -1&& motionJump == -1&& motionDown == -1){
+//                return;
+//            }else{
                 
                 //跳跃和蹲下的动作 双脚是同步的
                 if (motionJump == MOTION_JUMP){
@@ -615,96 +731,101 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
                     
                 /******************鞋子动作状态数据 实时回调*****************/
                 //左右脚动作:所有游戏都需要回调
-                [self.sdk bridgingMotionAction:DEVICETYPE_MAIN left:motionLeft right:motionRight];
+                [[IOSPlatformSDK sharedInstance] bridgingMotionAction:DEVICETYPE_MAIN left:motionLeft right:motionRight];
                 
                 //步频状态:只有跑酷回调
                 if (self.game_info.game_type == GAME_TYPE_RUN){
-                    [self.sdk bridgingStepAction:DEVICETYPE_MAIN leftStatus:self.shoes_info.leftStepStatus rightStatus:self.shoes_info.rightStepStatus leftFrag:self.shoes_info.leftStepFreq rightFrag:self.shoes_info.rightStepFreq];
+                    [[IOSPlatformSDK sharedInstance] bridgingStepAction:DEVICETYPE_MAIN leftStatus:self.shoes_info.leftStepStatus rightStatus:self.shoes_info.rightStepStatus leftFrag:self.shoes_info.leftStepFreq rightFrag:self.shoes_info.rightStepFreq];
                 }
                 
-                //人物朝向 只有 三轮车 需要
-                if (self.game_info.game_type == GAME_TYPE_CYCLE){
-                        int attLength = 3;
-                        int left[attLength];
-                        int right[attLength];
-                         game->getFootAtt(left, right);
-                        self.nativeAttX = left[0];
-                        NSLog(@"self.nativeAttX = %d",self.nativeAttX);
-                }
+//                //人物朝向 只有 三轮车 需要
+//                if (self.game_info.game_type == GAME_TYPE_CYCLE){
+//                        int attLength = 3;
+//                        int left[attLength];
+//                        int right[attLength];
+//                         game->getFootAtt(left, right);
+//                        self.nativeAttX = left[0];
+//                        NSLog(@"self.nativeAttX = %d",self.nativeAttX);
+//                }
                 
-           }
+//           }
      
         }else{//当前是交互模式
-
-//            int interaction = game->getInteractionCMD();
-////            NSLog(@"主设备 当前的脚步交互动作 ===== >> %d",interaction);
-//            //游戏交互
-//            [self.sdk bridgingInteraction:DEVICETYPE_MAIN code:interaction];
-//            //自定义弹窗界面交互
-//            if (interaction!=-1){
-//                NSLog(@"BTDataProcess 有效交互动作 ===>> %d",interaction);
-////                [self.searchDeviceVC getInteraction:interaction];
-//            }else{
-//    //            NSLog(@"BTDataProcess 无效交互动作 ===>> %@",@"原地");
-//            }
+            
+            if (self.isPopUp == NO){
+                return;
+            }
+            
+            /********************初始化 运动轨迹算法 SDK *****************/
+            NSData * validData= [characteristic subdataWithRange:NSMakeRange(4, characteristic.length-4)];
+            Byte * buff = (Byte*)[validData bytes];
+            game->GameProcessBuf(buff, (int)validData.length);
+            
+            int interaction = game->getInteractionCMD();
+//            NSLog(@"主设备 当前的脚步交互动作 ===== >> %d",interaction);
+            //游戏交互
+//            [[IOSPlatformSDK sharedInstance] bridgingInteraction:DEVICETYPE_MAIN code:interaction];
+            //自定义弹窗界面交互
+            if (interaction!=-1){
+                NSLog(@"BTDataProcess 有效交互动作 ===>> %d",interaction);
+                [self.searchDeviceVC getInteraction:interaction];
+            }else{
+//                NSLog(@"BTDataProcess 无效交互动作 ===>> %@",@"原地");
+            }
+            
         }
     
 }
 
-
 #pragma mark ===============================================>>副设备 报文数据解析后 -- 调用蓝牙鞋子SDK装换数据 -- ios call unity 更新游戏动作
 -(void)viceShoseSDK:(NSData*)characteristic{
     
-    /********************初始化 运动轨迹算法 SDK *****************/
-    //游戏数据
-    NSData * validData= [characteristic subdataWithRange:NSMakeRange(4, characteristic.length-4)];
-    Byte * buff = (Byte*)[validData bytes];
-    viceDeviceGame->GameProcessBuf(buff, (int)validData.length);
-
-    int length = 4;
-    int result[length];
-    viceDeviceGame->getGameResult(result);
-    //   NSLog(@"result == %d %d %d %d \n",result[0],result[1],result[2],result[3]);
-
-    /********************蓝牙sdk返回的鞋子 状态 步频 步数*****************/
-    int leftStepStatus =  viceDeviceGame->getStepStatus(LEFT_FOOT);
-    int leftStepFreq =  viceDeviceGame->getStepFreq(LEFT_FOOT);
-    int leftStepCount =  viceDeviceGame->getStepCount(LEFT_FOOT);
-    int rightStepStatus =  viceDeviceGame->getStepStatus(RIGHT_FOOT);
-    int rightStepFreq =  viceDeviceGame->getStepFreq(RIGHT_FOOT);
-    int rightStepCount =  viceDeviceGame->getStepCount(RIGHT_FOOT);
-    
-    /********************蓝牙sdk返回的鞋子 动作*****************/
-    int motionLeft = result[0];//左脚的动作
-    int motionRight = result[1];//右脚的动作
-    int ivce_motionJump = result[2];//jump
-    int ivce_motionDown = result[3];//down
-    
-    if (motionLeft==-1 && motionRight == -1&& ivce_motionJump == -1&& ivce_motionDown == -1){//无效动作
-        return;
-    }else{
+    if (self.shoes_info.gameModel==YES){//当前是游戏模式
+        
+        /********************初始化 运动轨迹算法 SDK *****************/
+        //游戏数据
+        NSData * validData= [characteristic subdataWithRange:NSMakeRange(4, characteristic.length-4)];
+        Byte * buff = (Byte*)[validData bytes];
+        viceDeviceGame->GameProcessBuf(buff, (int)validData.length);
+
+        int length = 10;
+        int result[length];
+        viceDeviceGame->getGameResult(result);
+
+        /********************蓝牙sdk返回的鞋子 状态 步频 步数*****************/
+        int leftStepStatus =  viceDeviceGame->getStepStatus(LEFT_FOOT);
+        int leftStepFreq =  viceDeviceGame->getStepFreq(LEFT_FOOT);
+        int leftStepCount =  viceDeviceGame->getStepCount(LEFT_FOOT);
+        int rightStepStatus =  viceDeviceGame->getStepStatus(RIGHT_FOOT);
+        int rightStepFreq =  viceDeviceGame->getStepFreq(RIGHT_FOOT);
+        int rightStepCount =  viceDeviceGame->getStepCount(RIGHT_FOOT);
+        
+        /********************蓝牙sdk返回的鞋子 动作*****************/
+        int motionLeft = result[0];//左脚的动作
+        int motionRight = result[1];//右脚的动作
+        int ivce_motionJump = result[2];//jump
+        int ivce_motionDown = result[3];//down
         
         //跳跃和蹲下的动作 双脚是同步的
         if (ivce_motionJump == MOTION_JUMP){
             motionLeft = ivce_motionJump;
             motionRight = ivce_motionJump;
-            NSLog(@"副设备 ======================================== 跳起来");
         }
         if (ivce_motionDown == MOTION_DOWN){
             motionLeft = ivce_motionDown;
             motionRight = ivce_motionDown;
-            NSLog(@"副设备 ========================================= 蹲下去");
         }
         
         //ios call unity
         if (self.game_info.game_type == GAME_TYPE_RUN){//跑酷才需要回调
-            [self.sdk bridgingStepAction:DEVICETYPE_VICE leftStatus:leftStepStatus rightStatus:rightStepStatus leftFrag:leftStepFreq rightFrag:rightStepFreq];//副设备左右脚速度 步频
+            [[IOSPlatformSDK sharedInstance] bridgingStepAction:DEVICETYPE_VICE leftStatus:leftStepStatus rightStatus:rightStepStatus leftFrag:leftStepFreq rightFrag:rightStepFreq];//副设备左右脚速度 步频
         }
         //ios call unity
-        [self.sdk bridgingMotionAction:DEVICETYPE_VICE left:motionLeft right:motionRight];//副设备左右脚动作
+        [[IOSPlatformSDK sharedInstance] bridgingMotionAction:DEVICETYPE_VICE left:motionLeft right:motionRight];//副设备左右脚动作
         
     }
-    
+
+            
 }
 
 #pragma mark ===============================================>> 懒加载 -- 蓝牙设备数据源
@@ -728,6 +849,8 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     int total_rock_count = game->getMotionCount(ROCK_COUNT) - self.game_info.rock;
 //    int total_trample_count = game->getMotionCount(ROCK_COUNT) - self.game_info.trample;
 
+//    NSLog(@"total_ = %d %d %d %d %d %d %d",total_step_count,total_jump_count,total_cro÷uch_count,total_tick_count,total_paper_count,total_scissors_count,total_rock_count);
+
     //缓存pilst文件
     NSMutableDictionary * motionCountObj = [NSMutableDictionary new];
     [motionCountObj setObject:[NSNumber numberWithInt:total_step_count] forKey:@"step"];

+ 3 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataSend.h

@@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)vibration:(DEVICE_TYPE)deviceType duration:(int)duration;
 //开启/关闭 激光模式
 - (void)laser:(int)state;
+
+-(void)keepConnect;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 36 - 7
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataSend.m

@@ -54,11 +54,11 @@ static BTDataSend* instance = nil;
 
     [writeData appendBytes:&bcc length:sizeof(bcc)];
 
-    if (LEManager.peripheral!=nil){
+    if (LEManager.peripheral!=nil&&LEManager.write!=nil){
         NSLog(@"发送的报文 主设备 查询设备信息 %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.write writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_MAIN];
     }
-    if (LEManager.vicePeripheral!=nil){
+    if (LEManager.vicePeripheral!=nil&&LEManager.viceWrite!=nil){
         NSLog(@"发送的报文 副设备 查询设备信息 %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.viceWrite writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_VICE];
     }
@@ -83,12 +83,12 @@ static BTDataSend* instance = nil;
     //传输数据 -->> NSData
     [writeData appendBytes:&bcc length:sizeof(bcc)];
 
-    if (LEManager.peripheral!=nil){
+    if (LEManager.peripheral!=nil&&LEManager.write!=nil){
         NSLog(@"发送的报文 主设备 开启游戏模式: %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.write writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_MAIN];
     }
     
-    if (LEManager.vicePeripheral!=nil){
+    if (LEManager.vicePeripheral!=nil&&LEManager.viceWrite!=nil){
         NSLog(@"发送的报文 副设备 开启游戏模式: %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.viceWrite writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_VICE];
     }
@@ -105,7 +105,7 @@ static BTDataSend* instance = nil;
      Byte lengthNegation = ~length;
      Byte cmd = 0xA4;
      //振动时间 2字节
-     short ms = 100;//400毫秒
+     short ms = 200;//400毫秒
      Byte mslow = (Byte) (0x00FF & ms);//定义第一个byte
      Byte mshigh = (Byte) (0x00FF & (ms>>8));//定义第二个byte
     //计算校验位
@@ -115,10 +115,10 @@ static BTDataSend* instance = nil;
      Byte newByte[] = {header,length,lengthNegation,cmd,mshigh,mslow,bcc};
      writeData = [[NSMutableData alloc] initWithBytes:newByte length:sizeof(newByte)];
 
-    if (deviceType==DEVICETYPE_MAIN){
+    if (deviceType==DEVICETYPE_MAIN&&LEManager.write!=nil){
         NSLog(@"发送的报文 主设备 设备震动 %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.write writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_MAIN];
-    }else if (deviceType == DEVICETYPE_VICE){
+    }else if (deviceType == DEVICETYPE_VICE&&LEManager.viceWrite!=nil){
         NSLog(@"发送的报文 副设备 设备震动 %@", writeData);
         [LEManager writeValue:writeData forCharacteristic:LEManager.viceWrite writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_VICE];
     }
@@ -160,4 +160,33 @@ static BTDataSend* instance = nil;
     
 }
 
+-(void)keepConnect{
+    
+    //头帧AA + 数据长度 + 长度取反 + cmd + 数据 + 校验
+    NSMutableData * writeData = [NSMutableData new];
+    
+    Byte header = 0xaa;
+    Byte length = 0x06;//长度A1->6  A2->5  A3->7
+    Byte lengthNegation = ~length;
+    Byte cmd = 0xB0;
+    Byte data = 0x01;
+
+    Byte byte[] = {header,length,lengthNegation,cmd,data};
+    writeData = [[NSMutableData alloc] initWithBytes:byte length:sizeof(byte)];
+//        [writeData appendData:msData];
+    Byte bcc = [AlgorithmTool byteSumBBC:writeData];
+
+    [writeData appendBytes:&bcc length:sizeof(bcc)];
+
+    if (LEManager.peripheral!=nil&&LEManager.write!=nil){
+        NSLog(@"发送的报文 主设备 保持链接 %@", writeData);
+        [LEManager writeValue:writeData forCharacteristic:LEManager.write writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_MAIN];
+    }
+    if (LEManager.vicePeripheral!=nil&&LEManager.viceWrite!=nil){
+        NSLog(@"发送的报文 副设备 保持链接 %@", writeData);
+        [LEManager writeValue:writeData forCharacteristic:LEManager.viceWrite writeType:CBCharacteristicWriteWithResponse deviceType:DEVICETYPE_VICE];
+    }
+    
+}
+
 @end

+ 2 - 2
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/LEONBLManager.h

@@ -42,7 +42,7 @@ typedef void(^LEDiscoveredServicesBlock)(CBPeripheral *peripheral, NSArray *serv
 typedef void(^LEDiscoverCharacteristicsBlock)(CBPeripheral *peripheral, CBService *service, NSArray *characteristics, NSError *error);
 
 /** 收到摸个特性中数据的回调 */
-typedef void(^LEReadValueForCharacteristicBlock)(CBPeripheral *peripheral,CBCharacteristic *characteristic, NSData *value, NSError *error,DEVICE_TYPE type);
+typedef void(^LEReadValueForCharacteristicBlock)(CBPeripheral *peripheral,CBCharacteristic *characteristic, NSData *value, NSError *error);
 
 /** 往特性中写入数据的回调 */
 typedef void(^LEWriteToCharacteristicBlock)(CBPeripheral *peripheral,CBCharacteristic *characteristic, NSError *error,DEVICE_TYPE type);
@@ -122,7 +122,7 @@ typedef void(^RSSIBlock)(NSNumber *RSSI);
  外部主动断开蓝牙链接
  @param peripheral 待断开的CBPeripheral对象
  */
-- (void)cancelPeripheralConnection;
+- (void)cancelPeripheralConnection:(int)type;
 
 #pragma mark -------------- public methon ==>> 外部 操作 CBPeripheral
 

+ 16 - 20
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/LEONBLManager.m

@@ -61,6 +61,7 @@ static LEONBLManager * instance;
 //    NSDictionary *options = @{CBCentralManagerOptionShowPowerAlertKey:@(YES)};
     NSDictionary *options = @{CBCentralManagerScanOptionAllowDuplicatesKey:@(YES)};
     self.centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue() options:options];
+    NSLog(@"LEONBLManager ===>> initCBCentralManager");
     
 }
 
@@ -84,12 +85,12 @@ static LEONBLManager * instance;
 }
  
 /**
- 外部主动断开蓝牙链接
+ 外部主动链接蓝牙
  @param peripheral 待链接的CBPeripheral对象
  @param options 一个可选的字典,指定连接行为选项
  */
 - (void)connectPeripheral:(CBPeripheral *)peripheral options:(nullable NSDictionary<NSString *, id> *)options{
-    
+   
     [self stopScan];
     
     if (peripheral==self.peripheral){
@@ -106,18 +107,17 @@ static LEONBLManager * instance;
  外部主动断开蓝牙链接
  @param peripheral 待断开的CBPeripheral对象
  */
-- (void)cancelPeripheralConnection{
+- (void)cancelPeripheralConnection:(int)type{
     
-    if (self.peripheral!=nil){
-        
+    if (self.peripheral!=nil&&type==0){
         [self.centralManager cancelPeripheralConnection:self.peripheral];
-        NSLog(@"主动断开蓝牙链接 = %@",self.peripheral.name);
+        NSLog(@"主设备 主动断开蓝牙链接 = %@",self.peripheral.name);
 //        self.peripheral = nil;
 
-    }else if (self.vicePeripheral!=nil){
+    }else if (self.vicePeripheral!=nil&&type==1){
         
         [self.centralManager cancelPeripheralConnection:self.vicePeripheral];
-        NSLog(@"主动断开蓝牙链接 = %@",self.vicePeripheral.name);
+        NSLog(@"副设备 主动断开蓝牙链接 = %@",self.vicePeripheral.name);
 //        self.vicePeripheral = nil;
 
     }
@@ -207,7 +207,7 @@ static LEONBLManager * instance;
     
 }
 
-//丢失蓝牙链接
+//蓝牙链接断开
 - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(nullable NSError *)error{
     
     if (_disConnectBlock){
@@ -231,20 +231,16 @@ static LEONBLManager * instance;
     }
     
     if (peripheral == self.peripheral){
-        
-        for (CBService * service in peripheral.services){
-                
-            NSLog(@"主设备发现 %@ 的服务值:%@ 开始查找它的特征",peripheral.name,service);
-
-        }
-        
+            NSLog(@"主设备发现 %@ 的服务值:%@ 开始查找它的特征",peripheral.name,peripheral.services);
     }else if (peripheral == self.vicePeripheral){
-        NSLog(@"副设备发现 %@ 的服务值:%@ 开始查找它的特征",peripheral.name,peripheral.services);
+           NSLog(@"副设备发现 %@ 的服务值:%@ 开始查找它的特征",peripheral.name,peripheral.services);
     }
     
     //扫描所有的特征
     for (CBService *service in peripheral.services){
-    [peripheral discoverCharacteristics:nil forService:service];
+//        NSLog(@"扫描所有的特征 %@",service);
+//        peripheral.delegate = self;
+        [peripheral discoverCharacteristics:nil forService:service];
     }
     
 }
@@ -315,7 +311,7 @@ static LEONBLManager * instance;
 
             }
             
-            _readValueForCharacteristicBlock(weakself.peripheral,characteristic,data,error,DEVICETYPE_MAIN);
+            _readValueForCharacteristicBlock(weakself.peripheral,characteristic,data,error);
 //            NSLog(@"收到主设备 %@ 推送的报文 %@",peripheral.name,data);
            
         }else if (peripheral == weakself.vicePeripheral){
@@ -326,7 +322,7 @@ static LEONBLManager * instance;
                 weakself.vice_read = 0;
             }
             
-            _readValueForCharacteristicBlock(weakself.vicePeripheral,characteristic,data,error,DEVICETYPE_VICE);
+            _readValueForCharacteristicBlock(weakself.vicePeripheral,characteristic,data,error);
 //            NSLog(@"收到副设备 %@ 推送的报文 %@",peripheral.name,data);
 
         }

+ 2 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Entity /ShoesInfo.h

@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
 //趣动跳转过来携带的mac 实际是蓝牙设备的identity
 @property(strong,nonatomic)NSString * macAddress;
 
+@property(strong,nonatomic)NSString * viceMacAddress;
+
 //鞋子是否开启游戏模式
 @property(nonatomic,assign)BOOL gameModel;
 

+ 7 - 2
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/HTTP/HTTPDataProcession.h

@@ -15,8 +15,13 @@
 #define CFBundleVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
 #define OS @"2"
 
-//#define BASE_URL @"http://shoes-api.hiyd.com"//正式环境
-#define BASE_URL @"http://test-shoes-api.hiyd.com"//测试环境
+//api
+#ifdef DEBUG
+#define BASE_URL @"https://test-shoes-api.funfet.com"//测试环境
+#else
+#define BASE_URL @"https://shoes-api.funfet.com"//正式环境
+#endif
+
 #define GAME_INVITE [NSString stringWithFormat:@"%@%@?v=%@&os=%@",BASE_URL,@"/game/invite",CFBundleVersion,OS]
 #define GAME_RECORD [NSString stringWithFormat:@"%@%@?v=%@&os=%@",BASE_URL,@"/gameRecord/addGame",CFBundleVersion,OS]
 #define GAME_FRIENDS [NSString stringWithFormat:@"%@%@?v=%@&os=%@",BASE_URL,@"/forum/friends",CFBundleVersion,OS]

+ 12 - 12
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/HTTP/HTTPDataProcession.m

@@ -43,7 +43,7 @@
             // 网络请求完成之后就会执行,NSURLSession自动实现多线程
             successBlock(data);
             
-        } else {//
+        } else {
             // 网络访问失败
             for (NSString * key  in error.userInfo){
                 
@@ -144,7 +144,7 @@
     
     NSString *urlString =  [NSString stringWithFormat:@"%@&limit=%@&v=%@&os=%@",GAME_FRIENDS,@"1000",CFBundleVersion,OS];
 
-    [HTTPDataProcession getHTTPDataProcession:urlString token:[MYFactoryManager getToken]  success:^(id data){
+    [HTTPDataProcession getHTTPDataProcession:urlString token:[CacheTool getToken]  success:^(id data){
             // 网络访问成功
 //            NSLog(@"data=%@",[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
             NSError * error;
@@ -216,11 +216,11 @@
     
     NSString * invite_user_id = [NSString stringWithFormat:@"%d",friendid];
     NSString * invite = [NSString stringWithFormat:@"%s",info];
-    NSString *urlString = [NSString stringWithFormat:@"%@&invite_user_id=%@&invite=%@&game_id=%@",GAME_INVITE,invite_user_id,invite,[MYFactoryManager getGameId]];
+    NSString *urlString = [NSString stringWithFormat:@"%@&invite_user_id=%@&invite=%@&game_id=%@",GAME_INVITE,invite_user_id,invite,[CacheTool getGameId]];
     //    NSLog(@"InviteFriend ===>> token:%@  friendid:%d  info:%s",token,friendid,info);
     NSLog(@"InviteFriend urlString ===>> %@",urlString);
 
-    [HTTPDataProcession getHTTPDataProcession:urlString token:[MYFactoryManager getToken]  success:^(id data){
+    [HTTPDataProcession getHTTPDataProcession:urlString token:[CacheTool getToken]  success:^(id data){
         
             NSError * error;
             NSDictionary *dictionary =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
@@ -254,11 +254,11 @@
         scoreType = @"friend";
     }
     
-    NSString *urlString = [NSString stringWithFormat:@"%@&game_id=%@&scope=%@",GAME_RANK,[MYFactoryManager getGameId],scoreType];
+    NSString *urlString = [NSString stringWithFormat:@"%@&game_id=%@&scope=%@",GAME_RANK,[CacheTool getGameId],scoreType];
 
     NSLog(@"urlString == %@",urlString);
     
-    [HTTPDataProcession getHTTPDataProcession:urlString token:[MYFactoryManager getToken]  success:^(id data){
+    [HTTPDataProcession getHTTPDataProcession:urlString token:[CacheTool getToken]  success:^(id data){
 
             NSError * error;
             NSDictionary *dictionary =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
@@ -349,8 +349,8 @@
 */
 +(void)gameStart{
 
-    NSString *urlString = [NSString stringWithFormat:@"%@&id=%@",GAME_START,[MYFactoryManager getGameId]];
-    [HTTPDataProcession getHTTPDataProcession:urlString token:[MYFactoryManager getToken]  success:^(id data){
+    NSString *urlString = [NSString stringWithFormat:@"%@&id=%@",GAME_START,[CacheTool getGameId]];
+    [HTTPDataProcession getHTTPDataProcession:urlString token:[CacheTool getToken]  success:^(id data){
         
             NSError * error;
             NSDictionary *dictionary =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
@@ -382,8 +382,8 @@
 */
 +(void)gameEnd{
     
-    NSString *urlString = [NSString stringWithFormat:@"%@&id=%@",GAME_END,[MYFactoryManager getGameId]];
-    [HTTPDataProcession getHTTPDataProcession:urlString token:[MYFactoryManager getToken]  success:^(id data){
+    NSString *urlString = [NSString stringWithFormat:@"%@&id=%@",GAME_END,[CacheTool getGameId]];
+    [HTTPDataProcession getHTTPDataProcession:urlString token:[CacheTool getToken]  success:^(id data){
         
             NSError * error;
             NSDictionary *dictionary =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
@@ -421,7 +421,7 @@
     
     NSMutableDictionary * gameRecord = [NSMutableDictionary new];
     //缓存的token、game_id
-    NSString * game_id = [MYFactoryManager getGameId];
+    NSString * game_id = [CacheTool getGameId];
     [gameRecord setObject:game_id forKey:@"game_id"];//游戏类型
     //预留字段:默认
     [gameRecord setObject:@0 forKey:@"distance"];//废弃
@@ -443,7 +443,7 @@
     
     NSLog(@"gameRecord = %@",gameRecord);
 
-    [HTTPDataProcession postHTTPDataProcession:GAME_RECORD withParams:gameRecord  token:[MYFactoryManager getToken] success:^(id data){
+    [HTTPDataProcession postHTTPDataProcession:GAME_RECORD withParams:gameRecord  token:[CacheTool getToken] success:^(id data){
         NSError * error;
         NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
 

+ 8 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.h

@@ -110,6 +110,14 @@ extern void ConnectDevice(int type);
 }
 
 /**
+ * 链接设备
+ * type: 设备ID
+ */
+extern "C" {
+extern void DisConnectDevice(int type);
+}
+
+/**
  * 震动
  * type: 设备ID
  * duration: 时长 ms [100 .. 1000]

+ 12 - 8
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.mm

@@ -1,11 +1,9 @@
 //
 //  IOSPlatformSDK.m
 //  OYGameSKD
-//
 //  Created by leon on 2021/1/21.
 //  Copyright © 2021 Oujia. All rights reserved.
 
-
 #import "IOSPlatformSDK.h"
 #import "BugTool.h"
 
@@ -126,9 +124,10 @@ static IOSPlatformSDK * instance;
          return YES;
      }
     
+//    UIDevice
+    
 }
 
-//
 #pragma mark ============================>> ios call unity (数据处理后的回调)
 -(void)bridgingMotionAction:(int)cusid
                        left:(int)left
@@ -310,7 +309,9 @@ void SearchDevice(int type){
     if ([instance existUserInfo]==NO){
         return;
     }
+        
     [BTDataInstance searchBLEAction:type];
+    
 }
 
 /**
@@ -372,8 +373,8 @@ void GetUserFriends(){
      if ([instance existUserInfo]==NO){
          return MakeStringCopy("");
      }else{
-         const char * cuschart = [[MYFactoryManager getUserInfo] UTF8String];
-         NSLog(@"IOS_SKD 回调用户信息 GetUserInfoJson ===> %@",[MYFactoryManager getUserInfo]);
+         const char * cuschart = [[CacheTool getUserInfo] UTF8String];
+//         NSLog(@"IOS_SKD 回调用户信息 GetUserInfoJson ===> %@",[CacheTool getUserInfo]);
          //要先copy 不然c#调用free的时候回闪退
          return MakeStringCopy(cuschart);
      }
@@ -385,10 +386,13 @@ void GetUserFriends(){
 * type: 设备类型 0: 主, 1: 副
 */
 void DisConnectDevice(int type){
-    NSLog(@"Unity 请求断开蓝牙链接 disConnectDevice ===>>");
+    NSLog(@"Unity 请求断开蓝牙链接 disConnectDevice ===>> %d",type);
     if ([instance existUserInfo]==NO){
         return;
     }
+    
+    [BTDataInstance disConnedctBle:type];
+    
 }
 
 /**
@@ -420,9 +424,9 @@ void GetInviteInfo(){
         return;
     }
     //user字典 -> 字符串 -> Char
-    const char * userChar = [[MYFactoryManager getInviteUser] UTF8String];
+    const char * userChar = [[CacheTool getInviteUser] UTF8String];
     //info字符串 -> Char
-    const char * infoChar =[[MYFactoryManager getInviteInfo] UTF8String];
+    const char * infoChar =[[CacheTool getInviteInfo] UTF8String];
     NSLog(@"IOS_SKD 回调好友邀请信息 GetInviteInfo ===>>  %s , %s",userChar,infoChar);
     inviteFriendHandler(0,userChar,infoChar);
     

+ 1 - 3
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.m

@@ -178,9 +178,7 @@
     NSString *mainCallStackSymbolMsg = [AvoidCrash getMainCallStackSymbolMessageWithCallStackSymbols:callStackSymbolsArr];
     
     if (mainCallStackSymbolMsg == nil) {
-        
         mainCallStackSymbolMsg = @"崩溃方法定位失败,请您查看函数调用栈来排查错误原因";
-        
     }
     
     NSString *errorName = exception.name;
@@ -196,7 +194,6 @@
     logErrorMessage = [NSString stringWithFormat:@"%@\n\n%@\n\n",logErrorMessage,AvoidCrashSeparator];
     AvoidCrashLog(@"%@",logErrorMessage);
     
-    
     //请忽略下面的赋值,目的只是为了能顺利上传到cocoapods
     logErrorMessage = logErrorMessage;
     
@@ -213,6 +210,7 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         [[NSNotificationCenter defaultCenter] postNotificationName:AvoidCrashNotification object:nil userInfo:errorInfoDic];
     });
+    
 }
 
 

+ 1 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m

@@ -85,6 +85,7 @@
     @finally {
         return subString;
     }
+    
 }
 
 //=================================================================

+ 1 - 19
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/AlgorithmTool.m

@@ -202,24 +202,6 @@
     
 }
 
-////获取当前时间 (以毫秒为单位)
-////返回值格式:2019-04-19 10:33:35.886
-//- (NSString *)getNowTimeTimestamp{
-//
-//    NSDate *datenow = [NSDate date];//现在时间,你可以输出来看下是什么格式
-//
-//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-//
-//    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];
-//
-//    [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Beijing"]];
-//
-//    NSString *dateString      = [formatter stringFromDate: datenow];
-//
-//    NSLog(@"当前时间戳对应的时间是:%@",dateString);
-//
-//    return dateString;
-//
-//}
+
 
 @end

+ 40 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/BugTool.m

@@ -10,6 +10,46 @@
 #import <Bugly/Bugly.h>
 
 @implementation BugTool
+/***/
+//雨淋湿了天空 灰的很讲究 你说你不懂 为何在这时牵手
+//我晒干了沉默 毁的很冲动 就算这是做错 也只是怕错过
+//在一起叫梦 分开了叫痛 是不是说 没有做完的梦最痛 迷路的后果 我能承受
+//这最后的出口 在爱过了才有
+//能不能给我一首歌的时间 静静的把那拥抱变成永远 在我的怀里 不用害怕失眠 如果你想忘记 我也能适应
+//能不能给我一首歌的时间 吧故事听到最后再说再见 你送我的眼泪 让他留在雨天 越过你划得线 我定了勇气的终点
+//你说我不该不该不该在这时候说了我爱你 要怎么证明我没有说谎的力气  请告诉我。。 暂停算不算放弃 我只有那一天的回忆
+
+/***/
+//塞纳河畔 左岸的咖啡 我手一杯 品尝你的美 留下唇印的嘴
+//花店玫瑰 名字写错谁 告白气球 风吹到对街 微笑在天上飞
+//你说你有点难追 想让我知难而退 礼物不需调最贵 只要香榭的落叶
+//营造浪漫的约会 不害怕搞砸一切 拥有你就拥有 全世界
+//亲爱的 爱上你 从那天起 甜蜜的很轻易,亲爱的 别任性 你的眼睛 在说我愿意
+//亲爱的 爱上你 恋爱日记 飘香水的回忆,一整瓶 的梦境 全都有你 搅拌在一起
+
+/***/
+//最怕空气突然安静 最怕朋友突然的关心,最怕回忆 突然翻滚绞痛着不平息,最怕突然听到你的消息,
+//想念如果会有声音 不愿那是悲伤的哭泣,事到如今 终于让自己属于我自己,只剩眼泪还骗不过自己
+//突然好想你,你会在哪里,过得快乐或委屈,突然好想你,突然锋利的回忆,突然模糊的眼睛
+//我们是一首美丽的歌曲,变成两部悲伤的电影,为什么你,带我走过最难忘的旅行,然后留下最痛的纪念品
+//我们 那么甜 那么美 那么相信,那么疯 那么热烈的曾经,为何我们 还是要各自奔向各自的 幸福和遗憾中老去
+
+/***/
+//你爱热吻却永不爱人,练习为乐但是怕熟人,你爱路过去索取见闻,陌路人变得必有份好感
+//你热爱别离 再和再离 似花瓣献技 叫花粉遍地 嗷嗷,你在拨弄这穿线游戏 跟他结束 他与她再一起,你小心
+//一吻遍颠倒众生 一吻便救一个人 给你拯救的体温 总会再捐给某人
+//一吻便偷一个心 一吻便杀一个人 一寸敏感一寸金 一脸崎岖的旅行
+//哦 让半夜情人 延续吻别人 让你旧情人 又惠顾他人
+//
+//每晚大概有上亿个人 在地球上落力的亲吻 你那习惯散布给世人 在地球上惠泽遍及世人
+//你热爱别离 再和再离 似花瓣献技 叫花粉遍地 嗷嗷,你在拨弄这穿线游戏 跟他结束 他与她再一起,你小心
+//一吻遍颠倒众生 一吻便救一个人 给你拯救的体温 总会再捐给某人
+//一吻便偷一个心 一吻便杀一个人 一寸敏感一寸金 一脸崎岖的旅行
+
+//哦 你为何未曾尽兴 这塑胶的爱情 跳蚤的旅程 延展偷天盖地好本领 哦
+//这吊诡的爱情 播种的旅程 kiss
+//别了她 她吻他 他吻她吻他吻他延续愉快过程 你我他真高兴
+//下个她 她吻他 他吻她再亲你结束这旅程 多得你这煞星
 
 +(void)startAvoidBug{
     

+ 9 - 1
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/CacheTool.h

@@ -7,11 +7,19 @@
 
 #import <Foundation/Foundation.h>
 #import "GameInfo.h"
-
+#import "MYFactoryManager.h"
 
 @interface CacheTool : NSObject
 
 +(void)cacheGameInfoInfo:(GameInfo*)gameInfo;
 
++(NSString*)getUserInfo;
++(NSString*)getToken;
++(NSString*)getGameId;
++(NSString*)getGameType;
++(NSString*)getGameMac;
++(NSString*)getInviteUser;
++(NSString*)getInviteInfo;
+
 @end
 

+ 101 - 3
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/CacheTool.m

@@ -7,10 +7,13 @@
 
 #import "CacheTool.h"
 
+
 @implementation CacheTool
 #pragma mark ===============================================>>玩游戏过程中缓存 动作数据 和时间戳 数据存入plist
 +(void)cacheGameInfoInfo:(GameInfo*)gameInfo{
-
+ 
+        
+    
 //    //总数
 //    int total_step_count = game->getMotionCount(STEP_COUNT) - gameInfo.step;
 //    int total_jump_count = game->getMotionCount(JUMP_COUNT) - gameInfo.jump;
@@ -19,7 +22,7 @@
 //    int total_paper_count = game->getMotionCount(PAPER_COUNT) - gameInfo.paper;
 //    int total_scissors_count = game->getMotionCount(SCISSORS_COUNT) - gameInfo.scissors;
 //    int total_rock_count = game->getMotionCount(ROCK_COUNT) - gameInfo.rock;
-////    int total_trample_count = game->getMotionCount(ROCK_COUNT) - gameInfo.trample;
+//    int total_trample_count = game->getMotionCount(ROCK_COUNT) - gameInfo.trample;
 //
 //    //缓存pilst文件
 //    NSMutableDictionary * motionCountObj = [NSMutableDictionary new];
@@ -39,11 +42,106 @@
 //    [movements setObject:[NSNumber numberWithInt:durationTime] forKey:@"duration"];
 //
 //    NSDictionary * dict = [NSDictionary dictionaryWithDictionary:movements];
-//        
+//
 //    //归档缓存
 //    [IOS_NSUSERDEFAULT setObject:dict forKey:IOSSDK_MOTIONCOUNT];
 //    [IOS_NSUSERDEFAULT synchronize];
 //    
 }
 
+
+
+//获取getUserInfo
++(NSString*)getUserInfo{
+    NSDictionary * jsonDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSDictionary * user = jsonDict[@"user"];
+    if ([user isKindOfClass:[NSNull class]] || user == nil || [user isEqual:[NSNull null]]){
+        return @"";
+    }else{
+        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:user options:NSJSONWritingPrettyPrinted error:nil];
+        NSString * userJsonString =  [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+        return userJsonString;
+    }
+    
+}
+
+//获取token
++(NSString*)getToken{
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSString * token =  [urlDict objectForKey:@"token"];
+    if ([token isKindOfClass:[NSNull class]] || token == nil || [token isEqual:[NSNull null]]){
+//        [PopupView showCusHUDA:@"获取token失败,请从趣动启动"];
+        return @"";
+    }else{
+        return token;
+    }
+    
+}
+
+//获取缓存game_id
++(NSString*)getGameId{
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSString * game_id =  [urlDict objectForKey:@"game_id"];
+    if ([game_id isKindOfClass:[NSNull class]] || game_id == nil || [game_id isEqual:[NSNull null]]){
+//         [PopupView showCusHUDA:@"获取id失败,请从趣动启动"];
+        return @"";
+    }else{
+        return game_id;
+    }
+}
+
+//获取缓存game_type
++(NSString*)getGameType{
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSString * game_type =  [urlDict objectForKey:@"game_type"];
+    if ([game_type isKindOfClass:[NSNull class]] || game_type == nil || [game_type isEqual:[NSNull null]]){
+//         [PopupView showCusHUDA:@"获取type失败,请从趣动启动"];
+        return @"";
+    }else{
+        return game_type;
+    }
+}
+
+//获取缓存mac
++(NSString*)getGameMac{
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSString * mac =  [urlDict objectForKey:@"mac"];
+    if ([mac isKindOfClass:[NSNull class]] || mac == nil || [mac isEqual:[NSNull null]]){
+//         [PopupView showCusHUDA:@"获取mac失败,请从趣动启动"];
+        return @"";
+    }else{
+        return mac;
+    }
+}
+    
+//获取缓存邀请信息
++(NSString*)getInviteUser{
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSDictionary * invite = urlDict[@"invite"];
+    if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
+//         [PopupView showCusHUDA:@"获取getInviteUser失败,请从趣动启动"];
+        return @"";
+    }else{
+        //user字典 -> 字符串 -> Char
+        NSDictionary * user =  [invite objectForKey:@"user"];
+        NSData * userData = [NSJSONSerialization dataWithJSONObject:user options:NSJSONWritingPrettyPrinted error:nil];
+        NSString * userString =  [[NSString alloc] initWithData:userData encoding:NSUTF8StringEncoding];
+        return userString;
+    }
+        
+}
+
++(NSString*)getInviteInfo{
+    
+    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
+    NSDictionary * invite = urlDict[@"invite"];
+    if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
+//         [PopupView showCusHUDA:@"获取邀请信息失败,请从趣动启动"];
+        return @"";
+    }else{
+        NSString * info = [invite objectForKey:@"info"];
+        return info;
+    }
+ 
+}
 @end

+ 8 - 103
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.h

@@ -38,11 +38,13 @@
 
 //UI
 #import "SearchDeviceViewController.h"
-#import "AnimationView.h"
+#import "MainLoadingView.h"
+#import "ViceLoadingView.h"
 #import "PopupView.h"
 #import "NoDeviceTip.h"
 #import <AudioToolbox/AudioToolbox.h>
 #import "DebugView.h"
+#import "CacheTool.h"
 
 /*************************** 获取屏幕 宽度、高度 ***************************/
 #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
@@ -63,13 +65,13 @@
 #define IOSSDK_USERINFO @"iosSdk_userInfo"
 //缓存的步频数据
 #define IOSSDK_MOTIONCOUNT @"iosSdk_motionCount"
+//#define IOSSDK_GAMEID @"3"
+//#define IOSSDK_TOKEN @"shoes:61652aa99523f9.65681365I94"
 
 //custom System UserDefaults
 #define IOS_NSUSERDEFAULT [NSUserDefaults standardUserDefaults]
 #define CUS_NOTIFICATIONCENTER [NSNotificationCenter defaultCenter]
 
-//#define IOSSDK_GAMEID @"3"
-//#define IOSSDK_TOKEN @"shoes:61652aa99523f9.65681365I94"
 
 @interface MYFactoryManager : NSObject
 
@@ -82,108 +84,11 @@
 + (void)makeBoundsWithView:(UIView *)view color:(UIColor *)color width:(CGFloat)width;
 //圆角
 + (void)clipsToBoundsWithView:(UIView *)view Radius:(NSInteger)radius;
-/**高度自适应*/
-+ (CGFloat)heightForString:(NSString *)string fontSize:(CGFloat)fontSize andWidth:(CGFloat)width;
-/**宽度自适应*/
-+ (CGFloat)widthForString:(NSString *)string fontSize:(CGFloat)fontSize andHeight:(CGFloat)height;
+
 //正常加载还是打包后sdk加载
 +(UIImage*)imageString:(NSString*)imageName;
-//发送测试group通知
-+(void)postGroupCFNotificaiton:(NSString*)string;
-//开启后台任务保活
--(void)comeToBackgroundMode;
-
-+(NSString*)getUserInfo;
-+(NSString*)getToken;
-+(NSString*)getGameId;
-+(NSString*)getGameType;
-+(NSString*)getGameMac;
-+(NSString*)getInviteUser;
-+(NSString*)getInviteInfo;
-
-//#pragma mark -- 参数判断
-//+(BOOL)ifLoogIn:(BOOL)tip;
-//+(bool)internetStatus;
-//
-//#pragma mark -- 各类弹窗
-//+(void)popChooseSSIDListViewController;
-//
-//#pragma mark -- 授权
-//+(BOOL)authorizationCarmen;
-//
-//#pragma mark -- 正则
-////获取*****手机格式
-//+ (NSString *)getPhoneText:(NSString *)phoneNum;
-////手机格式
-//+ (BOOL)phoneNum:(NSString *) textString;
-////检测是否为邮箱
-//+ (BOOL)emailNum:(NSString *)emailStr;
-//
-//
-////字符串转字典与字典转字符串
-//+ (NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString;
-//+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
-//+ (NSString*)arrayToJson:(NSArray *)arr;
-//+ (NSArray *)parseJSONStringToNSArray:(NSString *)JSONString;
-//
-////时间计算
-//+ (NSString*)returnNowDateString;
-//+ (NSString*)returnNowTimeString;
-//+ (NSString *)getStartTimeDate:(NSNumber *)dateTime format:(NSString *)format;
-//+ (NSString *)returnUploadTime:(NSString *)timeStr;
-//+ (NSString *)getRealTime:(NSString *)dateTime format:(NSString *)format;
-//+ (NSString *)returnTimestamp:(NSString *)timeStr;
-//+ (void)countdownWith:(UIButton *)but;//倒计时
-//
-//#pragma mark -------------------------------------------------------------------------------------- 勒夫曼德
-////16位数字MD5加密
-//+ (NSString *)getMd5_16Bit_String:(NSString *)srcString;
-////将十六进制的字符串转换成NSString则可使用如下方式:
-//+ (NSString *)convertHexStrToString:(NSString *)str;
-////将NSString转换成十六进制的字符串则可使用如下方式:
-//+ (NSString *)convertStringToHexStr:(NSString *)str;
-////十六进制转换为二进制
-//+ (NSString *)convertDataToHexStr:(NSData *)data;
-////温度图文混排富文本
-//+(NSAttributedString*)labelAttribute:(NSString*)firstLabelText  secondLabelText:(NSString*)secondLabelText;
-////修改头部视图背景
-//+(NSString*)changePicturesAccordingToPeriods;
-////国际化地名简体转拼音
-//+ (NSString *)transform:(NSString *)chinese;
-////返回档位信息
-//+(NSString*)returnStallStr:(NSString*)command deviceinfo:(NSString*)deviceinfo;
-////返回天气图片
-//+(NSString*)returnWeatherImageStr:(NSString*)deviceInfo;
-////返回室外天气
-//+(NSString*)returnOutDoorAqi:(NSInteger)aqiValue;
-////验证报文
-//+(NSString*)authenticationMessage:(NSString*)MessageConent;
-////获取当前手机连接的wifi是否是luftmed-
-//+ (NSString*)getCurrentSSID;
-//+ (BOOL)ifConnetLuftmed;
-////获取UDID
-//+(NSString*)getUDIDString;
-////返回PM25污染度对应的文本
-//+(NSString*)getPM25ValueText:(NSString*)value;
-////返回PM25污染度对应的颜色
-//+(UIColor*)getPM25ValueColor:(NSString*)value;
-////返回PM25污染度对应角度
-//+(CGFloat)getPM25TotalAngle:(NSInteger)temp10;
-////返回TVOC污染度对应的文本
-//+(NSString*)getTVOCValueText:(NSString*)value;
-////返回TVOC污染度对应的颜色
-//+(UIColor*)getTVOCValueColor:(NSString*)value;
-////TVOC真实值
-//+(NSString*)returnRealTVOCValue:(NSString*)value;
-//
-//#pragma mark -------------------------------------------------------------------------------------- 车载相关
-////或异算法
-//+(NSString*)HardDriveVerificationAlgorithm:(NSString*)string_input;
-////字符串转16进制数据流 -- 用于蓝牙发送
-//+(NSData *)convertHexStrToData:(NSString *)str;
-////单个16进制字节-转换-》10进制
-//+(NSInteger)hexToInt:(NSString*)hex;
-//
+
+
 
 
 @end

+ 16 - 1325
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.m

@@ -7,8 +7,7 @@
 //
 
 #import "MYFactoryManager.h"
-#import <SystemConfiguration/CaptiveNetwork.h>//get ssid
-#import <CommonCrypto/CommonDigest.h>//get MD5
+
 
 @interface MYFactoryManager ()
 @end
@@ -49,34 +48,6 @@ static MYFactoryManager * instance;
     view.layer.masksToBounds = YES;
 }
 
-//计算高度
-+ (CGFloat)heightForString:(NSString *)string fontSize:(CGFloat)fontSize andWidth:(CGFloat)width{
-    
-    if (string != nil&&![string isKindOfClass:[NSNull class]]){
-        
-        CGRect rect = [string boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]} context:nil];
-        return rect.size.height;
-        
-    }else{
-        
-        return 20;
-        
-    }
-
-}
-
-//计算文本宽度
-+ (CGFloat)widthForString:(NSString *)string fontSize:(CGFloat)fontSize andHeight:(CGFloat)height{
-    
-    if (string != nil&&![string isKindOfClass:[NSNull class]]){
-        
-        CGRect rect = [string boundingRectWithSize:CGSizeMake(MAXFLOAT, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]} context:nil];
-        return rect.size.width;
-
-    }else{
-        return 50;
-    }
-}
 
 //正常加载还是打包后sdk加载
 +(UIImage*)imageString:(NSString*)imageName{
@@ -95,1304 +66,24 @@ static MYFactoryManager * instance;
     
 }
 
-#pragma mark ------  发送app group通知
-+ (void)postGroupCFNotificaiton:(NSString*)string{
-    
-    NSString * notificaitonName = @"OPEN_NOTIFICATION";
-    CFStringRef strRef = (__bridge CFStringRef)notificaitonName;
-    CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter ();
-    //第一种生成参数方法 测试无效
-//    NSDictionary * ocDict = @{@"key":@"123"};
-//    CFDictionaryRef dicRef = (__bridge CFDictionaryRef)ocDict;
-    //第二种 共享沙河数据
-    NSUserDefaults* userDefault = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.Oujia.AppAndGame"];
-    [userDefault setObject:string forKey:@"type"];//主副设备 断开的type
-    [userDefault synchronize];
-    //之后发送通知
-    CFNotificationCenterPostNotification(notification, strRef, NULL,nil, YES);
- 
-}
-
-
-#pragma mark -- leon add
--(void)comeToBackgroundMode{
-    //初始化一个后台任务BackgroundTask,这个后台任务的作用就是告诉系统当前app在后台有任务处理,需要时间
-    UIApplication*app = [UIApplication sharedApplication];
-    self.bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
-    [app endBackgroundTask:self.bgTask];
-    self.bgTask = UIBackgroundTaskInvalid;
-    }];
-    //开启定时器 不断向系统请求后台任务执行的时间
-    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30.0 target:self selector:@selector(applyForMoreTime) userInfo:nil repeats:YES];
-    [timer fire];
-}
-
--(void)applyForMoreTime{
-    
-    //如果系统给的剩余时间小于60秒 就终止当前的后台任务,再重新初始化一个后台任务,重新让系统分配时间,这样一直循环下去,保持APP在后台一直处于active状态。
-    if ([UIApplication sharedApplication].backgroundTimeRemaining < 30){
-    [[UIApplication sharedApplication] endBackgroundTask:self.bgTask];
-    self.bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
-    [[UIApplication sharedApplication] endBackgroundTask:self.bgTask];
-    self.bgTask = UIBackgroundTaskInvalid;
-    }];
-    }
-}
-
-//获取getUserInfo
-+(NSString*)getUserInfo{
-    NSDictionary * jsonDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSDictionary * user = jsonDict[@"user"];
-    if ([user isKindOfClass:[NSNull class]] || user == nil || [user isEqual:[NSNull null]]){
-        return @"";
-    }else{
-        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:user options:NSJSONWritingPrettyPrinted error:nil];
-        NSString * userJsonString =  [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-        return userJsonString;
-    }
-    
-}
-
-//获取token
-+(NSString*)getToken{
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSString * token =  [urlDict objectForKey:@"token"];
-    if ([token isKindOfClass:[NSNull class]] || token == nil || [token isEqual:[NSNull null]]){
-        [PopupView showCusHUDA:@"获取token失败,请从趣动启动"];
-        return @"";
-    }else{
-        return token;
-    }
-    
-}
-
-//获取缓存game_id
-+(NSString*)getGameId{
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSString * game_id =  [urlDict objectForKey:@"game_id"];
-    if ([game_id isKindOfClass:[NSNull class]] || game_id == nil || [game_id isEqual:[NSNull null]]){
-         [PopupView showCusHUDA:@"获取id失败,请从趣动启动"];
-        return @"";
-    }else{
-        return game_id;
-    }
-}
-
-//获取缓存game_type
-+(NSString*)getGameType{
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSString * game_type =  [urlDict objectForKey:@"game_type"];
-    if ([game_type isKindOfClass:[NSNull class]] || game_type == nil || [game_type isEqual:[NSNull null]]){
-         [PopupView showCusHUDA:@"获取type失败,请从趣动启动"];
-        return @"";
-    }else{
-        return game_type;
-    }
-}
-
-//获取缓存mac
-+(NSString*)getGameMac{
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSString * mac =  [urlDict objectForKey:@"mac"];
-    if ([mac isKindOfClass:[NSNull class]] || mac == nil || [mac isEqual:[NSNull null]]){
-//         [PopupView showCusHUDA:@"获取mac失败,请从趣动启动"];
-        return @"";
-    }else{
-        return mac;
-    }
-}
-    
-//获取缓存邀请信息
-+(NSString*)getInviteUser{
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSDictionary * invite = urlDict[@"invite"];
-    if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
-//         [PopupView showCusHUDA:@"获取getInviteUser失败,请从趣动启动"];
-        return @"";
-    }else{
-        //user字典 -> 字符串 -> Char
-        NSDictionary * user =  [invite objectForKey:@"user"];
-        NSData * userData = [NSJSONSerialization dataWithJSONObject:user options:NSJSONWritingPrettyPrinted error:nil];
-        NSString * userString =  [[NSString alloc] initWithData:userData encoding:NSUTF8StringEncoding];
-        return userString;
-    }
-        
-}
-
-+(NSString*)getInviteInfo{
-    
-    NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
-    NSDictionary * invite = urlDict[@"invite"];
-    if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
-//         [PopupView showCusHUDA:@"获取邀请信息失败,请从趣动启动"];
-        return @"";
-    }else{
-        NSString * info = [invite objectForKey:@"info"];
-        return info;
-    }
- 
-}
-
-
-//加载xib
-- (void)tableViewRegisterNib{
-    
-//    BOOL ifSdk = NO;
-//    if (ifSdk){
-//        NSBundle *bkBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"IOSToUnityBundle" ofType:@"bundle"]];
-//        [self.tableView registerNib:[UINib nibWithNibName:@"PeripheralCell" bundle:bkBundle] forCellReuseIdentifier:@"PeripheralCell"];
-//    }else{
-//        [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([PeripheralCell class]) bundle:nil] forCellReuseIdentifier:@"PeripheralCell"];
-//    }
-    
-}
-
-////倒计时
-//+ (void)countdownWith:(UIButton *)but{
-//    
-//    __block int timeout=59; //倒计时时间
-//    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
-//    dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue);
-//    dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
-//    dispatch_source_set_event_handler(_timer, ^{
-//        if(timeout<=0){ //倒计时结束,关闭
-//            dispatch_source_cancel(_timer);
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//                //设置界面的按钮显示 根据自己需求设置
-//                //设置按钮的样式
-//                but.titleLabel.font = [UIFont  systemFontOfSize:10];
-//                [but setTitle:@"发送验证码" forState:UIControlStateNormal];
-//                [but setTitleColor:[UIColor colorWithHexString:@"#BABBBB"] forState:(UIControlStateNormal)];
-//                but.userInteractionEnabled = YES;
-//            });
-//        }else{
-//            
-//            int seconds = timeout % 60;
-//            NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds];
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//                //设置界面的按钮显示 根据自己需求设置
-//                but.titleLabel.font = [UIFont  systemFontOfSize:10];
-//                [but setTitle:[NSString stringWithFormat:@"重新发送(%@)",strTime] forState:UIControlStateNormal];
-//                [but setTitleColor:[UIColor colorWithHexString:@"#BABBBB"] forState:(UIControlStateNormal)];
-//                but.userInteractionEnabled = NO;
-//                
-//            });
-//            timeout--;
-//        }
-//    });
-//    dispatch_resume(_timer);
-//    
-//}
-//
-//#pragma mark ---------------------------------------------------------------- 参数判断
-////网络链接状态
-//+(bool)internetStatus{
-//    
-//    Reachability * reachability   = [Reachability reachabilityWithHostName:@"www.apple.com"];
-//    NetworkStatus internetStatus = [reachability currentReachabilityStatus];
-//    bool  net = NO;
-//    switch (internetStatus){
-//        case ReachableViaWiFi:
-//            net = YES;
-//            break;
-//        case ReachableViaWWAN:
-//            net = YES;
-//            break;
-//        case NotReachable:
-//            net = NO;
-//            [MBProgressHUD showTextMessage:@"当前无网络连接,请检查网络配置!"];
-//        default:
-//            break;
-//    }
-//    
-//    return net;
-//}
-//
-//+(BOOL)ifLoogIn:(BOOL)tip{
-//    
-//    UserInfoModel * userModel = [UserInfoModel getUserInfoModelFormLocal];
-//    AccessTokenInfo * token = [AccessTokenInfo getAccessTokenModelFormLocal];
-//    //9aafc5e3-5910-433c-b33c-3e85b1ec8917
-//    if (userModel.uuid.length!=16||userModel==nil||token.access_token.length!=36||token==nil){//未登录
-//        
-//        if (tip == YES){
-//            [MBProgressHUD showTextMessage:MyLocalizedString(@"Use Smart series equipment, please log in first!")];
-//        }
-//
-//        return NO;
-//        
-//    }else{
-//     
-//        return YES;
-//        
-//    }
-//    
-//}
-//
-//
-//
-//#pragma mark ---------------------------------------------------------------- 各类弹窗
-////其他网络  提示用户切换网络为luftmed
-//+(void)popChooseSSIDListViewController{
-//    
-//    //链接失败毛玻璃效果
-//    PopToSystemViewController  * visualEffecVC = [PopToSystemViewController  new];
-//    
-//    visualEffecVC.closeTask = ^{
-//        
-//        NSString * urlStr =  [kDefaults objectForKey:@"simulation_api"];
-//        
-//        if (urlStr.length<=0){
-//            urlStr = UIApplicationOpenSettingsURLString;
-//        }
-//        
-//        if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlStr]]){
-//            
-//            if (iOS10){
-//                
-//                //iOS10.0以上  使用的操作
-//                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:@{} completionHandler:nil];
-//                
-//            }else{
-//                
-//                //iOS10.0以下  使用的操作
-//                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
-//                
-//            }
-//            
-//        }
-//
-//    };
-//    
-//    [[UIApplication sharedApplication].keyWindow addSubview:visualEffecVC.view];
-//    
-//}
-//
-//
-//
-//#pragma mark ---------------------------------------------------------------- 系统授权类
-////申请摄像头授权
-//+(BOOL)authorizationCarmen{
-//    
-//    NSString *mediaType = AVMediaTypeVideo;
-//    AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];
-//    if(authStatus ==AVAuthorizationStatusRestricted){
-//        NSLog(@"Restricted");
-//        return NO;
-//
-//    }else if(authStatus == AVAuthorizationStatusDenied){
-//        NSLog(@"Denied");
-//        //应该是这个,如果不允许的话
-//        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:MyLocalizedString(@"Tip")
-//                                                        message:MyLocalizedString(@"Please allow access to the camera in the device \" settings privacy camera -Luftmed\"")
-//                                                       delegate:self
-//                                              cancelButtonTitle:MyLocalizedString(@"Confirm")
-//                                              otherButtonTitles:nil];
-//        [alert show];
-//        return NO;
-//
-//    }else if(authStatus == AVAuthorizationStatusAuthorized){//允许访问
-//        
-//        NSLog(@"Authorized");
-//        return YES;
-//        
-//    }else if(authStatus == AVAuthorizationStatusNotDetermined){
-//        
-//        [AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) {
-//            if(granted){//点击允许访问时调用
-//                
-//                //用户明确许可与否,媒体需要捕获,但用户尚未授予或拒绝许可。
-//                NSLog(@"Granted access to %@", mediaType);
-//                
-//            }else{
-//                
-//                NSLog(@"Not granted access to %@", mediaType);
-//                
-//            }
-//            
-//        }];
-//        
-//        return NO;
-//        
-//    }
-//    
-//    return NO;
-//    
-//}
-//
-//
-//#pragma mark ---------------------------------------------------------------- 正则
-//+ (BOOL)phoneNum:(NSString *)mobileNum{
-//    
-//    if (mobileNum.length != 11){
-//        return NO;
-//    }
-//    /**
-//     * 手机号码:
-//     * 13[0-9], 14[5,7], 15[0, 1, 2, 3, 5, 6, 7, 8, 9], 17[0, 1, 6, 7, 8], 18[0-9]
-//     * 移动号段: 134,135,136,137,138,139,147,150,151,152,157,158,159,170,178,182,183,184,187,188
-//     * 联通号段: 130,131,132,145,155,156,170,171,172,175,176,185,186
-//     * 电信号段: 133,149,153,170,173,177,180,181,189
-//     */
-//    NSString *MOBILE = @"^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9])\\d{8}$";
-//    /**
-//     * 中国移动:China Mobile
-//     * 134,135,136,137,138,139,147,150,151,152,157,158,159,170,178,182,183,184,187,188
-//     */
-//    NSString *CM = @"(^1(3[4-9]|4[7]|5[0-27-9]|7[08]|8[2-478])\\d{8}$";
-//    /**
-//     * 中国联通:China Unicom
-//     * 130,131,132,145,155,156,170,171,172,175,176,185,186
-//     */
-//    NSString *CU = @"(^1(3[0-2]|4[5]|5[56]|701256||8[56])\\d{8}$";
-//    /**
-//     * 中国电信:China Telecom
-//     * 133,149,153,170,173,177,180,181,189
-//     */
-//    NSString *CT = @"^1(3[3]|4[9]|53|7[037]|8[019])\\d{8}$";
-//    NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE];
-//    NSPredicate *regextestcm = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CM];
-//    NSPredicate *regextestcu = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CU];
-//    NSPredicate *regextestct = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CT];
-//    
-//    if (([regextestmobile evaluateWithObject:mobileNum] == YES)
-//        || ([regextestcm evaluateWithObject:mobileNum] == YES)
-//        || ([regextestct evaluateWithObject:mobileNum] == YES)
-//        || ([regextestcu evaluateWithObject:mobileNum] == YES))
-//    {
-//        return YES;
-//        
-//    }else{
-//        
-//        return NO;
-//    }
-//    
-//}
-//
-////获取部分显示手机格式
-//+ (NSString *)getPhoneText:(NSString *)phoneNum {
-//    NSString *headStr = [phoneNum substringToIndex:3];//截取掉下标2之前的字符串
-//    NSString *backStr = [phoneNum substringFromIndex:7];//截取掉下标6之后的字符串
-//    return [NSString stringWithFormat:@"%@****%@",headStr,backStr];
-//}
-//
-//#pragma mark - ***** 检测是否为邮箱
-//+ (BOOL)emailNum:(NSString *)emailStr{
-//    
-//    NSString *pattern = @"^[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
-//    NSRegularExpression *regex = [[NSRegularExpression alloc] initWithPattern:pattern options:0 error:nil];
-//    NSArray *results = [regex matchesInString:emailStr options:0 range:NSMakeRange(0, emailStr.length)];
-//    return results.count > 0;
-//    
-//}
-//
-//#pragma mark ---------------------------------------------------------------- 字符串转字典与字典转字符串
-//+ (NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString {
-//    NSData *JSONData = [JSONString dataUsingEncoding:NSUTF8StringEncoding];
-//    NSDictionary *responseJSON = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingMutableContainers error:nil];
-//    return responseJSON;
-//}
-//
-//+ (NSArray *)parseJSONStringToNSArray:(NSString *)JSONString {
-//    NSData *JSONData = [JSONString dataUsingEncoding:NSUTF8StringEncoding];
-//    NSArray *responseJSON = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingMutableContainers error:nil];
-//    return responseJSON;
-//}
-//
-//+ (NSString*)arrayToJson:(NSArray *)arr
-//{
-//    NSError *parseError = nil;
-//    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:arr options:NSJSONWritingPrettyPrinted error:&parseError];
-//    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-//}
-//
-//+ (NSString*)dictionaryToJson:(NSDictionary *)dic{
-//    
-//    NSError *parseError = nil;
-//    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
-//    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-//    
-//}
-//
-//
-//#pragma mark ---------------------------------------------------------------- 时间
-////返回当前的日期
-//+(NSString*)returnNowDateString{
-//    
-//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-//    // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
-//    //            [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
-//    [formatter setDateFormat:@"yyyyMMdd"];
-//    //现在时间,你可以输出来看下是什么格式
-//    NSDate *datenow = [NSDate date];
-//    //----------将nowDateStr按formatter格式转成nsstring
-//    NSString *nowDateStr = [formatter stringFromDate:datenow];
-//    NSLog(@"nowDateStr =  %@",nowDateStr);
-//    return nowDateStr;
-//    
-//}
-//
-////返回当前的时间
-//+(NSString*)returnNowTimeString{
-//    
-//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-//    // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
-//    //            [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
-//    [formatter setDateFormat:@"HHmmss"];
-//    //现在时间,你可以输出来看下是什么格式
-//    NSDate *datenow = [NSDate date];
-//    //----------将nsdate按formatter格式转成nsstring
-//    NSString *nowtimeStr = [formatter stringFromDate:datenow];
-//    NSLog(@"nowtimeStr =  %@",nowtimeStr);
-//    return nowtimeStr;
-//    
-//}
-//
-//+ (NSString *)getStartTimeDate:(NSNumber *)dateTime format:(NSString *)format{
-//    if (format == nil){
-//        format = @"yyyy/MM/dd";
-//    }
-//    NSString *timeS = @"";
-//    if ([[MYFactoryManager returnRealValue:dateTime] length] > 3){
-//        timeS = [dateTime stringValue];
-//        timeS = [timeS substringToIndex:timeS.length-3];
-//        NSTimeInterval time= [timeS doubleValue];//因为时差问题要加8小时 == 28800 sec
-//        NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
-//        //实例化一个NSDateFormatter对象
-//        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
-//        //设定时间格式,这里可以设置成自己需要的格式 @"yyyy/MM/dd"
-//        [dateFormatter setDateFormat:format];
-//        timeS = [dateFormatter stringFromDate: detaildate];
-//    }
-//    return timeS;
-//}
-//
-//
-//+ (NSString *)getRealTime:(NSString *)dateTime format:(NSString *)format{
-//    
-//    if (format == nil) {
-//        format = @"yyyy-MM-dd HH:mm:ss";
-//    }
-//    if ([[MYFactoryManager returnRealValue:dateTime] length] > 3) {
-//        dateTime = [dateTime substringToIndex:dateTime.length-3];
-//        NSTimeInterval time= [dateTime doubleValue];//因为时差问题要加8小时 == 28800 sec
-//        NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
-//        //实例化一个NSDateFormatter对象
-//        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
-//        //设定时间格式,这里可以设置成自己需要的格式 @"yyyy/MM/dd"
-//        [dateFormatter setDateFormat:format];
-//        dateTime = [dateFormatter stringFromDate: detaildate];
-//    }
-//    return dateTime;
-//}
-//
-//+ (NSString *)returnRealValue:(id)sendValue {
-//    if ([sendValue isKindOfClass:[NSNull class]] || sendValue == NULL) {
-//        return @"";
-//    }
-//    if ([sendValue isKindOfClass:[NSNumber class]]) {
-//        return [sendValue stringValue];
-//    }
-//    return sendValue;
-//}
-//
-///*处理返回应该显示的时间*/
-//+ (NSString *) returnUploadTime:(NSString *)timeStr
-//{
-//    NSTimeInterval time= [timeStr doubleValue];//因为时差问题要加8小时 == 28800 sec
-//    NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
-//    //实例化一个NSDateFormatter对象
-//    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
-//    //设定时间格式,这里可以设置成自己需要的格式
-//    [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
-//    NSString *currentDateStr = [dateFormatter stringFromDate: detaildate];
-//    NSDate *datenow = [NSDate date];
-//    NSDateFormatter * dm = [[NSDateFormatter alloc]init];
-//    //指定输出的格式   这里格式必须是和上面定义字符串的格式相同,否则输出空
-//    [dm setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
-//    NSDate * newdate = [dm dateFromString:currentDateStr];
-//    long dd = (long)[datenow timeIntervalSince1970] - [newdate timeIntervalSince1970];
-//    NSString *timeString=@"";
-//    if (dd/3600<1)
-//    {
-//        timeString = [NSString stringWithFormat:@"%ld", dd/60];
-//        timeString=[NSString stringWithFormat:@"%@分钟前", timeString];
-//    }
-//    if (dd/3600>1&&dd/86400<1)
-//    {
-//        timeString = [NSString stringWithFormat:@"%ld", dd/3600];
-//        timeString=[NSString stringWithFormat:@"%@小时前", timeString];
-//    }
-//    if (dd/86400>1)
-//    {
-//        timeString = [NSString stringWithFormat:@"%ld", dd/86400];
-//        timeString=[NSString stringWithFormat:@"%@天前", timeString];
-//    }
-//    return timeString;
-//}
-//
-//
-//// 返回时间戳
-//+ (NSString *)returnTimestamp:(NSString *)timeStr{
-//    //实例化一个NSDateFormatter对象
-//    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
-//    //设定时间格式,这里可以设置成自己需要的格式
-//    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
-//    NSDate *date = [dateFormatter dateFromString:timeStr];
-//    NSTimeInterval timeSp = [date timeIntervalSince1970];
-//    return [NSString stringWithFormat:@"%f",timeSp];
-//}
-//
-//
-//#pragma mark ---------------------------------------------------------------------------------------- 勒夫曼德
-////16位MD5加密方式 16*2 =32 再截取中间16位
-//+ (NSString *)getMd5_16Bit_String:(NSString *)srcString{
-//
-//    const char *cStr = [srcString UTF8String];
-//    unsigned char digest[CC_MD5_DIGEST_LENGTH];
-//    CC_MD5( cStr, strlen(cStr), digest );
-//    NSMutableString *result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
-//    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++){
-//        [result appendFormat:@"%02x", digest[i]];
-//    }
-//    //32位 加密 取出来
-//    NSString * result_16 = [[result substringToIndex:24] substringFromIndex:8];//即9~25位
-//    
-//    return   [result_16 uppercaseString];
-//    
-//}
-//
-////将十六进制的字符串转换成NSString则可使用如下方式:
-//+ (NSString *)convertHexStrToString:(NSString *)str{
-//    if (!str || [str length] == 0) {
-//        return nil;
-//    }
-//    NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:8];
-//    NSRange range;
-//    if ([str length] % 2 == 0) {
-//        range = NSMakeRange(0, 2);
-//    } else {
-//        range = NSMakeRange(0, 1);
-//    }
-//    for (NSInteger i = range.location; i < [str length]; i += 2) {
-//        unsigned int anInt;
-//        NSString *hexCharStr = [str substringWithRange:range];
-//        NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr];
-//        
-//        [scanner scanHexInt:&anInt];
-//        NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
-//        [hexData appendData:entity];
-//        
-//        range.location += range.length;
-//        range.length = 2;
-//    }
-//    NSString *string = [[NSString alloc]initWithData:hexData encoding:NSUTF8StringEncoding];
-//    return string;
-//}
-//
-////将NSString转换成十六进制的字符串则可使用如下方式:
-//+ (NSString *)convertStringToHexStr:(NSString *)str{
-//    if (!str || [str length] == 0) {
-//        return @"";
-//    }
-//    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
-//    
-//    NSMutableString *string = [[NSMutableString alloc] initWithCapacity:[data length]];
-//    
-//    [data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, BOOL *stop) {
-//        unsigned char *dataBytes = (unsigned char*)bytes;
-//        for (NSInteger i = 0; i < byteRange.length; i++) {
-//            NSString *hexStr = [NSString stringWithFormat:@"%x", (dataBytes[i]) & 0xff];
-//            if ([hexStr length] == 2) {
-//                [string appendString:hexStr];
-//            } else {
-//                [string appendFormat:@"0%@", hexStr];
-//            }
-//        }
-//    }];
-//    
-//    return string;
-//}
-///**
-// 十六进制转换为二进制
-// @return 二进制数
-// */
-//+ (NSString *)convertDataToHexStr:(NSData *)data
-//{
-//    if (!data || [data length] == 0) {
-//        return @"";
-//    }
-//    NSMutableString *string = [[NSMutableString alloc] initWithCapacity:[data length]];
-//    
-//    [data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, BOOL *stop) {
-//        unsigned char *dataBytes = (unsigned char*)bytes;
-//        for (NSInteger i = 0; i < byteRange.length; i++) {
-//            NSString *hexStr = [NSString stringWithFormat:@"%x", (dataBytes[i]) & 0xff];
-//            if ([hexStr length] == 2) {
-//                [string appendString:hexStr];
-//            } else {
-//                [string appendFormat:@"0%@", hexStr];
-//            }
-//        }
-//    }];
-//    return string;
-//}
-//
-//#pragma mark -- 图文混排富文本
-//+(NSAttributedString*)labelAttribute:(NSString *)firstLabelText secondLabelText:(NSString *)secondLabelText{
-//    
-//    NSString* firstStr ;
-//    NSString* secondStr ;
-//    NSString* finalStr ;
-//    
-////    if ([firstLabelText isEqualToString:@"00"]){
-////
-////        firstStr = [NSString stringWithFormat:@"%@",firstLabelText];
-////        secondStr = [NSString stringWithFormat:@"%@",secondLabelText];
-////        finalStr = [NSString stringWithFormat:@"%@   %@",firstStr,secondStr];
-////
-////    }else{
-//    
-//        firstStr = [NSString stringWithFormat:@"%@℃",firstLabelText];
-//        secondStr = [NSString stringWithFormat:@"%@%",secondLabelText];
-//        finalStr = [NSString stringWithFormat:@"%@   %@",firstStr,secondStr];
-////    }
-//    
-//   // 1.创建一个富文本
-//    NSMutableAttributedString *attritube =  [[NSMutableAttributedString alloc] initWithString:finalStr];
-//    
-//    // 修改富文本中的不同文字的样式
-//    // 创建带有图片的富文本--1
-//    NSTextAttachment *temperatureAttch = [[NSTextAttachment alloc] init];
-//    temperatureAttch.bounds = CGRectMake(0, -3.5, 22, 22);
-//    temperatureAttch.image = [UIImage imageNamed:@"myair_temperature_img"];
-//    NSAttributedString *temperatureAttchImage = [NSAttributedString attributedStringWithAttachment:temperatureAttch];
-//    
-//    // 创建带有图片的富文本--2
-//    NSTextAttachment *humidity = [[NSTextAttachment alloc] init];
-//    humidity.bounds = CGRectMake(0, -3.5, 22, 22);
-//    humidity.image = [UIImage imageNamed:@"myair_humidity_img"];
-//    NSAttributedString *humidityImage = [NSAttributedString attributedStringWithAttachment:humidity];
-//    
-//    // 用label的attributedText属性来使用富文本
-//    [attritube insertAttributedString:temperatureAttchImage atIndex:0];// 插入某个位置
-//    [attritube insertAttributedString:humidityImage atIndex:7];// 插入某个位置
-//    
-//    return attritube;
-//    
-//}
-//
-//#pragma mark -- 头部背景视图
-//+(NSString*)changePicturesAccordingToPeriods{
-//    NSString * headImageStr;
-//    NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; //初始化格式器
-//    [formatter setDateFormat:@"HH"];//定义时间为这种格式: YYYY-MM-dd hh:mm:ss
-//    NSString *currentTime = [formatter stringFromDate:[NSDate date]];//将NSDate *对象 转化为 NSString *对象
-//    NSLog(@"当前时间是----%@", currentTime);//控制台打印出当前时间
-////    int time = [currentTime intValue];
-////    if(time>=6&&time<12) {
-////        NSLog(@"上午");
-//        headImageStr = @"bg_outdoor_morning_img";
-//        
-////    }else if (time>=12&&time<17){
-////        NSLog(@"下午");
-////        headImageStr = @"bg_outdoor_afteroom_img";
-////
-////    }else if (time>=17&&time<19){
-////        NSLog(@"傍晚");
-////        headImageStr = @"bg_outdoor_dusk_img";
-////
-////    }else if (time>=19&&time<24){
-////        NSLog(@"晚上");
-////        headImageStr = @"bg_outdoor_night_img";
-////
-////    }else if (time>=0&&time<6){
-////        NSLog(@"凌晨");
-////        headImageStr = @"bg_outdoor_night_img";
-////
-////    }
-//    
-//    return headImageStr;
-//}
-//
-//#pragma mark -- 定位的城市简体转拼音
-//+(NSString *)transform:(NSString *)chinese{
-//    
-//    if (chinese!=nil&&chinese.length>0){
-//        NSMutableString *pinyin = [chinese mutableCopy];
-//        CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO);//带音标的拼音
-//        CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripCombiningMarks, NO);//不带音标的拼音
-//        NSString * strUrl = [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""];
-//        strUrl = [strUrl stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[strUrl substringToIndex:1] uppercaseString]];
-//        NSString *finalStr = [strUrl substringToIndex:[strUrl length] - 3];
-//        NSLog(@"转换过来的拼音的城市名称是:%@", finalStr);
-//        return finalStr;
-//    }else{
-//        return @"No Data";
-//    }
-//
-//}
-//
-//#pragma mark -- 返回机器状态信息
-//+(NSString*)returnStallStr:(NSString*)command deviceinfo:(NSString*)deviceInfo{
-//    
-//    NSString * deviceStatus ;
-//    //开关机
-//    if ([command isEqualToString:@"A0"]) {
-//        
-//        if ([deviceInfo isEqualToString:@"00000000"]) {
-//            
-//            deviceStatus = @"当前是关机";
-//            
-//        }else if ([deviceInfo isEqualToString:@"00000001"]){
-//            
-//            deviceStatus = @"当前是开机";
-//            
-//        }
-//        
-//    }
-//    
-//    //档位
-//    if ([command isEqualToString:@"A4"]){
-//        
-//        deviceStatus = @"当前是Auto档位";
-//
-//    }else if([command isEqualToString:@"A8"]){
-//        
-//        deviceStatus = @"当前是Max档位";
-//        
-//    }else if([command isEqualToString:@"A9"]){
-//        
-//        deviceStatus = @"当前是Sleep档位";
-//        
-//    }else if([command isEqualToString:@"A1"]){//机器当前是 1 2 3
-//        
-//        if ([deviceInfo isEqualToString:@"00000001"]) {
-//            
-//            deviceStatus = @"当前是一档";
-//
-//        }else if ([deviceInfo isEqualToString:@"00000002"]){
-//            
-//            deviceStatus = @"当前是二档";
-//            
-//        }else if ([deviceInfo isEqualToString:@"00000003"]){
-//            
-////            [SVProgressHUD showSuccessWithStatus:@"当前的档位是三档"];
-//            deviceStatus = @"当前是三档";
-//
-//        }
-//        
-//    }
-//    return deviceStatus;
-//}
-//
-//#pragma mark -- 返回室外天气图片
-//+(NSString*)returnWeatherImageStr:(NSString*)deviceInfo{
-//    
-//    NSString * imageString;
-//    
-//    NSString * weatherStr = [deviceInfo substringWithRange:NSMakeRange(5, 3)];
-//    NSString*path =[[NSBundle mainBundle] pathForResource:@"weatherImageDict" ofType:@"plist"];
-//    NSMutableDictionary * dictplist =[[NSMutableDictionary alloc] initWithContentsOfFile:path];
-//    NSMutableDictionary * airImageDict = dictplist[@"airImageDict"];
-////    NSLog(@"path%@",airImageDict);
-//    
-//    for (NSString * key in [airImageDict allKeys]){
-//        
-//        if ([weatherStr isEqualToString:key]){//获取的天气在图片字典中
-//            imageString = [key lowercaseString];//转UI图片小写字母
-//            break;
-//        }
-//        
-//    }
-//    NSLog(@"返回的天气图片 %@  遍历天气字典结果 %@",weatherStr,imageString);
-//
-//    if (imageString.length==0) {
-//        imageString = @"w0";
-//    }
-//    
-//    return imageString;
-//    
-//}
-//
-//#pragma mark -- 室外天气质量
-//+(NSString*)returnOutDoorAqi:(NSInteger)aqiValue{
-//    
-//    NSString * aqi;
-//
-//    if (aqiValue>0&& aqiValue<=50){
-//
-//        NSLog(@"优");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Good")];
-//        
-//    }else if (aqiValue>50&& aqiValue<=100){
-//        
-//        NSLog(@"良");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Average")];
-//
-//    }else if (aqiValue>100&& aqiValue<=150){
-//        
-//        NSLog(@"轻度污染");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Pollution")];
-//
-//    }else if (aqiValue>150&& aqiValue<=200){
-//        
-//        NSLog(@"中度污染");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Moderate Pollution")];
-//
-//    }else if (aqiValue>200&& aqiValue<=300){
-//        
-//        NSLog(@"重度污染");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Heavy Pollution")];
-//
-//    }else if (aqiValue>300){
-//        
-//        NSLog(@"严重污染");
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"Serious Pollution")];
+//#pragma mark ------  发送app group通知
+//+ (void)postGroupCFNotificaiton:(NSString*)string{
 //
-//    }else{
-//        
-//        aqi = [NSString stringWithFormat:@"AQI: %@",MyLocalizedString(@"No data")];
+//    NSString * notificaitonName = @"OPEN_NOTIFICATION";
+//    CFStringRef strRef = (__bridge CFStringRef)notificaitonName;
+//    CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter ();
+//    //第一种生成参数方法 测试无效
+////    NSDictionary * ocDict = @{@"key":@"123"};
+////    CFDictionaryRef dicRef = (__bridge CFDictionaryRef)ocDict;
+//    //第二种 共享沙河数据
+//    NSUserDefaults* userDefault = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.Oujia.AppAndGame"];
+//    [userDefault setObject:string forKey:@"type"];//主副设备 断开的type
+//    [userDefault synchronize];
+//    //之后发送通知
+//    CFNotificationCenterPostNotification(notification, strRef, NULL,nil, YES);
+//    //
 //
-//    }
-//    
-//    return aqi;
-//    
 //}
-//
-//#pragma mark --- 验证报文
-//+(NSString*)authenticationMessage:(NSString*)MessageConent{
-//    
-//    int total = 0;
-//
-//    NSData * data = [MessageConent  dataUsingEncoding:NSUTF8StringEncoding];//字符串 UTF-8编码 转换出来的是10进制数据流
-//
-//    Byte * testByteArr = (Byte *)[data bytes];//16进制数据流 转换成Byte数组 数组里面是10进制数据
-//    
-////        NSLog(@"长度是:%ld",[data length]);//一个字符对应一个长度
-//    
-//    for(int i=0;i<[data length];i++){//转换出来的是10进制数据流
-//        
-////        printf("testByte = %d\n",testByteArr[i]);
-//        total = total+testByteArr[i];
-//        
-//    }
-//    
-//    NSString * back = [MYFactoryManager getHexByDecimal:total];
-//    
-//    NSString * finalStr;
-//    
-//    //截取后面两位
-//    if (back.length==4){
-//        finalStr = [back substringFromIndex:2];
-//    }else{
-//        finalStr = [back substringFromIndex:1];
-//    }
-//    return finalStr;
-//    
-//}
-//
-////十进制转换成16进制字符串
-//+ (NSString *)getHexByDecimal:(NSInteger)decimal{
-//    //3819
-//    NSString *hex =@"";
-//    NSString *letter;
-//    NSInteger number;
-//    for (int i = 0; i<9; i++){
-//        
-//        number = decimal % 16;
-//        decimal = decimal / 16;
-//        switch (number) {
-//                
-//            case 10:
-//                letter =@"A"; break;
-//            case 11:
-//                letter =@"B"; break;
-//            case 12:
-//                letter =@"C"; break;
-//            case 13:
-//                letter =@"D"; break;
-//            case 14:
-//                letter =@"E"; break;
-//            case 15:
-//                letter =@"F"; break;
-//            default:
-//                letter = [NSString stringWithFormat:@"%ld", number];
-//        }
-//        hex = [letter stringByAppendingString:hex];
-//        if (decimal == 0) {
-//            break;
-//        }
-//    }
-//    return hex;
-//}
-//
-//+ (NSString*)getCurrentSSID{
-//    
-//    NSDictionary * ifs = [MYFactoryManager fetchSSIDInfo];;
-//    NSString *ssid = [ifs objectForKey:@"SSID"];
-//    if (ssid.length<=0){
-//        return @"未知网络";
-//    }else{
-//        return ssid;
-//    }
-//    
-//}
-//
-//
-//#pragma mark -- 获取当前链接的wifi - 是不是luftmed
-//+ (BOOL)ifConnetLuftmed{
-//    
-//    BOOL wifiOK = FALSE;
-//    NSDictionary *ifs;
-//    NSString *ssid;
-//    
-//    if (!wifiOK){
-//        
-//        ifs = [MYFactoryManager fetchSSIDInfo];
-//        ssid = [ifs objectForKey:@"SSID"];
-//        
-//        if(ssid!= nil){
-//            
-//            wifiOK= TRUE;
-//            
-//            NSString * tails;
-//            if (ssid.length==12){
-//                tails = [ssid substringWithRange:NSMakeRange(8, 4)];
-//            }
-//            
-//            NSLog(@"当前的SSID是 ========>> %@  %@",ssid,tails);
-//            
-//            if (ssid.length == 12&&[self judgePassWordLegal:tails]){
-//                
-//                if ([ssid hasPrefix:@"luftmed_"]||[ssid hasPrefix:@"luftmed-"]){//当前连接的网络是 luftmed_wifi 协议三判断是否已经配网
-//                    
-//                    return YES;
-//                    
-//                }else{
-//                    
-//                    return NO;
-//                    
-//                }
-//                
-//            }else{
-//                
-//                return NO;
-//            }
-//            
-//        }else{
-//            
-//            return NO;
-//
-//        }
-//        
-//    }
-//    
-//    return NO;
-//    
-//}
-//
-////是否由数字或者字母组成
-//+(BOOL)judgePassWordLegal:(NSString*)ssid{
-//    
-//    NSString *regex = @"^[a-z0-9A-Z]*$";
-//    
-//    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
-//    
-//    if ([predicate evaluateWithObject:ssid] == YES) {
-//        
-//        return YES;
-//        
-//    }else{
-//        
-//        return NO;
-//    }
-//
-//}
-////是否由数字+字母组成
-//+(BOOL)judgePassWordLegalCountOrAZ:(NSString *)ssid{
-//    BOOL result = false;
-//    if ([ssid length] == 4){
-//        // 判断长度大于8位后再接着判断是否同时包含数字和字符
-//        NSString * regex = @"^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$";
-//        NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
-//        result = [pred evaluateWithObject:ssid];
-//    }
-//    return result;
-//    NSLog(@"result ===> %@",result?@"YES":@"NO");
-//}
-//
-//
-//
-//+(id)fetchSSIDInfo{
-//    
-//    NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
-////    NSLog(@"Supported interfaces: %@", ifs);
-//    id info = nil;
-//    for (NSString *ifnam in ifs) {
-////        NSLog(@"遍历到的SSID数据是ifnam--%@",ifnam);
-//        info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
-////        NSLog(@"%@ => %@", ifnam, info);
-//        if (info && [info count]) { break; }
-//    }
-//    return info;
-//    
-//}
-//
-//#pragma mark -------------------------------- 获取UDID
-//+(NSString*)getUDIDString{
-//    
-//    NSString *identifierStr = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
-//    NSString * udid = [identifierStr stringByReplacingOccurrencesOfString:@"-" withString:@""];
-//    NSString * udidString = [udid substringToIndex:16];
-////    NSLog(@"udidString = %@",udidString);
-//    return udidString;
-//}
-//
-//#pragma mark --------------------------------- 返回PM25对应的文本
-//+(NSString*)getPM25ValueText:(NSString*)value{
-//    
-//    CGFloat floatValue = [value floatValue];
-//    NSString * text;
-//    //    优    0~35μg/m³
-//    //    良    35~75μg/m³
-//    //    轻度污染    75~115μg/m³
-//    //    中度污染    115~150μg/m³
-//    //    重度污染    150~250μg/m³
-//    //    严重污染    大于250μg/m³及以上
-//    if (floatValue>=0&&floatValue<40){//优
-//        text = MyLocalizedString(@"Good");
-//    }else  if(floatValue>=40&&floatValue<100){//一般
-//        text = MyLocalizedString(@"Average");
-//    }else  if(floatValue>=100&&floatValue<180){//轻度
-//        text = MyLocalizedString(@"Pollution");
-//    }else  if(floatValue>=180&&floatValue<250){//重度
-//        text = MyLocalizedString(@"Moderate Pollution");
-//    }else  if(floatValue>=250&&floatValue<1000){//严重
-//        text = MyLocalizedString(@"Heavy Pollution");
-//    }
-//    return text;
-//    
-//}
-//
-//#pragma mark --- 返回PM25对应的颜色
-//+(UIColor*)getPM25ValueColor:(NSString*)value{
-//    CGFloat floatValue = [value floatValue];
-//    UIColor * color ;
-////    优    0~35μg/m³
-////    良    35~75μg/m³
-////    轻度污染    75~115μg/m³
-////    中度污染    115~150μg/m³
-////    重度污染    150~250μg/m³
-////    严重污染    大于250μg/m³及以上
-//    if (floatValue>=0&&floatValue<40){//优
-//        color = PM25ExcellentColor;
-//    }else  if(floatValue>=40&&floatValue<100){//一般
-//        color = PM25NormalColor;
-//    }else  if(floatValue>=100&&floatValue<180){//轻度
-//        color = PM25LightColor;
-//    }else  if(floatValue>=180&&floatValue<250){//重度
-//        color = PM25SevereColor;
-//    }else  if(floatValue>=250&&floatValue<1000){//严重
-//        color = PM25SeriousColor;
-//    }
-//    return color;
-//}
-//
-//#pragma mark --- 返回PM25 角度
-//+(CGFloat)getPM25TotalAngle:(NSInteger)temp10{
-//    
-//    CGFloat totalAngle;
-//    if (temp10>=0&&temp10<=40){//优秀
-//        CGFloat progress = temp10 /40.0;
-//        CGFloat newAngle = progress * 70;
-//        totalAngle = 55+newAngle;
-//    }else if(temp10>40&&temp10<=99){//一般
-//        CGFloat progress = (temp10-40) /60.0;
-//        CGFloat newAngle = progress * 60;
-//        totalAngle = 55+70+newAngle;
-//    }else if(temp10>99&&temp10<=179){//轻度污染
-//        CGFloat progress = (temp10-100) /80.0;
-//        CGFloat newAngle = progress * 50;
-//        totalAngle = 55+130+newAngle;
-//    }else if(temp10>179&&temp10<=249){//轻度污染
-//        CGFloat progress = (temp10-180) /70.0;
-//        CGFloat newAngle = progress * 60;
-//        totalAngle = 55+180+newAngle;
-//    }else{//严重
-//        CGFloat progress = (temp10-250)/750.0;
-//        CGFloat newAngle = progress * 30;
-//        totalAngle = 55+220+newAngle;
-//    }
-//    
-//    return totalAngle;
-//}
-//
-//#pragma mark --------------------------------- 返回TVOC 文本
-//+(NSString*)getTVOCValueText:(NSString*)value{
-//    NSString * valveString = [NSString stringWithFormat:@"%.2f", [value floatValue]/100];
-//    CGFloat floatValue = [valveString floatValue];
-//    NSString * text;
-//    if (floatValue>=0&&floatValue<2.0){//优
-//        text = MyLocalizedString(@"Good");
-//    }else  if(floatValue>=2.0&&floatValue<4.0){//一般
-//        text = MyLocalizedString(@"Average");
-//    }else  if(floatValue>=4.0&&floatValue<6.0){//轻度
-//        text = MyLocalizedString(@"Pollution");
-//    }else  if(floatValue>=6.0&&floatValue<8.0){//重度
-//        text = MyLocalizedString(@"Moderate Pollution");
-//    }else  if(floatValue>=8.0&&floatValue<9.9){//严重
-//        text = MyLocalizedString(@"Heavy Pollution");
-//    }
-//    return text;
-//}
-//
-//#pragma mark --- 返回TVOC 颜色
-//+(UIColor*)getTVOCValueColor:(NSString*)value{
-//    
-//    NSString * valveString = [NSString stringWithFormat:@"%.2f", [value floatValue]/100];
-//    CGFloat floatValue = [valveString floatValue];
-////    NSLog(@"floatValue  = %f",floatValue);
-//    UIColor * color ;
-//    if (floatValue>=0&&floatValue<2.0){//优
-//        color = PM25ExcellentColor;
-//    }else  if(floatValue>=2.0&&floatValue<4.0){//一般
-//        color = PM25NormalColor;
-//    }else  if(floatValue>=4.0&&floatValue<6.0){//轻度
-//        color = PM25LightColor;
-//    }else  if(floatValue>=6.0&&floatValue<8.0){//重度
-//        color = PM25SevereColor;
-//    }else  if(floatValue>=8.0&&floatValue<9.9){//严重
-//        color = PM25SeriousColor;
-//    }
-//    return color;
-//
-//}
-//
-////返回TVOC真实值
-//+(NSString*)returnRealTVOCValue:(NSString*)value{
-//    
-//    NSString * text = [NSString stringWithFormat:@"%.2f", [value floatValue]/100];
-////    NSLog(@"text = %@",text);
-//    NSString * tail = [text substringWithRange:NSMakeRange(3, 1)];
-//    if ([tail isEqualToString:@"0"]) {
-//        text = [text substringToIndex:3];
-//    }
-////    NSLog(@"tail = %@",tail);
-//    if ([text isEqualToString:@"0.0"]) {
-//        text = @"0";
-//    }
-//   
-//    return text;
-//}
-//
-//
-//#pragma mark ---------------------------------------------------------------- 车载相关
-//+(NSString*)HardDriveVerificationAlgorithm:(NSString*)string_input{
-//    
-//    //    NSString * string_input = @"0380000D00007CEC79EEF51F000106";
-//    //string_input = 指令 + 数据长度 + 流水号 + MAC地址 + 数据
-//    int i = 0;
-//    NSMutableArray * stringArr = [NSMutableArray new];
-//    
-//    while (i<string_input.length-1) {
-//        
-//        NSString * tempStr = [string_input substringWithRange:NSMakeRange(i, 2)];
-//        NSString * temp10 = [NSString stringWithFormat:@"%lu",strtoul([tempStr UTF8String],0,16)];
-//        //NSLog(@"转换出来的10进制数字是 %@ %@",tempStr,temp10);
-//        [stringArr addObject:temp10];
-//        i = i+2;
-//        
-//    }
-//    
-//    //取数组内容-》异或校验算法对比
-//    int sum = 0;
-//    for (NSString * temp10 in stringArr){
-//        int temp = [temp10 intValue];
-//        sum = sum^temp;
-//        
-//    }
-//    
-//    //转16进制
-//    NSString * checkCode = [self getHexByDecimal:sum];
-//    
-//    NSLog(@"int总和转换出来的16进制的字符串是 %d  %@",sum,checkCode);
-//    
-//    if (checkCode.length<2){
-//        checkCode = [NSString stringWithFormat:@"0%@",checkCode];
-//        return checkCode;
-//    }else{
-//        return checkCode;
-//    }
-//    
-//}
-//
-////字符串转16进制数据流
-//+(NSData *)convertHexStrToData:(NSString *)str{
-//    
-//    if (!str || [str length] == 0){
-//        return nil;
-//    }
-//    NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:8];
-//    NSRange range;
-//    if ([str length] % 2 == 0) {
-//        range = NSMakeRange(0, 2);
-//    } else {
-//        range = NSMakeRange(0, 1);
-//    }
-//    for (NSInteger i = range.location; i < [str length]; i += 2){
-//        
-//        unsigned int anInt;
-//        NSString *hexCharStr = [str substringWithRange:range];
-//        NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr];
-//        
-//        [scanner scanHexInt:&anInt];
-//        NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
-//        [hexData appendData:entity];
-//        
-//        range.location += range.length;
-//        range.length = 2;
-//        
-//    }
-//    
-//    NSLog(@"发送数据 字符串转16进制数据流 hexdata: %@", hexData);
-//    return hexData;
-//    
-//}
-//
-//+(NSInteger)hexToInt:(NSString*)hex{
-//    
-////    NSLog(@"16转10报错信息 =  %@",hex);
-//    NSString * hexFormatStr = [NSString stringWithFormat:@"%lu",strtoul([hex UTF8String],0,16)];
-//    NSInteger temp10 = [hexFormatStr integerValue];
-//    return temp10;
-//    
-//}
-//
-///*!* @brief 把格式化的JSON格式的字符串转换成字典* @param jsonString JSON格式的字符串* @return 返回字典*/
-////json格式字符串转字典:
-//+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
-//    if (jsonString == nil) {
-//        return nil;
-//    }
-//    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];NSError *err;
-//    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonDataoptions:NSJSONReadingMutableContainerserror:&err];
-//    if(err) {
-//        NSLog(@"json解析失败:%@",err);
-//        return nil;
-//        
-//    }return dic;
-//    
-//}
-////字典转json格式字符串:
-//+ (NSString*)dictionaryToJson:(NSDictionary *)dic{
-//    NSError *parseError = nil;
-//    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
-//    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-//    
-//}
-////NSJSONWritingPrettyPrinted  是有换位符的。如果NSJSONWritingPrettyPrinted 是nil 的话 返回的数据是没有 换位符的
-
 
 
 @end

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/.DS_Store


+ 0 - 286
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/AnimationView.m

@@ -1,286 +0,0 @@
-//
-//  AnimationVIew.m
-//  luftemd
-//
-//  Created by leon on 2017/11/1.
-//  Copyright © 2017年 林柏显. All rights reserved.
-//
-
-/*************************** 获取屏幕 宽度、高度 ***************************/
-#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
-#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
-#define RGBA(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
-
-#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
-
-#import "AnimationView.h"
-#import "MYFactoryManager.h"
-
-
-@implementation AnimationView
-
-+(instancetype)shanreAnimationView{
-    
-    static AnimationView * animationView = nil;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        animationView =  [AnimationView new];
-    });
-    return animationView;
-    
-}
-
-//-(void)startAnimation{
-//    
-//    self.animationView =  [UIView new];
-//    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-//    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
-//    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
-//    
-//    //
-//    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2,(SCREEN_HEIGHT - 90) / 2, 90, 90)];
-//    [self.animationView addSubview:self.imageView];
-//    
-//    if (self.imageView.isAnimating) return;
-//    // 1.加载所有的动画图片
-//    NSMutableArray *images = [NSMutableArray array];
-//    
-//    for (int i = 0 ; i<60; i++){
-//        
-//        NSString * filename = nil;
-//        // 计算文件名
-//        if (i < 10){
-//            filename = [NSString stringWithFormat:@"linking000%d",i];
-//        } else {
-//            filename = [NSString stringWithFormat:@"linking00%d",i];
-//        }
-//        //        NSLog(@"filename = %@",filename);
-//        UIImage *image = [UIImage imageNamed:filename];
-//        // 添加图片到数组中
-//        [images addObject:image];
-//        
-//    }
-//    
-//    self.imageView.animationImages = images;
-//    // 2.设置播放次数(1次)
-//    self.imageView.animationRepeatCount = 0;
-//    // 3.设置播放时间
-//    self.imageView.animationDuration = images.count * 0.1;
-//    [self.imageView startAnimating];
-//
-//}
-//
-////label显示
-//-(void)startAnimationWithAnimationLabel:(NSString*)title{
-//    
-//    //蒙层背景
-//    self.animationView =  [UIView new];
-//    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-//    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
-//    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
-//        
-//    //白底背景
-//    self.backView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 180) / 2,(SCREEN_HEIGHT - 180) / 2, 180, 180)];
-//    self.backView.backgroundColor = [UIColor whiteColor];
-//    [MYFactoryManager clipsToBoundsWithView:self.backView Radius:10];
-//    [self.animationView addSubview:self.backView];
-//    
-//    //动画imageview
-//    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(30,10,120, 120)];
-//    [self.backView addSubview:self.imageView];
-//
-//    if (self.imageView.isAnimating) return;
-//    // 1.加载所有的动画图片
-//    NSMutableArray *images = [NSMutableArray array];
-//
-//    for (int i = 0; i<60; i++){
-//        NSString *filename = nil;
-//        // 计算文件名
-//        if (i < 10){
-//            filename = [NSString stringWithFormat:@"linking000%d",i];
-//        } else {
-//            filename = [NSString stringWithFormat:@"linking00%d",i];
-//        }
-//        //        NSLog(@"filename = %@",filename);
-//        UIImage *image = [UIImage imageNamed:filename];
-//        // 添加图片到数组中
-//        [images addObject:image];
-//    }
-//    self.imageView.animationImages = images;
-//    // 2.设置播放次数(1次)
-//    self.imageView.animationRepeatCount = 0;
-//    // 3.设置播放时间
-//    self.imageView.animationDuration = images.count * 0.1;
-//    [self.imageView startAnimating];
-//
-//    //tip
-//    self.animationLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 140,180, 40)];
-//    self.animationLabel.text = title;
-//    self.animationLabel.textColor = [UIColor whiteColor];
-//    self.animationLabel.font = [UIFont systemFontOfSize:12];
-//    self.animationLabel.textAlignment = NSTextAlignmentCenter;
-//    self.animationLabel.backgroundColor = [UIColor whiteColor];
-//    [self.backView addSubview:self.animationLabel];
-//
-//}
-//
-////倒计时按钮显示
-//-(void)startAnimationWithCountButton{
-//    
-//    //蒙层背景
-//    self.animationView =  [UIView new];
-//    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-//    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
-//    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
-//    
-//    //白底背景
-//    self.backView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 180) / 2,(SCREEN_HEIGHT - 180) / 2, 180, 180)];
-//    self.backView.backgroundColor = [UIColor whiteColor];
-//    [MYFactoryManager clipsToBoundsWithView:self.backView Radius:10];
-//    [self.animationView addSubview:self.backView];
-//    
-//    //动画imageview
-//    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(30,10,120, 120)];
-//    [self.backView addSubview:self.imageView];
-//    
-//    if (self.imageView.isAnimating) return;
-//    // 1.加载所有的动画图片
-//    NSMutableArray *images = [NSMutableArray array];
-//    
-//    for (int i = 0; i<60; i++){
-//        NSString *filename = nil;
-//        // 计算文件名
-//        if (i < 10){
-//            filename = [NSString stringWithFormat:@"linking000%d",i];
-//        } else {
-//            filename = [NSString stringWithFormat:@"linking00%d",i];
-//        }
-//        //        NSLog(@"filename = %@",filename);
-//        UIImage *image = [UIImage imageNamed:filename];
-//        // 添加图片到数组中
-//        [images addObject:image];
-//    }
-//    self.imageView.animationImages = images;
-//    // 2.设置播放次数(1次)
-//    self.imageView.animationRepeatCount = 0;
-//    // 3.设置播放时间
-//    self.imageView.animationDuration = images.count*0.1;
-//    [self.imageView startAnimating];
-//    
-//    self.countButton = [UIButton buttonWithType:UIButtonTypeCustom];
-//    self.countButton.frame = CGRectMake(0, 140,180, 40);
-//    self.countButton.titleLabel.font = [UIFont systemFontOfSize:12];;
-//    self.countButton.titleLabel.textAlignment = NSTextAlignmentCenter;
-//    [self.countButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-//    self.countButton.backgroundColor = [UIColor whiteColor];
-//    self.countButton.userInteractionEnabled = NO;
-//    [self.backView addSubview:self.countButton];
-//
-//    __block int timeout = 59; //倒计时时间
-//    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
-//    dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue);
-//    dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
-//    dispatch_source_set_event_handler(_timer, ^{
-//        if(timeout<=0){ //倒计时结束,关闭
-//            dispatch_source_cancel(_timer);
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//
-//            });
-//        }else{
-//            
-//            int seconds = timeout % 60;
-//            NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds];
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//                [self.countButton setTitle:[NSString stringWithFormat:@"%@%@s..",@"蓝牙连接丢失...",strTime] forState:UIControlStateNormal];
-//            });
-//            timeout--;
-//        }
-//    });
-//    dispatch_resume(_timer);
-//    
-//}
-
--(void)stopAnimation{
-    
-//    if (self.imageView.isAnimating){
-        
-        [self.imageView stopAnimating];
-        [self.animationView removeFromSuperview];
-        [self.backView removeFromSuperview];
-        [self.imageView removeFromSuperview];
-        [self.animationLabel removeFromSuperview];
-        [self.countButton removeFromSuperview];
-        
-//    }
-    
-    [self pauseLayer:self.imageView.layer];
-    
-}
-
-//初始化小风扇动画
--(void)addAnimation{
-    
-    if (self.animationView!=nil){
-        [self stopAnimation];
-    }
-    
-    self.animationView =  [UIView new];
-    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
-    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
-    
-    //
-    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2,(SCREEN_HEIGHT - 90) / 2, 90, 90)];
-    self.imageView.image = [UIImage imageNamed:@"loading"];
-    [self.animationView addSubview:self.imageView];
-    
-    //tip
-    self.animationLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2, (SCREEN_HEIGHT - 90)/2+90+10,180, 40)];
-//    self.animationLabel.text = @"链接鞋子...";
-    self.animationLabel.textColor = [UIColor whiteColor];
-    self.animationLabel.font = [UIFont systemFontOfSize:12];
-    self.animationLabel.textAlignment = NSTextAlignmentCenter;
-    self.animationLabel.backgroundColor = [UIColor clearColor];
-    [self.animationView addSubview:self.animationLabel];
-    
-    //添加旋转动画
-    _rotationAnimation = [self rotationDurTime:2 angle:360.f direction:-1 repeatCount:MAXFLOAT];
-    _rotationAnimation.delegate = self;
-    _rotationAnimation.removedOnCompletion = NO;
-    [_rotationAnimation setRepeatCount:HUGE_VALF];
-    _rotationAnimation.speed = 1;
-    [self.imageView.layer addAnimation:self.rotationAnimation forKey:@"rotate"];
-    
-    WS(ws);
-    //链接超时
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [ws stopAnimation];
-    });
-}
-
-//暂停layer上面的动画
--(void)pauseLayer:(CALayer*)layer{
-    
-    CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
-    layer.speed = 0.0;
-    layer.timeOffset = pausedTime;
-    
-}
-
-//周期时间 角度 方向 重复次数
--(CABasicAnimation *)rotationDurTime:(float)durTime angle:(float)angle direction:(int)direction repeatCount:(int)repeatCount{
-    
-    CABasicAnimation* animation  = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
-//    animation.fromValue = [NSNumber numberWithFloat:0.f];
-    animation.toValue = [NSNumber numberWithFloat:M_PI];
-    animation.duration= durTime;
-    animation.cumulative= YES;//是否累加
-    animation.removedOnCompletion=NO;
-    animation.fillMode =kCAFillModeForwards;
-    animation.autoreverses = NO;//自动逆转
-    animation.repeatCount = repeatCount;
-    return animation;
-    
-}
-
-@end

+ 5 - 8
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/AnimationView.h → DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/MainLoadingView.h

@@ -1,15 +1,15 @@
 //
-//  AnimationVIew.h
-//  luftemd
+//  MainLoadingView.h
+//  Unity-iPhone
 //
-//  Created by leon on 2017/11/1.
-//  Copyright © 2017年 林柏显. All rights reserved.
+//  Created by duowan123 on 2022/8/2.
 //
 
+
 #import <UIKit/UIKit.h>
 #import <QuartzCore/QuartzCore.h>
 
-@interface AnimationView : UIView<CAAnimationDelegate>
+@interface MainLoadingView : UIView<CAAnimationDelegate>
 
 @property(nonatomic,strong)UIView * animationView;
 @property(nonatomic,strong)UIView * backView;
@@ -20,9 +20,6 @@
 
 +(instancetype)shanreAnimationView;
 
-//-(void)startAnimation;
-//-(void)startAnimationWithAnimationLabel:(NSString*)title;
-//-(void)startAnimationWithCountButton;
 
 -(void)stopAnimation;
 

+ 116 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/MainLoadingView.m

@@ -0,0 +1,116 @@
+//
+//  MainLoadingView.m
+//  Unity-iPhone
+//
+//  Created by duowan123 on 2022/8/2.
+//
+
+/*************************** 获取屏幕 宽度、高度 ***************************/
+#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
+#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
+#define RGBA(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
+
+#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
+
+#import "MainLoadingView.h"
+#import "MYFactoryManager.h"
+
+@implementation MainLoadingView
+
++(instancetype)shanreAnimationView{
+    
+    static MainLoadingView * animationView = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        animationView =  [MainLoadingView new];
+    });
+    return animationView;
+    
+}
+
+
+-(void)stopAnimation{
+    
+//    if (self.imageView.isAnimating){
+        
+        [self.imageView stopAnimating];
+        [self.animationView removeFromSuperview];
+        [self.backView removeFromSuperview];
+        [self.imageView removeFromSuperview];
+        [self.animationLabel removeFromSuperview];
+        [self.countButton removeFromSuperview];
+        
+//    }
+    
+    [self pauseLayer:self.imageView.layer];
+    
+}
+
+//初始化动画
+-(void)addAnimation{
+    
+    if (self.animationView!=nil){
+        [self stopAnimation];
+    }
+    
+    self.animationView =  [UIView new];
+    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
+    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
+    
+    //
+    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2,(SCREEN_HEIGHT - 90) / 2, 90, 90)];
+    self.imageView.image = [UIImage imageNamed:@"loading"];
+    [self.animationView addSubview:self.imageView];
+    
+    //tip
+    self.animationLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2, (SCREEN_HEIGHT - 90)/2+90+10,180, 40)];
+//    self.animationLabel.text = @"链接鞋子...";
+    self.animationLabel.textColor = [UIColor whiteColor];
+    self.animationLabel.font = [UIFont systemFontOfSize:12];
+    self.animationLabel.textAlignment = NSTextAlignmentCenter;
+    self.animationLabel.backgroundColor = [UIColor clearColor];
+    [self.animationView addSubview:self.animationLabel];
+    
+    //添加旋转动画
+    _rotationAnimation = [self rotationDurTime:2 angle:360.f direction:-1 repeatCount:MAXFLOAT];
+    _rotationAnimation.delegate = self;
+    _rotationAnimation.removedOnCompletion = NO;
+    [_rotationAnimation setRepeatCount:HUGE_VALF];
+    _rotationAnimation.speed = 1;
+    [self.imageView.layer addAnimation:self.rotationAnimation forKey:@"rotate"];
+    
+    WS(ws);
+    //链接超时
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [ws stopAnimation];
+    });
+    
+}
+
+//暂停layer上面的动画
+-(void)pauseLayer:(CALayer*)layer{
+    
+    CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
+    layer.speed = 0.0;
+    layer.timeOffset = pausedTime;
+    
+}
+
+//周期时间 角度 方向 重复次数
+-(CABasicAnimation *)rotationDurTime:(float)durTime angle:(float)angle direction:(int)direction repeatCount:(int)repeatCount{
+    
+    CABasicAnimation* animation  = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
+//    animation.fromValue = [NSNumber numberWithFloat:0.f];
+    animation.toValue = [NSNumber numberWithFloat:M_PI];
+    animation.duration= durTime;
+    animation.cumulative= YES;//是否累加
+    animation.removedOnCompletion=NO;
+    animation.fillMode =kCAFillModeForwards;
+    animation.autoreverses = NO;//自动逆转
+    animation.repeatCount = repeatCount;
+    return animation;
+    
+}
+
+@end

+ 4 - 8
RunGame/Classes/SDK/UI/AnimationVIew/AnimationView.h → DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/ViceLoadingView.h

@@ -1,15 +1,14 @@
 //
-//  AnimationVIew.h
-//  luftemd
+//  ViceLoadingView.h
+//  Unity-iPhone
 //
-//  Created by leon on 2017/11/1.
-//  Copyright © 2017年 林柏显. All rights reserved.
+//  Created by duowan123 on 2022/8/2.
 //
 
 #import <UIKit/UIKit.h>
 #import <QuartzCore/QuartzCore.h>
 
-@interface AnimationView : UIView<CAAnimationDelegate>
+@interface ViceLoadingView : UIView<CAAnimationDelegate>
 
 @property(nonatomic,strong)UIView * animationView;
 @property(nonatomic,strong)UIView * backView;
@@ -20,9 +19,6 @@
 
 +(instancetype)shanreAnimationView;
 
-//-(void)startAnimation;
-//-(void)startAnimationWithAnimationLabel:(NSString*)title;
-//-(void)startAnimationWithCountButton;
 
 -(void)stopAnimation;
 

+ 116 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/AnimationVIew/ViceLoadingView.m

@@ -0,0 +1,116 @@
+//
+//  ViceLoadingView.m
+//  Unity-iPhone
+//
+//  Created by duowan123 on 2022/8/2.
+//
+
+/*************************** 获取屏幕 宽度、高度 ***************************/
+#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
+#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
+#define RGBA(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
+
+#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
+
+#import "ViceLoadingView.h"
+#import "MYFactoryManager.h"
+
+@implementation ViceLoadingView
+
++(instancetype)shanreAnimationView{
+    
+    static ViceLoadingView * animationView = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        animationView =  [ViceLoadingView new];
+    });
+    return animationView;
+    
+}
+
+
+-(void)stopAnimation{
+    
+//    if (self.imageView.isAnimating){
+        
+        [self.imageView stopAnimating];
+        [self.animationView removeFromSuperview];
+        [self.backView removeFromSuperview];
+        [self.imageView removeFromSuperview];
+        [self.animationLabel removeFromSuperview];
+        [self.countButton removeFromSuperview];
+        
+//    }
+    
+    [self pauseLayer:self.imageView.layer];
+    
+}
+
+//初始化动画
+-(void)addAnimation{
+    
+    if (self.animationView!=nil){
+        [self stopAnimation];
+    }
+    
+    self.animationView =  [UIView new];
+    self.animationView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+    self.animationView.backgroundColor = RGBA(76, 76, 76, 0.8);
+    [[UIApplication sharedApplication].keyWindow addSubview:self.animationView];
+    
+    //
+    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2,(SCREEN_HEIGHT - 90) / 2, 90, 90)];
+    self.imageView.image = [UIImage imageNamed:@"loading"];
+    [self.animationView addSubview:self.imageView];
+    
+    //tip
+    self.animationLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 90) / 2, (SCREEN_HEIGHT - 90)/2+90+10,180, 40)];
+//    self.animationLabel.text = @"链接鞋子...";
+    self.animationLabel.textColor = [UIColor whiteColor];
+    self.animationLabel.font = [UIFont systemFontOfSize:12];
+    self.animationLabel.textAlignment = NSTextAlignmentCenter;
+    self.animationLabel.backgroundColor = [UIColor clearColor];
+    [self.animationView addSubview:self.animationLabel];
+    
+    //添加旋转动画
+    _rotationAnimation = [self rotationDurTime:2 angle:360.f direction:-1 repeatCount:MAXFLOAT];
+    _rotationAnimation.delegate = self;
+    _rotationAnimation.removedOnCompletion = NO;
+    [_rotationAnimation setRepeatCount:HUGE_VALF];
+    _rotationAnimation.speed = 1;
+    [self.imageView.layer addAnimation:self.rotationAnimation forKey:@"rotate"];
+    
+    WS(ws);
+    //链接超时
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [ws stopAnimation];
+    });
+    
+}
+
+//暂停layer上面的动画
+-(void)pauseLayer:(CALayer*)layer{
+    
+    CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
+    layer.speed = 0.0;
+    layer.timeOffset = pausedTime;
+    
+}
+
+//周期时间 角度 方向 重复次数
+-(CABasicAnimation *)rotationDurTime:(float)durTime angle:(float)angle direction:(int)direction repeatCount:(int)repeatCount{
+    
+    CABasicAnimation* animation  = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
+//    animation.fromValue = [NSNumber numberWithFloat:0.f];
+    animation.toValue = [NSNumber numberWithFloat:M_PI];
+    animation.duration= durTime;
+    animation.cumulative= YES;//是否累加
+    animation.removedOnCompletion=NO;
+    animation.fillMode =kCAFillModeForwards;
+    animation.autoreverses = NO;//自动逆转
+    animation.repeatCount = repeatCount;
+    return animation;
+    
+}
+
+@end

+ 0 - 41
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.h

@@ -1,41 +0,0 @@
-//
-//  ShoesCarouselView.h
-//  Unity-iPhone
-//
-//  Created by duowan123 on 2021/8/31.
-//
-
-#import <UIKit/UIKit.h>
-#import <CoreBluetooth/CoreBluetooth.h>
-
-#import "TXCarouselCellModel.h"
-
-@protocol ConnectDeviceDelegate <NSObject>
-
--(void)connectDevice:(CBPeripheral*)peripheral;
-
-@end
-
-@interface ShoesCarouselView : UIView
-
-@property(nonatomic,assign)id<ConnectDeviceDelegate> delegate;
-
-/**
- 配置数据(固定TXCarouselView)
-
- @param array TXCarouselCellModelArray
- */
-//-(void)setArrayData:(NSArray <TXCarouselCellModel *>*)array;
-
-/**
- 配置数据(滑动TXCarouselView,加在ScrollViewv上时 需要传入)
- @param array TXCarouselCellModelArray
- @param superScrollView 父系ScrollView
- */
--(void)setArrayData:(NSArray <TXCarouselCellModel *>*)array;
-
--(void)yw_gotoNext:(NSInteger)index;
-
-
-@end
-

+ 0 - 403
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.m

@@ -1,403 +0,0 @@
-//
-//  ShoesCarouselView.m
-//  Unity-iPhone
-//
-//  Created by duowan123 on 2021/8/31.
-//
-
-#import "ShoesCarouselView.h"
-
-#import "ShoesCollectionCell.h"
-#import "TXCarouselViewLayout.h"
-
-#import "TXCarouselCellModel.h"
-#import <CoreMotion/CoreMotion.h>
-
-#define itemHight 1
-
-//当前 carousel 状态
-@interface  CarouselCurrentState : NSObject
-@property (nonatomic, assign) BOOL isOverturnState; //是否进入翻转状态
-@property (nonatomic, assign) BOOL isDragState;     //是否处于拖动状态
-@property (nonatomic, assign) BOOL isDidScroll;     //是否处于滑动状态
-@property (nonatomic, assign) BOOL isCenter;        //是否处于回到正中状态
-@property (nonatomic, assign) BOOL isRestrict;      //是否处于限制重力感应
-@property (nonatomic, assign) CGFloat lastCarouselPoint;//上一个lastPoint
-
-@end
-
-@implementation CarouselCurrentState
-@end
-
-typedef void (^OpenAccelerometerUpdatesBlock)(CGFloat value);
-typedef void (^OpenGyroUpdatesBlock)(CGFloat value);
-
-@interface ShoesCarouselView ()<
-UICollectionViewDelegateFlowLayout,
-UICollectionViewDataSource,
-UICollectionViewDelegate,
-UIScrollViewDelegate
->
-
-@property (nonatomic, strong) TXCarouselViewLayout *carouselViewLayout;
-@property (nonatomic, strong) CarouselCurrentState *currentState;//当前 carousel 状态
-@property (nonatomic, strong) UIScrollView *superScrollView;
-@property (nonatomic, strong) UICollectionView *collectionView;
-@property (nonatomic, strong) NSMutableArray *modelArray;
-@property (nonatomic, assign) CGFloat lasttimePoint;
-@property (nonatomic, assign) CGFloat gyrValue;//加速计值
-@property (nonatomic, assign) CGSize carouselSize;
-
-@property (nonatomic, assign)CGFloat lastContentOffsetY;
-
-@property (nonatomic, assign) CGFloat cIndex;
-@property (nonatomic, assign) BOOL turnLeft;//滑动方向
-@property (nonatomic, assign) BOOL isLeft_1;//第一次滑到最左边
-@property (nonatomic, assign) BOOL isRight_1;//第一次滑到最右边
-
-@end
-
-@implementation ShoesCarouselView
-
-
-#pragma mark - 生命周期
-- (instancetype)initWithCoder:(NSCoder *)coder{
-    
-    self = [super initWithCoder:coder];
-    if (self){
-        self.currentState = [[CarouselCurrentState alloc]init];
-        self.currentState.isOverturnState = NO;
-        self.currentState.isDragState = NO;
-        self.currentState.isDidScroll = NO;
-        self.currentState.isCenter = NO;
-        self.currentState.isRestrict = NO;
-        
-        self.userInteractionEnabled = NO;
-  
-    }
-    return self;
-    
-}
-
-//
--(void)layoutSubviews{
-    
-    NSLog(@"layoutSubviewslayoutSubviewslayoutSubviewslayoutSubviews");
-    self.carouselSize = self.frame.size;
-    [self createCollectionView];
-    [self.collectionView reloadData];
-    [self.collectionView layoutIfNeeded];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [self setpoint];
-    });
-    NSLog(@"这里运行一次");
-    //监听滑动结束的状态
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getNotificationAction:) name:@"ThisIsANoticafication" object:nil];
-    
-}
-
-//
--(void)setpoint{
-    [self.collectionView setContentOffset:CGPointMake(0, self.collectionView.contentOffset.y) animated:NO];
-    [self.collectionView setContentOffset:CGPointMake(0+((self.modelArray.count/2)*(self.carouselSize.height*itemHight)), self.collectionView.contentOffset.y) animated:NO];
-    self.currentState.lastCarouselPoint = 0;
-    [self setSlideEnd];
-}
-
-#pragma  mark - loadData
--(void)setArrayData:(NSArray<TXCarouselCellModel *> *)array{
-    
-    [self.modelArray removeAllObjects];
-    if (array.count<=0){
-        return;
-    }
-    
-    [self.modelArray addObjectsFromArray:array];
-    [self.collectionView reloadData];
-    [self.collectionView layoutIfNeeded];
-    
-    // 当只有一个数据源的时候 让cell滑到正中间
-    if (array.count==1){
-        
-        NSLog(@"设备列表只有一个数据源");
-        _cIndex = 0;
-        [self testAction];
-        
-    }else{
-        
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-             [self setpoint];
-         });
-        
-    }
-        
-    // 当只有两个数据源的时候 添加手势 防止collectionView数据少 没有占满屏幕 时候滑不动的BUG
-    if (array.count==2){
-        UISwipeGestureRecognizer *  left = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)];
-       [left setDirection:(UISwipeGestureRecognizerDirectionLeft)];
-       [self.collectionView addGestureRecognizer:left];
-        UISwipeGestureRecognizer *  right = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)];
-       [right setDirection:(UISwipeGestureRecognizerDirectionRight)];
-       [self.collectionView addGestureRecognizer:right];
-     }
-    
-}
-
-#pragma mark -- UISwipeGestureRecognizer
-- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{
-    
-   if(recognizer.direction == UISwipeGestureRecognizerDirectionLeft){
-       NSLog(@"swipe left");
-       [self yw_gotoNext:1];
-   }
-    
-   if(recognizer.direction == UISwipeGestureRecognizerDirectionRight){
-     NSLog(@"swipe right");
-       [self yw_gotoNext:-1];
-   }
-    
-}
-
-#pragma mark -- scrollView delegate
--(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
-    self.lastContentOffsetY = scrollView.contentOffset.x;
- }
-
--(void)scrollViewDidScroll:(UIScrollView *)scrollView{
-    
-    if (scrollView.contentOffset.x < self.lastContentOffsetY){
-//        NSLog(@"左左");
-        self.turnLeft = YES;
-        //第一次滑到最左-1
-        self.isLeft_1 = NO;
-
-    }else if (scrollView.contentOffset.x > self.lastContentOffsetY){
-//        NSLog(@"右右");
-        self.turnLeft = NO;
-        //第一次滑到最右-1
-        self.isRight_1 = NO;
-
-    }
-    
-}
-
-#pragma mark -- collectionView delegate
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
-    NSLog(@"numberOfItemsInSection-%zi",self.modelArray.count);
-    return  self.modelArray.count;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
-    
-    ShoesCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ShoesCollectionCell" forIndexPath:indexPath];
-    [cell setCarouselCellModel:self.modelArray[indexPath.row]];
-    
-    __weak typeof(self) weakSelf = self;
-    
-//    [cell setBlock:^{
-//        weakSelf.currentState.isDragState = YES;
-//        weakSelf.currentState.isCenter = YES;
-//    }];
-    
-    //单击cell 滚到cell位置
-    cell.tapGestureBlock = ^(NSInteger i){
-        _cIndex = i;
-        [self testAction];
-    };
-    return cell;
-    
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
-    
-    NSLog(@"选中了  ==== %ld",(long)indexPath.row);
-    ShoesCollectionCell * cell = (ShoesCollectionCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
-    cell.cusSelected = YES;
-    
-    //选中的cell滚到中间位置
-//    [self setpoint];
-    
-    //将当前滚动到的cell->蓝牙 回调给SearchDeviceViewController
-    TXCarouselCellModel * model = self.modelArray[indexPath.row];
-    if ([self.delegate respondsToSelector:@selector(connectDevice:)]){
-        [self.delegate connectDevice:model.peripheral];
-    }
-    
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath{
-//    NSLog(@"未选中  ==== %ld",(long)indexPath.row);
-    ShoesCollectionCell * cell = (ShoesCollectionCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
-    cell.cusSelected = NO;
-}
-
-#pragma mark - privately method
-/**
- 回到屏幕正中间
- */
--(void)setSlideEnd{
-
-    CGPoint collectionViewPoint = self.collectionView.contentOffset;
-    if ( self.currentState.lastCarouselPoint == collectionViewPoint.x||self.currentState.isDragState){
-        return;
-    }
-    CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-    CGFloat itemHeight = self.carouselSize.height*itemHight;
-    CGFloat index = roundf((self.collectionView.contentOffset.x+ viewHeight / 2 - itemHeight / 2) /itemHeight)-1;
-//    NSLog(@"setSlideEnd:x[%f]----y[%f]---index[%f]",collectionViewPoint.x,collectionViewPoint.y,index);
-
-    collectionViewPoint.x = itemHeight * index + itemHeight / 2 - viewHeight / 2;
-
-    [self.collectionView setContentOffset:CGPointMake(collectionViewPoint.x, collectionViewPoint.y) animated:YES];
-    self.currentState.lastCarouselPoint = self.collectionView.contentOffset.x;
-    self.currentState.isDidScroll = YES;
-
-    _cIndex = index;
-    NSLog(@"setSlideEnd:x[%f]----y[%f]---index[%f]",collectionViewPoint.x,collectionViewPoint.y,index);
-    
-    [self jugeSelected];
-
-}
-
-#pragma mark yw add 限制点击事件
-- (void)yw_gotoNext:(NSInteger)index{
-    
-    NSLog(@"yw_gotoNext:(NSInteger)index = %d %ld",(int)_cIndex,(long)index);
-    if ((int)_cIndex<1 && index == -1){//滑到最左边
-        return;
-    }else if ((int)_cIndex>self.modelArray.count-2 && index == 1){//滑到最左边
-        return;
-    }else{
-        _cIndex = _cIndex + index;
-        [self testAction];
-    }
-    
-}
-
-//setContentOffset到对应位置
-- (void)testAction{
-    
-    CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-    CGFloat itemHeight = self.carouselSize.height*itemHight;
-    CGFloat offsetX = (_cIndex + (itemHeight/2)/itemHeight - (viewHeight/2)/itemHeight)*itemHeight;
-    NSLog(@"testAction:%f----_cIndex:%f",offsetX,_cIndex);
-    [self.collectionView setContentOffset:CGPointMake(offsetX, 0) animated:YES];
-    
-    [self jugeSelected];
-    
-}
-
-#pragma mark leon add
-- (void)getNotificationAction:(NSNotification *)notification{
-    
-    NSDictionary * infoDic = [notification object];
-    // 这样就得到了我们在发送通知时候传入的字典了
-    NSNumber * number = infoDic[@"parameter"];
-    NSInteger i = [number integerValue];
-
-    NSLog(@"通知 number ==== %@  _cIndex = %f self.modelArray.count = %lu",number,_cIndex,(unsigned long)self.modelArray.count);
-
-    _cIndex = i;
-    [self endScroll];
-
-    if (i==1&&self.turnLeft==YES){
-                
-        NSLog(@"滑到最左边");
-        _cIndex = 0;
-        [self endScroll];
-        
-    }
-    if (i==self.modelArray.count-2&&self.turnLeft==NO){
-
-        NSLog(@"滑到最右边");
-        _cIndex = self.modelArray.count-1;
-        [self endScroll];
-    }
-    
-}
-
-//
--(void)endScroll{
-    
-    __weak typeof(self)WeakSelf = self;
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-   
-        CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-        CGFloat itemHeight = self.carouselSize.height*itemHight;
-        CGFloat offsetX = (_cIndex + (itemHeight/2)/itemHeight - (viewHeight/2)/itemHeight)*itemHeight;
-        //滚动到对应位置
-        [WeakSelf.collectionView setContentOffset:CGPointMake(offsetX, 0) animated:YES];
-        //当前选中的是哪个
-        [WeakSelf jugeSelected];
-        
-    });
-  
-}
-
-//判断哪个cell是选中的
--(void)jugeSelected{
-    
-    NSLog(@"jugeSelected (NSInteger)_cIndex = %ld",(NSInteger)_cIndex);
-    //判断哪个是选中的
-    for (NSInteger i =0; i<self.modelArray.count; i++){
-        
-        if (i == (NSInteger)_cIndex){//选中的cell
-            
-             NSIndexPath *indexPath = [NSIndexPath indexPathForItem:(NSInteger)_cIndex inSection:0];
-            if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:didSelectItemAtIndexPath:)]){
-                [self.collectionView.delegate collectionView:self.collectionView didSelectItemAtIndexPath:indexPath];
-            }
-            
-        }else{
-            
-            NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
-           if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:didDeselectItemAtIndexPath:)]){
-               [self.collectionView.delegate collectionView:self.collectionView didDeselectItemAtIndexPath:indexPath];
-           }
-            
-        }
-        
-    }
-    
-}
-
-#pragma mark - Lazy
--(TXCarouselViewLayout *)carouselViewLayout{
-    
-    if (!_carouselViewLayout){
-        CGFloat itemsHeight = _carouselSize.height*itemHight;
-        _carouselViewLayout = [[TXCarouselViewLayout alloc] init];
-        _carouselViewLayout.itemSize = CGSizeMake(itemsHeight, itemsHeight);
-        _carouselViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
-    }
-    return _carouselViewLayout;
-    
-}
-
--(void)createCollectionView{
-    
-    if (!self.collectionView){
-        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width,self.frame.size.height ) collectionViewLayout:self.carouselViewLayout];
-        self.collectionView.dataSource = self;
-        self.collectionView.delegate = self;
-        self.collectionView.pagingEnabled = NO;
-        self.collectionView.showsVerticalScrollIndicator = NO;
-        self.collectionView.showsHorizontalScrollIndicator = NO;
-        [self.collectionView registerNib:[UINib nibWithNibName:@"ShoesCollectionCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"ShoesCollectionCell"];
-        self.collectionView.backgroundColor = [UIColor whiteColor];
-        [self addSubview:self.collectionView];
-        self.collectionView.backgroundColor = [UIColor clearColor];
-    }
-    
-}
-
--(NSMutableArray *)modelArray{
-    
-    if (!_modelArray){
-        _modelArray = [[NSMutableArray alloc]init];
-    }
-    return _modelArray;
-    
-}
-
-@end

+ 0 - 28
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.h

@@ -1,28 +0,0 @@
-//
-//  ShoesCollectionCell.h
-//  Unity-iPhone
-//
-//  Created by duowan123 on 2021/8/31.
-//
-
-#import <UIKit/UIKit.h>
-#import "TXCarouselCellModel.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface ShoesCollectionCell : UICollectionViewCell
-
-@property (weak, nonatomic) IBOutlet UIView *covierView;
-@property (weak, nonatomic) IBOutlet UILabel *stateLable;
-
-@property (assign, nonatomic) BOOL cusSelected;
-
-@property(nonatomic,strong)TXCarouselCellModel * model;
--(void)setCarouselCellModel:(TXCarouselCellModel *)model;
-
-//点击cell回调block
-@property(nonatomic,copy)void(^tapGestureBlock)(NSInteger i);
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 111
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.m

@@ -1,111 +0,0 @@
-//
-//  ShoesCollectionCell.m
-//  Unity-iPhone
-//
-//  Created by duowan123 on 2021/8/31.
-//
-
-#import "ShoesCollectionCell.h"
-#import "CBPeripheral+ADName.h"
-
-#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
-#define SCALEoefficient(num)   (SCREEN_WIDTH/667.0)*(num)
-
-@interface ShoesCollectionCell ()<UIGestureRecognizerDelegate>
-@property (weak, nonatomic) IBOutlet UIImageView *imageView;
-@property (weak, nonatomic) IBOutlet UILabel *titleStr;
-
-@end
-
-@implementation ShoesCollectionCell
-
-- (void)awakeFromNib{
-    
-    [super awakeFromNib];
-    
-//    self.layer.shadowRadius = 6.0f;
-//    self.layer.shadowColor = [UIColor blackColor].CGColor;
-//    self.layer.shadowOpacity = 6.0f;
-//    self.layer.shadowOffset = CGSizeMake(0, 0);
-//    self.layer.masksToBounds = NO;
-    
-    self.covierView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
-    self.covierView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.16].CGColor;
-    self.covierView.layer.shadowOffset = CGSizeMake(0,3);
-    self.covierView.layer.shadowRadius = 6;
-    self.covierView.layer.shadowOpacity = 1;
-    self.covierView.layer.cornerRadius = 10;
-    
-    self.covierView.layer.masksToBounds = YES;
-    self.covierView.layer.borderColor = [UIColor whiteColor].CGColor;
-    self.covierView.layer.borderWidth = 3;
-    self.covierView.backgroundColor = [UIColor whiteColor];
-    self.covierView.layer.cornerRadius = 15;
-    
-//    self.imageView.layer.masksToBounds = YES;
-//    self.imageView.layer.cornerRadius = 70;
-    
-    self.titleStr.font = [UIFont systemFontOfSize: SCALEoefficient(20)];
-    
-    //状态label
-    NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"在线" attributes:@{NSFontAttributeName: [UIFont fontWithName:@"PingFang SC" size: 12], NSForegroundColorAttributeName: [UIColor colorWithRed:0/255.0 green:220/255.0 blue:66/255.0 alpha:1.0]}];
-    self.stateLable.attributedText = string;
-    self.stateLable.textColor = [UIColor colorWithRed:0/255.0 green:220/255.0 blue:66/255.0 alpha:1.0];
-    
-    //cell添加点击事件
-    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(myTableViewClick:)];
-    [self.contentView addGestureRecognizer:tapGesture];
-    
-    //
-    
-}
-
-#pragma mark - 点击事件
-- (void)myTableViewClick:(UIGestureRecognizer *)gestureRecognizer{
-    if (self.tapGestureBlock){
-        self.tapGestureBlock(self.model.newsId);
-    }
-}
-
-/**
- 加载数据
- @param model TXCarouselCellModel
- */
--(void)setCarouselCellModel:(TXCarouselCellModel *)model{
-    
-//    self.imageView.image = [UIImage imageNamed:model.imageUrl];
-    if (self.model!=model){
-        self.model = model;
-    }
-    if (model.peripheral!=nil){
-        NSLog(@" %@ ",model.peripheral);
-        self.titleStr.text = model.peripheral.advertiseName;
-    }
-    
-}
-
-//更新状态
--(void)setCusSelected:(BOOL)cusSelected{
-   
-    if (cusSelected == YES){
-        
-        self.covierView.layer.masksToBounds = YES;
-        self.covierView.layer.borderColor = [UIColor colorWithRed:255/255.0 green:196/255.0 blue:0/255.0 alpha:1.0].CGColor;
-        self.covierView.layer.borderWidth = 3;
-        self.covierView.backgroundColor = [UIColor colorWithRed:255/255.0 green:245/255.0 blue:210/255.0 alpha:1.0];
-        self.covierView.layer.cornerRadius = 15;
-
-    }else{
-        
-        self.covierView.layer.masksToBounds = YES;
-        self.covierView.layer.borderColor = [UIColor whiteColor].CGColor;
-        self.covierView.layer.borderWidth = 3;
-        self.covierView.backgroundColor = [UIColor whiteColor];
-        self.covierView.layer.cornerRadius = 15;
-             
-    }
-    
-}
-
-@end
-

+ 0 - 73
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCollectionCell.xib

@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina6_1" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="jr8-xA-tUP" customClass="ShoesCollectionCell">
-            <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-            <autoresizingMask key="autoresizingMask"/>
-            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                <subviews>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tfp-Y9-ewB">
-                        <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-                        <subviews>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gamepop_shoes.png" translatesAutoresizingMaskIntoConstraints="NO" id="Kjh-S8-wbt">
-                                <rect key="frame" x="26.5" y="20.5" width="140" height="100"/>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="100" id="2N3-0f-boH"/>
-                                    <constraint firstAttribute="width" constant="140" id="csp-CZ-mMg"/>
-                                </constraints>
-                            </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="设备名字7个字" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qVV-VO-9dC">
-                                <rect key="frame" x="0.0" y="130.5" width="193" height="40"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="40" id="ljL-xf-aKV"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <nil key="textColor"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <constraints>
-                            <constraint firstAttribute="trailing" secondItem="qVV-VO-9dC" secondAttribute="trailing" id="7uS-XB-5xe"/>
-                            <constraint firstItem="Kjh-S8-wbt" firstAttribute="centerX" secondItem="tfp-Y9-ewB" secondAttribute="centerX" id="OnM-ie-CSx"/>
-                            <constraint firstItem="Kjh-S8-wbt" firstAttribute="centerY" secondItem="tfp-Y9-ewB" secondAttribute="centerY" constant="-20" id="QWq-Ef-tO9"/>
-                            <constraint firstItem="qVV-VO-9dC" firstAttribute="leading" secondItem="tfp-Y9-ewB" secondAttribute="leading" id="g5E-nC-J2X"/>
-                            <constraint firstItem="qVV-VO-9dC" firstAttribute="top" secondItem="Kjh-S8-wbt" secondAttribute="bottom" constant="10" id="mSu-pJ-2wD"/>
-                        </constraints>
-                    </view>
-                </subviews>
-            </view>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="tfp-Y9-ewB" secondAttribute="trailing" id="4dP-wZ-RMv"/>
-                <constraint firstAttribute="trailing" secondItem="tfp-Y9-ewB" secondAttribute="trailing" id="6ST-zX-cZT"/>
-                <constraint firstAttribute="bottom" secondItem="tfp-Y9-ewB" secondAttribute="bottom" id="JC7-AD-M77"/>
-                <constraint firstAttribute="bottom" secondItem="tfp-Y9-ewB" secondAttribute="bottom" id="KLa-qi-M7Y"/>
-                <constraint firstItem="tfp-Y9-ewB" firstAttribute="leading" secondItem="jr8-xA-tUP" secondAttribute="leading" id="KUC-03-LZE"/>
-                <constraint firstItem="tfp-Y9-ewB" firstAttribute="top" secondItem="jr8-xA-tUP" secondAttribute="top" id="bgN-3A-kkl"/>
-                <constraint firstItem="tfp-Y9-ewB" firstAttribute="top" secondItem="jr8-xA-tUP" secondAttribute="top" id="c5r-Kh-4Wh"/>
-                <constraint firstItem="tfp-Y9-ewB" firstAttribute="leading" secondItem="jr8-xA-tUP" secondAttribute="leading" id="uwK-uY-9d5"/>
-            </constraints>
-            <size key="customSize" width="111" height="129"/>
-            <connections>
-                <outlet property="covierView" destination="tfp-Y9-ewB" id="42j-nz-lFI"/>
-                <outlet property="imageView" destination="Kjh-S8-wbt" id="Nxa-P0-ROr"/>
-                <outlet property="titleStr" destination="qVV-VO-9dC" id="ICc-zT-9gI"/>
-            </connections>
-            <point key="canvasLocation" x="-59" y="42"/>
-        </collectionViewCell>
-    </objects>
-    <resources>
-        <image name="gamepop_shoes.png" width="68" height="43.5"/>
-    </resources>
-</document>

+ 0 - 20
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCellModel.h

@@ -1,20 +0,0 @@
-//
-//  TXCarouselCellModel.h
-//  textView
-//
-//  Created by 新华龙mac on 2018/1/10.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-#import <CoreBluetooth/CoreBluetooth.h>
-
-@interface TXCarouselCellModel : NSObject
-@property (nonatomic, assign) NSInteger newsId;
-@property (nonatomic, strong) NSString *titleStr;
-@property (nonatomic, strong) NSString *imageUrl;
-
-@property (nonatomic, strong) CBPeripheral *peripheral;
-
-@end

+ 0 - 15
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCellModel.m

@@ -1,15 +0,0 @@
-//
-//  TXCarouselCellModel.m
-//  textView
-//
-//  Created by 新华龙mac on 2018/1/10.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import "TXCarouselCellModel.h"
-
-@implementation TXCarouselCellModel
--(void)setModel:(TXCarouselCellModel *)model{
-    
-}
-@end

+ 0 - 25
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.h

@@ -1,25 +0,0 @@
-//
-//  TXCustomCollectionViewCell.h
-//  slidetext
-//
-//  Created by 新华龙mac on 2018/1/16.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "TXCarouselCellModel.h"
-
-@interface TXCarouselCollectionViewCell : UICollectionViewCell
-
-@property (weak, nonatomic) IBOutlet UIView *covierView;
-@property (weak, nonatomic) IBOutlet UILabel *stateLable;
-
-@property (assign, nonatomic) BOOL cusSelected;
-
-
--(void)setCarouselCellModel:(TXCarouselCellModel *)model;
-
-
-@property(nonatomic,copy)void(^block)(void);
-
-@end

+ 0 - 99
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.m

@@ -1,99 +0,0 @@
-//
-//  TXCustomCollectionViewCell.m
-//  slidetext
-//
-//  Created by 新华龙mac on 2018/1/16.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import "TXCarouselCollectionViewCell.h"
-
-@interface TXCarouselCollectionViewCell()<UIGestureRecognizerDelegate>
-@property (weak, nonatomic) IBOutlet UIImageView *imageView;
-@property (weak, nonatomic) IBOutlet UILabel *titleStr;
-
-@end
-
-@implementation TXCarouselCollectionViewCell
-
-- (void)awakeFromNib{
-    
-    [super awakeFromNib];
-    
-//    self.layer.shadowRadius = 6.0f;
-//    self.layer.shadowColor = [UIColor blackColor].CGColor;
-//    self.layer.shadowOpacity = 6.0f;
-//    self.layer.shadowOffset = CGSizeMake(0, 0);
-//    self.layer.masksToBounds = NO;
-    
-    self.covierView.layer.masksToBounds = YES;
-    self.covierView.layer.borderColor = [UIColor whiteColor].CGColor;
-    self.covierView.layer.borderWidth = 3;
-    self.covierView.backgroundColor = [UIColor whiteColor];
-    self.covierView.layer.cornerRadius = 15;
-    
-    self.imageView.layer.masksToBounds = YES;
-    self.imageView.layer.cornerRadius = 70;
-    
-    //状态label
-    NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"在线" attributes:@{NSFontAttributeName: [UIFont fontWithName:@"PingFang SC" size: 12], NSForegroundColorAttributeName: [UIColor colorWithRed:0/255.0 green:220/255.0 blue:66/255.0 alpha:1.0]}];
-    self.stateLable.attributedText = string;
-    self.stateLable.textColor = [UIColor colorWithRed:0/255.0 green:220/255.0 blue:66/255.0 alpha:1.0];
-    
-}
-
-/**
- 解决手势冲突
- @param gestureRecognizer gestureRecognizer
- @param otherGestureRecognizer otherGestureRecognizer
- @return bool
- */
--(BOOL)gestureRecognizer:(UIGestureRecognizer*) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer{
-    
-    if ([gestureRecognizer.view isKindOfClass:[UICollectionView class]]){
-        return NO;
-    }else{
-        return YES;
-    }
-    
-}
-
-/**
- 手势滑动
- */
--(void)panSild{
-    if (self.block) {self.block();}
-}
-
-/**
- 加载数据
-
- @param model TXCarouselCellModel
- */
--(void)setCarouselCellModel:(TXCarouselCellModel *)model{
-//    self.imageView.image = [UIImage imageNamed:model.imageUrl];
-//    self.titleStr.text = model.titleStr;
-}
-
--(void)setCusSelected:(BOOL)cusSelected{
-   
-    if (cusSelected == YES){
-        
-        self.covierView.layer.masksToBounds = YES;
-        self.covierView.layer.borderColor = [UIColor colorWithRed:255/255.0 green:196/255.0 blue:0/255.0 alpha:1.0].CGColor;
-        self.covierView.layer.borderWidth = 3;
-        self.covierView.backgroundColor = [UIColor colorWithRed:255/255.0 green:245/255.0 blue:210/255.0 alpha:1.0];
-        self.covierView.layer.cornerRadius = 15;
-
-    }else{
-        
-        self.covierView.layer.masksToBounds = YES;
-        self.covierView.layer.borderColor = [UIColor whiteColor].CGColor;
-        self.covierView.layer.borderWidth = 3;
-        self.covierView.backgroundColor = [UIColor whiteColor];
-        self.covierView.layer.cornerRadius = 15;
-             
-    }
-    
-}
-@end

+ 0 - 86
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselCollectionViewCell.xib

@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina6_5" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
-        <capability name="System colors in document resources" minToolsVersion="11.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="TXCarouselCollectionViewCell">
-            <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-            <autoresizingMask key="autoresizingMask"/>
-            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                <subviews>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFN-X7-bdp">
-                        <rect key="frame" x="0.0" y="0.0" width="193" height="181"/>
-                        <subviews>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wtP-54-JOE">
-                                <rect key="frame" x="26.666666666666671" y="0.6666666666666714" width="140" height="140"/>
-                                <color key="backgroundColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="calibratedRGB"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="140" id="CwA-fz-5Xc"/>
-                                    <constraint firstAttribute="height" constant="140" id="sLa-ht-nz6"/>
-                                </constraints>
-                            </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="网友名字7个字" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Vk-B9-hSK">
-                                <rect key="frame" x="0.0" y="140.66666666666666" width="193" height="40"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="40" id="R33-DD-Rfr"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <nil key="textColor"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="· 在线" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A8N-o1-bXF">
-                                <rect key="frame" x="0.0" y="180.66666666666666" width="193" height="30"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="30" id="5xm-mk-bps"/>
-                                    <constraint firstAttribute="height" constant="30" id="tIP-l7-Viv"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                                <color key="textColor" red="0.0" green="0.99757534265518188" blue="0.18224716186523438" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                        </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
-                        <constraints>
-                            <constraint firstItem="A8N-o1-bXF" firstAttribute="leading" secondItem="RFN-X7-bdp" secondAttribute="leading" id="0kv-9Q-eap"/>
-                            <constraint firstItem="A8N-o1-bXF" firstAttribute="top" secondItem="7Vk-B9-hSK" secondAttribute="bottom" id="FBa-Bv-kUv"/>
-                            <constraint firstItem="7Vk-B9-hSK" firstAttribute="leading" secondItem="RFN-X7-bdp" secondAttribute="leading" id="IJU-kR-wvN"/>
-                            <constraint firstItem="7Vk-B9-hSK" firstAttribute="top" secondItem="wtP-54-JOE" secondAttribute="bottom" id="KIa-Fu-QR5"/>
-                            <constraint firstAttribute="trailing" secondItem="7Vk-B9-hSK" secondAttribute="trailing" id="MEf-jF-V3h"/>
-                            <constraint firstItem="wtP-54-JOE" firstAttribute="centerY" secondItem="RFN-X7-bdp" secondAttribute="centerY" constant="-20" id="VdR-JD-EJC"/>
-                            <constraint firstItem="wtP-54-JOE" firstAttribute="centerX" secondItem="RFN-X7-bdp" secondAttribute="centerX" id="c3P-K1-ujz"/>
-                            <constraint firstAttribute="trailing" secondItem="A8N-o1-bXF" secondAttribute="trailing" id="zYS-v8-Www"/>
-                        </constraints>
-                    </view>
-                </subviews>
-            </view>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="RFN-X7-bdp" secondAttribute="trailing" id="1Pj-ew-3Aj"/>
-                <constraint firstItem="RFN-X7-bdp" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Gr4-W1-1G5"/>
-                <constraint firstAttribute="bottom" secondItem="RFN-X7-bdp" secondAttribute="bottom" id="Ou4-Tf-F52"/>
-                <constraint firstItem="RFN-X7-bdp" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="sIy-tS-Pdf"/>
-            </constraints>
-            <size key="customSize" width="111" height="129"/>
-            <connections>
-                <outlet property="covierView" destination="RFN-X7-bdp" id="9oo-Pa-LGL"/>
-                <outlet property="imageView" destination="wtP-54-JOE" id="7rb-Pg-arY"/>
-                <outlet property="stateLable" destination="A8N-o1-bXF" id="f2M-e0-9Vi"/>
-                <outlet property="titleStr" destination="7Vk-B9-hSK" id="32l-ZG-FYX"/>
-            </connections>
-            <point key="canvasLocation" x="-79" y="47"/>
-        </collectionViewCell>
-    </objects>
-    <resources>
-        <systemColor name="systemBackgroundColor">
-            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-        </systemColor>
-    </resources>
-</document>

+ 0 - 33
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselView.h

@@ -1,33 +0,0 @@
-//
-//  TXCarouselView.h
-//  textView
-//
-//  Created by 新华龙mac on 2018/1/17.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "TXCarouselCellModel.h"
-
-@interface TXCarouselView : UIView
-
-/**
- 配置数据(固定TXCarouselView)
-
- @param array TXCarouselCellModelArray
- */
-//-(void)setArrayData:(NSArray <TXCarouselCellModel *>*)array;
-
-/**
- 配置数据(滑动TXCarouselView,加在ScrollViewv上时 需要传入)
- @param array TXCarouselCellModelArray
- @param superScrollView 父系ScrollView
- */
--(void)setArrayData:(NSArray <TXCarouselCellModel *>*)array;
-
-
--(void)yw_gotoNext:(NSInteger)index;
-
-
-
-@end

+ 0 - 338
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselView.m

@@ -1,338 +0,0 @@
-//
-//  TXCarouselView.m
-//  textView
-//
-//  Created by 新华龙mac on 2018/1/17.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import "TXCarouselView.h"
-#import "TXCarouselCollectionViewCell.h"
-#import "TXCarouselViewLayout.h"
-
-#import "TXCarouselCellModel.h"
-#import <CoreMotion/CoreMotion.h>
-
-#define itemHight 1
-
-//当前 carousel 状态
-@interface  carouselCurrentState : NSObject
-@property (nonatomic, assign) BOOL isOverturnState; //是否进入翻转状态
-@property (nonatomic, assign) BOOL isDragState;     //是否处于拖动状态
-@property (nonatomic, assign) BOOL isDidScroll;     //是否处于滑动状态
-@property (nonatomic, assign) BOOL isCenter;        //是否处于回到正中状态
-@property (nonatomic, assign) BOOL isRestrict;      //是否处于限制重力感应
-@property (nonatomic, assign) CGFloat lastCarouselPoint;//上一个lastPoint
-
-@end
-
-@implementation carouselCurrentState
-@end
-
-typedef void (^OpenAccelerometerUpdatesBlock)(CGFloat value);
-typedef void (^OpenGyroUpdatesBlock)(CGFloat value);
-
-@interface TXCarouselView ()<
-UICollectionViewDelegateFlowLayout,
-UICollectionViewDataSource,
-UICollectionViewDelegate,
-UIScrollViewDelegate
->
-
-@property (nonatomic, strong) TXCarouselViewLayout *carouselViewLayout;
-@property (nonatomic, strong) carouselCurrentState *currentState;//当前 carousel 状态
-@property (nonatomic, strong) UIScrollView *superScrollView;
-@property (nonatomic, strong) UICollectionView *collectionView;
-@property (nonatomic, strong) NSMutableArray *modelArray;
-@property (nonatomic, assign) CGFloat lasttimePoint;
-@property (nonatomic, assign) CGFloat gyrValue;//加速计值
-@property (nonatomic, assign) CGSize carouselSize;
-
-@property (nonatomic, assign)CGFloat lastContentOffsetY;
-
-@property (nonatomic, assign) CGFloat cIndex;
-@property (nonatomic, assign) BOOL turnLeft;//滑动方向
-
-@end
-
-@implementation TXCarouselView
-
-
-
-#pragma mark - 生命周期
-- (instancetype)initWithCoder:(NSCoder *)coder{
-    
-    self = [super initWithCoder:coder];
-    
-    if (self){
-  
-        self.currentState = [[carouselCurrentState alloc]init];
-        self.currentState.isOverturnState = NO;
-        self.currentState.isDragState = NO;
-        self.currentState.isDidScroll = NO;
-        self.currentState.isCenter = NO;
-        self.currentState.isRestrict = NO;
-  
-    }
-    return self;
-    
-}
-
--(void)layoutSubviews{
-    
-    NSLog(@"layoutSubviewslayoutSubviewslayoutSubviewslayoutSubviews");
-    self.carouselSize = self.frame.size;
-    [self createCollectionView];
-    [self.collectionView reloadData];
-    [self.collectionView layoutIfNeeded];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [self setpoint];
-    });
-    
-    //监听滑动结束的状态
-    [[NSNotificationCenter defaultCenter]
-    addObserver:self selector:@selector(getNotificationAction:) name:@"ThisIsANoticafication" object:nil];
-
-}
-
--(void)setpoint{
-    [self.collectionView setContentOffset:CGPointMake(0, self.collectionView.contentOffset.y) animated:NO];
-    [self.collectionView setContentOffset:CGPointMake(0+((self.modelArray.count/2)*(self.carouselSize.height*itemHight)), self.collectionView.contentOffset.y) animated:NO];
-    self.currentState.lastCarouselPoint = 0;
-    [self setSlideEnd];
-}
-
-#pragma  mark - loadData
--(void)setArrayData:(NSArray<TXCarouselCellModel *> *)array{
-    
-    [self.modelArray removeAllObjects];
-    if (array.count<=0){
-        return;
-    }
-    [self.modelArray addObjectsFromArray:array];
-//    NSInteger index = 1;
-//    for (int i = 0; i<index; i++){
-//        [self.modelArray addObjectsFromArray:self.modelArray];
-//    }
-//    self.superScrollView = superScrollView;
-
-}
-
-
-#pragma mark -- scrollView delegate
--(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
-    self.lastContentOffsetY = scrollView.contentOffset.x;
- }
-
--(void)scrollViewDidScroll:(UIScrollView *)scrollView{
-    
-    if (scrollView.contentOffset.x < self.lastContentOffsetY){
-//        NSLog(@"左左");
-        self.turnLeft = YES;
-    } else if (scrollView.contentOffset.x > self.lastContentOffsetY){
-//        NSLog(@"右右");
-        self.turnLeft = NO;
-    }
-    
-}
-
-#pragma mark -- collectionView delegate
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
-    NSLog(@"numberOfItemsInSection-%zi",self.modelArray.count);
-    return  self.modelArray.count;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
-//    __weak typeof(self) weakSelf = self;
-    TXCarouselCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TXCarouselCollectionViewCell" forIndexPath:indexPath];
-    [cell setCarouselCellModel:self.modelArray[indexPath.row]];
-//    [cell setBlock:^{
-//        weakSelf.currentState.isDragState = YES;
-//        weakSelf.currentState.isCenter = NO;
-//    }];
-    return cell;
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
-    
-//    NSLog(@"选中了  ==== %ld",(long)indexPath.row);
-    TXCarouselCollectionViewCell * cell = (TXCarouselCollectionViewCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
-    cell.cusSelected = YES;
-    
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath{
-//    NSLog(@"未选中  ==== %ld",(long)indexPath.row);
-    TXCarouselCollectionViewCell * cell = (TXCarouselCollectionViewCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
-    cell.cusSelected = NO;
-}
-
-#pragma mark - privately method
-/**
- 回到屏幕正中间
- */
--(void)setSlideEnd{
-
-    CGPoint collectionViewPoint = self.collectionView.contentOffset;
-    if ( self.currentState.lastCarouselPoint == collectionViewPoint.x||self.currentState.isDragState){
-        return;
-    }
-    CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-    CGFloat itemHeight = self.carouselSize.height*itemHight;
-    CGFloat index = roundf((self.collectionView.contentOffset.x+ viewHeight / 2 - itemHeight / 2) /itemHeight)-1;
-//    NSLog(@"setSlideEnd:x[%f]----y[%f]---index[%f]",collectionViewPoint.x,collectionViewPoint.y,index);
-
-    collectionViewPoint.x = itemHeight * index + itemHeight / 2 - viewHeight / 2;
-
-    [self.collectionView setContentOffset:CGPointMake(collectionViewPoint.x, collectionViewPoint.y) animated:YES];
-    self.currentState.lastCarouselPoint = self.collectionView.contentOffset.x;
-    self.currentState.isDidScroll = NO;
-
-    _cIndex = index;
-    NSLog(@"setSlideEnd:x[%f]----y[%f]---index[%f]",collectionViewPoint.x,collectionViewPoint.y,index);
-    
-    [self jugeSelected];
-
-}
-
-#pragma mark yw add
-- (void)yw_gotoNext:(NSInteger)index{
-    
-    NSLog(@"yw_gotoNext:(NSInteger)index = %d %ld",(int)_cIndex,(long)index);
-    if ((int)_cIndex<1 && index == -1){//滑到最左边
-        return;
-    }else if ((int)_cIndex>self.modelArray.count-2 && index == 1){//滑到最左边
-        return;
-    }else{
-        _cIndex = _cIndex + index;
-        [self testAction];
-    }
-    
-}
-
-//setContentOffset到对应位置
-- (void)testAction{
-    
-    CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-    CGFloat itemHeight = self.carouselSize.height*itemHight;
-    CGFloat offsetX = (_cIndex + (itemHeight/2)/itemHeight - (viewHeight/2)/itemHeight)*itemHeight;
-    NSLog(@"testAction:%f----_cIndex:%f",offsetX,_cIndex);
-    [self.collectionView setContentOffset:CGPointMake(offsetX, 0) animated:YES];
-    
-    [self jugeSelected];
-    
-}
-
-
-#pragma mark leon add
-- (void)getNotificationAction:(NSNotification *)notification{
-    
-    NSDictionary * infoDic = [notification object];
-    // 这样就得到了我们在发送通知时候传入的字典了
-    NSNumber * number = infoDic[@"parameter"];
-    NSInteger i = [number integerValue];
-
-    NSLog(@"通知 number ==== %@  _cIndex = %f self.modelArray.count = %lu",number,_cIndex,(unsigned long)self.modelArray.count);
-
-    _cIndex = i;
-    [self endScroll];
-
-//    if (i==1&&self.turnLeft==YES){
-//        NSLog(@"滑到最左边");
-//        _cIndex = 0;
-//        [self endScroll];
-//    }
-//    if (i==self.modelArray.count-2&&self.turnLeft==NO){
-//
-//        NSLog(@"滑到最右边");
-//        _cIndex = self.modelArray.count-1;
-//        [self endScroll];
-//    }
-    
-}
-
--(void)endScroll{
-    
-    __weak typeof(self)WeakSelf = self;
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-   
-        CGFloat viewHeight = CGRectGetWidth(self.collectionView.frame);
-        CGFloat itemHeight = self.carouselSize.height*itemHight;
-        CGFloat offsetX = (_cIndex + (itemHeight/2)/itemHeight - (viewHeight/2)/itemHeight)*itemHeight;
-        //滚动到对应位置
-        [WeakSelf.collectionView setContentOffset:CGPointMake(offsetX, 0) animated:YES];
-        //当前选中的是哪个
-        [WeakSelf jugeSelected];
-        
-    });
-  
-}
-
-//判断哪个cell是选中的
--(void)jugeSelected{
-    
-    NSLog(@"jugeSelected (NSInteger)_cIndex = %ld",(NSInteger)_cIndex);
-    //判断哪个是选中的
-    for (NSInteger i =0; i<self.modelArray.count; i++){
-        
-        if (i == (NSInteger)_cIndex){//选中的cell
-            
-             NSIndexPath *indexPath = [NSIndexPath indexPathForItem:(NSInteger)_cIndex inSection:0];
-            if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:didSelectItemAtIndexPath:)]){
-                [self.collectionView.delegate collectionView:self.collectionView didSelectItemAtIndexPath:indexPath];
-            }
-            
-        }else{
-            
-            NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
-           if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:didDeselectItemAtIndexPath:)]){
-               [self.collectionView.delegate collectionView:self.collectionView didDeselectItemAtIndexPath:indexPath];
-           }
-            
-        }
-        
-    }
-    
-}
-
-
-#pragma mark - Lazy
--(TXCarouselViewLayout *)carouselViewLayout{
-    
-    if (!_carouselViewLayout){
-        CGFloat itemsHeight = _carouselSize.height*itemHight;
-        _carouselViewLayout = [[TXCarouselViewLayout alloc] init];
-        _carouselViewLayout.itemSize = CGSizeMake(itemsHeight, itemsHeight);
-        _carouselViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
-    }
-    return _carouselViewLayout;
-    
-}
-
--(void)createCollectionView{
-    
-    if (!self.collectionView){
-        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width,self.frame.size.height ) collectionViewLayout:self.carouselViewLayout];
-        self.collectionView.dataSource = self;
-        self.collectionView.delegate = self;
-        self.collectionView.pagingEnabled = NO;
-        self.collectionView.showsVerticalScrollIndicator = NO;
-        self.collectionView.showsHorizontalScrollIndicator = NO;
-        [self.collectionView registerNib:[UINib nibWithNibName:@"TXCarouselCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"TXCarouselCollectionViewCell"];
-        self.collectionView.backgroundColor = [UIColor whiteColor];
-        [self addSubview:self.collectionView];
-        self.collectionView.backgroundColor = [UIColor yellowColor];
-    }
-    
-}
-
--(NSMutableArray *)modelArray{
-    
-    if (!_modelArray){
-        _modelArray = [[NSMutableArray alloc]init];
-    }
-    return _modelArray;
-    
-}
-
-@end

+ 0 - 22
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselViewLayout.h

@@ -1,22 +0,0 @@
-//
-//  TXCarouselViewLayout.h
-//  textView
-//
-//  Created by 新华龙mac on 2018/1/17.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-
-@interface TXCarouselViewLayout : UICollectionViewLayout
-@property (nonatomic,assign) CGSize itemSize;
-@property (nonatomic,assign) NSInteger visibleCount;
-@property (nonatomic) UICollectionViewScrollDirection scrollDirection;
-
-@property (nonatomic,copy)void(^TargetScrollEnd)(NSInteger i);//预留
-
-
-
-@end
-

+ 0 - 174
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/TXCarouselViewLayout.m

@@ -1,174 +0,0 @@
-//
-//  TXCarouselViewLayout.m
-//  HJCarouselDemo
-//
-//  Created by 新华龙mac on 2018/1/17.
-//  Copyright © 2018年 新华龙mac. All rights reserved.
-//
-
-#import "TXCarouselViewLayout.h"
-
-#define INTERSPACEPARAM  0.90
-@interface TXCarouselViewLayout ()
-@property (nonatomic, assign) CGFloat collectionViewWidth;
-@property (nonatomic, assign) CGFloat itemWidth;
-@property (nonatomic, assign) CGFloat lastDirectionIndex;
-@property (nonatomic, assign) CGFloat slidDistance;
-@property (nonatomic, strong) NSIndexPath *lastIndexOne;
-@end
-
-@implementation TXCarouselViewLayout
-
-/**
- * 当collectionView的显示范围发生改变的时候,是否需要重新刷新布局
- * 一旦重新刷新布局,就会重新调用下面的方法
- 1.prepareLayout
- 2.layoutAttributesForElementsInRect:方法
- */
-- (void)prepareLayout{
-    [super prepareLayout];
-    self.visibleCount = 9;
-    self.collectionViewWidth = CGRectGetWidth(self.collectionView.frame);
-    self.itemWidth = self.itemSize.width;
-//    self.itemWidth = self.itemSize.width;
-}
-
-- (CGSize)collectionViewContentSize{
-    NSInteger cellCount = [self.collectionView numberOfItemsInSection:0];
-    if (self.scrollDirection == UICollectionViewScrollDirectionVertical){
-        return CGSizeMake(CGRectGetWidth(self.collectionView.frame), cellCount * self.itemWidth);
-    }
-    return CGSizeMake(cellCount * self.itemWidth, CGRectGetHeight(self.collectionView.frame));
-}
-
-/**
- * 这个方法的返回值是一个数组(数组里面存放着rect范围内所有元素的布局属性)
- * 这个数组中存放的都是UICollectionViewLayoutAttributes对象
- * 这个方法的返回值决定了rect范围内所有元素的排布(frame)
- * */
-- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect{
-    
-    NSInteger cellCount = [self.collectionView numberOfItemsInSection:0];
-    CGFloat centerX =  self.collectionView.contentOffset.x + self.collectionViewWidth / 2;
-    NSInteger totalCount = centerX / self.itemWidth;
-    NSInteger count = (self.visibleCount) / 2;
-    NSInteger minIndex = MAX(0, (totalCount - count));
-    NSInteger maxIndex = MIN((cellCount - 1), (totalCount + count));
-//    NSLog(@"minIndex = %ld  maxIndex = %ld",minIndex,maxIndex);
-    NSMutableArray *array = [NSMutableArray array];
-    for (NSInteger i = minIndex; i <= maxIndex; i++){
-        NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
-        UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
-        [array addObject:attributes];
-    }
-    return array;
-    //
-    
-}
-
-//返回每个cell的中心值和 缩放系数
-- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath{
-    
-    UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
-    attributes.size = self.itemSize;
-    CGFloat cX = self.collectionView.contentOffset.x + self.collectionViewWidth / 2;
-    CGFloat attributesX = self.itemWidth * indexPath.row + self.itemWidth / 2;//
-    attributes.zIndex = -ABS(attributesX - cX);
-    CGFloat delta = cX - attributesX;
-    CGFloat ratio =  - delta / (self.itemWidth * 2);
-    CGFloat scale = 0.6 - ABS(delta) / (self.itemWidth * 6.0) * cos(ratio * M_2_PI*0.9);
-    attributes.transform = CGAffineTransformMakeScale(scale, scale);
-    CGFloat centerY = attributesX;
-//    NSLog(@"scale= %f",scale);
-//    NSLog(@"indexPath = %ld",(long)indexPath.row);
-//    NSLog(@"self.lastIndexOne = %ld",(long)self.lastIndexOne.row);
-//    NSLog(@"scale ======== %f",scale);
-    if (scale>0.999){//滑动到最前面时, 交换持有者
-         self.lastIndexOne = indexPath;
-    }
-    if (self.lastIndexOne == indexPath){
-        CGFloat index1 = 0.0f;
-        if ([self judgeDirection:centerY]){
-            index1 = 2;
-        }else{
-            index1 = -2;
-        }
-        centerY = cX + sin(ratio * 1.31) * self.itemWidth * INTERSPACEPARAM*2.2+index1;
-        //双保险,如果滑动急快的情况下,方法没有获取到最高点的坐标会导致判断失败scale>0.999 实效,
-        //所以启用判断scale <= 0.84加以纠正。(且只有在上述方法实效的情况下调用,所以不能使用|| ,不然有冲突,)
-        if (scale <= 0.84){
-            if ([self judgeDirection:centerY]){
-                NSIndexPath *indexNext = [NSIndexPath indexPathForRow:self.lastIndexOne.row+1 inSection:0];
-                self.lastIndexOne = indexNext;
-            }else{
-                NSIndexPath *indexNext = [NSIndexPath indexPathForRow:self.lastIndexOne.row-1 inSection:0];
-                self.lastIndexOne = indexNext;
-            }
-        }
-        if (scale <=0.9172) {
-            CGFloat sinIndex = sin(ratio * 1.31) * self.itemWidth * INTERSPACEPARAM*2.7+index1;
-            if ([self judgeDirection:centerY]) {
-                centerY = centerY-(sinIndex+(self.itemSize.width*96/124));
-            }else{
-                centerY = centerY-(sinIndex-(self.itemSize.width*96/124));
-            }
-        }
-        self.lastDirectionIndex = centerY;
-    }else{
-        centerY = cX + sin(ratio * 1.217) * self.itemWidth * INTERSPACEPARAM;
-    }
-    attributes.center = CGPointMake(centerY, CGRectGetHeight(self.collectionView.frame) / 2);
-    return attributes;
-    
-}
-
-/**
- * 这个方法的返回值,就决定了collectionView停止滚动时的偏移量
- * 这个方法在滚动松手的那一刻调用
- */
-- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity{
-    
-//    NSLog(@"proposedContentOffset = (%f,%f)",proposedContentOffset.x,proposedContentOffset.y);
-//    NSLog(@"velocity = (%f,%f)",velocity.x,velocity.y);
-
-    CGFloat index = roundf((proposedContentOffset.x + self.collectionViewWidth / 2 - self.itemWidth / 2) / self.itemWidth);
-//    NSLog(@"test1 = %f",proposedContentOffset.x + self.collectionViewWidth / 2 - self.itemWidth / 2);
-//    NSLog(@"test2 = %f",(proposedContentOffset.x + self.collectionViewWidth / 2 - self.itemWidth / 2) / self.itemWidth);
-//    [index intVelue];
-//    NSLog(@"self.collectionViewWidth = %f",self.collectionViewWidth);
-//    NSLog(@"self.itemWidth = %f",self.itemWidth);
-    NSLog(@"indexindexindexindex = %f",index);
-    proposedContentOffset.x = self.itemWidth * index + self.itemWidth / 2 - self.collectionViewWidth / 2;
-    // proposedContentOffset 预计的位置(滚动结束时)
-    
-    NSInteger i = (NSInteger)index;
-    [[NSNotificationCenter defaultCenter] postNotificationName:@"ThisIsANoticafication" object:@{@"parameter":@(i)}];
-    
-//    //leon 回调i值
-//    NSInteger i = (NSInteger)index;
-//    if (self.TargetScrollEnd){
-//        self.TargetScrollEnd(i);
-//    }
-    
-    return proposedContentOffset;
-    
-}
-
-//判断滑动的方向(yes往左,no为右);
--(BOOL)judgeDirection:(CGFloat)index{
-    
-    if (self.lastDirectionIndex>index){
-        NSLog(@"滑动 = YES");
-        return YES;
-    }else{
-        NSLog(@"滑动 = NO");
-        return NO;
-    }
-
-}
-
-- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds{
-    return YES;
-}
-
-@end

+ 7 - 11
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/DebugView.h

@@ -11,29 +11,25 @@
 #import "ShoesInfo.h"
 
 #define DebugViewInstance [DebugView sharedInstance]
-#define JBSDKLog @"testLog.txt"
+//#define JBSDKLog @".txt"
 
 @interface DebugView : UIView
 
-//当前的时间戳+丢包
-@property (nonatomic,strong)NSString * tempStepString;//剑波要的字符串数据 缓存plist
-@property(nonatomic,assign) int currentTS;//颖嘉要的测试数据
-
 +(instancetype)sharedInstance;
 
 #pragma mark ===============================================>> DEBUG
--(void)initTestLabel;
-
-////清理缓存
-//- (void)clearCacheWithFilePath;
+-(void)notificationStartGame;
 
 //数据写入沙河
 -(void)writeFileToplist;
 
-//上传
+//上传沙盒文件
 -(void)uploadpPlistFile;
+
+//清理缓存
+- (void)clearCacheWithFilePath;
     
-//计算实时数据
+//报文数据
 -(void)debugMessage:(NSString*)message shoesInfo:(ShoesInfo*)shoesInfo;
 
 @end

+ 88 - 77
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/DebugView.m → DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/DebugView.mm

@@ -6,13 +6,19 @@
 //
 
 #import "DebugView.h"
-
+#import "pub.h"
 @interface DebugView ()
 /*****测试*******/
 @property (nonatomic,strong)UILabel * testLabel;//调试框
 @property (nonatomic,strong)UIButton * uploadButton;//上传
 @property (nonatomic,strong)UIButton * clearnButton;//上传
 
+//当前的时间戳+丢包
+@property (nonatomic,strong)NSString * tempStepString;//剑波要的字符串数据 缓存plist
+@property(nonatomic,assign) int currentTS;//颖嘉要的测试数据
+
+@property (nonatomic,strong)NSString *current_game_date;
+
 @end
 
 @implementation DebugView
@@ -22,6 +28,7 @@ static DebugView* instance = nil;
 +(instancetype)sharedInstance{
 //    NSLog(@"创建单例一次 1");
      return [[self alloc] init];
+    
 }
 
 + (instancetype)allocWithZone:(struct _NSZone *)zone{
@@ -43,7 +50,14 @@ static DebugView* instance = nil;
 }
 
 #pragma mark ===============================================>> DEBUG
--(void)initTestLabel{
+-(void)notificationStartGame{
+    
+    //建立socket链接
+    SocketRocketUtility * install = [SocketRocketUtility sharedInstance];
+    [install SRWebSocketOpen];
+    
+    //初始化实时时间戳
+    self.currentTS = -1;
 
     if (self.testLabel!=nil){
         [self.testLabel removeFromSuperview];
@@ -57,24 +71,24 @@ static DebugView* instance = nil;
         [self.clearnButton removeFromSuperview];
     }
     
-    self.uploadButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.uploadButton.frame = CGRectMake(30, SCREEN_HEIGHT-40-10, SCALEoefficient(60), SCALEoefficient(25));
-    self.uploadButton.backgroundColor = [UIColor redColor];
-    [self.uploadButton addTarget: self action: @selector (button1BackGroundHighlighted:) forControlEvents:UIControlEventTouchDown];
-    [self.uploadButton addTarget: self action: @selector (button1BackGroundNormal:) forControlEvents:UIControlEventTouchUpInside];
-    [self.uploadButton setFont: [UIFont boldSystemFontOfSize:SCALEoefficient(13)]];
-    [self.uploadButton setTitle:@"上传" forState:UIControlStateNormal];
-    [self.uploadButton addTarget:self action:@selector(uploadpPlistFile) forControlEvents:UIControlEventTouchUpInside];
-    
     self.clearnButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.clearnButton.frame = CGRectMake(30+SCALEoefficient(60)+20, SCREEN_HEIGHT-40-10, SCALEoefficient(60), SCALEoefficient(25));
+    self.clearnButton.frame = CGRectMake(30, SCREEN_HEIGHT-40-10, SCALEoefficient(60), SCALEoefficient(25));
     self.clearnButton.backgroundColor = [UIColor redColor];
-//    [self.clearnButton addTarget:self action:@selector(button1BackGroundHighlighted:) forControlEvents:UIControlEventTouchDown];
-//    [self.clearnButton addTarget:self action:@selector(button1BackGroundNormal:) forControlEvents:UIControlEventTouchUpInside];
+    [self.clearnButton addTarget: self action: @selector (button1BackGroundHighlighted:) forControlEvents:UIControlEventTouchDown];
+    [self.clearnButton addTarget: self action: @selector (button1BackGroundNormal:) forControlEvents:UIControlEventTouchUpInside];
     [self.clearnButton setFont: [UIFont boldSystemFontOfSize:SCALEoefficient(13)]];
     [self.clearnButton setTitle:@"清理缓存" forState:UIControlStateNormal];
     [self.clearnButton addTarget:self action:@selector(clearCacheWithFilePath) forControlEvents:UIControlEventTouchUpInside];
     
+    self.uploadButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    self.uploadButton.frame = CGRectMake(30+SCALEoefficient(60)+20, SCREEN_HEIGHT-40-10, SCALEoefficient(60), SCALEoefficient(25));
+    self.uploadButton.backgroundColor = [UIColor redColor];
+    [self.uploadButton addTarget:self action:@selector(button1BackGroundHighlighted:) forControlEvents:UIControlEventTouchDown];
+    [self.uploadButton addTarget:self action:@selector(button1BackGroundNormal:) forControlEvents:UIControlEventTouchUpInside];
+    [self.uploadButton setFont: [UIFont boldSystemFontOfSize:SCALEoefficient(13)]];
+    [self.uploadButton setTitle:@"上传" forState:UIControlStateNormal];
+    [self.uploadButton addTarget:self action:@selector(uploadpPlistFile) forControlEvents:UIControlEventTouchUpInside];
+    
     self.testLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCALEoefficient(20), -20, [UIScreen mainScreen].bounds.size.width-100, SCALEoefficient(140))];
     self.testLabel.textColor = [UIColor redColor];
     self.testLabel.font = [UIFont boldSystemFontOfSize:SCALEoefficient(14)];
@@ -84,13 +98,16 @@ static DebugView* instance = nil;
 
     //
     if ([UIApplication sharedApplication].keyWindow != nil){
-//        [[UIApplication sharedApplication].keyWindow addSubview:self.uploadButton];
 //        [[UIApplication sharedApplication].keyWindow addSubview:self.clearnButton];
-        [[UIApplication sharedApplication].keyWindow addSubview:self.testLabel];
+//        [[UIApplication sharedApplication].keyWindow addSubview:self.uploadButton];
+//        [[UIApplication sharedApplication].keyWindow addSubview:self.testLabel];
     }
     
     //jb
-    [self clearCacheWithFilePath];
+//    [self clearCacheWithFilePath];
+    
+    //缓存当局游戏的起始时间
+    self.current_game_date = [self getNowTime];
 
 }
 
@@ -110,17 +127,13 @@ static DebugView* instance = nil;
 //清理缓存
 - (void)clearCacheWithFilePath{
     
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    //获取完整路径
-    NSString *documentsDirectory = [paths objectAtIndex:0];
-    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:JBSDKLog];//这里就是你将要存储的沙盒路径(.plist文件,名字自定义)
+    NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"Log"];
     NSError *error = nil;
     //删除子文件夹
-    [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
+    [[NSFileManager defaultManager] removeItemAtPath:path error:&error];
     if (error){
-//        NSLog(@"清理缓存失败");
+        NSLog(@"清理缓存失败 %@",error);
         [PopupView showCusHUDA:@"清理失败"];
-//        [self clearCacheWithFilePath];
     }else{
         NSLog(@"清理缓存成功");
         [PopupView showCusHUDA:@"清理成功"];
@@ -131,14 +144,34 @@ static DebugView* instance = nil;
 //数据写入沙河
 -(void)writeFileToplist{
     
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    //获取完整路径
-    NSString *documentsDirectory = [paths objectAtIndex:0];
-    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:JBSDKLog];//这里就是你将要存储的沙盒路径(.plist文件,名字自定义)
-
-    if(![[NSFileManager defaultManager] fileExistsAtPath:filePath]){//plistPath这个文件\文件夹是否存在
-
-        NSLog(@"-------文件不存在,写入文件----------");
+       NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"Log"];
+       NSFileManager *fileManager = [NSFileManager defaultManager];
+       BOOL isDirExist = [fileManager fileExistsAtPath:path];
+       if(!(isDirExist)){//文件夹不存在
+           
+          BOOL bCreateDir = [fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
+          if(!bCreateDir){
+              NSLog(@"文件夹不存在,创建文件夹失败!");
+          }else{
+              NSLog(@"文件夹不存在,创建文件夹成功,文件路径%@",path);
+          }
+           
+       }else{//文件夹存在
+           
+           NSString * filePath = [[path stringByAppendingPathComponent:self.current_game_date] stringByAppendingPathExtension:@"txt"];
+//           NSLog(@"-------文件夹存在件---------- 文件路径%@",path);
+           if ([fileManager fileExistsAtPath:filePath]){
+//           NSLog(@"-------文件存在,追加文件---------- 文件路径%@",filePath);
+
+               NSFileHandle *fileHandle = [NSFileHandle fileHandleForUpdatingAtPath:filePath];
+               [fileHandle seekToEndOfFile];  //将节点跳到文件的末尾
+               NSData* stringData  = [self.tempStepString dataUsingEncoding:NSUTF8StringEncoding];
+               [fileHandle writeData:stringData]; //追加写入数据
+               [fileHandle closeFile];
+               
+           }else{
+               
+               NSLog(@"-------文件不存在,第一次写入文件---------- 文件路径%@",filePath);
 
                NSError *error;
                if([self.tempStepString writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error]){
@@ -146,29 +179,19 @@ static DebugView* instance = nil;
                }else{
                     NSLog(@"------写入文件------fail,error==%@",error);
                };
-
-    }else{
-
-//     NSLog(@"-------文件存在,追加文件----------");
-       NSFileHandle *fileHandle = [NSFileHandle fileHandleForUpdatingAtPath:filePath];
-       [fileHandle seekToEndOfFile];  //将节点跳到文件的末尾
-       NSData* stringData  = [self.tempStepString dataUsingEncoding:NSUTF8StringEncoding];
-       [fileHandle writeData:stringData]; //追加写入数据
-       [fileHandle closeFile];
-
-    }
-
+               
+           }
+      
+       }
+    
 }
 
 -(void)uploadpPlistFile{
     
     //这个方法获取出的结果是一个数组.因为有可以搜索到多个路径.
-    NSArray *array =  NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    //在这里,我们指定搜索的是Cache目录,所以结果只有一个,取出Cache目录
-    NSString *documentsDirectory = array[0];
-//    NSLog(@"%@",documentsDirectory);
+    NSString *documentsDirectory = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"Log"];
     //拼接文件路径
-    NSString *filePathName = [documentsDirectory stringByAppendingPathComponent:JBSDKLog];
+    NSString *filePathName = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.txt",self.current_game_date]];
     //如果保存的是一个数组.那就通过数组从文件当中加载.
     NSString *string = [NSString stringWithContentsOfFile:filePathName encoding:NSUTF8StringEncoding error:nil];
 //    NSLog(@"%@",string);
@@ -197,7 +220,7 @@ static DebugView* instance = nil;
     AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:nil];
     [sessionManager POST:@"http://172.16.14.127:8080/upload" parameters:nil headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData){
 
-        [formData  appendPartWithFileData:upData name:@"file" fileName:[NSString stringWithFormat:@"ios_%@_%@.txt",gameType,[self getNowTimeTimestamp]] mimeType:@"text/plain"];
+        [formData  appendPartWithFileData:upData name:@"file" fileName:[NSString stringWithFormat:@"ios_%@_%s_%@_%@.txt",gameType,GAME_VERSION,[AlgorithmTool returnTimestamp],LEManager.peripheral.name] mimeType:@"text/plain"];
 
         }progress:^(NSProgress * _Nonnull uploadProgress){
             NSLog(@"测试数据 上传进度 = %@",uploadProgress);
@@ -230,31 +253,6 @@ static DebugView* instance = nil;
  
 }
 
-//获取当前时间戳有两种方法(以秒为单位)
--(NSString *)getNowTimeTimestamp{
-
-    NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ;
-
-    [formatter setDateStyle:NSDateFormatterMediumStyle];
-
-    [formatter setTimeStyle:NSDateFormatterShortStyle];
-
-    [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
-
-    //设置时区,这个对于时间的处理有时很重要
-
-    NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
-
-    [formatter setTimeZone:timeZone];
-
-    NSDate *datenow = [NSDate date];//现在时间,你可以输出来看下是什么格式
-
-    NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[datenow timeIntervalSince1970]];
-
-    return timeSp;
-
-}
-
 
 -(void)debugMessage:(NSString*)message shoesInfo:(ShoesInfo*)shoesInfo{
 
@@ -283,7 +281,7 @@ static DebugView* instance = nil;
 //    NSLog(@"aArray == %@",aArray);
 //    dispatch_async(dispatch_get_main_queue(), ^{
         if (self.testLabel!=nil){
-            self.testLabel.text = [NSString stringWithFormat:@"right:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@] \nleft:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@]  \nrssi:[%@ %@] ts:%@ \n步数:[%@ %@][%d %d] \n步频:[%d:%d  %d:%d] ",aArray[0],aArray[1],aArray[2],aArray[3],aArray[4],aArray[5],aArray[6],aArray[7],aArray[8],aArray[9],aArray[10],aArray[11],aArray[12],aArray[13],aArray[14],aArray[15],aArray[16],aArray[17],aArray[18],aArray[19],aArray[20],aArray[21],aArray[22],aArray[23],LEManager.RSSI,aArray[26],aArray[27],aArray[28],aArray[29],shoesInfo.rightStepCount,shoesInfo.leftStepCount,shoesInfo.rightStepStatus,shoesInfo.rightStepFreq,shoesInfo.leftStepStatus,shoesInfo.leftStepFreq];
+            self.testLabel.text = [NSString stringWithFormat:@"right:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@] \nleft:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@]  \nrssi:[%@ %@] ts:%@ \n步数:[%@ %@][%d %d] \n步频:[%d:%d  %d:%d] \nsdk版本:%s ",aArray[0],aArray[1],aArray[2],aArray[3],aArray[4],aArray[5],aArray[6],aArray[7],aArray[8],aArray[9],aArray[10],aArray[11],aArray[12],aArray[13],aArray[14],aArray[15],aArray[16],aArray[17],aArray[18],aArray[19],aArray[20],aArray[21],aArray[22],aArray[23],LEManager.RSSI,aArray[26],aArray[27],aArray[28],aArray[29],shoesInfo.rightStepCount,shoesInfo.leftStepCount,shoesInfo.rightStepStatus,shoesInfo.rightStepFreq,shoesInfo.leftStepStatus,shoesInfo.leftStepFreq,GAME_VERSION];
         }
 //    });
     
@@ -309,7 +307,7 @@ static DebugView* instance = nil;
             NSLog(@"getGameDataStr 丢包 ================================>> %d",total);
             dispatch_async(dispatch_get_main_queue(), ^{
                 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
-                [PopupView showCusHUDA:[NSString stringWithFormat:@"丢包数: %d",total]];
+//                [PopupView showCusHUDA:[NSString stringWithFormat:@"丢包数: %d",total]];
             });
         }
     }
@@ -317,5 +315,18 @@ static DebugView* instance = nil;
     self.currentTS = tsInt;
     
 }
+
+
+
+// 返回时间戳
+-(NSString *)getNowTime{
+
+    NSDate *currentDate = [NSDate date];//获取当前时间,日期
+    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];// 创建一个时间格式化对象
+    [dateFormatter setDateFormat:@"YYYY_MM_dd_HH_mm_ss"];//设定时间格式,这里可以设置成自己需要的格式
+    NSString *dateString = [dateFormatter stringFromDate:currentDate];//将时间转化成字符串
+    return dateString;
+
+}
    
 @end

+ 2 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.h

@@ -16,6 +16,8 @@
 @property (strong,nonatomic)CBPeripheral * currentPeripheral;
 
 @property (copy,nonatomic)void(^connectDeviceBlock)(CBPeripheral * peripheral);
+//
+@property (copy,nonatomic)void(^closeBlock)();
 
 //
 -(void)reloadData;

+ 57 - 88
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m

@@ -7,7 +7,6 @@
 
 #import "SearchDeviceViewController.h"
 
-#import "TXCarouselView.h"
 #import "ShoesCarouselView.h"
 
 @interface SearchDeviceViewController ()<ConnectDeviceDelegate>
@@ -16,8 +15,9 @@
 //button
 @property(nonatomic,strong)UIButton * nextButton;//
 @property(nonatomic,strong)UIButton * lastButton;//
-@property(nonatomic,strong)UIButton * searchButton;//
+@property(nonatomic,strong)UIButton * cancelButton;//
 @property(nonatomic,strong)UIButton * connectButton;//
+@property (nonatomic,strong)UIButton * clearnButton;//清理缓存
 
 //留白
 @property(nonatomic,strong)NoDeviceTip * tipView;
@@ -50,7 +50,7 @@
     }];
     [self.view addSubview:visualV];
     
-    //留白
+    //无设备
     [self.view addSubview:self.tipView];
         
     //设备列表
@@ -60,12 +60,6 @@
     [self.view addSubview:self.shoesCarouselView];
     self.shoesCarouselView.delegate = self;
     
-    //好友列表
-//    self.carouselView  = [[TXCarouselView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-300, SCREEN_HEIGHT-150)];
-//    self.carouselView.centerX = self.view.centerX;
-//    self.carouselView.centerY = self.view.centerY-20;
-//    [self.view addSubview:self.carouselView];
-    
     //上一个
     self.nextButton = [UIButton buttonWithType:UIButtonTypeSystem];
     self.nextButton.frame = CGRectMake(0, 0, SCALEoefficient(16), SCALEoefficient(32));
@@ -87,69 +81,41 @@
     self.lastButton.backgroundColor = [UIColor clearColor];
     
     //关闭弹窗
-    self.searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.searchButton.frame = CGRectMake(SCREEN_WIDTH/2-SCALEoefficient(160)-20, self.shoesCarouselView.bottom-10, SCALEoefficient(160), SCALEoefficient(40));
-    [self.searchButton setTitle:@"关闭弹窗" forState:UIControlStateNormal];
-    [self.searchButton setImage:[MYFactoryManager imageString:@"gamepop_close"] forState:UIControlStateNormal];
-    [self.searchButton setFont: [UIFont systemFontOfSize: SCALEoefficient(14)]];
-    [self.searchButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    [self.view addSubview:self.searchButton];
-    [self.searchButton addTarget:self action:@selector(close) forControlEvents:UIControlEventTouchUpInside];
-    self.searchButton.backgroundColor = [UIColor whiteColor];
-    self.searchButton.layer.masksToBounds = YES;
-    self.searchButton.layer.cornerRadius = SCALEoefficient(20);
-    [self.searchButton setImageEdgeInsets:UIEdgeInsetsMake(0, SCALEoefficient(-15), 0, 0)];
-//    self.searchButton.imageView.contentMode = UIViewContentModeScaleAspectFill;
-    
-    //链接设备
-    self.connectButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.connectButton.frame = CGRectMake(SCREEN_WIDTH/2+20, self.shoesCarouselView.bottom-10, SCALEoefficient(160), SCALEoefficient(40));
-    [self.connectButton setTitle:@"连接设备" forState:UIControlStateNormal];
-    [self.connectButton setImage:[MYFactoryManager imageString:@"gamepop_determine"] forState:UIControlStateNormal];
-    [self.connectButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    [self.connectButton setFont: [UIFont systemFontOfSize: SCALEoefficient(14)]];
-    [self.view addSubview:self.connectButton];
-    [self.connectButton addTarget:self action:@selector(selectedDeviceAction) forControlEvents:UIControlEventTouchUpInside];
-    self.connectButton.backgroundColor = [UIColor colorWithRed:255/255.0 green:221/255.0 blue:0/255.0 alpha:1.0];
-    self.connectButton.layer.masksToBounds = YES;
-    self.connectButton.layer.cornerRadius = SCALEoefficient(20);
-    [self.connectButton setImageEdgeInsets:UIEdgeInsetsMake(0, SCALEoefficient(-15), 0, 0)];
-//    self.connectButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
-    
-    NSArray * array = @[@"gamepop_leftarrow_notes",@"gamepop_rihgtarrow_notes",@"gamepop_close_notes",@"gamepop_determine_notes"];
-    NSArray * titleArray = @[@"左踩 · 上一个",@"右踩 · 下一个",@"左垫脚 · 关闭",@"右垫脚 · 确认"];
-    for (int i =0; i<4; i++){
-        UIButton * searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        searchButton.frame = CGRectMake(SCREEN_WIDTH-SCALEoefficient(62+20+20)*(4-i),SCALEoefficient(23), SCALEoefficient(62+20), SCALEoefficient(20));
-        [searchButton setTitle:titleArray[i] forState:UIControlStateNormal];
-        [searchButton setImage:[MYFactoryManager imageString:array[i]] forState:UIControlStateNormal];
-        [searchButton setFont: [UIFont boldSystemFontOfSize: SCALEoefficient(10)]];
-        [searchButton.titleLabel setTextColor:[UIColor whiteColor]];
-        [self.view addSubview:searchButton];
-//        searchButton.tag = i;
-//        [searchButton addTarget:self action:@selector(mapBtnClick:) forControlEvents:UIControlEventTouchUpInside];
-//        searchButton.backgroundColor = [UIColor yellowColor];
-        [searchButton setImageEdgeInsets:UIEdgeInsetsMake(0, SCALEoefficient(-10), 0, 0)];
-//        searchButton.imageView.contentMode = UIViewContentModeScaleAspectFill;
+    self.cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    self.cancelButton.frame = CGRectMake(SCREEN_WIDTH-SCALEoefficient(100+20),SCALEoefficient(15), SCALEoefficient(100), SCALEoefficient(30));
+    [self.cancelButton setTitle:@"左踮脚 · 返回" forState:UIControlStateNormal];
+    [self.cancelButton setImage:[MYFactoryManager imageString:@"gamepop_close_notes"] forState:UIControlStateNormal];
+    [self.cancelButton setFont: [UIFont boldSystemFontOfSize: SCALEoefficient(12)]];
+    [self.cancelButton.titleLabel setTextColor:[UIColor whiteColor]];
+    self.cancelButton.backgroundColor = [UIColor clearColor];
+    [self.cancelButton setImageEdgeInsets:UIEdgeInsetsMake(0, SCALEoefficient(-10), 0, 0)];
+    [self.cancelButton addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.cancelButton];
+    
+    //隐藏的清理缓存的按钮
+    self.clearnButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    self.clearnButton.frame = CGRectMake(0, SCREEN_HEIGHT-SCALEoefficient(30)-SCALEoefficient(25), SCALEoefficient(60), SCALEoefficient(25));
+    self.clearnButton.backgroundColor = [UIColor clearColor];
+    [self.clearnButton addTarget:self action:@selector(clearCacheWithFilePath) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.clearnButton];
+
+    NSArray * array = @[@"gamepop_leftarrow_notes",@"gamepop_rihgtarrow_notes",@"gamepop_determine_notes"];
+    NSArray * titleArray = @[@"左踏 · 上一个",@"右踏 · 下一个",@"右踮脚 · 确认"];
+    for (int i =0; i<3; i++){
+        UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
+//        button.frame = CGRectMake(SCREEN_WIDTH-SCALEoefficient(62+20+20)*(4-i),SCALEoefficient(23), SCALEoefficient(62+20), SCALEoefficient(20));
+        button.frame = CGRectMake(SCREEN_WIDTH/3*i,SCREEN_HEIGHT-SCALEoefficient(30), SCREEN_WIDTH/3, SCALEoefficient(30));
+        [button setTitle:titleArray[i] forState:UIControlStateNormal];
+        [button setImage:[MYFactoryManager imageString:array[i]] forState:UIControlStateNormal];
+        [button setFont: [UIFont boldSystemFontOfSize: SCALEoefficient(10)]];
+        [button.titleLabel setTextColor:[UIColor whiteColor]];
+//        button.tag = i;
+        button.backgroundColor = [UIColor blackColor];
+        [button setImageEdgeInsets:UIEdgeInsetsMake(0, SCALEoefficient(-10), 0, 0)];
+        //        [searchButton addTarget:self action:@selector(mapBtnClick:) forControlEvents:UIControlEventTouchUpInside];
+        [self.view addSubview:button];
     }
     
-//    NSArray *arrayStr = [NSArray arrayWithObjects:
-//                         @"1111111111111111111111111111111111111111111111",
-//                         @"2222222222222222222222222222222222222222222222",
-//                         @"3333333333333333333333333333333333333333333333",
-//                         @"4444444444444444444444444444444444444444444444",
-//                         @"5555555555555555555555555555555555555555555555",
-//                         nil];
-//    for (int i = 0; i<arrayStr.count; i++){
-//        TXCarouselCellModel *model = [[TXCarouselCellModel alloc]init];
-//        model.imageUrl = [NSString stringWithFormat:@"zongshujidaowojia%d",i+1];
-//        model.titleStr = arrayStr[i];
-//        model.newsId = i;
-//        [self.array addObject:model];
-//    }
-//    [self.shoesCarouselView setArrayData:arrayStr];
-//    [self.carouselView setArrayData:arrayStr];
-    
 }
 
 #pragma mark -------------- 外部事件
@@ -158,10 +124,10 @@
     
     NSMutableArray * dataArr = [NSMutableArray new];
     for (int i = 0; i<self.deviceArray.count; i++){
-        TXCarouselCellModel *model = [[TXCarouselCellModel alloc]init];
+        ShoesPeripheralMolde *model = [[ShoesPeripheralMolde alloc]init];
         model.newsId = i;
         model.peripheral = self.deviceArray[i];
-        NSLog(@"model.peripheral === >> %@",model.peripheral.name);
+//        NSLog(@"model.peripheral === >> %@",model.peripheral.name);
         [dataArr addObject:model];
     }
     [self.shoesCarouselView setArrayData:dataArr];
@@ -181,22 +147,22 @@
         
     }else if(interaction == 3){//左踩 -- 选中上一个设备
         
-        [self nextAction];
-        
-    }else if(interaction == 4){//右踩 -- 选中下一个设备
-        
         [self lastAction];
+
+    }else if(interaction == 4){//右踩 -- 选中下一个设备
         
-    }else if(interaction == 5){//左垫脚 -- 关闭弹窗
+        [self nextAction];
+
+    }else if(interaction == 6){//左垫脚 -- 关闭弹窗
         
-        [self close];
+        [self closeAction];
         
-    }else if(interaction == 6){//右垫脚 -- 链接设备
+    }else if(interaction == 5){//右垫脚 -- 链接设备
      
         if (self.connectDeviceBlock){
             self.connectDeviceBlock(self.currentPeripheral);
         }
-        [self close];
+        [self closeAction];
         
     }
     
@@ -223,23 +189,22 @@
     [_shoesCarouselView yw_gotoNext:1];
 }
 
-//关闭弹窗
--(void)closeAction{
-    [self close];
-}
-
 //确认选中的设备 开始蓝牙连接
 -(void)selectedDeviceAction{
     
     if (self.connectDeviceBlock){
         self.connectDeviceBlock(self.currentPeripheral);
     }
-    [self close];
+    [self closeAction];
     
 }
 
-//关闭毛玻璃遮罩
-- (void)close{
+//关闭弹窗
+- (void)closeAction{
+    
+    if (self.closeBlock){
+        self.closeBlock();
+    }
 
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         [UIView animateWithDuration:0.25 animations:^{
@@ -252,6 +217,10 @@
     
 }
 
+//清理缓存
+-(void)clearCacheWithFilePath{
+    [DebugViewInstance clearCacheWithFilePath];
+}
 
 #pragma mark -------------- shoesCarouseView delegate
 //来自shoesCarouseView被选中的当前蓝牙

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /.DS_Store


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /112@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_close_notes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_determine_notes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_leftarrow_notes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihgtarrow_notes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_rihtarrow@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_search@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /icon_弹窗/gamepop_shoes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /loading.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_circle.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_circle@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_shoes.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /pop_image_shoes@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /图像 45@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组24@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25@2x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/resources /组25@3x.png


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoe_sdk_c/.DS_Store


+ 3 - 1
DanceGame/Classes/UnityAppController.mm

@@ -315,7 +315,9 @@ extern "C" void UnityRequestQuit()
          [sdk startWithUrl:url];
      }else if (!launchOptions){
          NSLog(@"打开方式 手动点击打开");
-        [IOSPlatformSDK sharedInstance];
+#if DEBUG
+         [IOSPlatformSDK sharedInstance];
+#endif
 //         BOOL QA = [[FitfunYDManager ff_sharedInstance] judegServerEnvironmentQA];
 //         NSLog(@"Unity 请求用户信息 GetUserInfoJson ===>> %d",QA);
 //             if (QA == 0) {//正式环境+无数据=桌面启动

BIN
DanceGame/Data/.DS_Store


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor