구매목록 - 구매한 콘텐츠 총 개수 표시

This commit is contained in:
Yu Sung 2023-10-31 18:34:57 +09:00
parent 0079f248ee
commit 68675ebfe8
2 changed files with 21 additions and 0 deletions

View File

@ -33,6 +33,24 @@ struct OrderListAllView: View {
.frame(height: 50)
.background(Color.black)
HStack(spacing: 0) {
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "dd4500"))
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
Spacer()
}
.padding(.horizontal, 13.3)
.padding(.top, 13.3)
ScrollViewReader { reader in
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 10.7) {

View File

@ -18,6 +18,7 @@ final class OrderListAllViewModel: ObservableObject {
@Published var isLoading = false
@Published var orderList = [GetAudioContentOrderListItem]()
@Published var totalCount = 0
@Published var scrollToTop = false
var page = 1
@ -49,6 +50,8 @@ final class OrderListAllViewModel: ObservableObject {
self.scrollToTop.toggle()
}
self.totalCount = data.totalCount
if !data.items.isEmpty {
page += 1
self.orderList.append(contentsOf: data.items)