Commit f20b2d65 authored by zhaowl123's avatar zhaowl123
Browse files

4.14.6上线

parent 80810361
No preview for this file type
......@@ -321,6 +321,11 @@
04DF5D4B2265D6540060B43B /* icon_radio_bg@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04DF5D492265D6540060B43B /* icon_radio_bg@3x.png */; };
04E332BB226EA81F0091AC52 /* icon_ad_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04E332B9226EA81E0091AC52 /* icon_ad_close@2x.png */; };
04E332BC226EA81F0091AC52 /* icon_ad_close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04E332BA226EA81F0091AC52 /* icon_ad_close@3x.png */; };
04E789E52696E37C00A1C6D4 /* DWAnswerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E789DE2696E37C00A1C6D4 /* DWAnswerView.m */; };
04E789E62696E37C00A1C6D4 /* DWAnswerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E789DF2696E37C00A1C6D4 /* DWAnswerModel.m */; };
04E789E72696E37C00A1C6D4 /* DWAnswerProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E789E22696E37C00A1C6D4 /* DWAnswerProgress.m */; };
04E789E82696E37C00A1C6D4 /* DWAnswerCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E789E42696E37C00A1C6D4 /* DWAnswerCollectionViewCell.m */; };
04E789EB2696EDC500A1C6D4 /* DWVodPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E789E92696EDC400A1C6D4 /* DWVodPlayerView.m */; };
04E7C9D72445852400BB876A /* BrightnessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E7C9D12445852300BB876A /* BrightnessView.m */; };
04E7C9D82445852400BB876A /* DWPlayerTimeSilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E7C9D52445852400BB876A /* DWPlayerTimeSilder.m */; };
04E7C9D92445852400BB876A /* DWVodPlayerPanGesture.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E7C9D62445852400BB876A /* DWVodPlayerPanGesture.m */; };
......@@ -358,7 +363,6 @@
04FFA9B822644CD0008C2713 /* icon_download_normal@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04FFA9B422644CD0008C2713 /* icon_download_normal@3x.png */; };
04FFA9B922644CD0008C2713 /* icon_download_select@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04FFA9B522644CD0008C2713 /* icon_download_select@3x.png */; };
04FFA9BC2264573C008C2713 /* DWVodPlayBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FFA9BB2264573C008C2713 /* DWVodPlayBottomView.m */; };
04FFA9BF22646C6A008C2713 /* DWVodPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FFA9BE22646C6A008C2713 /* DWVodPlayerView.m */; };
04FFA9D622647579008C2713 /* icon_play_return@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04FFA9C022647577008C2713 /* icon_play_return@3x.png */; };
04FFA9D722647579008C2713 /* icon_play_circle@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04FFA9C122647577008C2713 /* icon_play_circle@3x.png */; };
04FFA9D922647579008C2713 /* icon_play_circle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 04FFA9C322647577008C2713 /* icon_play_circle@2x.png */; };
......@@ -890,6 +894,16 @@
04DF5D492265D6540060B43B /* icon_radio_bg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_radio_bg@3x.png"; sourceTree = "<group>"; };
04E332B9226EA81E0091AC52 /* icon_ad_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_ad_close@2x.png"; sourceTree = "<group>"; };
04E332BA226EA81F0091AC52 /* icon_ad_close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_ad_close@3x.png"; sourceTree = "<group>"; };
04E789DD2696E37C00A1C6D4 /* DWAnswerProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWAnswerProgress.h; sourceTree = "<group>"; };
04E789DE2696E37C00A1C6D4 /* DWAnswerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWAnswerView.m; sourceTree = "<group>"; };
04E789DF2696E37C00A1C6D4 /* DWAnswerModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWAnswerModel.m; sourceTree = "<group>"; };
04E789E02696E37C00A1C6D4 /* DWAnswerCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWAnswerCollectionViewCell.h; sourceTree = "<group>"; };
04E789E12696E37C00A1C6D4 /* DWAnswerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWAnswerView.h; sourceTree = "<group>"; };
04E789E22696E37C00A1C6D4 /* DWAnswerProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWAnswerProgress.m; sourceTree = "<group>"; };
04E789E32696E37C00A1C6D4 /* DWAnswerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWAnswerModel.h; sourceTree = "<group>"; };
04E789E42696E37C00A1C6D4 /* DWAnswerCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWAnswerCollectionViewCell.m; sourceTree = "<group>"; };
04E789E92696EDC400A1C6D4 /* DWVodPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWVodPlayerView.m; sourceTree = "<group>"; };
04E789EA2696EDC500A1C6D4 /* DWVodPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWVodPlayerView.h; sourceTree = "<group>"; };
04E7C9D12445852300BB876A /* BrightnessView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BrightnessView.m; sourceTree = "<group>"; };
04E7C9D22445852400BB876A /* DWVodPlayerPanGesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWVodPlayerPanGesture.h; sourceTree = "<group>"; };
04E7C9D32445852400BB876A /* DWPlayerTimeSilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWPlayerTimeSilder.h; sourceTree = "<group>"; };
......@@ -938,8 +952,6 @@
04FFA9B522644CD0008C2713 /* icon_download_select@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_download_select@3x.png"; sourceTree = "<group>"; };
04FFA9BA2264573C008C2713 /* DWVodPlayBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWVodPlayBottomView.h; sourceTree = "<group>"; };
04FFA9BB2264573C008C2713 /* DWVodPlayBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWVodPlayBottomView.m; sourceTree = "<group>"; };
04FFA9BD22646C6A008C2713 /* DWVodPlayerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWVodPlayerView.h; sourceTree = "<group>"; };
04FFA9BE22646C6A008C2713 /* DWVodPlayerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWVodPlayerView.m; sourceTree = "<group>"; };
04FFA9C022647577008C2713 /* icon_play_return@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_play_return@3x.png"; sourceTree = "<group>"; };
04FFA9C122647577008C2713 /* icon_play_circle@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_play_circle@3x.png"; sourceTree = "<group>"; };
04FFA9C322647577008C2713 /* icon_play_circle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_play_circle@2x.png"; sourceTree = "<group>"; };
......@@ -1068,6 +1080,7 @@
04344214225F0EDD003F7EC1 /* View */ = {
isa = PBXGroup;
children = (
04E789DC2696E37C00A1C6D4 /* Answer */,
04CB7E5E24AD7E8800EF6BCF /* Barrage */,
04357C6522699371002081C0 /* Main */,
04357C6422699371002081C0 /* Player */,
......@@ -1262,8 +1275,8 @@
04357C6422699371002081C0 /* Player */ = {
isa = PBXGroup;
children = (
04FFA9BD22646C6A008C2713 /* DWVodPlayerView.h */,
04FFA9BE22646C6A008C2713 /* DWVodPlayerView.m */,
04E789EA2696EDC500A1C6D4 /* DWVodPlayerView.h */,
04E789E92696EDC400A1C6D4 /* DWVodPlayerView.m */,
04FFA9AF22642E7D008C2713 /* DWVodPlayTableViewCell.h */,
04FFA9B022642E7D008C2713 /* DWVodPlayTableViewCell.m */,
04FFA9BA2264573C008C2713 /* DWVodPlayBottomView.h */,
......@@ -1787,6 +1800,21 @@
path = Ad;
sourceTree = "<group>";
};
04E789DC2696E37C00A1C6D4 /* Answer */ = {
isa = PBXGroup;
children = (
04E789E02696E37C00A1C6D4 /* DWAnswerCollectionViewCell.h */,
04E789E42696E37C00A1C6D4 /* DWAnswerCollectionViewCell.m */,
04E789E32696E37C00A1C6D4 /* DWAnswerModel.h */,
04E789DF2696E37C00A1C6D4 /* DWAnswerModel.m */,
04E789DD2696E37C00A1C6D4 /* DWAnswerProgress.h */,
04E789E22696E37C00A1C6D4 /* DWAnswerProgress.m */,
04E789E12696E37C00A1C6D4 /* DWAnswerView.h */,
04E789DE2696E37C00A1C6D4 /* DWAnswerView.m */,
);
path = Answer;
sourceTree = "<group>";
};
04EB65BC226D57BF00FAB532 /* SubTitle */ = {
isa = PBXGroup;
children = (
......@@ -1919,7 +1947,7 @@
TargetAttributes = {
B547EC4518E033FB00BC980C = {
DevelopmentTeam = 39TBB43S2R;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.AccessWiFi = {
enabled = 1;
......@@ -2251,6 +2279,7 @@
049FF0BA225EEEA700D944C5 /* DWNetworkMonitorViewController.m in Sources */,
049FF0B6225EEEA700D944C5 /* DWSubtitleAnalysis.m in Sources */,
047CE82922B8DBD500D87AAF /* DWExercisesQuestionView.m in Sources */,
04E789E62696E37C00A1C6D4 /* DWAnswerModel.m in Sources */,
04344378225F1F07003F7EC1 /* SDImageIOCoder.m in Sources */,
04FFAA0422648D12008C2713 /* DWPlayerSlider.m in Sources */,
049FF17B225EEEA700D944C5 /* DWDifferentCell.m in Sources */,
......@@ -2271,7 +2300,6 @@
049FF0A4225EEEA700D944C5 /* MASCompositeConstraint.m in Sources */,
04344388225F1F07003F7EC1 /* SDImageCachesManager.m in Sources */,
049FF09D225EEEA700D944C5 /* MJFoundation.m in Sources */,
04FFA9BF22646C6A008C2713 /* DWVodPlayerView.m in Sources */,
04CB7E6F24AD7E8800EF6BCF /* DWBarrageBgView.m in Sources */,
04E7C9D92445852400BB876A /* DWVodPlayerPanGesture.m in Sources */,
0434436B225F1F07003F7EC1 /* SDWebImageCacheSerializer.m in Sources */,
......@@ -2279,6 +2307,7 @@
049FF0A3225EEEA700D944C5 /* ViewController+MASAdditions.m in Sources */,
049FF11B225EEEA700D944C5 /* DWMarkView.m in Sources */,
04CB7E8C24AD81BC00EF6BCF /* OCBarrageTrackInfo.m in Sources */,
04E789E52696E37C00A1C6D4 /* DWAnswerView.m in Sources */,
0434436F225F1F07003F7EC1 /* UIImage+MultiFormat.m in Sources */,
04344392225F1F07003F7EC1 /* SDWebImageDefine.m in Sources */,
04F0B799226026CD0097C3CB /* DWMemberViewController.m in Sources */,
......@@ -2297,6 +2326,7 @@
04CB7E8824AD81BC00EF6BCF /* OCBarrageCell.m in Sources */,
0434437F225F1F07003F7EC1 /* SDAsyncBlockOperation.m in Sources */,
04344375225F1F07003F7EC1 /* SDImageCoderHelper.m in Sources */,
04E789E72696E37C00A1C6D4 /* DWAnswerProgress.m in Sources */,
049FF17D225EEEA700D944C5 /* DWQuestionCell.m in Sources */,
04344393225F1F07003F7EC1 /* UIView+WebCacheOperation.m in Sources */,
04CB7E8D24AD81BC00EF6BCF /* OCBarrageRenderView.m in Sources */,
......@@ -2336,6 +2366,7 @@
04344390225F1F07003F7EC1 /* SDImageCacheConfig.m in Sources */,
049FF113225EEEA700D944C5 /* DWSubtitleView.m in Sources */,
049FF0B5225EEEA700D944C5 /* DWFeedBackView.m in Sources */,
04E789EB2696EDC500A1C6D4 /* DWVodPlayerView.m in Sources */,
04344383225F1F07003F7EC1 /* SDImageCache.m in Sources */,
04344371225F1F07003F7EC1 /* SDWebImageCompat.m in Sources */,
04344391225F1F07003F7EC1 /* SDWebImageCacheKeyFilter.m in Sources */,
......@@ -2370,6 +2401,7 @@
049FF0A2225EEEA700D944C5 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
04344364225F1F07003F7EC1 /* UIImageView+HighlightedWebCache.m in Sources */,
04344379225F1F07003F7EC1 /* SDDiskCache.m in Sources */,
04E789E82696E37C00A1C6D4 /* DWAnswerCollectionViewCell.m in Sources */,
04FFA9AB226426CC008C2713 /* DWVodPlayViewController.m in Sources */,
04CB7E8624AD81BC00EF6BCF /* OCBarrageTextCell.m in Sources */,
04E7C9D82445852400BB876A /* DWPlayerTimeSilder.m in Sources */,
......@@ -2477,11 +2509,11 @@
CLANG_WARN_OBJC_RECEIVER_WEAK = NO;
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = Demo/Demo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.0;
DEVELOPMENT_TEAM = 39TBB43S2R;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -2508,7 +2540,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = hd.bokecc.vodDemo;
PRODUCT_NAME = "cc视频Demo";
PROVISIONING_PROFILE_SPECIFIER = vodDemoDevelopment;
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "";
VALIDATE_WORKSPACE = YES;
......@@ -2526,11 +2558,11 @@
CLANG_WARN_OBJC_RECEIVER_WEAK = NO;
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = Demo/Demo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.0;
DEVELOPMENT_TEAM = 39TBB43S2R;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -2557,7 +2589,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = hd.bokecc.vodDemo;
PRODUCT_NAME = "cc视频Demo";
PROVISIONING_PROFILE_SPECIFIER = vodDemoDevelopment;
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "";
VALIDATE_WORKSPACE = YES;
......
......@@ -48,8 +48,8 @@
3.在reloadLoaclData,填写自己账号下的具体数据
*/
// [self reloadLoaclData];
[self reloadNetworkData];
[self reloadLoaclData];
// [self reloadNetworkData];
}
-(void)reloadNetworkData
......@@ -95,7 +95,7 @@
-(void)reloadLoaclData
{
//请自行替换数据
NSArray * videos = @[];
NSArray * videos = @[@"EF92508659A28ACC63835A29B2A11961", @"64CBF1E6BC32A3D62BBA984E86119800", @"26638480834D0CDAFC9558351D509E7C"];
for (int i = 0; i < videos.count; i++) {
DWVodModel * vodModel = [[DWVodModel alloc]init];
......
//
// DWAnswerCollectionViewCell.h
// Demo
//
// Created by hd on 2021/6/25.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DWAnswerProgress.h"
#import "DWAnswerModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface DWAnswerCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong) DWAnswerProgress *progressView;
@property (nonatomic, strong) UILabel *numberLabel;//
@property (nonatomic, strong) UILabel *titleLabel;// A B C D
@property (nonatomic, strong) UILabel *tickLabel;//对钩
- (void)configViewWithModel:(AnswerContentModel *)model content:(answers *)asModel collectionIndexArr:(NSArray *)collectionIndexArr index:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
//
// DWAnswerCollectionViewCell.m
// Demo
//
// Created by hd on 2021/6/25.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import "DWAnswerCollectionViewCell.h"
@implementation DWAnswerCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
if(self = [super initWithFrame:frame]){
_progressView = [[DWAnswerProgress alloc] initWithFrame:CGRectZero];
_progressView.progress = 0.6;
_progressView.progressTintColor = ColorFrom16A(0x999999, 0.8);
_progressView.trackTintColor = ColorFrom16A(0xF55757, 1);// 绿色 1BBD79 红色F55757
[self addSubview:_progressView];
if ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeRight ||
[UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeLeft) {
//当前横屏
_progressView.frame = CGRectMake(5, 8, 22, 90);
} else {
//当前竖屏
_progressView.frame = CGRectMake(5, 0, 22, 78);
}
_numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 2, 22, 30)];
_numberLabel.textColor = UIColor.whiteColor;
_numberLabel.font = DWFont(8);
_numberLabel.numberOfLines = 2;
_numberLabel.text = @"20%\n20";
_numberLabel.textAlignment = 1;
[_progressView addSubview:_numberLabel];
_tickLabel = [UILabel new];
_tickLabel.text = @"✓";
_tickLabel.font = [UIFont boldSystemFontOfSize:14];
_tickLabel.textColor = UIColor.whiteColor;
_tickLabel.textAlignment = 1;
_tickLabel.hidden = YES;
[_progressView addSubview:_tickLabel];
[_tickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(_progressView).offset(-5);
make.centerX.equalTo(_progressView.mas_centerX);
}];
_titleLabel = [UILabel new];
_titleLabel.textColor = ColorFrom16A(0x1BBD79, 1);
_titleLabel.font = DWFont(14);
_titleLabel.textAlignment = 1;
[self addSubview:_titleLabel];
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_progressView.mas_bottom).offset(4);
make.centerX.equalTo(_progressView.mas_centerX);
}];
}
return self;
}
- (void)configViewWithModel:(AnswerContentModel *)model content:(answers *)asModel collectionIndexArr:(nonnull NSArray *)collectionIndexArr index:(NSInteger)index{
_numberLabel.text = [NSString stringWithFormat:@"%.f%%\n%@", model.scale.floatValue, model.num];
_titleLabel.text = model.name;
if(asModel.right.intValue == 1){//错误
_progressView.trackTintColor = ColorFrom16A(0x1BBD79, 1);
}else{
_progressView.trackTintColor = ColorFrom16A(0xF55757, 1);
}
_progressView.progress = 1.0 - model.scale.floatValue/100.0;
if([collectionIndexArr containsObject:@(index)]){
_tickLabel.hidden = NO;
}else{
_tickLabel.hidden = YES;
}
}
@end
//
// DWAnswerModel.h
// Demo
//
// Created by hd on 2021/6/28.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import <Foundation/Foundation.h>
@class answers;
NS_ASSUME_NONNULL_BEGIN
@interface DWAnswerModel : NSObject
@property (nonatomic, copy) NSString *id;
@property (nonatomic, copy) NSString *showTime;//显示时间
@property (nonatomic, copy) NSString *jump;//是否允许跳过
@property (nonatomic, copy) NSArray <answers *> *answers;
@property (nonatomic, assign) BOOL isShow;//是否显示过
@end
@interface answers : NSObject
@property (nonatomic, copy) NSString *content;
@property (nonatomic, copy) NSString *id;
@property (nonatomic, copy) NSString *right;
@end
@interface AnswerContentModel : NSObject
@property (nonatomic, copy) NSString *id;
@property (nonatomic, copy) NSString *num;
@property (nonatomic, copy) NSString *scale;
@property (nonatomic, copy) NSString *name;
@end
NS_ASSUME_NONNULL_END
//
// DWAnswerModel.m
// Demo
//
// Created by hd on 2021/6/28.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import "DWAnswerModel.h"
@implementation DWAnswerModel
+ (NSDictionary *)objectClassInArray{
return @{@"answers" : [answers class]};
}
@end
@implementation answers
@end
@implementation AnswerContentModel
@end
//
// DWAnswerProgress.h
// Demo
//
// Created by hd on 2021/6/25.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, DWProgressViewStyle) {
DWProgressViewStyleDefault, // 默认
DWProgressViewStyleTrackFillet , // 轨道圆角(默认半圆)
DWProgressViewStyleAllFillet, //进度与轨道都圆角
};
@interface DWAnswerProgress : UIView
@property(nonatomic) float progress; // 0.0 .. 1.0, 默认0 超出为1.
@property(nonatomic,assign) DWProgressViewStyle progressViewStyle;
@property(nonatomic,assign) BOOL isTile; //背景图片是平铺填充 默认NO拉伸填充 设置为YES时图片复制平铺填充
@property(nonatomic, strong, nullable) UIColor* progressTintColor;
@property(nonatomic, strong, nullable) UIColor* trackTintColor;
@property(nonatomic, strong, nullable) UIImage* progressImage; //进度条背景图片,默认拉伸填充 优先级大于背景色
@property(nonatomic, strong, nullable) UIImage* trackImage; //轨道填充图片
- (instancetype)initWithFrame:(CGRect)frame progressViewStyle:(DWProgressViewStyle)style;
@end
//
// DWAnswerProgress.m
// Demo
//
// Created by hd on 2021/6/25.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import "DWAnswerProgress.h"
@interface DWAnswerProgress ()
{
UIView *_progressView;
float _progress;
}
@end
@implementation DWAnswerProgress
- (instancetype)initWithFrame:(CGRect)frame{
return [self initWithFrame:frame progressViewStyle:DWProgressViewStyleDefault];
}
- (instancetype)initWithFrame:(CGRect)frame progressViewStyle:(DWProgressViewStyle)style
{
if (self=[super initWithFrame:frame]) {
_progressView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, frame.size.height)];
_progress=0;
self.progressViewStyle=style;
[self addSubview:_progressView];
}
return self;
}
-(void)setProgressViewStyle:(DWProgressViewStyle)progressViewStyle
{
_progressViewStyle=progressViewStyle;
if (progressViewStyle==DWProgressViewStyleTrackFillet) {
self.layer.masksToBounds=YES;
self.layer.cornerRadius=self.bounds.size.height/2;
}
else if (progressViewStyle==DWProgressViewStyleAllFillet)
{
self.layer.masksToBounds=YES;
self.layer.cornerRadius=self.bounds.size.height/2;
_progressView.layer.cornerRadius=self.bounds.size.height/2;
}
}
-(void)setTrackTintColor:(UIColor *)trackTintColor
{
_trackTintColor=trackTintColor;
if (self.trackImage) {
}
else
{
self.backgroundColor=trackTintColor;
}
}
-(void)setProgress:(float)progress
{
_progress=MIN(progress, 1);
_progressView.frame=CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height*_progress);
}
-(float)progress
{
return _progress;
}
-(void)setProgressTintColor:(UIColor *)progressTintColor
{
_progressTintColor=progressTintColor;
_progressView.backgroundColor=progressTintColor;
}
-(void)setTrackImage:(UIImage *)trackImage
{
_trackImage=trackImage;
if(self.isTile)
{
self.backgroundColor=[UIColor colorWithPatternImage:trackImage];
}
else
{
self.backgroundColor=[UIColor colorWithPatternImage:[self stretchableWithImage:trackImage]];
}
}
-(void)setIsTile:(BOOL)isTile
{
_isTile = isTile;
if (self.progressImage) {
[self setProgressImage:self.progressImage];
}
if (self.trackImage) {
[self setTrackImage:self.trackImage];
}
}
-(void)setProgressImage:(UIImage *)progressImage
{
_progressImage = progressImage;
if(self.isTile)
{
_progressView.backgroundColor=[UIColor colorWithPatternImage:progressImage];
}
else
{
_progressView.backgroundColor=[UIColor colorWithPatternImage:[self stretchableWithImage:progressImage]];
}
}
- (UIImage *)stretchableWithImage:(UIImage *)image{
UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.f);
[image drawInRect:self.bounds];
UIImage *lastImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return lastImage;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// DWAnswerView.h
// Demo
//
// Created by hd on 2021/6/22.
// Copyright © 2021 com.bokecc.www. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DWAnswerModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^DWContinueBlock)(void);//继续播放
typedef void(^DWSubmitBlock)(NSDictionary *);//提交答案
@interface DWAnswerView : UIView
- (void)showDWAnswerViewWithModel:(DWAnswerModel *)model;
@property (nonatomic, strong) UIButton *submitOrContinueBtn;//继续播放按钮 提交答案按钮
@property (nonatomic, strong) UIButton *jumpBtn;//跳过按钮
@property (nonatomic, strong) UIButton *resubmitBtn;//重新提交按钮
@property (nonatomic, strong) UIImageView *submitErrrorImage;//提交失败图片
@property (nonatomic, strong) UIButton *closeBtn;//关闭按钮
@property (nonatomic, strong) UILabel *reminderLabel;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, copy) DWContinueBlock continueBlock;
@property (nonatomic, copy) DWSubmitBlock submitBlock;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
......@@ -13,6 +13,7 @@
#import "DWTableChooseModel.h"
#import "DWMarkView.h"
#import "DWQuestionView.h"
#import "DWAnswerView.h"
#import "DWFeedBackView.h"
#import "DWSubtitleView.h"
<