Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 준비 현황 뷰 구현 #186

Merged
merged 25 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
74679af
fix/#176 rootView로 네이밍 전환
youz2me Jul 14, 2024
9cda8af
feat/#176 소요시간 정보 뷰 구현
youz2me Jul 14, 2024
b28c076
feat/#176 소요시간 정보 뷰 구현
youz2me Jul 14, 2024
4898437
feat/#176 rootView viewDidLoad()에서 loadView()에서 설정 변경
youz2me Jul 14, 2024
3433905
feat/#176 화면 컴포넌트 구현
youz2me Jul 14, 2024
350b162
feat/#176 준비 현황 뷰 구현
youz2me Jul 14, 2024
4baafa8
fix/#176 충돌 해결 중
youz2me Jul 14, 2024
04f5d77
fix/#176 충돌 해결
youz2me Jul 14, 2024
8353124
fix/#176 충돌 해결
youz2me Jul 14, 2024
92b853a
Merge remote-tracking branch 'refs/remotes/origin/suyeon'
youz2me Jul 14, 2024
ce7ef60
fix/#176 충돌 해결
youz2me Jul 14, 2024
a66e0bd
feat/#176 준비 현황 뷰 구현 완료
youz2me Jul 14, 2024
a04c646
feat/#176 tableView 코드 삭제
youz2me Jul 14, 2024
8c38be1
feat/#176 OurReadyStatusCollectionViewCell 구현
youz2me Jul 15, 2024
b94cf2d
feat/#176 ReadyStatusProgressView 구현 완료
youz2me Jul 16, 2024
4ff8dab
feat/#176 ReadyStatusButton 구현
youz2me Jul 16, 2024
5c5093b
fix/#176 서버 수정된 부분에 맞게 모델 수정
youz2me Jul 16, 2024
6187c61
feat/#176 테스트용 ReadyStatusService 구현
youz2me Jul 16, 2024
71f2130
feat/#176 준비 현황 뷰 및 분기처리, 기능 구현
youz2me Jul 16, 2024
3374f87
feat/#176 준비 현황 구현
youz2me Jul 16, 2024
88704f6
Merge remote-tracking branch 'refs/remotes/origin/suyeon'
youz2me Jul 16, 2024
c14a7b8
fix/#176 충돌 해결
youz2me Jul 16, 2024
e6db3f7
fix/#176 리뷰 반영
youz2me Jul 16, 2024
df868aa
Merge remote-tracking branch 'refs/remotes/origin/suyeon'
youz2me Jul 16, 2024
59c01f2
fix/#186 컨벤션에 맞게 모델명 수정하고 CodingKeys 추가
youz2me Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 89 additions & 83 deletions KkuMulKum.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import Foundation

