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

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents c7881c15 cc4d5b26
......@@ -64,6 +64,7 @@
04307BB02D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BAF2D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift */; };
04307BB42D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BB32D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift */; };
04307BB62D2180C300ED8E8D /* YHRecommendedOnLiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BB52D2180C300ED8E8D /* YHRecommendedOnLiveView.swift */; };
04307BBC2D22A21E00ED8E8D /* YHLiveStatusModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.swift */; };
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
......@@ -1280,7 +1281,7 @@
04307BAF2D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedLiveHeader.swift; sourceTree = "<group>"; };
04307BB32D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedAppointmentLiveView.swift; sourceTree = "<group>"; };
04307BB52D2180C300ED8E8D /* YHRecommendedOnLiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedOnLiveView.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLiveStatusModel.swift; sourceTree = "<group>"; };
045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; };
045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
045C0A162D12CA5E00BD2DC0 /* YHNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNavigationController.swift; sourceTree = "<group>"; };
......@@ -5453,6 +5454,7 @@
045C0E932D12CA5E00BD2DC0 /* YHRecordedDetailModel.swift */,
04307BA92D1FF74500ED8E8D /* YHRecommendLiveListModel.swift */,
04307BAB2D1FFC1C00ED8E8D /* YHShareLiveInfoModel.swift */,
04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -6487,7 +6489,6 @@
04E86E212B81E9FA00A35F4B /* Recovered References */ = {
isa = PBXGroup;
children = (
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
......@@ -6926,6 +6927,7 @@
045C10222D12CA5F00BD2DC0 /* YHMyFileListViewController.swift in Sources */,
045C10232D12CA5F00BD2DC0 /* YHClipperView.swift in Sources */,
045C10242D12CA5F00BD2DC0 /* YHAddressViewController.swift in Sources */,
04307BBC2D22A21E00ED8E8D /* YHLiveStatusModel.swift in Sources */,
045C10252D12CA5F00BD2DC0 /* YHPeopleSuccessView.swift in Sources */,
045C10262D12CA5F00BD2DC0 /* YHLookResignAlertView.swift in Sources */,
045C10272D12CA5F00BD2DC0 /* YHUploadCertificateDetailModel.swift in Sources */,
......
......@@ -26,6 +26,7 @@ enum YHModuleNameValue: String {
case networkDataType = "networkDataType" // 网络数据
case h5InteractionType = "h5InteractionType" // 与H5交互相关
case clickType = "clickType" // 用户点点击事件
case logTypeError = "logTypeError" // log失败状态
}
class YHAliYunLogManager {
......
......@@ -77,6 +77,10 @@ class YHHomePageViewController: YHBaseViewController {
super.viewWillAppear(animated)
isTopMostAndVisible = true
YHPlayerManager.shared.handlePageChanged(isRecommendPage: true)
// 没登录不让展示小窗
guard YHLoginManager.shared.isLogin() else {
return
}
guard YHPlayerManager.shared.isConfigFloating != false else {
return
}
......
......@@ -17,6 +17,8 @@ class YHlifeCollectionReusableView: UICollectionReusableView {
self.tableView.reloadData()
}
}
private let viewModel = YHLiveSalesViewModel()
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
......@@ -93,8 +95,23 @@ extension YHlifeCollectionReusableView: UITableViewDelegate, UITableViewDataSour
return
}
let model = dataSource[indexPath.row]
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
YHHUD.show(.progress(message: "加载中..."))
viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, error 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, uid: nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: nil, playbackInfo: playbackInfo)
}
}
}
}
......
......@@ -251,7 +251,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
// YHPlayerManager.shared.leaveChannel(for: player)
// player.clearPlayerView()
// }
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)
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://录播
......@@ -276,7 +276,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.user_id), isLive: true, scene: .fullscreen)
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 不需要跳转")
......
......@@ -381,6 +381,7 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == items.count-1 {
let view = YHMyFileListFooterView(frame: .zero)
view.type = .qmas
return view
}
let view = UIView()
......
......@@ -8,7 +8,23 @@
import UIKit
enum YHFileListFooterType: Int {
case qmas = 0 // 优才
case ttps = 1 // 高才
}
class YHMyFileListFooterView: UIView {
var type: YHFileListFooterType = .qmas {
didSet {
if type == .qmas {
thanksLabel.text = "*感谢您对银河集团的信赖,以上信息均用于香港优才签证申请银河集团承诺对您所提供的信息将绝对保密"
} else if type == .ttps {
thanksLabel.text = "*感谢您对银河集团的信赖,以上信息均用于香港高才签证申请银河集团承诺对您所提供的信息将绝对保密"
}
}
}
lazy var whiteContentView:UIView = {
let view = UIView()
......
......@@ -382,6 +382,7 @@ extension YHGCMyFileListViewController : UITableViewDelegate, UITableViewDataSou
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == items.count-1 {
let view = YHMyFileListFooterView(frame: .zero)
view.type = .ttps
return view
}
let view = UIView()
......
......@@ -117,16 +117,32 @@ extension YHGCMineSchemeViewController {
if success == true {
guard let model = self.reqSchemeVM.schemeModel else { return }
let industry = model.industry.defaultStringIfEmpty()
let model1 = YHScemeItemModel(title: "职业界别", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:\n" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。", lightFont: UIFont.PFSC_B(ofSize: 16))
let contentStr = model.content.reduce("") { partialResult, current in
partialResult.count > 0 ? partialResult + "\n" + current : partialResult + current
let industry = model.industry
if !industry.isEmpty {
let model1 = YHScemeItemModel(title: "职业界别", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:\n" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。", lightFont: UIFont.PFSC_B(ofSize: 16))
self.dataSource?.append(model1)
}
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "按照您填报的学历信息, 证明文件如下:\(contentStr)")
self.dataSource = [model1, model2]
let contentStr: String
if model.content.count > 1 {
contentStr = model.content.enumerated().reduce("") { partialResult, current in
let (index, content) = current
return partialResult + "\n" + "(\(index + 1))" + content
}
} else if model.content.count > 0 {
contentStr = model.content.reduce("") { partialResult, current in
return partialResult + "\n" + current
}
} else {
contentStr = ""
}
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看,请您在1-2周内准备好文件并上传:", lightMessage: "1-2周内", subMessage: "按照您填报的收入信息, 证明文件如下:\(contentStr)")
self.dataSource?.append(model2)
self.tableView.reloadData()
let type = YHGCApplicationType(rawValue: model.application_type) ?? .typeA
self.headView.update(type: type, name: model.username.defaultStringIfEmpty())
let name = model.user_name.isEmpty ? "--" : "尊敬的\(model.user_name)"
self.headView.update(type: type, name: name)
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
......
......@@ -12,7 +12,7 @@ import SmartCodable
class YHGCMySchemeModel: SmartCodable {
var application_type: Int = 0
var industry : String = ""
var username : String = ""
var user_name : String = ""
var sex: Int = 0
var content: [String] = []
var certificate_skip_status: Bool = false
......
......@@ -252,6 +252,7 @@ extension YHGCFamilyMemberInfoListVC {
"info":["subset_name":"",
"not_fill_number":-1,
"have_permanent_residency":2,
"nows":1,
"follow":0]]
self.familyRequest.addOrSaveFamilyMember(params: dict) { [weak self] success, error in
......
......@@ -325,9 +325,26 @@ class YHLiveStateViewController: YHBaseViewController {
self.bookLive(liveId: model.live_id, liveView: view)
}
view.buttonClickEvent = {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
view.buttonClickEvent = { [weak self] in
guard let self = self else {
return
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, error 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, uid: nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: nil, playbackInfo: playbackInfo)
}
}
}
self.bottomView.addSubview(view)
view.snp.makeConstraints { make in
......@@ -348,10 +365,7 @@ class YHLiveStateViewController: YHBaseViewController {
private func bookLive(liveId: Int, liveView: YHRecommendedAppointmentLiveView) {
YHHUD.show(.progress(message: "加载中..."))
viewModel.postLiveBook(id: liveId) { [weak self] success, error in
guard let self = self else {
return
}
viewModel.postLiveBook(id: liveId) { success, error in
YHHUD.hide()
if success {
liveView.updateAppointmentButton(isAppointmented: true)
......
......@@ -251,6 +251,28 @@ class YHPlayerManager: NSObject {
}
if result == 0 {
player.setJoinInfo(token: token, channelId: channelId, uid: uid)
} else {
//-2: #AgoraErrorCodeInvalidArgument
//-3: #AgoraErrorCodeNotReady
//-5: #AgoraErrorCodeRefused
var errorMsg = "加入失败"
switch result {
case -2:
errorMsg = "AgoraErrorCodeInvalidArgument"
case -3:
errorMsg = "AgoraErrorCodeNotReady"
case -5:
errorMsg = "AgoraErrorCodeRefused"
default:
break
}
let dic: [AnyHashable : Any] = [
"type": "joinLiveChannelError",
"channelId" : channelId,
"uid" : uid,
"errorMsg": errorMsg
]
YHAliYunLogManager.shared.addModuleName(.logTypeError, remark: dic)
}
} else {
mainChannelDelegate?.channelId = channelId
......@@ -266,6 +288,28 @@ class YHPlayerManager: NSObject {
joinSuccess: nil)
if result == 0 {
player.setJoinInfo(token: token, channelId: channelId, uid: uid)
} else {
//-2: #AgoraErrorCodeInvalidArgument
//-3: #AgoraErrorCodeNotReady
//-5: #AgoraErrorCodeRefused
var errorMsg = "加入失败"
switch result {
case -2:
errorMsg = "AgoraErrorCodeInvalidArgument"
case -3:
errorMsg = "AgoraErrorCodeNotReady"
case -5:
errorMsg = "AgoraErrorCodeRefused"
default:
break
}
let dic: [AnyHashable : Any] = [
"type": "joinLiveChannelError",
"channelId" : channelId,
"uid" : uid,
"errorMsg": errorMsg
]
YHAliYunLogManager.shared.addModuleName(.logTypeError, remark: dic)
}
}
}
......@@ -420,6 +464,7 @@ class YHPlayerManager: NSObject {
}
}
/*
// 加入频道
if let token = playbackInfo.token,
let channelId = playbackInfo.channelId, let uid = playbackInfo.uid, !token.isEmpty, !channelId.isEmpty {
......@@ -434,6 +479,8 @@ class YHPlayerManager: NSObject {
joinChannel(for: player, token: token, channelId: channelId, uid: uid, view: playerVC.playerView)
}
}
*/
leaveChannel(for: player)
if let lastNav = lastNav, lastLiveVC != nil {
lastNav.viewControllers.removeAll()
......
//
// YHLiveStatusModel.swift
// galaxy
//
// Created by alexzzw on 2024/12/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
import SmartCodable
class YHLiveStatusModel: SmartCodable {
var status: Int = 0
var stream_status: Int = 0
required init() {
}
}
......@@ -302,6 +302,32 @@ extension YHLiveSalesViewModel {
callback(nil, err)
}
}
func getLiveStatus(liveId: Int, callback: @escaping (_ liveInfo: YHLiveStatusModel?, _ error: YHErrorModel?) -> Void) {
// 分享类型 1:直播 2录播
let param: [String: Any] = ["live_id": liveId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.LiveSales.liveStatus
_ = YHNetRequest.getRequest(url: strUrl, params: param) { json, _ in
// 1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String: Any], let resultModel = YHLiveStatusModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback(nil, err)
return
}
callback(resultModel, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback(nil, err)
}
} failBlock: { err in
callback(nil, err)
}
}
}
......
......@@ -728,6 +728,8 @@ class YHAllApiName {
static let recommendLiveList = "super-app/live/recommend-live-list"
// APP分享直播间
static let shareLive = "super-app/live/share-live"
// app直播间状态
static let liveStatus = "super-app/live/live-status"
}
struct AIChat {
......
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