Commit 5f9a7b2a authored by Alex朱枝文's avatar Alex朱枝文

直播详情接口调试

parent a2bfdc10
......@@ -301,6 +301,9 @@
04564D612CF59835004456E4 /* YHMessageInputViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D602CF59835004456E4 /* YHMessageInputViewController.swift */; };
04564D632CF60222004456E4 /* YHGradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D622CF60222004456E4 /* YHGradientView.swift */; };
04564D652CF6065D004456E4 /* YHFadeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D642CF6065D004456E4 /* YHFadeView.swift */; };
04564D682CF6BFA0004456E4 /* YHLiveSalesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D672CF6BFA0004456E4 /* YHLiveSalesViewModel.swift */; };
04564D6A2CF6C0FC004456E4 /* YHLiveDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D692CF6C0FC004456E4 /* YHLiveDetailModel.swift */; };
04564D6C2CF6C414004456E4 /* YHLivePlayerViewController+Api.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D6B2CF6C414004456E4 /* YHLivePlayerViewController+Api.swift */; };
0457920B2CBCE7B200EBD99B /* YHResignUploadTravelCardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457920A2CBCE7B200EBD99B /* YHResignUploadTravelCardViewModel.swift */; };
0457920D2CBCE8A800EBD99B /* YHResignUploadTravelCardListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457920C2CBCE8A800EBD99B /* YHResignUploadTravelCardListModel.swift */; };
0457920F2CBCE9D000EBD99B /* YHResignUploadTravelCardListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457920E2CBCE9D000EBD99B /* YHResignUploadTravelCardListTableViewCell.swift */; };
......@@ -1354,6 +1357,9 @@
04564D602CF59835004456E4 /* YHMessageInputViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMessageInputViewController.swift; sourceTree = "<group>"; };
04564D622CF60222004456E4 /* YHGradientView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGradientView.swift; sourceTree = "<group>"; };
04564D642CF6065D004456E4 /* YHFadeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFadeView.swift; sourceTree = "<group>"; };
04564D672CF6BFA0004456E4 /* YHLiveSalesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLiveSalesViewModel.swift; sourceTree = "<group>"; };
04564D692CF6C0FC004456E4 /* YHLiveDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLiveDetailModel.swift; sourceTree = "<group>"; };
04564D6B2CF6C414004456E4 /* YHLivePlayerViewController+Api.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "YHLivePlayerViewController+Api.swift"; sourceTree = "<group>"; };
0457920A2CBCE7B200EBD99B /* YHResignUploadTravelCardViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelCardViewModel.swift; sourceTree = "<group>"; };
0457920C2CBCE8A800EBD99B /* YHResignUploadTravelCardListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelCardListModel.swift; sourceTree = "<group>"; };
0457920E2CBCE9D000EBD99B /* YHResignUploadTravelCardListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelCardListTableViewCell.swift; sourceTree = "<group>"; };
......@@ -2923,6 +2929,7 @@
04564D3F2CF1BE76004456E4 /* LivestreamSales(直播销售) */ = {
isa = PBXGroup;
children = (
04564D662CF6BEBD004456E4 /* VM */,
04564D542CF413A1004456E4 /* IM(环信) */,
04564D432CF380D6004456E4 /* M */,
04564D412CF1BEA2004456E4 /* V */,
......@@ -2937,6 +2944,7 @@
04564D482CF385D9004456E4 /* YHBasePlayerViewController.swift */,
04564D602CF59835004456E4 /* YHMessageInputViewController.swift */,
04564D4A2CF389DD004456E4 /* YHLivePlayerViewController.swift */,
04564D6B2CF6C414004456E4 /* YHLivePlayerViewController+Api.swift */,
04564D522CF38FE2004456E4 /* YHVODPlayerViewController.swift */,
);
path = C;
......@@ -2961,6 +2969,7 @@
isa = PBXGroup;
children = (
04564D442CF3812F004456E4 /* YHMediaProtocolUtils.swift */,
04564D692CF6C0FC004456E4 /* YHLiveDetailModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -2973,6 +2982,14 @@
path = "IM(环信)";
sourceTree = "<group>";
};
04564D662CF6BEBD004456E4 /* VM */ = {
isa = PBXGroup;
children = (
04564D672CF6BFA0004456E4 /* YHLiveSalesViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
045EED972B9F171A0022A143 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup;
children = (
......@@ -6317,6 +6334,7 @@
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
A587F7C02BBADBE1002D9781 /* YHHKPlanItemView.swift in Sources */,
A57964C42C9E9FB80074D28B /* YHManagerFuncGuildeCheckView.swift in Sources */,
04564D6C2CF6C414004456E4 /* YHLivePlayerViewController+Api.swift in Sources */,
A5ACE94C2B4564F7002C94D2 /* YHHUDErrorView.swift in Sources */,
A5EB6C712C69FB9A0081FB6C /* YHOffivialApprovalSuccessView.swift in Sources */,
A567E5AD2BD7643D00D5D5A0 /* YHSearchInfoHistoryCell.swift in Sources */,
......@@ -6523,6 +6541,7 @@
045EEEEB2B9F171A0022A143 /* YHTest.swift in Sources */,
04CE1AD12C2AD91F001CB80A /* YHActivityTravelModel.swift in Sources */,
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */,
04564D6A2CF6C0FC004456E4 /* YHLiveDetailModel.swift in Sources */,
04256DEC2C732F6900A37BA4 /* YHGrabingNumberListView.swift in Sources */,
0457921D2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift in Sources */,
045EEEAC2B9F171A0022A143 /* YHWorkExperienceTableViewCell.swift in Sources */,
......@@ -6690,6 +6709,7 @@
A5A89FD72C256B94005A71DD /* YHHomeLastMessageModel.swift in Sources */,
045EEF172B9F171A0022A143 /* YHSelectCountryViewController.swift in Sources */,
044CF8D62BBA57DC00008CE8 /* YHFailPromptView.swift in Sources */,
04564D682CF6BFA0004456E4 /* YHLiveSalesViewModel.swift in Sources */,
04506F552C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift in Sources */,
044EE23E2C92E27500A2FE3A /* YHResignCertificateDetailViewController.swift in Sources */,
04912F822CB7CFAE00CC3105 /* YHResignAppointedScheduleLineView.swift in Sources */,
......
//
// YHLivePlayerViewController+Api.swift
// galaxy
//
// Created by alexzzw on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
extension YHLivePlayerViewController {
func requestData(id: Int) {
viewModel.getLiveDetail(id: id) { liveDetail, error in
//
}
}
}
......@@ -44,6 +44,8 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
return view
}()
let viewModel = YHLiveSalesViewModel()
// MARK: - Initialization
init(roomInfo: YHLiveRoomInfo) {
self.roomInfo = roomInfo
......@@ -59,6 +61,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
super.viewDidLoad()
setupUI()
startLive()
requestData(id: 23)
}
// MARK: - Setup
......
//
// YHLiveDetailModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
import SmartCodable
class YHLiveDetailModel: SmartCodable {
var account: String = ""
var avatar: String = ""
var hxNickname: String = ""
var hxUid: String = ""
var access_num: Int = 0
var tips: String = ""
var status: Int = 0
var roomId: String = ""
var pullUrl: String = ""
var goods: [YHLiveGoodsItem] = []
required init() {
}
}
class YHLiveGoodsItem: SmartCodable {
var id: Int = 0
var name: String = ""
var image: String = ""
var description: String = ""
var price: String = ""
var linePrice: String = ""
var sn: String = ""
var banner: String = ""
required init() {
}
}
......@@ -24,11 +24,11 @@ class YHFadeView: UIView {
private func setupMask() {
// 使用黑色渐变作为mask
maskLayer.colors = [
UIColor.white.cgColor,
UIColor.black.cgColor,
UIColor.clear.cgColor,
]
maskLayer.startPoint = CGPoint(x: 0.5, y: 0)
maskLayer.endPoint = CGPoint(x: 0.5, y: 1)
maskLayer.startPoint = CGPoint(x: 0, y: 0)
maskLayer.endPoint = CGPoint(x: 0, y: 1)
// 重要:将渐变层设置为mask
layer.mask = maskLayer
......
//
// YHLiveSalesViewModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLiveSalesViewModel: YHBaseViewModel {
func getLiveDetail(id: Int, callback: @escaping (_ liveDetail: YHLiveDetailModel?, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.LiveSales.liveDetail
_ = YHNetRequest.getRequest(url: strUrl, params: ["id": id]) { json, _ in
// 1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String: Any], let resultModel = YHLiveDetailModel.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)
}
}
}
......@@ -660,4 +660,9 @@ class YHAllApiName {
static let incomeUpdate = "infoflow/order/income/update"
}
struct LiveSales {
// 获取直播详情
static let liveDetail = "super-app/live/app-live-detail"
}
}
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