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

parent 88721a74
...@@ -181,154 +181,157 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate { ...@@ -181,154 +181,157 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
return return
} }
YHAnalytics.track("APP_Home_Banners") YHAnalytics.track("APP_Home_Banners")
switch model.skip_type { let vc = YHVoiceDemo()
case 1: // 跳转H5 UIViewController.current?.navigationController?.pushViewController(vc)
if model.skip_url.isEmpty == false {
} else { // switch model.skip_type {
YHHUD.flash(message: "error:skip_url不能为空") // case 1: // 跳转H5
return // if model.skip_url.isEmpty == false {
} // } else {
// YHHUD.flash(message: "error:skip_url不能为空")
// 1.增加app token // return
var url = "" // }
if YHLoginManager.shared.isLogin() { //
let token = YHLoginManager.shared.h5Token // // 1.增加app token
url = model.skip_url + "?param=" + token // var url = ""
let urlHasParam = String.hasQueryParameters(urlString: model.skip_url) // if YHLoginManager.shared.isLogin() {
if urlHasParam { // let token = YHLoginManager.shared.h5Token
url = model.skip_url + "&param=" + token // url = model.skip_url + "?param=" + token
} // let urlHasParam = String.hasQueryParameters(urlString: model.skip_url)
} else { // if urlHasParam {
url = model.skip_url // url = model.skip_url + "&param=" + token
} // }
// } else {
// 2.增加导航栏高度 // url = model.skip_url
var tUrl = url // }
if !url.contains("navigationH=") { //
tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)" // // 2.增加导航栏高度
if url.contains("?") { // var tUrl = url
tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)" // if !url.contains("navigationH=") {
} // tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
} // if url.contains("?") {
// tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
let vc = YHH5WebViewVC() // }
vc.url = tUrl // }
if model.is_double_11_flag { //
vc.isHideNavigationBar = false // let vc = YHH5WebViewVC()
} // vc.url = tUrl
// if model.is_double_11_flag {
if let tag = model.is_full_screen { // vc.isHideNavigationBar = false
vc.isFullScreenFlag = tag // }
} //
// if let tag = model.is_full_screen {
if model.is_share_h5_flag { // vc.isFullScreenFlag = tag
if let tModel = model.addtition_param { // }
if !tModel.ShareH5Url.isEmpty { //
vc.isShowRightShareItemFlag = true // if model.is_share_h5_flag {
vc.shareH5Title = tModel.ShareH5Title // if let tModel = model.addtition_param {
vc.shareH5Describe = tModel.ShareH5Describe // if !tModel.ShareH5Url.isEmpty {
vc.shareUrlFromOutside = tModel.ShareH5Url // vc.isShowRightShareItemFlag = true
} // vc.shareH5Title = tModel.ShareH5Title
} // vc.shareH5Describe = tModel.ShareH5Describe
} // vc.shareUrlFromOutside = tModel.ShareH5Url
self.parentViewController?.navigationController?.pushViewController(vc) // }
// }
case 2: // 跳转APP内Tab // }
if model.skip_url.isEmpty == false { // self.parentViewController?.navigationController?.pushViewController(vc)
} else { //
YHHUD.flash(message: "error:skip_url不能为空") // case 2: // 跳转APP内Tab
return // if model.skip_url.isEmpty == false {
} // } else {
goAppTab(tabBarName: model.skip_url) // YHHUD.flash(message: "error:skip_url不能为空")
case 3:// 3-跳转资讯页 // return
if model.skip_url.isEmpty == false { // }
} else { // goAppTab(tabBarName: model.skip_url)
YHHUD.flash(message: "error:skip_url不能为空") // case 3:// 3-跳转资讯页
return // if model.skip_url.isEmpty == false {
} // } else {
let vc = YHHomeWebViewController() // YHHUD.flash(message: "error:skip_url不能为空")
vc.url = model.skip_url // return
self.parentViewController?.navigationController?.pushViewController(vc) // }
case 100:// 直播 // let vc = YHHomeWebViewController()
// 文哥 // vc.url = model.skip_url
// media_type 投放类型:1 图片,2 直播 // self.parentViewController?.navigationController?.pushViewController(vc)
// live_id 直播ID // case 100:// 直播
// live_status 直播状态 1:直播中 2:未直播 0:未知状态 3:结束直播 // // 文哥
// live_type 播放类型:1 展示最新直播,2指定直播,3 指定录播 // // media_type 投放类型:1 图片,2 直播
// live_pull_url 直播拉流链接 // // live_id 直播ID
// video_url 视频链接 // // live_status 直播状态 1:直播中 2:未直播 0:未知状态 3:结束直播
// recorded_video_id 录播id token: String? = nil, channelId // // live_type 播放类型:1 展示最新直播,2指定直播,3 指定录播
if !checkLogin() { // // live_pull_url 直播拉流链接
return // // video_url 视频链接
} // // recorded_video_id 录播id token: String? = nil, channelId
let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell // if !checkLogin() {
// if let player = YHPlayerManager.shared.getPlayer(.secondary) { // return
// YHPlayerManager.shared.leaveChannel(for: player) // }
// player.clearPlayerView() // let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell
//// if let player = YHPlayerManager.shared.getPlayer(.secondary) {
//// YHPlayerManager.shared.leaveChannel(for: player)
//// player.clearPlayerView()
//// }
// YHHUD.show(.progress(message: "加载中..."))
// viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, _ in
// YHHUD.hide()
// guard let liveInfo = liveInfo else {
// let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
// UIViewController.current?.navigationController?.pushViewController(ctl)
// return
// }
// if liveInfo.status == 2 {
// let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
// UIViewController.current?.navigationController?.pushViewController(ctl)
// } else {
// let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, token: nil, channelId: nil, uid: nil, isLive: true, scene: .fullscreen)
// YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo)
// }
// }
//
// printLog("跳转直播")
// case 101:// 录播
// printLog("跳转录播")
// if !checkLogin() {
// return
// } // }
YHHUD.show(.progress(message: "加载中..."))
viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, _ in
YHHUD.hide()
guard let liveInfo = liveInfo else {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
return
}
if liveInfo.status == 2 {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
} else {
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, token: nil, channelId: nil, uid: nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo)
}
}
printLog("跳转直播")
case 101:// 录播
printLog("跳转录播")
if !checkLogin() {
return
}
if let player = YHPlayerManager.shared.getPlayer(.secondary) {
player.stop()
player.clearPlayerView()
}
let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.recorded_video_id, url: nil, title: nil, roomId: nil, uid: nil, isLive: false, scene: .fullscreen)
YHPlayerManager.shared.enterVOD(from: cell?.bannerImagV, playbackInfo: playbackInfo)
case 102:// 图片直播
printLog("跳转录播")
if !checkLogin() {
return
}
// if let player = YHPlayerManager.shared.getPlayer(.secondary) { // if let player = YHPlayerManager.shared.getPlayer(.secondary) {
// YHPlayerManager.shared.leaveChannel(for: player) // player.stop()
// player.clearPlayerView() // player.clearPlayerView()
// } // }
let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell // let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell
YHHUD.show(.progress(message: "加载中...")) // let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.recorded_video_id, url: nil, title: nil, roomId: nil, uid: nil, isLive: false, scene: .fullscreen)
viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, _ in // YHPlayerManager.shared.enterVOD(from: cell?.bannerImagV, playbackInfo: playbackInfo)
YHHUD.hide() // case 102:// 图片直播
guard let liveInfo = liveInfo else { // printLog("跳转录播")
let ctl = YHLiveAppointmentViewController(liveId: model.live_id) // if !checkLogin() {
UIViewController.current?.navigationController?.pushViewController(ctl) // return
return // }
} //// if let player = YHPlayerManager.shared.getPlayer(.secondary) {
if liveInfo.status == 2 { //// YHPlayerManager.shared.leaveChannel(for: player)
let ctl = YHLiveAppointmentViewController(liveId: model.live_id) //// player.clearPlayerView()
UIViewController.current?.navigationController?.pushViewController(ctl) //// }
} else { // let cell: YHHomeBannerCollectionViewCell? = pagerView.cellForItem(at: index) as? YHHomeBannerCollectionViewCell
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, token: nil, channelId: nil, uid: nil, isLive: true, scene: .fullscreen) // YHHUD.show(.progress(message: "加载中..."))
YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo) // viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, _ in
} // YHHUD.hide()
} // guard let liveInfo = liveInfo else {
// let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
case 0:// 0 不需要跳转 // UIViewController.current?.navigationController?.pushViewController(ctl)
printLog("0 不需要跳转") // return
default: // }
YHHUD.flash(message: "不需要处理的类型") // if liveInfo.status == 2 {
} // let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
YHAnalytics.track("homeBannerClick", properties: ["url": model.img_url, "index": index]) // UIViewController.current?.navigationController?.pushViewController(ctl)
// } else {
// let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, token: nil, channelId: nil, uid: nil, isLive: true, scene: .fullscreen)
// YHPlayerManager.shared.enterLive(from: cell?.bannerImagV, playbackInfo: playbackInfo)
// }
// }
//
// case 0:// 0 不需要跳转
// printLog("0 不需要跳转")
// default:
// YHHUD.flash(message: "不需要处理的类型")
// }
// YHAnalytics.track("homeBannerClick", properties: ["url": model.img_url, "index": index])
} }
func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) { func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
......
//
// YHVoiceDemo.swift
// galaxy
//
// Created by EDY on 2025/6/4.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVoiceDemo: YHBaseViewController {
var start: UIButton!
var end: UIButton!
var result: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHVoiceDemo {
func setupUI() {
// let recognizer = NuanceManager()
start = {
let view = UIButton()
view.setTitle("start", for: .normal)
view.setTitleColor(.black, for: .normal)
view.addTarget(self, action: #selector(startClick), for: .touchUpInside)
return view
}()
view.addSubview(start)
start.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.equalToSuperview()
make.height.equalTo(44)
make.width.equalTo(KScreenWidth/2)
}
end = {
let view = UIButton()
view.setTitle("end", for: .normal)
view.setTitleColor(.black, for: .normal)
view.addTarget(self, action: #selector(endClick), for: .touchUpInside)
return view
}()
view.addSubview(end)
end.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.right.equalToSuperview()
make.height.equalTo(44)
make.width.equalTo(KScreenWidth/2)
}
result = {
let view = UILabel()
view.text = "demo"
return view
}()
view.addSubview(result)
result.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 44)
make.right.left.bottom.equalToSuperview()
}
}
@objc func startClick() {
}
@objc func endClick() {
}
}
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "WXApi.h" #import "WXApi.h"
#import "JPUSHService.h" #import "JPUSHService.h"
#import <nuisdk/NeoNui.h> #import <nuisdk/NeoNui.h>
// iOS10注册APNs所需头文件 // iOS10注册APNs所需头文件
#ifdef NSFoundationVersionNumber_iOS_9_x_Max #ifdef NSFoundationVersionNumber_iOS_9_x_Max
#import <UserNotifications/UserNotifications.h> #import <UserNotifications/UserNotifications.h>
......
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