From e1cc10c399fae296f7044bb6f93b05000e447571 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 3 Mar 2025 23:00:57 +0800 Subject: [PATCH] fix --- dimensionhub/Views/DetailView.swift | 7 +- dimensionhub/Views/ListView.swift | 121 +++++++++++++--------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/dimensionhub/Views/DetailView.swift b/dimensionhub/Views/DetailView.swift index af964d4..cd36dda 100644 --- a/dimensionhub/Views/DetailView.swift +++ b/dimensionhub/Views/DetailView.swift @@ -305,7 +305,12 @@ extension DetailView { HStack { Text(episode.num_name) .font(.system(size: 12)) - .foregroundColor(Color(hex: "#333333")) + .foregroundColor(.white) + .padding([.leading, .trailing], 5) + .background( + Color.black.opacity(0.5) + .cornerRadius(5) + ) Spacer() } Spacer() diff --git a/dimensionhub/Views/ListView.swift b/dimensionhub/Views/ListView.swift index ecfdd41..bba4fab 100644 --- a/dimensionhub/Views/ListView.swift +++ b/dimensionhub/Views/ListView.swift @@ -85,84 +85,79 @@ struct ListView: View { .font(.system(size: 28)) .foregroundColor(Color(hex: "#333333")) .fontWeight(.medium) - - Text("返回") - .font(.system(size: 13)) - .foregroundColor(Color(hex: "#333333")) - .onTapGesture { - self.presentationMode.wrappedValue.dismiss() - } } Spacer() } .padding([.leading, .top, .bottom], 10) - .background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom]) - - // 渠道列表 - HStack(alignment: .center, spacing: 15) { - ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in - Text(channel.name) - .font(.system(size: 13)) - .foregroundColor(idx == detailModel.selectedChannelIdx ? Color(hex: "#169BD5") : Color(hex: "#666666")) - .onTapGesture { - detailModel.toggleChannel(channelIdx: idx) - } - } - Spacer() - } + .background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.top]) - // 渠道相关的数据列表 - ScrollView(.vertical, showsIndicators: false) { - LazyVStack(alignment: .center, spacing: 15) { - ForEach(detailModel.selectedEpisodes) { episode in - HStack(alignment: .center) { - AsyncImage(url: URL(string: episode.thumb)) { image in - image.resizable() - } placeholder: { - ProgressView() + VStack { + // 渠道列表 + HStack(alignment: .center, spacing: 15) { + ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in + Text(channel.name) + .font(.system(size: 13)) + .foregroundColor(idx == detailModel.selectedChannelIdx ? Color(hex: "#169BD5") : Color(hex: "#666666")) + .onTapGesture { + detailModel.toggleChannel(channelIdx: idx) } - .frame(width: 90, height: 60) - - VStack(alignment: .leading, spacing: 20) { - Text(episode.num_name) - .font(.system(size: 12)) - .foregroundColor(Color(hex: "#333333")) + } + Spacer() + } + + // 渠道相关的数据列表 + ScrollView(.vertical, showsIndicators: false) { + LazyVStack(alignment: .center, spacing: 15) { + ForEach(detailModel.selectedEpisodes) { episode in + HStack(alignment: .center) { + AsyncImage(url: URL(string: episode.thumb)) { image in + image.resizable() + } placeholder: { + ProgressView() + } + .frame(width: 90, height: 60) - Text(episode.name) - .font(.system(size: 12)) - .foregroundColor(Color(hex: "#333333")) - .lineLimit(1) + VStack(alignment: .leading, spacing: 20) { + Text(episode.num_name) + .font(.system(size: 12)) + .foregroundColor(Color(hex: "#333333")) + + Text(episode.name) + .font(.system(size: 12)) + .foregroundColor(Color(hex: "#333333")) + .lineLimit(1) + } + Spacer() } - Spacer() - } - .onTapGesture { - if let playUrl = URL(string: episode.play) { - UIApplication.shared.open(playUrl) + .onTapGesture { + if let playUrl = URL(string: episode.play) { + UIApplication.shared.open(playUrl) + } } } } } - } - - HStack(alignment: .center) { - Button { - self.presentationMode.wrappedValue.dismiss() - } label: { - Rectangle() - .frame(width: 200, height: 25) - .foregroundColor(Color(hex: "#F2F2F2")) - .overlay { - Text("收起剧集") - .font(.system(size: 13)) - .foregroundColor(Color(hex: "#999999")) - } + + HStack(alignment: .center) { + Button { + self.presentationMode.wrappedValue.dismiss() + } label: { + Rectangle() + .frame(width: 200, height: 25) + .foregroundColor(Color(hex: "#F2F2F2")) + .overlay { + Text("收起剧集") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#999999")) + } + } + } - + + Spacer() } - - Spacer() + .frame(width: 370, alignment: .center) } - .frame(width: 370, alignment: .center) .task { await detailModel.loadData(userId: self.userId, id: self.id) }