Commit df15f933 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'yinhe-live-1212' of...

Merge branch 'yinhe-live-1212' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into yinhe-live-1212
parents 79cbd916 0e3ec0b4
......@@ -7176,7 +7176,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -7318,7 +7318,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -7523,7 +7523,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -7570,7 +7570,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......
......@@ -350,7 +350,7 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 1.0
return 16.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......
......@@ -80,6 +80,9 @@ class YHHomePageViewController: YHBaseViewController {
guard YHPlayerManager.shared.isConfigFloating != false else {
return
}
// guard let configModel = YHConfigManager.shared.reqVM.configModel,configModel.is_integral_open else {
// return
// }
viewModel.getHomeFloatingLive { [weak self] success, error in
guard let self = self else {
return
......@@ -219,6 +222,14 @@ private extension YHHomePageViewController {
func addDefaultData() {
homeHeaderView.homeBannerView.dataArr = getCacheDataForBanner()
// if let configModel = YHConfigManager.shared.reqVM.configModel,configModel.is_integral_open {
// homeHeaderView.homeBannerView.dataArr = getCacheDataForBanner()
// } else {
// homeHeaderView.homeBannerView.dataArr = getCacheDataForBanner().filter {
// ($0.skip_type != 100) && ($0.skip_type != 101) && ($0.skip_type != 102)
// }
// }
getCacheDataForHomeNewsData()
}
......@@ -277,6 +288,14 @@ private extension YHHomePageViewController {
guard let self = self else { return }
DispatchQueue.main.async {
self.homeHeaderView.homeBannerView.dataArr = self.viewModel.banners ?? self.getCacheDataForBanner()
// if let configModel = YHConfigManager.shared.reqVM.configModel,configModel.is_integral_open {
// self.homeHeaderView.homeBannerView.dataArr = self.viewModel.banners ?? self.getCacheDataForBanner()
// } else {
// self.homeHeaderView.homeBannerView.dataArr = (self.viewModel.banners ?? self.getCacheDataForBanner()).filter {
// ($0.skip_type != 100) && ($0.skip_type != 101) && ($0.skip_type != 102)
// }
// }
if let arrB = self.viewModel.banners,arrB.count > 0 {
let arrString = arrB.toJSONString()
UserDefaults.standard.set(arrString, forKey: "homeBannerData")
......
......@@ -24,11 +24,17 @@ class YHHomeBannerView: UIView {
self.indicatorView.curIndicatorIndex = 0
// 指定显示图片为第一个
bannerView.selectItem(at: 0, animated: false)
let noNeedAutoScroll = dataArr.contains(where: {
if let index = dataArr.firstIndex(where: {
$0.skip_type == 100
})
// 开启定时器开始滚动
bannerView.automaticSlidingInterval = noNeedAutoScroll ? 0 : bannerSildingInterval
}) {
// 开启定时器开始滚动
bannerView.automaticSlidingInterval = 0
bannerView.scrollToItem(at: index, animated: false)
indicatorView.curIndicatorIndex = index
} else {
// 开启定时器开始滚动
bannerView.automaticSlidingInterval = bannerSildingInterval
}
bannerView.removesInfiniteLoopForSingleItem = true
bannerView.alwaysBounceHorizontal = true
}
......@@ -242,7 +248,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
YHPlayerManager.shared.leaveChannel(for: player)
player.clearPlayerView()
}
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: model.live_pull_url, title: nil, roomId: nil, token: model.token, channelId: model.rtmp_channel, uid: model.user_id != 0 ? UInt(model.user_id) : nil, isLive: true, scene: .fullscreen)
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, token: model.token, channelId: model.rtmp_channel, uid: model.user_id != 0 ? UInt(model.user_id) : nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo)
printLog("跳转直播")
case 101://录播
......@@ -267,7 +273,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
player.clearPlayerView()
}
let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: model.live_pull_url, title: nil, roomId: nil, token: model.token, channelId: model.rtmp_channel, uid: UInt(model.live_id), isLive: true, scene: .fullscreen)
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: model.live_pull_url, title: nil, roomId: nil, token: model.token, channelId: model.rtmp_channel, uid: UInt(model.user_id), isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo)
case 0://0 不需要跳转
printLog("0 不需要跳转")
......@@ -297,7 +303,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
}
if let cell = cell as? YHHomeBannerCollectionViewCell {
if model.skip_type == 100 {
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, token: model.token, channelId: model.rtmp_channel, uid: UInt(model.live_id), isLive: true, scene: .banner, playerType: .secondary)
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, token: model.token, channelId: model.rtmp_channel, uid: UInt(model.user_id), isLive: true, scene: .banner, playerType: .secondary)
YHPlayerManager.shared.enterBanner(playbackInfo: playbackInfo, inView: cell.bannerImagV)
} else {
if let player = YHPlayerManager.shared.getPlayer(.secondary) {
......
......@@ -39,6 +39,7 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
webview.scrollView.delegate = self
webview.setDebugMode(false)
webview.uiDelegate = self
return webview
}()
......
......@@ -165,13 +165,20 @@ extension YHMessageInputViewController {
}
@objc private func sendButtonTapped() {
// 禁用按钮
sendButton.isEnabled = false
let text = textView.text ?? ""
let currentText = text.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
guard currentText.count > 0 else {
YHHUD.flash(message: nullInputTips)
sendButton.isEnabled = true
return
}
inputCallback?(self, currentText)
// 延迟启用按钮
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
self.sendButton.isEnabled = true
}
}
@objc func closeKeyboard(_ sender: UIGestureRecognizer?) {
......
......@@ -30,7 +30,17 @@ class YHFloatingWindow: NSObject {
var source: Source = .userAction
weak var delegate: YHFloatingWindowDelegate?
var playbackInfo: YHPlayerManager.PlaybackInfo?
var playbackInfo: YHPlayerManager.PlaybackInfo? {
didSet {
if playbackInfo?.isLive == true {
bottomView.isHidden = false
bottomView.play(true)
} else {
bottomView.isHidden = true
bottomView.play(false)
}
}
}
// 视频方向
enum VideoOrientation {
......@@ -52,13 +62,13 @@ class YHFloatingWindow: NSObject {
static let minHeight: CGFloat = 67.5 // 16:9
static let maxHeight: CGFloat = UIScreen.main.bounds.height
static let defaultWidth: CGFloat = 150
static let defaultHeight: CGFloat = 84.375 // 16:9
static let defaultWidth: CGFloat = 72//150
static let defaultHeight: CGFloat = 128//84.375 // 16:9
}
private(set) var contentView: UIView
private var containerView: UIView
private var videoOrientation: VideoOrientation = .landscape
private var videoOrientation: VideoOrientation = .portrait//.landscape
// 手势相关
private var initialFrame: CGRect = .zero
......@@ -101,6 +111,13 @@ class YHFloatingWindow: NSObject {
closeButton.center = CGPoint(x: container.bounds.width / 2, y: container.bounds.height / 2)
return container
}()
private lazy var bottomView: YHGradientView = {
let view = YHGradientView()
view.isHidden = true
view.frame = CGRect(x: 0, y: 0, width: Size.defaultWidth, height: 20)
return view
}()
// MARK: - Initialization
......@@ -144,16 +161,25 @@ class YHFloatingWindow: NSObject {
closeButtonContainer.widthAnchor.constraint(equalToConstant: 30),
closeButtonContainer.heightAnchor.constraint(equalToConstant: 30),
])
containerView.addSubview(bottomView)
bottomView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
bottomView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor),
bottomView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
bottomView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
bottomView.heightAnchor.constraint(equalToConstant: 20),
])
}
private func setupGestures() {
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(handlePan(_:)))
let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(handlePinch(_:)))
//let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(handlePinch(_:)))
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:)))
tapGesture.delegate = self
containerView.addGestureRecognizer(panGesture)
containerView.addGestureRecognizer(pinchGesture)
//containerView.addGestureRecognizer(pinchGesture)
containerView.addGestureRecognizer(tapGesture)
}
......@@ -524,9 +550,9 @@ extension YHFloatingWindow: YHPlayerDelegate {
//
}
func player(_ player: YHPlayer, didReceiveVideoSize size: CGSize) {
DispatchQueue.main.async {
self.setVideoSize(size)
}
// DispatchQueue.main.async {
// self.setVideoSize(size)
// }
}
func player(_ player: YHPlayer, didChangedTo positionMs: Int, atTimestamp timestampMs: TimeInterval) {
//
......
......@@ -7,9 +7,24 @@
//
import UIKit
import Lottie
class YHGradientView: UIView {
private lazy var liveAnimationView: LottieAnimationView = {
let view = LottieAnimationView(name: "live")
view.backgroundColor = UIColor.clear
view.loopMode = .loop
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.text = "直播中"
label.font = .PFSC_R(ofSize: 11)
return label
}()
override class var layerClass: AnyClass {
return CAGradientLayer.self
}
......@@ -29,10 +44,32 @@ class YHGradientView: UIView {
return
}
gradientLayer.colors = [
UIColor(white: 1, alpha: 1).cgColor, // 顶部 100% 不透明
UIColor(white: 1, alpha: 0).cgColor // 底部 0% 完全透明
(UIColor(hexString: "#AFCEFF") ?? UIColor()).cgColor,
(UIColor(hexString: "#0046B4") ?? UIColor()).cgColor,
(UIColor(hexString: "#0046B4") ?? UIColor()).cgColor,
(UIColor(hexString: "#AFCEFF") ?? UIColor()).cgColor
]
gradientLayer.startPoint = CGPoint(x: 0.5, y: 0) // 上边中点
gradientLayer.endPoint = CGPoint(x: 0.5, y: 1) // 下边中点
gradientLayer.startPoint = CGPoint(x: 0, y: 0.5) // 上边中点
gradientLayer.endPoint = CGPoint(x: 1, y: 0.5) // 下边中点
addSubview(liveAnimationView)
addSubview(infoTitleLabel)
liveAnimationView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(8)
make.centerY.equalToSuperview()
make.width.height.equalTo(18)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(liveAnimationView.snp.right)
make.centerY.equalToSuperview()
make.right.lessThanOrEqualToSuperview().offset(-12)
}
}
func play(_ needPlay: Bool) {
if needPlay {
liveAnimationView.play()
} else {
liveAnimationView.stop()
}
}
}
......@@ -243,6 +243,7 @@ class YHLiveShopViewCell: UITableViewCell {
let c: ASAttributedString = .init("\(dataSource.price)", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor(hex:0x8993a2)), .strikethrough(.single))
subPriceLabel.attributed.text = c
flagLabel.text = "\(dataSource.flag)"
subPriceLabel.isHidden = dataSource.linePrice == dataSource.price
}
}
override func awakeFromNib() {
......
......@@ -296,7 +296,8 @@ class YHShareAlertView: UIView {
@objc func wxClick() {
if fromAiSale {
YHShareManager.shared.sendLinkContent(subMessage, "", mainImageView.image ?? UIImage(), link: linkUrl)
let content = isLive ? "\(title)正在直播中,快来围观吧~" : "点击查看详情讲解~"
YHShareManager.shared.sendLinkContent(subMessage, content, mainImageView.image ?? UIImage(), link: linkUrl)
} else {
YHShareManager.shared.sendLinkContent(title, subMessage, mainImageView.image ?? UIImage(), link: linkUrl)
}
......
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