显示简介
This commit is contained in:
parent
a8e3a68879
commit
f080cd4d13
@ -54,13 +54,13 @@ final class DetailModel {
|
|||||||
self.config = DisplayConfig(name: "前排占位", bgColor: .black, fontColor: .white)
|
self.config = DisplayConfig(name: "前排占位", bgColor: .black, fontColor: .white)
|
||||||
case "following":
|
case "following":
|
||||||
self.status = rawValue
|
self.status = rawValue
|
||||||
self.config = DisplayConfig(name: "追番", bgColor: .white, fontColor: Color(hex: "#333333"))
|
self.config = DisplayConfig(name: "追番", bgColor: .black, fontColor: .white)
|
||||||
case "catching_up":
|
case "catching_up":
|
||||||
self.status = rawValue
|
self.status = rawValue
|
||||||
self.config = DisplayConfig(name: "补番", bgColor: .black, fontColor: .white)
|
self.config = DisplayConfig(name: "补番", bgColor: .black, fontColor: .white)
|
||||||
case "dropping":
|
case "dropping":
|
||||||
self.status = rawValue
|
self.status = rawValue
|
||||||
self.config = DisplayConfig(name: "弃番", bgColor: .black, fontColor: .white)
|
self.config = DisplayConfig(name: "弃番", bgColor: .white, fontColor: Color(hex: "#333333"))
|
||||||
case "finished":
|
case "finished":
|
||||||
self.status = rawValue
|
self.status = rawValue
|
||||||
self.config = DisplayConfig(name: "补完", bgColor: .black, fontColor: .white)
|
self.config = DisplayConfig(name: "补完", bgColor: .black, fontColor: .white)
|
||||||
@ -134,6 +134,7 @@ final class DetailModel {
|
|||||||
|
|
||||||
struct DetailView: View {
|
struct DetailView: View {
|
||||||
@State var detailModel = DetailModel()
|
@State var detailModel = DetailModel()
|
||||||
|
@State var showAllSummary: Bool = false
|
||||||
let id: Int
|
let id: Int
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@ -144,11 +145,27 @@ struct DetailView: View {
|
|||||||
.font(.system(size: 28))
|
.font(.system(size: 28))
|
||||||
.fontWeight(.bold)
|
.fontWeight(.bold)
|
||||||
.foregroundColor(Color(hex: "#333333"))
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
|
if showAllSummary {
|
||||||
|
Text(detailModel.summary)
|
||||||
|
.lineLimit(nil)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.onTapGesture {
|
||||||
|
withAnimation {
|
||||||
|
self.showAllSummary = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Text(detailModel.summary)
|
Text(detailModel.summary)
|
||||||
.lineLimit(3)
|
.lineLimit(3)
|
||||||
.multilineTextAlignment(.leading)
|
.multilineTextAlignment(.leading)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.onTapGesture {
|
||||||
|
withAnimation {
|
||||||
|
self.showAllSummary = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding([.top, .leading], 10)
|
.padding([.top, .leading], 10)
|
||||||
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom])
|
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user