Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
cb8feab5
Commit
cb8feab5
authored
Dec 26, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预约直播
parent
f56cfa9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
YHlifeCollectionReusableView.swift
...es/Home(首页)/Life(生活)/V/YHlifeCollectionReusableView.swift
+10
-1
YHLiveSalesViewModel.swift
...dules/LivestreamSales(直播销售)/VM/YHLiveSalesViewModel.swift
+19
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/Life(生活)/V/YHlifeCollectionReusableView.swift
View file @
cb8feab5
...
...
@@ -12,7 +12,6 @@ class YHlifeCollectionReusableView: UICollectionReusableView {
static
let
reuseIdentifier
=
"YHlifeCollectionReusableView"
var
tableView
:
UITableView
!
var
sectionView
:
YHlifeCollectionReusableViewHeadView
!
var
dataSource
:
[
YHLiveListModel
]?
{
didSet
{
self
.
tableView
.
reloadData
()
...
...
@@ -163,6 +162,8 @@ class YHlifeCollectionReusableViewTableViewCell: UITableViewCell {
var
flagLabel
:
UILabel
!
var
timelabel
:
UILabel
!
var
actionButton
:
UIButton
!
var
viewModel
:
YHLiveSalesViewModel
=
YHLiveSalesViewModel
()
var
dataSource
:
YHLiveListModel
?
{
didSet
{
guard
let
dataSource
=
dataSource
else
{
return
}
...
...
@@ -325,5 +326,13 @@ class YHlifeCollectionReusableViewTableViewCell: UITableViewCell {
@objc
func
actionClick
()
{
actionButton
.
isSelected
=
true
viewModel
.
postLiveBook
(
id
:
dataSource
?
.
live_id
??
0
)
{
success
,
error
in
if
success
{
YHHUD
.
flash
(
message
:
"预约成功"
)
}
else
{
YHHUD
.
flash
(
message
:
"预约失败"
)
}
}
}
}
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/VM/YHLiveSalesViewModel.swift
View file @
cb8feab5
...
...
@@ -234,6 +234,25 @@ extension YHLiveSalesViewModel {
callback
(
nil
,
err
)
}
}
func
postLiveBook
(
id
:
Int
,
callback
:
@escaping
(
_
livePeople
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
params
:
[
String
:
Any
]
=
[
"live_id"
:
id
,
"source_type"
:
1
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
LiveSales
.
liveBook
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
_
in
// 1. json字符串 转 对象
printLog
(
"model 是 ==>
\(
json
)
"
)
if
json
.
code
==
200
{
callback
(
true
,
nil
)
}
else
{
let
err
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
.
isEmpty
?
""
:
json
.
msg
)
callback
(
false
,
err
)
}
}
failBlock
:
{
err
in
callback
(
false
,
err
)
}
}
}
private
extension
String
{
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
cb8feab5
...
...
@@ -722,6 +722,8 @@ class YHAllApiName {
// APP直播间人数
static
let
livePeople
=
"super-app/live/live-people"
static
let
schedulLiveList
=
"super-app/live/schedule-live-list"
static
let
liveBook
=
"super-app/live/live-book"
}
struct
AIChat
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment