fix List
This commit is contained in:
parent
676885375c
commit
d78b4c95bc
@ -82,16 +82,16 @@ struct ListView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .center, spacing: 20) {
|
VStack(alignment: .center, spacing: 20) {
|
||||||
Color.clear.frame(height: 50)
|
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Text(detailModel.name)
|
Text(detailModel.name)
|
||||||
.font(.system(size: 30))
|
.font(.system(size: 28))
|
||||||
.fontWeight(.bold)
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
|
.fontWeight(.medium)
|
||||||
|
|
||||||
Text("返回")
|
Text("返回")
|
||||||
.font(.system(size: 14))
|
.font(.system(size: 13))
|
||||||
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
self.presentationMode.wrappedValue.dismiss()
|
self.presentationMode.wrappedValue.dismiss()
|
||||||
}
|
}
|
||||||
@ -99,14 +99,14 @@ struct ListView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding([.leading, .top, .bottom], 10)
|
.padding([.leading, .top, .bottom], 10)
|
||||||
.background(Color.yellow)
|
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom])
|
||||||
|
|
||||||
// 渠道列表
|
// 渠道列表
|
||||||
HStack(alignment: .center, spacing: 15) {
|
HStack(alignment: .center, spacing: 15) {
|
||||||
ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in
|
ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in
|
||||||
Text(channel.name)
|
Text(channel.name)
|
||||||
.font(.system(size: 16))
|
.font(.system(size: 13))
|
||||||
.foregroundColor(idx == detailModel.selectedChannelIdx ? .blue : .black)
|
.foregroundColor(idx == detailModel.selectedChannelIdx ? Color(hex: "#169BD5") : Color(hex: "#666666"))
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
detailModel.toggleChannel(channelIdx: idx)
|
detailModel.toggleChannel(channelIdx: idx)
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ struct ListView: View {
|
|||||||
|
|
||||||
// 渠道相关的数据列表
|
// 渠道相关的数据列表
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .center, spacing: 20) {
|
VStack(alignment: .center, spacing: 15) {
|
||||||
ForEach(detailModel.selectedEpisodes, id: \.id) { episode in
|
ForEach(detailModel.selectedEpisodes, id: \.id) { episode in
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
AsyncImage(url: URL(string: episode.thumb)) { image in
|
||||||
@ -124,12 +124,16 @@ struct ListView: View {
|
|||||||
} placeholder: {
|
} placeholder: {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
}
|
}
|
||||||
.frame(width: 90, height: 70)
|
.frame(width: 90, height: 60)
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Text(episode.numName)
|
Text(episode.numName)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
|
|
||||||
Text(episode.name)
|
Text(episode.name)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
@ -143,13 +147,15 @@ struct ListView: View {
|
|||||||
self.presentationMode.wrappedValue.dismiss()
|
self.presentationMode.wrappedValue.dismiss()
|
||||||
} label: {
|
} label: {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.frame(width: 180, height: 50)
|
.frame(width: 200, height: 25)
|
||||||
.foregroundColor(Color.yellow)
|
.foregroundColor(Color(hex: "#F2F2F2"))
|
||||||
.cornerRadius(10)
|
.cornerRadius(10)
|
||||||
.overlay {
|
.overlay {
|
||||||
RoundedRectangle(cornerRadius: 10)
|
RoundedRectangle(cornerRadius: 10)
|
||||||
.stroke(Color.black, lineWidth: 1)
|
.stroke(Color.black, lineWidth: 1)
|
||||||
Text("收起剧集")
|
Text("收起剧集")
|
||||||
|
.font(.system(size: 13))
|
||||||
|
.foregroundColor(Color(hex: "#999999"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,10 +164,8 @@ struct ListView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.frame(width: 370, alignment: .center)
|
.frame(width: 370, alignment: .center)
|
||||||
.ignoresSafeArea(.all)
|
|
||||||
.task {
|
.task {
|
||||||
await detailModel.loadData(dramaId: 124)
|
await detailModel.loadData(dramaId: 124)
|
||||||
print(UIScreen.main.bounds.width)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user