struct AddPromiseModel: RequestModelType {
let name, placeName, x, y, address, roadAddress, time, dressUpLevel, penalty: String
let name, placeName, address, roadAddress, time, dressUpLevel, penalty: String
let x, y: Double
let id: Int
let participants: [Int]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ import Foundation
// MARK: 오늘 가장 가까운 약속 조회 (1개)

struct NearestPromiseModel: ResponseModelType {
let id, dDay: Int
let promiseID, dDay: Int
let name, meetingName, dressUpLevel, date, time, placeName: String

enum CodingKeys: String, CodingKey {
case promiseID = "promiseId"
case dDay
case name
case meetingName
case dressUpLevel
case date
case time
case placeName
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,16 @@
import Foundation

struct PromiseInfoModel: ResponseModelType {
let promiseID: Int
let placeName, address, roadAddress, time, dressUpLevel, penalty: String

enum CodingKeys: String, CodingKey {
case promiseID = "promiseId"
case placeName
case address
case roadAddress
case time
case dressUpLevel
case penalty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ import Foundation
// MARK: 약속 참여자 목록

struct PromiseParticipantListModel: ResponseModelType {
let participantCount: Int
let participants: [Participant]
}

struct Participant: Codable {
let id: Int
let name, profileImageURL, state: String
let participantId, memberId: Int
let name, state: String
let profileImageURL: String?

enum CodingKeys: String, CodingKey {
case id
case participantId
case memberId
case name
case profileImageURL = "profileImg"
case state
case profileImageURL = "profileImg"
}
}
8 changes: 7 additions & 1 deletion KkuMulKum/Network/DTO/Model/Promises/TardyInfoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ struct TardyInfoModel: ResponseModelType {

struct Comer: Codable {
let participantId: Int
let name, profileImg: String
let name, profileImageURL: String

enum CodingKeys: String, CodingKey {
case participantId
case name
case profileImageURL = "profileImg"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ struct UpcomingPromiseListModel: ResponseModelType {
}

struct UpcomingPromise: Codable {
let id, dDay: Int
let promiseID, dDay: Int
let name, meetingName, dressUpLevel, date, time, placeName: String

enum CodingKeys: String, CodingKey {
case promiseID = "promiseId"
case dDay
case name
case meetingName
case dressUpLevel
case date
case time
case placeName
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "text_popup.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ import UIKit
class PagePromiseViewController: BaseViewController {
private let promiseViewModel = PagePromiseViewModel()

// TODO: 서버 연결 시 데이터 바인딩 필요
private let promiseViewControllerList: [BaseViewController] = [
PromiseInfoViewController(),
ReadyStatusViewController(),
// TODO: 서버 연결 시 데이터 바인딩 필요
ReadyStatusViewController(
readyStatusViewModel: ReadyStatusViewModel(
readyStatusService: MockReadyStatusService()
)
),
TardyViewController(
tardyViewModel: TardyViewModel(
isPastDue: ObservablePattern<Bool>(false),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// ReadyStatusService.swift
// KkuMulKum
//
// Created by YOUJIM on 7/15/24.
//

import Foundation

protocol ReadyStatusServiceType {
func getMyPromiseStatus(with promiseID: Int) -> MyReadyStatusModel?
func patchMyReadyStatus(with myInfo: MyPromiseReadyInfoModel)
func getParticipantList(with promiseID: Int) -> PromiseParticipantListModel?
}

final class MockReadyStatusService: CreateMeetingServiceType {
func getMyPromiseStatus(with promiseID: Int) -> MyReadyStatusModel? {
let mockData = MyReadyStatusModel(
preparationTime: 300,
travelTime: 230,
preparationStartAt: "AM 11:00",
departureAt: "PM 1:30",
arrivalAt: "PM 2:00"
)

return mockData
}
Comment on lines +17 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

홈화면에 야미하게 가져다 써야지!


func getParticipantList(with promiseID: Int) -> PromiseParticipantListModel {
let mockData = PromiseParticipantListModel(
participantCount: 3,
participants: [
Participant(
participantId: 1,
memberId: 3,
name: "안꾸물이",
state: "도착",
profileImageURL: nil
),
Participant(
participantId: 2,
memberId: 4,
name: "꾸우우우웅물이",
state: "도착",
profileImageURL: nil
),
Participant(
participantId: 3,
memberId: 5,
name: "꾸물이",
state: "이동중",
profileImageURL: nil
)
]
)

return mockData
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ class EnterReadyInfoButtonView: BaseView {

override func setupAutoLayout() {
descriptionLabel.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.top.equalToSuperview().offset(21)
$0.leading.equalToSuperview().offset(20)
}

chevronButton.snp.makeConstraints {
$0.trailing.equalToSuperview().inset(17)
$0.centerY.equalToSuperview()
$0.centerY.equalTo(descriptionLabel)
$0.bottom.equalToSuperview().inset(21)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// OurReadyStatusCollectionViewCell.swift
// KkuMulKum
//
// Created by YOUJIM on 7/16/24.
//

import UIKit

class OurReadyStatusCollectionViewCell: BaseCollectionViewCell {
var profileImageView: UIImageView = UIImageView(image: .imgProfile).then {
$0.contentMode = .scaleAspectFill
}

let nameLabel: UILabel = UILabel().then {
$0.setText("유짐이", style: .body03, color: .gray8)
}

var readyStatusButton: ReadyStatusButton = ReadyStatusButton(
title: "준비중",
readyStatus: .ready
).then {
$0.layer.cornerRadius = Screen.height(14)
$0.layer.borderWidth = 0.5
}

override func setupView() {
backgroundColor = .white
layer.cornerRadius = 8
clipsToBounds = true

addSubviews(
profileImageView,
nameLabel,
readyStatusButton
)
}

override func setupAutoLayout() {
profileImageView.snp.makeConstraints {
$0.top.equalToSuperview().offset(14)
$0.bottom.equalToSuperview().inset(14)
$0.leading.equalToSuperview().offset(12)
$0.height.equalTo(Screen.height(44))
$0.width.equalTo(profileImageView.snp.height)
}

nameLabel.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalTo(profileImageView.snp.trailing).offset(13)
}

readyStatusButton.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.trailing.equalToSuperview().inset(12)
$0.height.equalTo(Screen.height(28))
$0.width.equalTo(Screen.width(68))
}
}
}
52 changes: 52 additions & 0 deletions KkuMulKum/Source/Promise/ReadyStatus/View/ReadyPlanInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,56 @@ class ReadyPlanInfoView: BaseView {
$0.setText("12시 30분에 준비하고,\n1시에 이동을 시작해야 해요", style: .body03)
$0.setHighlightText("12시 30분", "1시", style: .body03, color: .maincolor)
}

private let requestReadyTimeLabel: UILabel = UILabel().then {
$0.setText("준비 소요 시간: 30분", style: .label02, color: .gray8)
}

private let requestMoveTimeLabel: UILabel = UILabel().then {
$0.setText("이동 소요 시간: 1시간 30분", style: .label02, color: .gray8)
}

private let editButton: UIButton = UIButton().then {
$0.setTitle("수정", for: .normal)
$0.setTitleColor(.gray6, for: .normal)
$0.titleLabel?.font = .pretendard(.caption01)
$0.backgroundColor = .gray0
$0.layer.cornerRadius = 50
$0.clipsToBounds = true
}

override func setupView() {
backgroundColor = .white

addSubviews(
readyTimeLabel,
requestReadyTimeLabel,
requestMoveTimeLabel,
editButton
)
}

override func setupAutoLayout() {
readyTimeLabel.snp.makeConstraints {
$0.top.equalToSuperview().offset(16)
$0.leading.equalToSuperview().offset(20)
}

requestReadyTimeLabel.snp.makeConstraints {
$0.top.equalTo(readyTimeLabel.snp.bottom).offset(12)
$0.leading.equalToSuperview().offset(20)
}

requestMoveTimeLabel.snp.makeConstraints {
$0.top.equalTo(requestReadyTimeLabel.snp.bottom).offset(8)
$0.leading.equalToSuperview().offset(20)
$0.bottom.equalToSuperview().inset(18)
}

editButton.snp.makeConstraints {
$0.trailing.equalToSuperview().inset(22)
$0.bottom.equalToSuperview().inset(18)
$0.height.equalTo(Screen.height(28))
}
}
}
Loading