Commit c55512cf by ludi

修复一系列bug

parent e70b84b1
Showing with 215 additions and 181 deletions
......@@ -17,6 +17,7 @@
//#import <TencentOpenAPI/QQApiInterface.h>
#import <mob_sharesdk/WXApi.h>
//#import <FBSDKCoreKit/FBSDKProfile.h>
#import <Masonry/Masonry.h>
@interface FUSWKWebViewController ()
......@@ -63,7 +64,7 @@
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
self.webView.frame = self.view.bounds;
// self.webView.frame = self.view.bounds;
}
- (void)viewWillAppear:(BOOL)animated{
......@@ -80,7 +81,7 @@
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.webView.frame = self.view.bounds;
// self.webView.frame = self.view.bounds;
}
- (void)viewDidDisappear:(BOOL)animated {
......@@ -127,6 +128,9 @@
self.webView.backgroundColor = [UIColor clearColor];
self.webView.opaque = NO;
[self.view addSubview:self.webView];
[self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
if (_shouldShowShareBtn) {
// 显示分享按钮
UIButton *shareBtn = [UIButton buttonWithType:UIButtonTypeCustom];
......@@ -238,7 +242,7 @@
#pragma mark - 配置WebView
- (void)configWebView {
self.webView.frame = self.view.bounds;
// self.webView.frame = self.view.bounds;
_webView.shouldIncludeIdentifyInfo = self.shouldIncludeIdentifyInfo;
_webView.webUrlString = self.webUrlString;
_webView.clearCache = self.clearCache;
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_pk_control_pkMode_1v1_bigIcon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_pk_control_pkMode_1v1_bigIcon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -119,6 +119,9 @@
//是否在PK
@property (nonatomic, strong) NSString *isPk;
/// pk类型 0:普通\1:选秀
@property (nonatomic, assign) NSInteger pkShow;
@property (nonatomic, copy) NSArray<NSString *> *tag;
// 是否已经结束了直播
......
......@@ -26,6 +26,8 @@
///pk标识动画
@property (nonatomic, strong) FUSPKLiveAnimateImageView *PKAnimationImageView;
@property (nonatomic, strong) YYAnimatedImageView *pkShowAnimationImageView;
///底部的阴影View
@property (nonatomic, strong) UIImageView *bottomAlphaBgView;
......@@ -110,6 +112,14 @@
make.top.equalTo(self.hotNumBtn.mas_top);
}];
self.pkShowAnimationImageView = [[YYAnimatedImageView alloc] init];
[self.contentView addSubview:self.pkShowAnimationImageView];
[self.pkShowAnimationImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(self.PKAnimationImageView.mas_height).multipliedBy(0.9 / 90.0 * 150.0);
make.width.equalTo(self.pkShowAnimationImageView.mas_width).multipliedBy(1.0 / 150.0 * 400.0);
make.center.equalTo(self.PKAnimationImageView);
}];
self.hotNumBtn.hidden = YES;
self.locationBtn.hidden = YES;
}
......@@ -123,6 +133,8 @@
[self.tagView fus_stopAllTagsAnim];
self.PKAnimationImageView.hidden = YES;
[self.PKAnimationImageView stopAnimating];
self.pkShowAnimationImageView.hidden = YES;
}
- (void)fus_quickLiveRoom {
......@@ -130,12 +142,16 @@
[self.tagView fus_startAllTagsAnim];
//pk动画
if (self.model.isPk.boolValue) {
self.PKAnimationImageView.hidden = NO;
[self.PKAnimationImageView startAnimating];
} else {
if (self.model.pkShow == 1) {
self.pkShowAnimationImageView.hidden = NO;
self.PKAnimationImageView.hidden = YES;
[self.PKAnimationImageView stopAnimating];
}
else {
if (self.model.isPk.boolValue) {
self.PKAnimationImageView.hidden = NO;
[self.PKAnimationImageView startAnimating];
self.pkShowAnimationImageView.hidden = YES;
}
}
}
......@@ -184,12 +200,18 @@
self.tagView.hidden = NO;
[self.tagView fus_refreshTagImagesWithModel:model];
if (model.isPk.boolValue) {
self.PKAnimationImageView.hidden = NO;
[self.PKAnimationImageView startAnimating];
} else {
self.PKAnimationImageView.hidden = YES;
[self.PKAnimationImageView stopAnimating];
// pk动画
self.PKAnimationImageView.hidden = YES;
[self.PKAnimationImageView stopAnimating];
self.pkShowAnimationImageView.hidden = YES;
if (model.pkShow == 1) {
self.pkShowAnimationImageView.hidden = NO;
}
else {
if (model.isPk.boolValue) {
self.PKAnimationImageView.hidden = NO;
[self.PKAnimationImageView startAnimating];
}
}
__weak typeof(self) weakSelf = self;
......
......@@ -9,11 +9,15 @@
NS_ASSUME_NONNULL_BEGIN
@interface FUSPKLiveAnimateImageView : UIImageView
@interface FUSPKLiveAnimateImageView : UIView
/// 高亮时开始播放动画
@property (nonatomic, assign) BOOL startAnimWhenHighlighted;
-(void)startAnimating;
-(void)stopAnimating;
@end
NS_ASSUME_NONNULL_END
......@@ -6,6 +6,13 @@
//
#import "FUSPKLiveAnimateImageView.h"
#import <Masonry/Masonry.h>
@interface FUSPKLiveAnimateImageView()
@property (nonatomic, strong) UIImageView *imageView;
@end
@implementation FUSPKLiveAnimateImageView
......@@ -30,32 +37,55 @@
return self;
}
- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
if (self.startAnimWhenHighlighted) {
[self startAnimating];
}
}
- (void)fus_initial {
self.startAnimWhenHighlighted = YES;
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
NSMutableArray *imageArr = [NSMutableArray array];
for (int i = 1; i <= 19; i++) {
for (int i = 0; i < 40; i++) {
UIImage *image = [FUSShowRoomCenterBunble imageNamed:[NSString stringWithFormat:@"PK_Cover_Animation_%d",i]];
if (image) {
[imageArr addObject:image];
}
}
for (int i = 0; i < (NSInteger)(12 * 2); i++) {
UIImage *image = [FUSShowRoomCenterBunble imageNamed:@"PK_Cover_Animation_19"];
if (image) {
[imageArr addObject:image];
}
// for (int i = 0; i < (NSInteger)(12 * 2); i++) {
// UIImage *image = [HomeListBundle imageNamed:@"PK_Cover_Animation_19"];
// if (image) {
// [imageArr addObject:image];
// }
// }
self.imageView.animationImages = imageArr;
self.imageView.animationDuration = imageArr.count / 12;
}
- (void)layoutSubviews{
[super layoutSubviews];
self.backgroundColor = [UIColor colorWithHex:@"#000000" alpha:0.24];
self.layer.cornerRadius = self.height / 2.0f;
self.layer.masksToBounds = YES;
}
- (void)startAnimating{
[self.imageView startAnimating];
}
- (void)stopAnimating{
[self.imageView stopAnimating];
}
- (UIImageView *)imageView{
if (!_imageView) {
_imageView = [[UIImageView alloc] init];
[self addSubview:_imageView];
[_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self).inset(-2);
}];
}
self.animationImages = imageArr;
self.animationDuration = imageArr.count / 12;
return _imageView;
}
//- (void)setStartAnimWhenHighlighted:(BOOL)startAnimWhenHighlighted{
// self.imageView.startAnimWhenHighlighted = startAnimWhenHighlighted;
//}
@end
......@@ -14,7 +14,6 @@
#import "FUSScreenShotShareView.h"
#import "FUSBottomOptionalView.h"
#import "FUSLiveGameListView.h"
#import "FUSLiveAnchorSettingAlertView.h"
#import "FUSSocketMessageDelegate.h"
......
......@@ -125,11 +125,13 @@ import RxCocoa
titleLabel.font = .fus_themeFont(18)
titleLabel.textColor = .black
titleLabel.text = " "
// titleLabel.text = " "
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(28.5)
// 暂时不要标题了
make.height.equalTo(0)
}
self.collectionView.backgroundColor = .clear
......@@ -157,20 +159,24 @@ import RxCocoa
func fus_reloadUI(){
// if FFSwiftLiveHelper.shared.liveType == FFLiveType.Anchor {
if self.collectionItemList.map({ $0.type }).contains(.broadcastFunction) {
self.titleLabel.text = .fus_versionLocalString("主播工具")
}else {
self.titleLabel.text = .fus_versionLocalString("房间工具")
}
// if self.collectionItemList.map({ $0.type }).contains(.broadcastFunction) {
// self.titleLabel.text = .fus_versionLocalString("主播工具")
// }else {
// self.titleLabel.text = .fus_versionLocalString("房间工具")
// }
let titleHeight = 28.5 + 18
// let titleHeight = 28.5 + 18
let titleHeight = 28.5
var collectionViewHeight: CGFloat = 0
// 算出每一行的高度
for sectionModel in self.collectionItemList {
let itemLine = sectionModel.functionList.count/4 + (sectionModel.functionList.count%4 > 0 ? 1 : 0)
collectionViewHeight = collectionViewHeight + itemHeaderHeight + CGFloat(itemLine)*itemHeight
}
if self.collectionItemList.count <= 1 {
// 只有一个的时候不要标题
collectionViewHeight = collectionViewHeight - itemHeaderHeight
}
let contentViewHeight = titleHeight + collectionViewHeight + UIView.fus_SafeBottom()
let contentViewY = self.alertViewDidShow ? UIView.fus_screenH() - contentViewHeight : UIView.fus_screenH()
......@@ -349,10 +355,18 @@ extension FUSLiveChatInputToolAlertView: UICollectionViewDelegate, UICollectionV
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
if self.collectionItemList.count <= 1 {
return .zero
}
return CGSizeMake(UIView.fus_screenW(), itemHeaderHeight)
}
public func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if self.collectionItemList.count <= 1 {
return UICollectionReusableView()
}
if kind == UICollectionView.elementKindSectionHeader {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: FUSLiveGameListViewHeader.headerId, for: indexPath) as! FUSLiveGameListViewHeader
header.titleLabel.text = self.collectionItemList[indexPath.section].type.fus_getSectionName()
......@@ -418,7 +432,8 @@ extension FUSLiveBottomToolType{
case FUSLiveBottomToolTypeGift:
return FUSShowRoomCenterBunble.versionImageNamed("img_liveroom_input_gift")
case FUSLiveBottomToolTypeLiveSetting:
return FUSShowRoomCenterBunble.versionImageNamed(isSelect ? "live_chat_icon_live_setting_hl" : "live_chat_icon_live_setting")
// return FUSShowRoomCenterBunble.versionImageNamed(isSelect ? "live_chat_icon_live_setting_hl" : "live_chat_icon_live_setting")
return FUSShowRoomCenterBunble.imageNamed(isSelect ? "live_tool_anchor_setting_pressed" : "live_tool_anchor_setting_normal")
case FUSLiveBottomToolTypeScreenShot:
return FUSShowRoomCenterBunble.imageNamed(isSelect ? "live_chat_tool_screenshot_highlight" : "live_chat_tool_screenshot_normal")
case FUSLiveBottomToolTypeMessageBox:
......@@ -456,7 +471,8 @@ extension FUSLiveBottomToolType{
// case FUSLiveBottomToolTypeOpenRoom:
// return FUSShowRoomCenterBunble.versionImageNamed(isSelect ? "live_tool_open_room_pressed" : "live_tool_open_room_normal")
case FUSLiveBottomToolTypeRoomSetting:
return FUSShowRoomCenterBunble.imageNamed(isSelect ? "live_tool_anchor_setting_pressed" : "live_tool_anchor_setting_normal")
// return FUSShowRoomCenterBunble.imageNamed(isSelect ? "live_tool_anchor_setting_pressed" : "live_tool_anchor_setting_normal")
return FUSShowRoomCenterBunble.versionImageNamed(isSelect ? "live_chat_icon_live_setting_hl" : "live_chat_icon_live_setting")
case FUSLiveBottomToolTypeStartPictureInPicture:
return FUSShowRoomCenterBunble.imageNamed(isSelect ? "live_tool_start_pic_in_pic_btn" : "live_tool_start_pic_in_pic_btn")
// case .novaBuild:
......
......@@ -33,12 +33,12 @@ class FUSLiveGameListViewHeader: UICollectionReusableView {
make.centerY.equalToSuperview()
}
let lineImageView = UIImageView(image: FUSShowRoomCenterBunble.versionImageNamed("live_game_list_header_line"))
self.addSubview(lineImageView)
lineImageView.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right).offset(4)
make.right.lessThanOrEqualToSuperview().offset(-26)
make.centerY.equalTo(titleLabel.snp.centerY)
}
// let lineImageView = UIImageView(image: FUSShowRoomCenterBunble.versionImageNamed("live_game_list_header_line"))
// self.addSubview(lineImageView)
// lineImageView.snp.makeConstraints { make in
// make.left.equalTo(titleLabel.snp.right).offset(4)
// make.right.lessThanOrEqualToSuperview().offset(-26)
// make.centerY.equalTo(titleLabel.snp.centerY)
// }
}
}
//
// FUSLiveGameListView.h
// FusiClub
//
// Created by pierce on 2024/6/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSLiveGameListView : UIView
+ (void)fus_showLiveGameListView;
@end
NS_ASSUME_NONNULL_END
//
// FUSLiveGameListView.m
// FusiClub
//
// Created by pierce on 2024/6/27.
//
#import "FUSLiveGameListView.h"
#import "FUSLiveGameCollectionViewCell.h"
#import "FUSLiveHelper.h"
#import "FUSLiveConfigsDataCenter.h"
#import <Masonry/Masonry.h>
@interface FUSLiveGameListView ()<UICollectionViewDelegate, UICollectionViewDataSource>
/// 关闭按钮
@property (nonatomic, strong) UIButton *closeBtn;
/// 内容的View
@property (nonatomic, strong) UIView *contentView;
/// 列表
@property (nonatomic, strong) UICollectionView *collectionView;
@end
@implementation FUSLiveGameListView
+ (void)fus_showLiveGameListView {
FUSLiveGameListView *gameView = [[FUSLiveGameListView alloc] initWithFrame:UIView.fus_screenFrame];
[[FUSLiveHelper.shareInstance.currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerManualPopView] addSubview:gameView];
[gameView fus_showWithAnimation];
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.closeBtn addTarget:self action:@selector(fus_hideWithAnimation) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:self.closeBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
self.contentView = [[UIView alloc] initWithFrame:CGRectMake(0, UIView.fus_screenH, UIView.fus_screenW, 98)];
self.contentView.backgroundColor = UIColor.fus_appBGColor;
[self.contentView addRoundedCorners:UIRectCornerTopLeft | UIRectCornerTopRight withRadii:CGSizeMake(16, 16)];
[self addSubview:self.contentView];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.itemSize = CGSizeMake(UIView.fus_screenW / 4.0, 98);
self.collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:layout];
self.collectionView.backgroundColor = [UIColor fus_appBGColor];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
[self.collectionView registerClass:[FUSLiveGameCollectionViewCell class] forCellWithReuseIdentifier:[FUSLiveGameCollectionViewCell cellIdentifer]];
[self.contentView addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
}
return self;
}
- (void)fus_showWithAnimation {
[UIView animateWithDuration:0.3 animations:^{
self.contentView.y = UIView.fus_screenH - self.contentView.height;
}];
}
- (void)fus_hideWithAnimation {
[UIView animateWithDuration:0.3 animations:^{
self.contentView.y = UIView.fus_screenH;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
#pragma mark - UICollectionViewDelegate, UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return FUSLiveConfigsDataCenter.shareInstance.gameList.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
FUSLiveGameCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[FUSLiveGameCollectionViewCell cellIdentifer] forIndexPath:indexPath];
[cell fus_setupWithModel:FUSLiveConfigsDataCenter.shareInstance.gameList[indexPath.row]];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
FUSLiveGameModel *gameModel = FUSLiveConfigsDataCenter.shareInstance.gameList[indexPath.row];
FUSHalfWebViewModel *halfWebModel = [FUSHalfWebViewModel fus_modelWithDict:gameModel.popupStyle];
[FUSLiveHelper.shareInstance.currentFunctionView fus_showHalfWebView:halfWebModel];
[self fus_hideWithAnimation];
}
@end
//
// FUSLiveGameListViewCell.swift
// FUSShowRoomModule
//
// Created by aaa on 2026/3/6.
//
import UIKit
class FUSLiveGameListViewCell: FUSSwiftCollectionViewCell {
static let cellIdentifier = "FUSLiveGameListViewCell"
let iconImageView = UIImageView(frame: .init(x: 0, y: 0, width: 40, height: 35))
let titleLabel = UILabel(frame: .zero)
public override func makeUI() {
super.makeUI()
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
self.iconImageView.contentMode = .scaleAspectFit
self.contentView.addSubview(self.iconImageView)
self.iconImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-14)
make.width.equalTo(54)
make.height.equalTo(54)
}
self.titleLabel.font = .fus_themeFont(13)
self.titleLabel.textColor = .fus_textColorRich()
self.titleLabel.textAlignment = .center
self.contentView.addSubview(self.titleLabel)
self.titleLabel.snp.makeConstraints { make in
make.top.equalTo(self.iconImageView.snp.bottom).offset(10)
make.left.right.equalToSuperview()
// make.height.equalTo(10)
}
}
func fus_setup(model:FUSLiveGameModel) {
self.iconImageView.setWebImageWithSubURLString(model.gameIcon)
self.titleLabel.text = model.gameName
}
func fus_setupPlayModel(model: FUSLivePlayModel) {
self.iconImageView.setWebImageWithSubURLString(model.playIcon)
self.titleLabel.text = model.playName
}
}
......@@ -143,7 +143,7 @@ class FUSPKScoreProgressView: FUSBaseView {
self.progressLightImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview().offset(-0.5)
make.centerX.equalTo(self.rightProgress.snp.left).offset(-1.5)
make.centerX.equalTo(self.rightProgress.snp.left).offset(0)
}
self.giftBombProgressLightBgView.snp.makeConstraints { make in
......
......@@ -57,7 +57,8 @@ class FUSPKControlPKModeCell: UICollectionViewCell {
// make.centerX.equalToSuperview()
// make.centerY.equalToSuperview().offset(-6)
// make.size.equalTo(CGSizeMake(115, 115))
make.top.equalToSuperview()
// make.top.equalToSuperview()
make.centerY.equalToSuperview().offset(-12)
make.centerX.equalToSuperview()
make.left.greaterThanOrEqualTo(centerBgView.snp.left)
make.right.lessThanOrEqualTo(centerBgView.snp.right)
......@@ -123,7 +124,13 @@ class FUSPKControlPKModeCell: UICollectionViewCell {
self.iconImageView.image = iconImage
}
else {
self.iconImageView.setWebImageWithSubURLString(model.icon)
if model.type.intValue == 1 {
self.iconImageView.image = FUSShowRoomCenterBunble.imageNamed("live_pk_control_pkMode_1v1_bigIcon")
}
else {
self.iconImageView.setWebImageWithSubURLString(model.icon)
}
}
self.nameLabel.text = model.name
......
......@@ -20,7 +20,7 @@ class FUSPKPunishSelectPunishCell: UICollectionViewCell {
let lockView = UIView()
let otherFaceImageView = UIImageView()
let otherNickNameLabel = UILabel()
let selectImageView = UIImageView(image: .fus_selectedIcon())
let selectImageView = UIImageView(image: .fus_selectedIconFillStyle())
let activateLabel = UILabel()
let descBtn = UIButton(type: .custom)
......
......@@ -26,7 +26,7 @@ class FUSPKControlPKModeView: FUSPKControlSubBaseView {
let pkModeCollectionMargin: CGFloat = 18
let gamePlayItemWidth: CGFloat = 160
let gamePlayItemMargin: CGFloat = 6
let gamePlayItemMargin: CGFloat = 2
override func makeUI() {
super.makeUI()
......
......@@ -177,7 +177,7 @@ class FUSPKScoreProgressLargeSmallView: FUSBaseView {
self.progressLightImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview().offset(1)
make.centerX.equalTo(self.leftProgress.snp.right).offset(-1.5)
make.centerX.equalTo(self.leftProgress.snp.right).offset(0)
}
self.giftBombProgressLightBgView.snp.makeConstraints { make in
......
......@@ -92,7 +92,7 @@
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = [UIColor fus_lineColor];
lineView.backgroundColor = [UIColor whiteColor];
[_contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.offset(62);
......@@ -335,7 +335,7 @@
return self.dataSourceList.count;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 185;
return 90;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
......
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