Commit a396052f by pierce

备份一下囖咯

parent 9bbba25d
Showing with 318 additions and 71 deletions
//
// YALiveLoadingView.h
// FireflyShow
//
// Created by Jim Chan on 2018/11/27.
// Copyright © 2018 压寨团队. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, FUSLoadingState) {
// 闲置状态
FUSLoadingStateIdle = 0,
// 正在进入状态
FUSLoadingStateEntering,
// 暂停状态
FUSLoadingStatePause,
// 加载中状态
FUSLoadingStateLoading,
};
@interface FUSFuSiLoadingView : UIView
// 显示文案 Label
@property (nonatomic, strong) UILabel *titleLabel;
// 当前 loading View 状态,通过给这个属性赋值来执行不同的 Loading 动画
@property (nonatomic, assign) FUSLoadingState state;
// 设置暂停图片
- (void)fus_setPauseImageView;
- (void)fus_setTitleString:(NSString *)str;
@end
NS_ASSUME_NONNULL_END
//
// FUSLiveLoadingView.m
// FireflyShow
//
// Created by Jim Chan on 2018/11/27.
// Copyright © 2018 压寨团队. All rights reserved.
//
#import "FUSFuSiLoadingView.h"
#import "FUSToolSet.h"
NSString * const kBGShineMoveAnimation = @"kBGShineMoveAnimation";
@interface FUSFuSiLoadingView ()
// loading 动画 ImageView
@property (nonatomic, strong) UIImageView *loadingImageView;
// 顶部移动的动画 Image View
@property (nonatomic, strong) UIImageView *bgShiningImageView;
// 正在进入 动画 Image
@property (nonatomic, strong) UIImage *enteringAnimateImage;
// 暂停动画
@property (nonatomic, strong) UIImage *pauseImage;
// 加载动画
@property (nonatomic, strong) UIImage *loadingAnimateImage;
// 动画
@property (nonatomic, strong) CAKeyframeAnimation *moveAnimation;
@end
@implementation FUSFuSiLoadingView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initUI];
// 默认初始值
_state = FUSLoadingStateIdle;
}
return self;
}
#pragma mark - UI
/**
搭建 UI
*/
- (void)initUI
{
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
}
// 设置暂停图片
- (void)fus_setPauseImageView {
self.pauseImage = [UIImage imageNamed:@"PK_Anchor_Pause"];
}
- (void)layoutSubviews {
[super layoutSubviews];
_loadingImageView.center = CGPointMake(self.width / 2.0 , self.height / 2.0 - 70);
_titleLabel.centerX = self.width/2.0;
_titleLabel.y = CGRectGetMaxY(_loadingImageView.frame) - 10;
_bgShiningImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width * 2, self.height * 0.2)];
}
#pragma mark - Setter and Getter
/**
懒加载 Loading Image View
@return
*/
- (UIImageView *)loadingImageView
{
if (!_loadingImageView) {
CGFloat imageViewWidth = UIView.fus_screenH * (100.0 / 667.0);
_loadingImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, imageViewWidth, imageViewWidth)];
_loadingImageView.center = CGPointMake(self.width / 2.0, self.height / 2.0 - 70);
_loadingImageView.contentMode = UIViewContentModeScaleAspectFit;
_loadingImageView.animationDuration = 10;
[self addSubview:_loadingImageView];
}
return _loadingImageView;
}
/**
懒加载
*/
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 60)];
_titleLabel.numberOfLines = 0;
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.font = [UIFont themeFont:15];
_titleLabel.text = @"";
_titleLabel.centerX = _loadingImageView.centerX;
_titleLabel.y = CGRectGetMaxY(_loadingImageView.frame);
_titleLabel.textColor = [UIColor whiteColor];
[self addSubview:_titleLabel];
}
return _titleLabel;
}
- (void)fus_setTitleString:(NSString *)str{
_titleLabel.text = str;
_loadingImageView.center = CGPointMake(self.width / 2.0 , self.height / 2.0 - 70);
_titleLabel.size = CGSizeMake(138, UIView.fus_screenH*0.5); //UI上面限死了宽
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.centerX = self.width/2.0;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
[attr addAttributes:@{NSFontAttributeName:[UIFont themeFont:14]} range:NSMakeRange(0, str.length)];
CGSize size = [YYTextLayout layoutWithContainerSize:CGSizeMake(138, UIView.fus_screenH*0.5) text:attr].textBoundingSize;
_titleLabel.size = size;
_titleLabel.y = CGRectGetMaxY(_loadingImageView.frame) - 10;
_titleLabel.numberOfLines = 0;
}
- (UIImageView *)bgShiningImageView
{
if (!_bgShiningImageView) {
_bgShiningImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width * 2, self.height * 0.2)];
_bgShiningImageView.contentMode = UIViewContentModeScaleAspectFill;
_bgShiningImageView.image = [UIImage imageNamed:@"loading_yabo_shine"];
[self addSubview:_bgShiningImageView];
}
return _bgShiningImageView;
}
/**
设置不同的状态值
@param state 状态值
*/
- (void)setState:(FUSLoadingState)state
{
if (_state == state) {
FUSLogVerbose(@"FUSLoadingState 相同,重复赋值不执行");
return;
}
_state = state;
switch (state) {
case FUSLoadingStateIdle:// 闲置状态,不显示任何动画
{
[_loadingImageView stopAnimating];
_loadingImageView.animationImages = nil;
_loadingImageView.image = nil;
_titleLabel.text = @"";
_bgShiningImageView.hidden = YES;
[_bgShiningImageView.layer removeAnimationForKey:kBGShineMoveAnimation];
}
break;
case FUSLoadingStateLoading:// 读取中状态
{
self.loadingImageView.image = self.loadingAnimateImage;
[self.loadingImageView startAnimating];
// _titleLabel.text = @"";
[self.bgShiningImageView.layer addAnimation:self.moveAnimation forKey:kBGShineMoveAnimation];
_bgShiningImageView.hidden = NO;
}
break;
case FUSLoadingStateEntering:// 正在进入中
{
self.loadingImageView.image = self.enteringAnimateImage;
[self.loadingImageView startAnimating];
_titleLabel.text = @"";
[self.bgShiningImageView.layer addAnimation:self.moveAnimation forKey:kBGShineMoveAnimation];
_bgShiningImageView.hidden = NO;
}
break;
case FUSLoadingStatePause:// 暂停状态
{
self.loadingImageView.image = self.pauseImage;
self.titleLabel.text = FUSLocalizationHelper.localString(@"主播暂停,马上回来");
[_bgShiningImageView.layer removeAnimationForKey:kBGShineMoveAnimation];
_bgShiningImageView.hidden = YES;
}
break;
default:
break;
}
}
/**
懒加载方法加载动画图片
@return 正在进入中的动画图片
*/
- (UIImage *)enteringAnimateImage
{
if (!_enteringAnimateImage) {
_enteringAnimateImage = [UIImage animatedImageWithImages:[UIImage fus_animationImages:@"release_refresh_" mainBundle:NO needCache:YES] duration:1.5];
}
return _enteringAnimateImage;
}
- (UIImage *)pauseImage
{
if (!_pauseImage) {
_pauseImage = [UIImage imageNamed:@"Live_Pause"];
}
return _pauseImage;
}
- (UIImage *)loadingAnimateImage
{
if (!_loadingAnimateImage) {
_loadingAnimateImage = [UIImage animatedImageWithImages:[UIImage fus_animationImages:@"release_refresh_" mainBundle:NO needCache:YES] duration:1.5];
}
return _loadingAnimateImage;
}
- (CAKeyframeAnimation *)moveAnimation
{
if (!_moveAnimation) {
// 构建动画
_moveAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
_moveAnimation.values = @[@(0), @(-self.width)];
_moveAnimation.duration = 5.0;
_moveAnimation.repeatCount = CGFLOAT_MAX;
}
return _moveAnimation;
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *respondView = [super hitTest:point withEvent:event];
if (respondView == self) {
return nil;
}
for (UIView *subview in self.subviews) {
if (subview == respondView) {
return nil;
}
}
return respondView;
}
@end
//
// FUSVideoChatModel.h
// FusiLive
//
// Created by 盘世煜 on 2018/12/10.
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface FUSVideoChatModel : FUSBaseModel
// 视讯开关(0:关、1:开)
@property (nonatomic, copy) NSString *videoSwitch;
// 视讯收费价格
@property (nonatomic, copy) NSString *videoPrice;
// 声讯收费价格
@property (nonatomic, copy) NSString *audioPrice;
// 声讯开关(0:关、1:开)
@property (nonatomic, copy) NSString *audioSwitch;
// (0:未认证、1:认证审核中、2:已认证)
@property (nonatomic, copy) NSString *videoAuthState;
// 评分(0.00)
@property (nonatomic, assign) CGFloat avgLevel;
// 接听率
@property (nonatomic, copy) NSString *succRatio;
// 视讯或者声讯价格
@property (nonatomic, copy, readonly) NSString *callPrice;
@end
NS_ASSUME_NONNULL_END
//
// FUSVideoChatModel.m
// FusiLive
//
// Created by 盘世煜 on 2018/12/10.
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSVideoChatModel.h"
@implementation FUSVideoChatModel
- (NSString *)callPrice {
NSInteger videoPrice = [_videoPrice integerValue];
NSInteger audioPrice = [_audioPrice integerValue];
return @(MAX(videoPrice, audioPrice)).description;
}
@end
......@@ -15,7 +15,7 @@
#import "FUSScrollNumberView.h"
//other
#import "YYWeakProxy.h"
#import <YYKit/YYWeakProxy.h>
#import "UIColor+Conver.h"
typedef enum : NSUInteger {
......@@ -374,7 +374,7 @@ typedef enum : NSUInteger {
[self addSubview:_scrollNumberView];
__weak typeof(self) weakSelf = self;
__weak typeof(self) weakself = self;
self.scrollNumberView.startScrollNumberAnimation = ^{
//动画开始回调
......
......@@ -20,7 +20,7 @@
//other
#import "FUSDefine.h"
#import "YYWeakProxy.h"
#import <YYKit/YYWeakProxy.h>
#import "FUSFormatContentHelper.h"
@interface FUSLiveDewGiftNumberView ()<CAAnimationDelegate>
......@@ -188,7 +188,7 @@
//乘号
_multiplyLabel = [[FUSGradientLabel alloc] init];
_multiplyLabel.font = FUS_DEFAULT_BOLD_FONT(16);
_multiplyLabel.font = [UIFont themeBoldFont:16];
_multiplyLabel.text = @"x";
_multiplyLabel.colors = @[(id)[UIColor colorWithHex:@"7660FF"].CGColor,(id)[UIColor colorWithHex:@"7661FF"].CGColor];
_multiplyLabel.strokeColor = [UIColor whiteColor];
......
......@@ -12,7 +12,7 @@
#import "FUSLiveNormalGiftView.h"
//other
#import "YYWeakProxy.h"
#import <YYKit/YYWeakProxy.h>
#import "FUSLiveHelper.h"
......
......@@ -7,7 +7,7 @@
//
#import "FUSLiveNormalGiftEffectView.h"
#import "YYWeakProxy.h"
#import <YYKit/YYWeakProxy.h>
@interface FUSLiveNormalGiftEffectView ()<CAAnimationDelegate>
......
......@@ -15,7 +15,7 @@
#import "FUSLiveOutlineLabel.h"
//other
#import "YYWeakProxy.h"
#import <YYKit/YYWeakProxy.h>
#import "FUSCacheDataShare.h"
#import "FUSLiveHelper.h"
......@@ -165,7 +165,7 @@
[self addSubview:_eachLabel];
self.senderCountLabel = [[UILabel alloc] init];
self.senderCountLabel.font = FUS_DEFAULT_BOLD_FONT(17);
self.senderCountLabel.font = [UIFont themeBoldFont:17];
self.senderCountLabel.textColor = [UIColor whiteColor];
[self addSubview:self.senderCountLabel];
......@@ -190,7 +190,7 @@
//用户的等级
_richLevelLabel = [[FUSLiveOutlineLabel alloc] init];
_richLevelLabel.font = FUS_DEFAULT_BOLD_FONT(7);
_richLevelLabel.font = [UIFont themeBoldFont:7];
_richLevelLabel.textAlignment = NSTextAlignmentCenter;
_richLevelLabel.textColor = [UIColor whiteColor];
_richLevelLabel.strokeWidth = 0.5;
......@@ -320,7 +320,7 @@
// _giftNameLabel.left = CGRectGetMaxX(_fixationLabel.frame)+5;
_currentGiftModel = model;
_userNameLabel.font = FUS_DEFAULT_BOLD_FONT(14);
_userNameLabel.font = [UIFont themeBoldFont:14];
_userNameLabel.text = model.fromuser.nickname;
[_userNameLabel sizeToFit];
......
......@@ -3,7 +3,7 @@
// Lottie
//
// Created by Brandon Withrow on 8/5/20.
// Copyright © 2024年 FuSiLive. All rights reserved.
// Copyright © 2020 YurtvilleProds. All rights reserved.
//
import Foundation
......
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 sign in to comment