Commit 94ce19aa by 李威

进度条

parent 2c28289d
...@@ -10,6 +10,14 @@ ...@@ -10,6 +10,14 @@
1CA57422038A0DCD4DC42056 /* Pods_HJMDrWarter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BD61577192800BFFDBFA48 /* Pods_HJMDrWarter.framework */; }; 1CA57422038A0DCD4DC42056 /* Pods_HJMDrWarter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BD61577192800BFFDBFA48 /* Pods_HJMDrWarter.framework */; };
28CBDA67CE2B933E3BE49AD0 /* Pods_DJMPS2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE531B568DE2714EB3C17FBC /* Pods_DJMPS2.framework */; }; 28CBDA67CE2B933E3BE49AD0 /* Pods_DJMPS2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE531B568DE2714EB3C17FBC /* Pods_DJMPS2.framework */; };
29B4811846DA9AFF6B864DFF /* Pods_DJMHomeTY.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7A66C6D755F78ABD051F3B /* Pods_DJMHomeTY.framework */; }; 29B4811846DA9AFF6B864DFF /* Pods_DJMHomeTY.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7A66C6D755F78ABD051F3B /* Pods_DJMHomeTY.framework */; };
39E50A9E2BA81F8900D48C7D /* DXHotElectricVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */; };
39E50A9F2BA81F8900D48C7D /* DXHotElectricVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */; };
39E50AA02BA81F8900D48C7D /* DXHotElectricVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */; };
39E50AA12BA81F8900D48C7D /* DXHotElectricVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */; };
39E50AA42BA8272800D48C7D /* DXProgressBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50AA32BA8272800D48C7D /* DXProgressBarView.m */; };
39E50AA52BA8272800D48C7D /* DXProgressBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50AA32BA8272800D48C7D /* DXProgressBarView.m */; };
39E50AA62BA8272800D48C7D /* DXProgressBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50AA32BA8272800D48C7D /* DXProgressBarView.m */; };
39E50AA72BA8272800D48C7D /* DXProgressBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39E50AA32BA8272800D48C7D /* DXProgressBarView.m */; };
6C7891792B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; }; 6C7891792B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; };
6C78917A2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; }; 6C78917A2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; };
6C78917B2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; }; 6C78917B2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */; };
...@@ -643,6 +651,10 @@ ...@@ -643,6 +651,10 @@
22A9E98F925FC76E4FDE64EC /* Pods-DJMHomeDR.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeDR.release.xcconfig"; path = "Target Support Files/Pods-DJMHomeDR/Pods-DJMHomeDR.release.xcconfig"; sourceTree = "<group>"; }; 22A9E98F925FC76E4FDE64EC /* Pods-DJMHomeDR.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeDR.release.xcconfig"; path = "Target Support Files/Pods-DJMHomeDR/Pods-DJMHomeDR.release.xcconfig"; sourceTree = "<group>"; };
2DDF3A57856A2F27B92CD379 /* Pods-HJMDrWarter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HJMDrWarter.debug.xcconfig"; path = "Target Support Files/Pods-HJMDrWarter/Pods-HJMDrWarter.debug.xcconfig"; sourceTree = "<group>"; }; 2DDF3A57856A2F27B92CD379 /* Pods-HJMDrWarter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HJMDrWarter.debug.xcconfig"; path = "Target Support Files/Pods-HJMDrWarter/Pods-HJMDrWarter.debug.xcconfig"; sourceTree = "<group>"; };
39E1E5FF031957A0EABCCB00 /* Pods-DJMHomeTY.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeTY.debug.xcconfig"; path = "Target Support Files/Pods-DJMHomeTY/Pods-DJMHomeTY.debug.xcconfig"; sourceTree = "<group>"; }; 39E1E5FF031957A0EABCCB00 /* Pods-DJMHomeTY.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeTY.debug.xcconfig"; path = "Target Support Files/Pods-DJMHomeTY/Pods-DJMHomeTY.debug.xcconfig"; sourceTree = "<group>"; };
39E50A9C2BA81F8900D48C7D /* DXHotElectricVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DXHotElectricVC.h; sourceTree = "<group>"; };
39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DXHotElectricVC.m; sourceTree = "<group>"; };
39E50AA22BA8272800D48C7D /* DXProgressBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DXProgressBarView.h; sourceTree = "<group>"; };
39E50AA32BA8272800D48C7D /* DXProgressBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DXProgressBarView.m; sourceTree = "<group>"; };
43682A934E6B0849B0B6F729 /* Pods-DJMHomeTY.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeTY.release.xcconfig"; path = "Target Support Files/Pods-DJMHomeTY/Pods-DJMHomeTY.release.xcconfig"; sourceTree = "<group>"; }; 43682A934E6B0849B0B6F729 /* Pods-DJMHomeTY.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DJMHomeTY.release.xcconfig"; path = "Target Support Files/Pods-DJMHomeTY/Pods-DJMHomeTY.release.xcconfig"; sourceTree = "<group>"; };
6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlueToothUpdate.m; sourceTree = "<group>"; }; 6C7891772B0B2CEB0051C70B /* BlueToothUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlueToothUpdate.m; sourceTree = "<group>"; };
6C7891782B0B2CEB0051C70B /* BlueToothUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlueToothUpdate.h; sourceTree = "<group>"; }; 6C7891782B0B2CEB0051C70B /* BlueToothUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlueToothUpdate.h; sourceTree = "<group>"; };
...@@ -1097,6 +1109,8 @@ ...@@ -1097,6 +1109,8 @@
6CB327D72AEF8D6E00ABAEC3 /* DXHFXVC.m */, 6CB327D72AEF8D6E00ABAEC3 /* DXHFXVC.m */,
6CAFE7312AF4C71C00C929A7 /* DXHFXUpkeepVC.h */, 6CAFE7312AF4C71C00C929A7 /* DXHFXUpkeepVC.h */,
6CAFE7322AF4C71C00C929A7 /* DXHFXUpkeepVC.m */, 6CAFE7322AF4C71C00C929A7 /* DXHFXUpkeepVC.m */,
39E50A9C2BA81F8900D48C7D /* DXHotElectricVC.h */,
39E50A9D2BA81F8900D48C7D /* DXHotElectricVC.m */,
); );
path = Controller; path = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1119,6 +1133,8 @@ ...@@ -1119,6 +1133,8 @@
6CB327DD2AEFA1A600ABAEC3 /* DXHFXView.m */, 6CB327DD2AEFA1A600ABAEC3 /* DXHFXView.m */,
6CAFE73D2AFB8E6500C929A7 /* DXHFXVideoCell.h */, 6CAFE73D2AFB8E6500C929A7 /* DXHFXVideoCell.h */,
6CAFE73E2AFB8E6500C929A7 /* DXHFXVideoCell.m */, 6CAFE73E2AFB8E6500C929A7 /* DXHFXVideoCell.m */,
39E50AA22BA8272800D48C7D /* DXProgressBarView.h */,
39E50AA32BA8272800D48C7D /* DXProgressBarView.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2475,6 +2491,7 @@ ...@@ -2475,6 +2491,7 @@
883150FF2A0A2CB70025FDDE /* XHDeviceValidModel.m in Sources */, 883150FF2A0A2CB70025FDDE /* XHDeviceValidModel.m in Sources */,
883151002A0A2CB70025FDDE /* HJScanVC.m in Sources */, 883151002A0A2CB70025FDDE /* HJScanVC.m in Sources */,
883151012A0A2CB70025FDDE /* UITableView+SDAutoTableViewCellHeight.m in Sources */, 883151012A0A2CB70025FDDE /* UITableView+SDAutoTableViewCellHeight.m in Sources */,
39E50A9F2BA81F8900D48C7D /* DXHotElectricVC.m in Sources */,
6C78917A2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */, 6C78917A2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */,
883151022A0A2CB70025FDDE /* XHDeviceListVC.m in Sources */, 883151022A0A2CB70025FDDE /* XHDeviceListVC.m in Sources */,
883151032A0A2CB70025FDDE /* AppDelegate+XHViewController.m in Sources */, 883151032A0A2CB70025FDDE /* AppDelegate+XHViewController.m in Sources */,
...@@ -2498,6 +2515,7 @@ ...@@ -2498,6 +2515,7 @@
883151162A0A2CB70025FDDE /* XHButton.m in Sources */, 883151162A0A2CB70025FDDE /* XHButton.m in Sources */,
883151172A0A2CB70025FDDE /* XHAgreementVC.m in Sources */, 883151172A0A2CB70025FDDE /* XHAgreementVC.m in Sources */,
883151182A0A2CB70025FDDE /* XHAlterActionView.m in Sources */, 883151182A0A2CB70025FDDE /* XHAlterActionView.m in Sources */,
39E50AA52BA8272800D48C7D /* DXProgressBarView.m in Sources */,
883151192A0A2CB70025FDDE /* XHDRView.m in Sources */, 883151192A0A2CB70025FDDE /* XHDRView.m in Sources */,
8831511A2A0A2CB70025FDDE /* XHSelectModelView.m in Sources */, 8831511A2A0A2CB70025FDDE /* XHSelectModelView.m in Sources */,
8831511B2A0A2CB70025FDDE /* XHResetDeviceNameView.m in Sources */, 8831511B2A0A2CB70025FDDE /* XHResetDeviceNameView.m in Sources */,
...@@ -2616,6 +2634,7 @@ ...@@ -2616,6 +2634,7 @@
88D323DA2A177CDC00334372 /* XHDeviceValidModel.m in Sources */, 88D323DA2A177CDC00334372 /* XHDeviceValidModel.m in Sources */,
88D323DB2A177CDC00334372 /* HJScanVC.m in Sources */, 88D323DB2A177CDC00334372 /* HJScanVC.m in Sources */,
88D323DC2A177CDC00334372 /* UITableView+SDAutoTableViewCellHeight.m in Sources */, 88D323DC2A177CDC00334372 /* UITableView+SDAutoTableViewCellHeight.m in Sources */,
39E50AA12BA81F8900D48C7D /* DXHotElectricVC.m in Sources */,
6C78917C2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */, 6C78917C2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */,
88D323DD2A177CDC00334372 /* XHDeviceListVC.m in Sources */, 88D323DD2A177CDC00334372 /* XHDeviceListVC.m in Sources */,
88D323DE2A177CDC00334372 /* AppDelegate+XHViewController.m in Sources */, 88D323DE2A177CDC00334372 /* AppDelegate+XHViewController.m in Sources */,
...@@ -2639,6 +2658,7 @@ ...@@ -2639,6 +2658,7 @@
88D323F12A177CDC00334372 /* XHButton.m in Sources */, 88D323F12A177CDC00334372 /* XHButton.m in Sources */,
88D323F22A177CDC00334372 /* XHAgreementVC.m in Sources */, 88D323F22A177CDC00334372 /* XHAgreementVC.m in Sources */,
88D323F32A177CDC00334372 /* XHAlterActionView.m in Sources */, 88D323F32A177CDC00334372 /* XHAlterActionView.m in Sources */,
39E50AA72BA8272800D48C7D /* DXProgressBarView.m in Sources */,
88D323F42A177CDC00334372 /* XHDRView.m in Sources */, 88D323F42A177CDC00334372 /* XHDRView.m in Sources */,
88D323F52A177CDC00334372 /* XHSelectModelView.m in Sources */, 88D323F52A177CDC00334372 /* XHSelectModelView.m in Sources */,
88D323F62A177CDC00334372 /* XHResetDeviceNameView.m in Sources */, 88D323F62A177CDC00334372 /* XHResetDeviceNameView.m in Sources */,
...@@ -2757,6 +2777,7 @@ ...@@ -2757,6 +2777,7 @@
88EE69B42A04D3C900C37EE2 /* HJVerifyView.m in Sources */, 88EE69B42A04D3C900C37EE2 /* HJVerifyView.m in Sources */,
88EE69B52A04D3C900C37EE2 /* XHSelectDeviceVC.m in Sources */, 88EE69B52A04D3C900C37EE2 /* XHSelectDeviceVC.m in Sources */,
88EE69B62A04D3C900C37EE2 /* XHParentView.m in Sources */, 88EE69B62A04D3C900C37EE2 /* XHParentView.m in Sources */,
39E50AA02BA81F8900D48C7D /* DXHotElectricVC.m in Sources */,
6C78917B2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */, 6C78917B2B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */,
88EE69B72A04D3C900C37EE2 /* XHDeviceValidModel.m in Sources */, 88EE69B72A04D3C900C37EE2 /* XHDeviceValidModel.m in Sources */,
88EE69B82A04D3C900C37EE2 /* HJScanVC.m in Sources */, 88EE69B82A04D3C900C37EE2 /* HJScanVC.m in Sources */,
...@@ -2780,6 +2801,7 @@ ...@@ -2780,6 +2801,7 @@
88EE69C92A04D3C900C37EE2 /* XHBGRunManager.m in Sources */, 88EE69C92A04D3C900C37EE2 /* XHBGRunManager.m in Sources */,
88EE69CC2A04D3C900C37EE2 /* XHRegistSecondVC.m in Sources */, 88EE69CC2A04D3C900C37EE2 /* XHRegistSecondVC.m in Sources */,
88EE69CE2A04D3C900C37EE2 /* XHButton.m in Sources */, 88EE69CE2A04D3C900C37EE2 /* XHButton.m in Sources */,
39E50AA62BA8272800D48C7D /* DXProgressBarView.m in Sources */,
88EE69CF2A04D3C900C37EE2 /* XHAgreementVC.m in Sources */, 88EE69CF2A04D3C900C37EE2 /* XHAgreementVC.m in Sources */,
88EE69D02A04D3C900C37EE2 /* XHAlterActionView.m in Sources */, 88EE69D02A04D3C900C37EE2 /* XHAlterActionView.m in Sources */,
88EE69D12A04D3C900C37EE2 /* XHResetDeviceNameView.m in Sources */, 88EE69D12A04D3C900C37EE2 /* XHResetDeviceNameView.m in Sources */,
...@@ -2898,6 +2920,7 @@ ...@@ -2898,6 +2920,7 @@
88F07F0E29C1921900B2EBE6 /* XHDeviceValidModel.m in Sources */, 88F07F0E29C1921900B2EBE6 /* XHDeviceValidModel.m in Sources */,
88E7FC3229B3286C00F8585F /* HJScanVC.m in Sources */, 88E7FC3229B3286C00F8585F /* HJScanVC.m in Sources */,
884E460B29A600B600A58A9A /* UITableView+SDAutoTableViewCellHeight.m in Sources */, 884E460B29A600B600A58A9A /* UITableView+SDAutoTableViewCellHeight.m in Sources */,
39E50A9E2BA81F8900D48C7D /* DXHotElectricVC.m in Sources */,
6C7891792B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */, 6C7891792B0B2CEB0051C70B /* BlueToothUpdate.m in Sources */,
88E8438B29B9820C00263DB0 /* XHDeviceListVC.m in Sources */, 88E8438B29B9820C00263DB0 /* XHDeviceListVC.m in Sources */,
884E456C29A600A600A58A9A /* AppDelegate+XHViewController.m in Sources */, 884E456C29A600A600A58A9A /* AppDelegate+XHViewController.m in Sources */,
...@@ -2921,6 +2944,7 @@ ...@@ -2921,6 +2944,7 @@
88CAA08929B874E000825EDC /* XHRegistSecondVC.m in Sources */, 88CAA08929B874E000825EDC /* XHRegistSecondVC.m in Sources */,
884E462A29A600B600A58A9A /* XHButton.m in Sources */, 884E462A29A600B600A58A9A /* XHButton.m in Sources */,
88F07F1929C1C4BF00B2EBE6 /* XHAgreementVC.m in Sources */, 88F07F1929C1C4BF00B2EBE6 /* XHAgreementVC.m in Sources */,
39E50AA42BA8272800D48C7D /* DXProgressBarView.m in Sources */,
884E45FC29A600B600A58A9A /* XHAlterActionView.m in Sources */, 884E45FC29A600B600A58A9A /* XHAlterActionView.m in Sources */,
88314FC42A0A1B600025FDDE /* XHDRView.m in Sources */, 88314FC42A0A1B600025FDDE /* XHDRView.m in Sources */,
88314F942A0A168A0025FDDE /* XHSelectModelView.m in Sources */, 88314F942A0A168A0025FDDE /* XHSelectModelView.m in Sources */,
......
...@@ -14,6 +14,7 @@ typedef NS_ENUM(NSInteger, BtnTag) ...@@ -14,6 +14,7 @@ typedef NS_ENUM(NSInteger, BtnTag)
D3BtnTag = 10, D3BtnTag = 10,
DM1BtnTag, DM1BtnTag,
DR04BtnTag, DR04BtnTag,
DR05BtnTag,
MRQ1HBtnTag, MRQ1HBtnTag,
DWF08BtnTag, DWF08BtnTag,
D3CopyBtnTag, D3CopyBtnTag,
......
//
// DXHotElectricVC.h
// DJMHomeTY
//
// Created by nana on 2024/3/18.
//
#import "XHParentVC.h"
NS_ASSUME_NONNULL_BEGIN
@interface DXHotElectricVC : XHParentVC
@end
NS_ASSUME_NONNULL_END
//
// DXHotElectricVC.m
// DJMHomeTY
//
// Created by nana on 2024/3/18.
//
#import "DXHotElectricVC.h"
#import "DXProgressBarView.h"
@interface DXHotElectricVC ()<DXProgressBarViewDelegate>{
CGFloat palyTime;
}
@property (nonatomic ,strong)NSTimer *timer;
@property (nonatomic ,strong)DXProgressBarView *progressBarView;
@end
@implementation DXHotElectricVC
- (void)viewDidLoad {
[super viewDidLoad];
self.progressBarView = [[DXProgressBarView alloc] initWithFrame:CGRectMake(0, 200, HJScreenWidth, 30)];
self.progressBarView.delegate = self;
[self.view addSubview:self.progressBarView];
NSArray *array = @[@60,@20,@100,@50,@70,@60];
[self.progressBarView progressBarTimeArray:array Totaltime:360];
if (self.timer == nil) {
self.timer=[NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(handletimerAction) userInfo:nil repeats:true];
[[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
}
// Do any additional setup after loading the view.
}
-(void)playVideoTime:(CGFloat)time {
palyTime = time;
}
-(void)handletimerAction {
palyTime++;
if (palyTime>=360) {
[self.timer invalidate];
self.timer = nil;
}
self.progressBarView.playTime = palyTime;
}
-(void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[self.timer invalidate];
self.timer = nil;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// DXProgressBarView.h
// DJMHomeTY
//
// Created by nana on 2024/3/18.
//
#import <UIKit/UIKit.h>
@protocol DXProgressBarViewDelegate <NSObject>
-(void)playVideoTime:(CGFloat)time;
@end
NS_ASSUME_NONNULL_BEGIN
@interface DXProgressBarView : UIView
@property (nonatomic,assign)CGFloat playTime;
@property (nonatomic,assign)CGFloat totaltime;
@property (nonatomic,strong)UIView *progressView;
@property (nonatomic,strong)NSArray *timeArray;
@property (nonatomic,assign)id<DXProgressBarViewDelegate>delegate;
-(void)progressBarTimeArray:(NSArray *)array Totaltime:(CGFloat)time;
@end
NS_ASSUME_NONNULL_END
//
// DXProgressBarView.m
// DJMHomeTY
//
// Created by nana on 2024/3/18.
//
#import "DXProgressBarView.h"
@implementation DXProgressBarView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
-(void)progressBarTimeArray:(NSArray *)array Totaltime:(CGFloat)time{
self.totaltime = time;
self.timeArray = array;
UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(18.5, 10, HJScreenWidth-18.5*2, 6.5)];
backView.backgroundColor = XHColorRGB_Alpha(175, 44, 35, 0.12);
backView.layer.cornerRadius = backView.height/2;
[self addSubview:backView];
self.progressView = [[UIView alloc] initWithFrame:CGRectMake(18.5, 10, 0, 6.5)];
self.progressView.backgroundColor = XHColorRGB_Alpha(175, 44, 35, 0.5);
self.progressView.layer.cornerRadius = self.progressView.height/2;
[self addSubview:self.progressView];
CGFloat currentLength = 0;
CGFloat node = 0;
for (int i = 0; i<array.count; i++) {
CGFloat length = [[array objectAtIndex:i] floatValue];
node = node+length;
CGFloat proportion = node/time;
if (i == 0) {
UIView *circleView = [[UIView alloc] initWithFrame:CGRectMake(currentLength+17.5, 9, 8.6, 8.6)];
circleView.backgroundColor = XHColorRGB_Alpha(164, 47, 36, 1);
circleView.layer.cornerRadius = circleView.width/2;
circleView.layer.borderWidth = 0.5;
circleView.layer.borderColor = XHColorRGB_Alpha(175, 44, 35, 1).CGColor;
[self addSubview:circleView];
}
UIView *circleView = [[UIView alloc] initWithFrame:CGRectMake(currentLength+17.5+backView.width*proportion, 9, 8.6, 8.6)];
circleView.backgroundColor = [UIColor whiteColor];
circleView.layer.cornerRadius = circleView.width/2;
circleView.layer.borderWidth = 0.5;
circleView.tag = 1000+i;
circleView.layer.borderColor = XHColorRGB_Alpha(175, 44, 35, 1).CGColor;
[self addSubview:circleView];
}
UITapGestureRecognizer *tap11 = [[UITapGestureRecognizer alloc] init];
[tap11 addTarget:self action:@selector(tapprogress:)];
[self addGestureRecognizer:tap11];
}
-(void)setPlayTime:(CGFloat)playTime {
self.progressView.width = playTime/self.totaltime*(HJScreenWidth-18.5*2);
CGFloat node = 0;
for (int i = 0; i<self.timeArray.count; i++) {
CGFloat length = [[self.timeArray objectAtIndex:i] floatValue];
node = node+length;
UIView *circleView = [self viewWithTag:1000+i];
if (node>=playTime && playTime != self.totaltime) {
circleView.backgroundColor = [UIColor whiteColor];
}else {
circleView.backgroundColor = XHColorRGB_Alpha(164, 47, 36, 1);
}
}
_playTime = playTime;
}
-(void)tapprogress:(UITapGestureRecognizer *)tap {
CGPoint point = [tap locationInView:self];
if (point.x<18.5 || point.x>HJScreenWidth-18.5) {
return;
}
self.playTime = self.totaltime*((point.x-18.5)/(HJScreenWidth-18.5*2));
if (self.delegate && [self.delegate respondsToSelector:@selector(playVideoTime:)]) {
[self.delegate playVideoTime:self.playTime];
}
}
@end
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "XHMainVC1.h" #import "XHMainVC1.h"
#import "DXHFXVC.h" #import "DXHFXVC.h"
#import "DXBannerVC.h" #import "DXBannerVC.h"
#import "DXHotElectricVC.h"
static NSString *dxmachineCell = @"DXDeviceListCell"; static NSString *dxmachineCell = @"DXDeviceListCell";
@interface DXDeviceListVC ()<UITableViewDelegate,UITableViewDataSource,XHCountDownButtonDelegate,DXDeviceListCellDelegate> @interface DXDeviceListVC ()<UITableViewDelegate,UITableViewDataSource,XHCountDownButtonDelegate,DXDeviceListCellDelegate>
...@@ -211,7 +212,14 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -211,7 +212,14 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
@"DeviceId":@"Dr-04", @"DeviceId":@"Dr-04",
@"imgName":@"DXDr_HFX", @"imgName":@"DXDr_HFX",
@"tag":@(DR04BtnTag) @"tag":@(DR04BtnTag)
}]; },
// @{@"DeviceType":@"Dr.热电仪",
// @"DeviceCode":@"Dr-05",
// @"DeviceId":@"Dr-05",
// @"imgName":@"DXDr_HFX",
// @"tag":@(DR05BtnTag)
// }
];
self.dataArr = [XHDeviceListModel mj_objectArrayWithKeyValuesArray:arr]; self.dataArr = [XHDeviceListModel mj_objectArrayWithKeyValuesArray:arr];
[self.myTabView reloadData]; [self.myTabView reloadData];
} }
...@@ -297,7 +305,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -297,7 +305,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
XHGetDataManager.isFirstInto =false; XHGetDataManager.isFirstInto =false;
break; break;
case 5: case 5:
self.myVCArr = @[[[DXHFXVC alloc]init],[[XHMainVC1 alloc]init]]; self.myVCArr = @[[[DXHFXVC alloc]init],[[XHMainVC1 alloc]init],[[DXHotElectricVC alloc]init]];
break; break;
default: default:
break; break;
...@@ -316,7 +324,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -316,7 +324,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
switch (TargetType) { switch (TargetType) {
case 1: case 1:
case 5: case 5:
self.myVCArr = @[[[XHMainVC1 alloc]init],[[DXHFXVC alloc]init]]; self.myVCArr = @[[[XHMainVC1 alloc]init],[[DXHFXVC alloc]init],[[DXHotElectricVC alloc]init]];
break; break;
case 4: case 4:
self.myVCArr = @[[[XHDRVC alloc]init],[[XHMainVC1 alloc]init]]; self.myVCArr = @[[[XHDRVC alloc]init],[[XHMainVC1 alloc]init]];
...@@ -334,7 +342,12 @@ static NSString *dxmachineCell = @"DXDeviceListCell"; ...@@ -334,7 +342,12 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
DXHFXVC *hfxvc = [[DXHFXVC alloc]init]; DXHFXVC *hfxvc = [[DXHFXVC alloc]init];
hfxvc.hidesBottomBarWhenPushed = YES; hfxvc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:hfxvc animated:false]; [self.navigationController pushViewController:hfxvc animated:false];
}else{ }else if ([VC isKindOfClass:[DXHotElectricVC class]]) {
DXHotElectricVC *hfxvc = [[DXHotElectricVC alloc]init];
hfxvc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:hfxvc animated:false];
}
else{
[self.navigationController pushViewController:VC animated:false]; [self.navigationController pushViewController:VC animated:false];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment