From: liangzhenying <867174124@qq.com> Date: Wed, 19 Nov 2025 09:55:43 +0000 (+0800) Subject: 首页增加背景图 X-Git-Tag: 1.0.2~60 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=736a549d0439c4311c438472d5ccbe2843c3fe9b;p=mirrors%2FShenYin.git 首页增加背景图 --- diff --git a/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Contents.json new file mode 100644 index 0000000..59cf37e --- /dev/null +++ b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle_966@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle_966@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@2x.png b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@2x.png new file mode 100644 index 0000000..590adb4 Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@2x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@3x.png b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@3x.png new file mode 100644 index 0000000..e07c11c Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/home/home_bg.imageset/Rectangle_966@3x.png differ diff --git a/ShenYin/ShenYin/Info.plist b/ShenYin/ShenYin/Info.plist index 2c22161..16b05a5 100644 --- a/ShenYin/ShenYin/Info.plist +++ b/ShenYin/ShenYin/Info.plist @@ -55,5 +55,7 @@ 允许APP使用定位方便查找耳机 ITSAppUsesNonExemptEncryption + UIUserInterfaceStyle + Light diff --git a/ShenYin/ShenYin/Launch/JoySdkManager.swift b/ShenYin/ShenYin/Launch/JoySdkManager.swift index 5f7cd03..5d3425e 100644 --- a/ShenYin/ShenYin/Launch/JoySdkManager.swift +++ b/ShenYin/ShenYin/Launch/JoySdkManager.swift @@ -101,7 +101,13 @@ extension JoySdkManager : JoyGemChatManagerDelegate { isTtsPlaying = false PcmSound.sharedInstance().cleanup() PcmSound.sharedInstance().setup(16000, withchannels: 1) - let options: AVAudioSession.CategoryOptions = [.allowBluetooth] + + var options: AVAudioSession.CategoryOptions = [.allowBluetooth] +// if App.shared.isInBackground{ +// options = [.mixWithOthers] +// } + + do { try AVAudioSession.sharedInstance().setCategory(.playback, options: [options]) try AVAudioSession.sharedInstance().setActive(true) @@ -109,7 +115,6 @@ extension JoySdkManager : JoyGemChatManagerDelegate { Logger.debug(error) } } - // stateLabel.text = "正在录音" break case .stopRecord: break diff --git a/ShenYin/ShenYin/SDKBleManager/JLBleAssistManager.m b/ShenYin/ShenYin/SDKBleManager/JLBleAssistManager.m index 92d2f7d..376d3fc 100644 --- a/ShenYin/ShenYin/SDKBleManager/JLBleAssistManager.m +++ b/ShenYin/ShenYin/SDKBleManager/JLBleAssistManager.m @@ -83,7 +83,7 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 #pragma mark 设备断开连接 - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(nullable NSError *)error { - kJLLog(JLLOG_DEBUG, @"BLE Disconnect ---> Device %@ error:%d", peripheral.name, (int)error.code); +// kJLLog(JLLOG_DEBUG, @"BLE Disconnect ---> Device %@ error:%d", peripheral.name, (int)error.code); /*--- JLSDK ADD ---*/ [self.mAssist assistDisconnectPeripheral:peripheral]; @@ -99,7 +99,9 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 #pragma mark 设备特征回调 - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(nullable NSError *)error { - if (error) { kJLLog(JLLOG_DEBUG, @"Err: Discovered Characteristics fail."); return; } + if (error) { +// kJLLog(JLLOG_DEBUG, @"Err: Discovered Characteristics fail."); return; + } /*--- JLSDK ADD ---*/ [self.mAssist assistDiscoverCharacteristicsForService:service Peripheral:peripheral]; @@ -140,15 +142,15 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 */ - (void)getDeviceInfo:(GET_DEVICE_CALLBACK _Nonnull)callback { __weak typeof(self) weakSelf = self; - kJLLog(JLLOG_DEBUG, @"getDeviceInfo:%d",__LINE__); +// kJLLog(JLLOG_DEBUG, @"getDeviceInfo:%d",__LINE__); /*--- 获取设备信息 ---*/ [self.mAssist.mCmdManager cmdTargetFeatureResult:^(JL_CMDStatus status, uint8_t sn, NSData * _Nullable data) { - kJLLog(JLLOG_DEBUG, @"getDeviceInfo:%d",__LINE__); +// kJLLog(JLLOG_DEBUG, @"getDeviceInfo:%d",__LINE__); if (status == JL_CMDStatusSuccess) { JLModel_Device *model = [weakSelf.mAssist.mCmdManager outputDeviceModel]; JL_OtaStatus upSt = model.otaStatus; if (upSt == JL_OtaStatusForce) { - kJLLog(JLLOG_DEBUG, @"---> 进入强制升级."); +// kJLLog(JLLOG_DEBUG, @"---> 进入强制升级."); if (weakSelf.selectedOtaFilePath) { [weakSelf otaFuncWithFilePath:weakSelf.selectedOtaFilePath]; } else { @@ -157,7 +159,7 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 return; } else { if (model.otaHeadset == JL_OtaHeadsetYES) { - kJLLog(JLLOG_DEBUG, @"---> 进入强制升级: OTA另一只耳机."); +// kJLLog(JLLOG_DEBUG, @"---> 进入强制升级: OTA另一只耳机."); if (weakSelf.selectedOtaFilePath) { [weakSelf otaFuncWithFilePath:weakSelf.selectedOtaFilePath]; } else { @@ -166,14 +168,14 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 return; } } - kJLLog(JLLOG_DEBUG, @"---> 设备正常使用..."); +// kJLLog(JLLOG_DEBUG, @"---> 设备正常使用..."); [JL_Tools mainTask:^{ /*--- 获取公共信息 ---*/ [weakSelf.mAssist.mCmdManager cmdGetSystemInfo:JL_FunctionCodeCOMMON Result:nil]; callback(false); }]; } else { - kJLLog(JLLOG_DEBUG, @"---> ERROR:设备信息获取错误!"); +// kJLLog(JLLOG_DEBUG, @"---> ERROR:设备信息获取错误!"); } }]; } @@ -183,7 +185,7 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 * @param otaFilePath ota升级文件路径 */ - (void)otaFuncWithFilePath:(NSString *)otaFilePath { - kJLLog(JLLOG_DEBUG, @"current otaFilePath ---> %@", otaFilePath); +// kJLLog(JLLOG_DEBUG, @"current otaFilePath ---> %@", otaFilePath); self.selectedOtaFilePath = otaFilePath; NSData *otaData = [[NSData alloc] initWithContentsOfFile:otaFilePath]; diff --git a/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.h b/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.h deleted file mode 100644 index 0c983c3..0000000 --- a/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.h +++ /dev/null @@ -1,22 +0,0 @@ -//// -//// SDKBleHelper.h -//// JL_OTA -//// -//// Created by EzioChan on 2022/10/12. -//// Copyright © 2022 Zhuhia Jieli Technology. All rights reserved. -//// -// -//#import -//#import -// -//NS_ASSUME_NONNULL_BEGIN -// -//@interface SDKBleHelper : NSObject -// -//+(NSMutableArray *)fitterHandle:(NSArray*)basicArray; -// -// -// -//@end -// -//NS_ASSUME_NONNULL_END diff --git a/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.m b/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.m deleted file mode 100644 index 9b51bf7..0000000 --- a/ShenYin/ShenYin/SDKBleManager/SDKBleHelper.m +++ /dev/null @@ -1,35 +0,0 @@ -//// -//// SDKBleHelper.m -//// JL_OTA -//// -//// Created by EzioChan on 2022/10/12. -//// Copyright © 2022 Zhuhia Jieli Technology. All rights reserved. -//// -// -//#import "SDKBleHelper.h" -//#import "FittingView.h" -//#import -// -//@implementation SDKBleHelper -// -//+(NSMutableArray *)fitterHandle:(NSArray*)basicArray{ -// NSMutableArray *localArray = [NSMutableArray new]; -// NSString *key = [[FittingView getFitterKey] uppercaseString]; -// for (JL_EntityM *entity in basicArray) { -// if ([key isEqualToString:@""]) { -// [localArray addObject:entity]; -// }else{ -// if ([[entity.mItem uppercaseString] rangeOfString:key].location == NSNotFound || !entity.mItem) { -// // -// kJLLog(JLLOG_DEBUG, @"过滤 ----> NAME:%@ RSSI:%@", entity.mItem,entity.mRSSI); -// }else{ -// [localArray addObject:entity]; -// } -// } -// } -// return localArray; -//} -// -// -// -//@end diff --git a/ShenYin/ShenYin/SDKBleManager/YLOtaManager.h b/ShenYin/ShenYin/SDKBleManager/YLOtaManager.h deleted file mode 100644 index 32cd108..0000000 --- a/ShenYin/ShenYin/SDKBleManager/YLOtaManager.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// YLOtaManager.h -// JL_OTA -// -// Created by suhailian on 2025/8/4. -// Copyright © 2025 Zhuhia Jieli Technology. All rights reserved. -// - -#import -#import "HandleBroadcastPtl.h" -#import -#import -#import -#import -#import - -typedef void(^GET_DEVICE_CALLBACK)(BOOL needForcedUpgrade); - -typedef void(^CANCEL_CALLBACK)(uint8_t status); - -NS_ASSUME_NONNULL_BEGIN - -@protocol YLOtaDelegate - -@required - -- (void)otaNeedSendToble:(NSData *)data; - -- (void)otaProgressWithOtaResult:(JL_OTAResult)result withProgress:(float)progress; - -- (void)otaCancel; - -- (void)pairResult:(BOOL)isSuccess; -@end - - -@interface YLOtaManager : HandleBroadcastPtl -@property(nonatomic,weak)id delegate; - - -- (void)startPair; - -- (void)otaFuncWithFilePath:(NSString *)otaFilePath; - -//收到硬件传过来的数据 --(void)receiveOtaData:(NSData *)data; -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/ShenYin/SDKBleManager/YLOtaManager.m b/ShenYin/ShenYin/SDKBleManager/YLOtaManager.m deleted file mode 100644 index 61c8f4a..0000000 --- a/ShenYin/ShenYin/SDKBleManager/YLOtaManager.m +++ /dev/null @@ -1,208 +0,0 @@ -// -// YLOtaManager.m -// JL_OTA -// -// Created by suhailian on 2025/8/4. -// Copyright © 2025 Zhuhia Jieli Technology. All rights reserved. -// - -#import "YLOtaManager.h" -#import - -@interface YLOtaManager() - -@property (strong, nonatomic) JL_OTAManager *otaManager; -@property (strong, nonatomic) JLHashHandler *pairHash; -@property (strong, nonatomic) NSString *selectedOtaFilePath; -@property (strong, nonatomic) GET_DEVICE_CALLBACK getCallback; - -/// 连接蓝牙是否需要认证配对 -@property (assign, nonatomic) BOOL isPaired; -@property (assign, nonatomic) BOOL pairStatus; -/// 连接设备的MTU(单次最大发送数据) -@property (assign, nonatomic) NSInteger bleMtu; -@property (assign, nonatomic) NSData *pairKey; -@end - -@implementation YLOtaManager - -- (instancetype)init { - self = [super init]; - if (self) { - - _isPaired = YES; - _pairStatus = NO; - self.bleMtu = 182; - - /*--- JLSDK ADD ---*/ - _otaManager = [JL_OTAManager getOTAManager]; - [JL_OTAManager logSDKVersion]; - [JLHashHandler sdkVersion]; - [_otaManager logSendData:false]; - - _otaManager.delegate = self; - // 调试临时添加的 -// _otaManager.mBLE_NAME = @"EB_002000008"; -// _otaManager.mBLE_UUID = @"C5A56B61-A90A-3869-096D-24B7710D338B"; - self.pairHash = [[JLHashHandler alloc] init]; - self.pairHash.delegate = self; - - - } - return self; -} - - -- (void)otaFuncCancel:(CANCEL_CALLBACK _Nonnull)result{ - - [_otaManager cmdOTACancelResult:^(uint8_t status, uint8_t sn, NSData * _Nullable data) { - result(status); - }]; -} - - - -//MARK: - ota manager delegate callback --(void)otaCancel{ - //TODO: 取消OTA升级回调 - [self.delegate otaCancel]; -} --(void)otaUpgradeResult:(JL_OTAResult)result Progress:(float)progress{ - //TODO: 设备升级过程回调,包括进度状态 -// [self.delegate otaProgressWithOtaResult:result withProgress:progress]; -} - --(void)otaDataSend:(NSData *)data{ - [self writeDataByCbp:data]; -} - --(void)otaFeatureResult:(JL_OTAManager *)manager{ - - kJLLog(JLLOG_DEBUG, @"getDeviceInfo:%d",__LINE__); - if (manager.otaStatus == JL_OtaStatusForce) { - kJLLog(JLLOG_DEBUG, @"---> 进入强制升级."); - if (self.selectedOtaFilePath) { - [self otaFuncWithFilePath:self.selectedOtaFilePath]; - } else { - _getCallback(true); - } - return; - } else { - if (manager.otaHeadset == JL_OtaHeadsetYES) { - kJLLog(JLLOG_DEBUG, @"---> 进入强制升级: OTA另一只耳机."); - if (self.selectedOtaFilePath) { - [self otaFuncWithFilePath:self.selectedOtaFilePath]; - } else { - _getCallback(true); - } - return; - } - } - kJLLog(JLLOG_DEBUG, @"---> 设备正常使用..."); - dispatch_async(dispatch_get_main_queue(), ^{ - /*--- 获取公共信息 ---*/ - [self->_otaManager cmdSystemFunction]; - self->_getCallback(false); - }); - -} - -//MARK: - Hash pair delegate callback - --(void)hashOnPairOutputData:(NSData *)data{ - [self writeDataByCbp:data]; -} - -/// 需要分包发送 -/// - Parameter data: 数据 --(void)writeDataByCbp:(NSData *)data{ - NSInteger len = data.length; - while (len>0) { - if (len <= _bleMtu) { - NSData *mtuData = [data subdataWithRange:NSMakeRange(0, data.length)]; - [self selectSendAction:mtuData]; - len -= data.length; - }else{ - NSData *mtuData = [data subdataWithRange:NSMakeRange(0, _bleMtu)]; - [self selectSendAction:mtuData]; - len -= _bleMtu; - data = [data subdataWithRange:NSMakeRange(_bleMtu, len)]; - } - } -} - -//发送给蓝牙设备 --(void)selectSendAction:(NSData *)data{ - [self.delegate otaNeedSendToble:data]; -} - - -- (void)pairAction{ - __weak typeof(self) weakSelf = self; - - kJLLog(JLLOG_DEBUG, @"BLE ---> MTU:%lu",(unsigned long)self.bleMtu); - if (self.isPaired == YES) { - [_pairHash hashResetPair]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - //设备认证 - [self->_pairHash bluetoothPairingKey:self.pairKey Result:^(BOOL ret) { - if(ret){ - [weakSelf.otaManager noteEntityConnected]; - weakSelf.pairStatus = YES; - [weakSelf.delegate pairResult:true]; - }else{ - kJLLog(JLLOG_DEBUG, @"JL_Assist Err: bluetooth pairing fail."); - [weakSelf.delegate pairResult:false]; - } - }]; - }); - }else{ - [self.otaManager noteEntityConnected]; - [weakSelf.delegate pairResult:true]; - } -} - - -- (void)startPair{ - [self pairAction]; -} - -- (void)otaFuncWithFilePath:(NSString *)otaFilePath { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self getDeviceInfo:^(BOOL needForcedUpgrade) { - NSLog(needForcedUpgrade ? @"需要升级===" : @"不需要强制升级==="); - [self startOta:otaFilePath]; - }]; - }); -} - -- (void)startOta:(NSString *)otaFilePath{ - kJLLog(JLLOG_DEBUG, @"current otaFilePath ---> %@", otaFilePath); - self.selectedOtaFilePath = otaFilePath; - NSData *otaData = [[NSData alloc] initWithContentsOfFile:otaFilePath]; - NSLog(@"固件文件大小:%@",otaData); - [_otaManager cmdOTAData:otaData Result:^(JL_OTAResult result, float progress) { - if([self.delegate respondsToSelector:@selector(otaProgressWithOtaResult:withProgress:)]){ - [self.delegate otaProgressWithOtaResult:result withProgress:progress]; - } - }]; -} - --(void)receiveOtaData:(NSData*)data{ - NSLog(@"传给sdk数据 = %@",data); - - if(_isPaired == YES && _pairStatus == NO){ - //收到设备的认证交互数据 - [_pairHash inputPairData:data]; - }else{ - //收到的设备数据,正常通讯数据 - [_otaManager cmdOtaDataReceive:data]; - } -} - -- (void)getDeviceInfo:(GET_DEVICE_CALLBACK _Nonnull)callback { - /*--- 获取设备信息 ,请求设备状态---*/ - _getCallback = callback; - [_otaManager cmdTargetFeature]; -} -@end diff --git a/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.h b/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.h deleted file mode 100644 index 4451183..0000000 --- a/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.h +++ /dev/null @@ -1,39 +0,0 @@ -//// -//// YLOtaManager.h -//// JL_OTA -//// -//// Created by liangshi on 2025/8/16. -//// Copyright © 2025 Zhuhia Jieli Technology. All rights reserved. -//// -// -////#import -////#import "HandleBroadcastPtl.h" -//#import -// -//NS_ASSUME_NONNULL_BEGIN -// -//@protocol YLOtaDelegate -// -//@required -// -// -//- (void)otaProgressWithOtaResult:(JL_OTAResult)result withProgress:(float)progress; -// -//- (void)otaCancel; -// -//@end -// -// -//@interface YLOtaManager : NSObject -//@property(nonatomic,weak)id delegate; -//@property (strong, nonatomic) JL_BLEMultiple *mBleMultiple; -//@property (weak, nonatomic) JL_EntityM *__nullable mBleEntityM; -// -//+ (instancetype)shared; -// -// -//- (void)otaFuncWithFilePath:(NSString *)otaFilePath; -// -//@end -// -//NS_ASSUME_NONNULL_END diff --git a/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.m b/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.m deleted file mode 100644 index c895538..0000000 --- a/ShenYin/ShenYin/SDKBleManager/YLOtaManager2.m +++ /dev/null @@ -1,128 +0,0 @@ -//// -//// YLOtaManager.m -//// JL_OTA -//// -//// Created by suhailian on 2025/8/4. -//// Copyright © 2025 Zhuhia Jieli Technology. All rights reserved. -//// -// -//#import "YLOtaManager2.h" -//#import "JL_RunSDK.h" -//#import "SDKBleHelper.h" -//@interface YLOtaManager() -// -//@property (strong, nonatomic) NSString *otaFilePath; -//@property (strong, nonatomic) NSString *connectUUID; -// -//@end -//@implementation YLOtaManager -// -//+ (instancetype)shared { -// static YLOtaManager *singleton = nil; -// static dispatch_once_t onceToken; -// dispatch_once(&onceToken, ^{ -// singleton = [[self alloc] init]; -// }); -// return singleton; -//} -// -// -//- (instancetype)init { -// self = [super init]; -// if (self) { -// -// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(allNoteListen:) name:nil object:nil]; -// } -// return self; -//} -// -//- (void)allNoteListen:(NSNotification*)note { -// NSString *name = note.name; -// -// if([name isEqual:kJL_BLE_M_FOUND]){ -// NSArray *itemsArray = [note object]; -//// NSArray *list = [SDKBleHelper fitterHandle:itemsArray]; -// JL_EntityM *entity = [[JL_RunSDK sharedInstance] mBleEntityM]; -// if ( entity.mBLE_IS_PAIRED ) { -//// [self.btEnityList insertObject:entity atIndex:0]; -// } -// for (JL_EntityM *model in itemsArray) { -// NSLog(@"%@",@"发现设备"); -// if ([@"EB_002111108" isEqualToString:model.mPeripheral.name]) { -// JL_EntityM *selectedItem = model; -// CBPeripheral *item = selectedItem.mPeripheral; -//// if (item.state == CBPeripheralStateConnected || item.state == CBPeripheralStateConnecting) { -//// return; -//// } -//// if (item.state == CBPeripheralStateConnected || item.state == CBPeripheralStateConnecting) { -//// return; -//// } -// NSLog(@"%@",@"开始连接"); -// [JL_RunSDK sharedInstance].mBleMultiple.BLE_PAIR_ENABLE = true; -// [[JL_RunSDK sharedInstance].mBleMultiple connectEntity:selectedItem Result:^(JL_EntityM_Status status) { -// if(status == JL_EntityM_StatusPaired){ -// NSLog(@"%@",@"配对成功"); -// } -// }]; -// } -// } -// } -// -// if ([name isEqual:kJL_BLE_M_ENTITY_CONNECTED]) { -// NSLog(@"%@",@"已连接"); -// CBPeripheral *cpb = note.object; -// NSArray *list = [JL_RunSDK sharedInstance].mBleMultiple.bleConnectedArr; -// for (JL_EntityM *entity in list) { -// if([entity.mPeripheral.identifier.UUIDString isEqualToString:cpb.identifier.UUIDString]){ -// [JL_RunSDK sharedInstance].mBleEntityM = entity; -// break; -// } -// } -// [JL_Tools delay:0.5 Task:^{ -// [[JL_RunSDK sharedInstance] getDeviceInfo:^(BOOL needForcedUpgrade) { -// [[JL_RunSDK sharedInstance] otaFuncWithFilePath:self.otaFilePath]; -// }]; -// }]; -// } -// -// if ([name isEqual:kJL_BLE_M_ENTITY_DISCONNECTED]) { -// NSLog(@"%@",@"断开连接"); -// } -//} -// -//- (void)startSearch{ -// NSMutableArray *mConnectArr = self.mBleMultiple.bleConnectedArr; -// NSLog(@"已连接==== %@",mConnectArr); -// [[JL_RunSDK sharedInstance].mBleMultiple scanStart]; -//} -// -//- (void)otaFuncWithFilePath:(NSString *)otaFilePath{ -// self.otaFilePath = otaFilePath; -// [JL_RunSDK sharedInstance].otaDelegate = self; -// [self startSearch]; -//} -// -//- (void)otaProgressWithOtaResult:(JL_OTAResult)result withProgress:(float)progress { -// if (result == JL_OTAResultUpgrading || result == JL_OTAResultPreparing) { -// if (result == JL_OTAResultPreparing){ -// NSLog(@"%@",@"校验文件中"); -// } -// if (result == JL_OTAResultUpgrading){ -// NSLog(@"%@",@"正在升级"); -// } -// } else if (result == JL_OTAResultPrepared) { -// NSLog(@"---> 检验文件【完成】"); -// } else if (result == JL_OTAResultReconnect) { -// NSLog(@"---> OTA正在回连设备... %@", [JL_RunSDK sharedInstance].mBleEntityM.mPeripheral.name); -// } else if (result == JL_OTAResultReconnectWithMacAddr) { -// NSLog(@"---> OTA正在通过Mac Addr方式回连设备... %@", [JL_RunSDK sharedInstance].mBleEntityM.mPeripheral.name); -// } else if (result == JL_OTAResultSuccess) { -// NSLog(@"--->升级成功."); -// } else if (result == JL_OTAResultReboot) { -// NSLog(@"--->设备重启."); -// } else { -// // 其余错误码详细 Command+点击JL_OTAResult 查看说明 -// NSLog(@"ota update result: %d", result); -// } -//} -//@end diff --git a/ShenYin/ShenYin/ShenYin-Bridging-Header.h b/ShenYin/ShenYin/ShenYin-Bridging-Header.h index e322d7d..3fc4e5b 100644 --- a/ShenYin/ShenYin/ShenYin-Bridging-Header.h +++ b/ShenYin/ShenYin/ShenYin-Bridging-Header.h @@ -9,5 +9,4 @@ #import "YLTimerButton.h" #import "PcmSound.h" #import -#import "YLOtaManager.h" #import "JLBleAssistManager.h" diff --git a/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift b/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift index 6c62d3c..1c576bb 100644 --- a/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift +++ b/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift @@ -9,6 +9,7 @@ import UIKit class HomeDeviceVC:BaseVC{ private var collectionView:UICollectionView! + let imgView = UIImageView() override func viewDidLoad() { super.viewDidLoad() @@ -30,7 +31,7 @@ class HomeDeviceVC:BaseVC{ layout.minimumLineSpacing = 18 layout.itemSize = CGSize(width: (kScreenWid-54)/2, height: 128) collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: layout) - view.addSubview(collectionView) + view.addSubviews([imgView,collectionView]) collectionView.do { (v) in v.dataSource = self @@ -41,12 +42,19 @@ class HomeDeviceVC:BaseVC{ v.register(HomeDeviceCell.self, forCellWithReuseIdentifier: HomeDeviceCell.reuseID) v.register(HomeHeadInfoView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier:HomeHeadInfoView.reuseID ) } + imgView.do { v in +// v.backgroundColor = .red + v.image = UIImage(named: "home_bg") + } } override func setupLayout() { collectionView.snp.makeConstraints { (m) in m.top.equalTo(kNavBtm) m.left.right.bottom.equalToSuperview() } + imgView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } } func reloadData() { DeviceVM.shared.refresh {[weak self] result in diff --git a/ShenYin/ShenYin/UI/Sleep/AudioPlayView.swift b/ShenYin/ShenYin/UI/Sleep/AudioPlayView.swift index 3282160..bd8db62 100644 --- a/ShenYin/ShenYin/UI/Sleep/AudioPlayView.swift +++ b/ShenYin/ShenYin/UI/Sleep/AudioPlayView.swift @@ -120,6 +120,7 @@ class AudioPlayView: BaseView { } @objc func closeAction(){ AudioPlayerManager.shared.pause() + self.isHidden = true } func show(){ self.isHidden = false diff --git a/ShenYin/ShenYin/test.mp3 b/ShenYin/ShenYin/test.mp3 deleted file mode 100644 index 238e70d..0000000 Binary files a/ShenYin/ShenYin/test.mp3 and /dev/null differ