Commit 59888772 authored by Alex朱枝文's avatar Alex朱枝文

直播预约

parent 458c0dc6
......@@ -190,9 +190,10 @@ class YHLiveAppointmentViewController: YHBaseViewController {
}
liveNameLabel.text = liveInfo.title
anchorLabel.text = liveInfo.account
let content = ""
infoContentLabel.text = content
let content = liveInfo.watch
if content.isEmpty {
infoContentLabel.text = content
infoContentLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(0)
make.left.equalToSuperview().offset(12)
......@@ -200,6 +201,7 @@ class YHLiveAppointmentViewController: YHBaseViewController {
make.bottom.equalToSuperview().offset(0)
}
} else {
infoContentLabel.text = "直播看点:\n" + content
infoContentLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(12)
make.left.equalToSuperview().offset(12)
......@@ -207,9 +209,22 @@ class YHLiveAppointmentViewController: YHBaseViewController {
make.bottom.equalToSuperview().offset(-12)
}
}
infoTimeLabel.text = "直播时间:" + liveInfo.start_time + "~" + liveInfo.end_time
var timeStr = "直播时间:" + liveInfo.start_time
if !liveInfo.end_time.isEmpty {
timeStr += "~" + liveInfo.end_time
}
infoTimeLabel.text = timeStr
updateAppointmentButton(!liveInfo.is_schedule_live)
}
private func isSameDay(date1: Date, date2: Date) -> Bool {
let calendar = Calendar.current
let components1 = calendar.dateComponents([.year, .month, .day], from: date1)
let components2 = calendar.dateComponents([.year, .month, .day], from: date2)
return components1.year == components2.year &&
components1.month == components2.month &&
components1.day == components2.day
}
private func updateAppointmentButton(_ isEnable: Bool) {
appointmentButton.isEnabled = isEnable
......
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