From 681351a57f066c767671e54577258da338e2bead Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:15:21 +0900 Subject: [PATCH] =?UTF-8?q?[Chore]=20#84=20-=20MyPage=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=20=ED=94=84=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiterals.swift | 6 ++-- .../Contents.json | 0 .../mypage_img_stamp7.png | Bin .../mypage_img_stamp7@2x.png | Bin .../mypage_img_stamp7@3x.png | Bin .../Contents.json | 0 .../mypage_img_stamp8.png | Bin .../mypage_img_stamp8@2x.png | Bin .../mypage_img_stamp8@3x.png | Bin .../Contents.json | 0 .../mypage_img_stamp9.png | Bin .../mypage_img_stamp9@2x.png | Bin .../mypage_img_stamp9@3x.png | Bin .../GoalRewardInfoModel.swift | 26 ++++++++++++++++++ .../MyPage/VC/InfoVC/GoalRewardInfoVC.swift | 26 ++++-------------- .../Presentation/MyPage/VC/MyPageVC.swift | 11 ++++++-- 16 files changed, 42 insertions(+), 27 deletions(-) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p1.imageset => img_stamp_u1.imageset}/Contents.json (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p1.imageset => img_stamp_u1.imageset}/mypage_img_stamp7.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p1.imageset => img_stamp_u1.imageset}/mypage_img_stamp7@2x.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p1.imageset => img_stamp_u1.imageset}/mypage_img_stamp7@3x.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p2.imageset => img_stamp_u2.imageset}/Contents.json (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p2.imageset => img_stamp_u2.imageset}/mypage_img_stamp8.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p2.imageset => img_stamp_u2.imageset}/mypage_img_stamp8@2x.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p2.imageset => img_stamp_u2.imageset}/mypage_img_stamp8@3x.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p3.imageset => img_stamp_u3.imageset}/Contents.json (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p3.imageset => img_stamp_u3.imageset}/mypage_img_stamp9.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p3.imageset => img_stamp_u3.imageset}/mypage_img_stamp9@2x.png (100%) rename Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/{img_stamp_p3.imageset => img_stamp_u3.imageset}/mypage_img_stamp9@3x.png (100%) diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift index 26949435..589a6e03 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift @@ -48,9 +48,9 @@ enum ImageLiterals { static var imgStampC1: UIImage { .load(named: "img_stamp_c1") } static var imgStampC2: UIImage { .load(named: "img_stamp_c2") } static var imgStampC3: UIImage { .load(named: "img_stamp_c3") } - static var imgStampP1: UIImage { .load(named: "img_stamp_p1") } - static var imgStampP2: UIImage { .load(named: "img_stamp_p2") } - static var imgStampP3: UIImage { .load(named: "img_stamp_p3") } + static var imgStampU1: UIImage { .load(named: "img_stamp_u1") } + static var imgStampU2: UIImage { .load(named: "img_stamp_u2") } + static var imgStampU3: UIImage { .load(named: "img_stamp_u3") } static var imgStampR1: UIImage { .load(named: "img_stamp_r1") } static var imgStampR2: UIImage { .load(named: "img_stamp_r2") } static var imgStampR3: UIImage { .load(named: "img_stamp_r3") } diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/Contents.json similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/Contents.json rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/Contents.json diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7@2x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7@2x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7@2x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7@2x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7@3x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p1.imageset/mypage_img_stamp7@3x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u1.imageset/mypage_img_stamp7@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/Contents.json similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/Contents.json rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/Contents.json diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8@2x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8@2x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8@2x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8@2x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8@3x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p2.imageset/mypage_img_stamp8@3x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u2.imageset/mypage_img_stamp8@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/Contents.json similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/Contents.json rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/Contents.json diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9@2x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9@2x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9@2x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9@2x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9@3x.png similarity index 100% rename from Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_p3.imageset/mypage_img_stamp9@3x.png rename to Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/img_stamp_u3.imageset/mypage_img_stamp9@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoModel.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoModel.swift index 61202843..82de027c 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoModel.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoModel.swift @@ -11,3 +11,29 @@ struct GoalRewardInfoModel { let stampImg: UIImage let stampStandard: String } + +extension GoalRewardInfoModel { + static var stampNameList: [GoalRewardInfoModel] { + return [ + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC1, stampStandard: "그린 코스 1개"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC2, stampStandard: "그린 코스 5개"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC3, stampStandard: "그린 코스 10개"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS1, stampStandard: "스크랩 1회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS2, stampStandard: "스크랩 5회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS3, stampStandard: "스크랩 10회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampU1, stampStandard: "업로드 1회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampU2, stampStandard: "업로드 5회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampU3, stampStandard: "업로드 10회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR1, stampStandard: "달리기 1회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR2, stampStandard: "달리기 5회"), + GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR2, stampStandard: "달리기 10회") + ] + } + + static var stampNameImageDictionary: [String: UIImage] { ["c1": ImageLiterals.imgStampC1, "c2": ImageLiterals.imgStampC2, "c3": ImageLiterals.imgStampC3, + "s1": ImageLiterals.imgStampS1, "s2": ImageLiterals.imgStampS2, "s3": ImageLiterals.imgStampS3, + "u1": ImageLiterals.imgStampU1, "u2": ImageLiterals.imgStampU2, "u3": ImageLiterals.imgStampU3, + "r1": ImageLiterals.imgStampR1, "r2": ImageLiterals.imgStampR2, "r3": ImageLiterals.imgStampR3] + + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift index bfe55235..ed5bf2b8 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift @@ -18,22 +18,13 @@ final class GoalRewardInfoVC: UIViewController { plugins: [NetworkLoggerPlugin(verbose: true)] ) - var stampNameList: [GoalRewardInfoModel] = [ - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC1, stampStandard: "그린 코스 1개"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC2, stampStandard: "그린 코스 5개"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampC3, stampStandard: "그린 코스 10개"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS1, stampStandard: "스크랩 1회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS2, stampStandard: "스크랩 5회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampS3, stampStandard: "스크랩 10회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampP1, stampStandard: "업로드 1회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampP2, stampStandard: "업로드 5회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampP3, stampStandard: "업로드 10회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR1, stampStandard: "달리기 1회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR2, stampStandard: "달리기 5회"), - GoalRewardInfoModel(stampImg: ImageLiterals.imgStampR2, stampStandard: "달리기 10회") - ] + var stampNameList: [GoalRewardInfoModel] = GoalRewardInfoModel.stampNameList private var goalRewardList = [GoalRewardStamp]() + let stampNameDictionary: [String: Int] = ["c1": 0, "c2": 1, "c3": 2, + "s1": 3, "s2": 4, "s3": 5, + "u1": 6, "u2": 7, "u3": 8, + "r1": 9, "r2": 10, "r3": 11] var isStampExistList = Array(repeating: false, count: 12) // MARK: - Constants @@ -96,18 +87,11 @@ extension GoalRewardInfoVC { } func setIsStampExistList(list: [GoalRewardStamp]) { - let stampNameDictionary: [String: Int] = ["c1": 0, "c2": 1, "c3": 2, - "s1": 3, "s2": 4, "s3": 5, - "u1": 6, "u2": 7, "u3": 8, - "r1": 9, "r2": 10, "r3": 11] - for stamp in list { guard let index = stampNameDictionary[stamp.id] else { return } self.isStampExistList[index] = true } - print(isStampExistList) - stampCollectionView.reloadData() } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift index 6ddd62b9..e6dd9423 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift @@ -18,6 +18,8 @@ final class MyPageVC: UIViewController { private var myPageProvider = MoyaProvider( plugins: [NetworkLoggerPlugin(verbose: true)] ) + + let stampNameImageDictionary: [String: UIImage] = GoalRewardInfoModel.stampNameImageDictionary // MARK: - UI Components @@ -28,9 +30,7 @@ final class MyPageVC: UIViewController { private let secondDivideView = UIView() private let thirdDivideView = UIView() - private let myProfileImage = UIImageView().then { - $0.image = ImageLiterals.imgStampR2 - } + private let myProfileImage = UIImageView() private let myProfileNameLabel = UILabel().then { $0.textColor = .m1 @@ -159,6 +159,7 @@ extension MyPageVC { self.myRunningProgressBar.setProgress(Float(model.user.levelPercent)/100, animated: false) setMyRunningProgressPercentLabel(label: myRunnigProgressPercentLabel, model: model) setMyRunningLevelLavel(label: myRunningLevelLavel, model: model) + setMyProfileImage(model: model) } private func setMyRunningProgressPercentLabel(label: UILabel, model: MyPageDto) { @@ -173,6 +174,10 @@ extension MyPageVC { label.attributedText = attributedString } + private func setMyProfileImage(model: MyPageDto) { + guard let profileImage = stampNameImageDictionary[model.user.latestStamp] else { return } + myProfileImage.image = profileImage + } } // MARK: - @objc Function