85 Commits

Author SHA1 Message Date
Yu Sung
41b7247a44 캔 충전 후 로컬에 저장된 캔 수가 변하지 않는 버그 수정 2023-11-04 21:13:21 +09:00
Yu Sung
63a259f890 콘텐츠 메인 - 새로고침 시 인기콘텐츠 순위 정렬 버튼이 중복되는 버그 수정 2023-11-04 20:07:13 +09:00
Yu Sung
7c8f9b1460 콘텐츠 구매 - 캔이 부족하면 캔 충전 페이지로 이동하도록 수정 2023-11-03 20:37:47 +09:00
Yu Sung
27df89d78e 인기 콘텐츠 전체 보기 - 정렬 추가 2023-11-03 14:45:51 +09:00
Yu Sung
cf7f1527b7 콘텐츠 메인 - 인기 콘텐츠 정렬 추가 2023-11-03 13:10:51 +09:00
Yu Sung
68675ebfe8 구매목록 - 구매한 콘텐츠 총 개수 표시 2023-10-31 18:34:57 +09:00
Yu Sung
0079f248ee 라이브 - 방장을 제외한 모든 유저에게 참여자 목록 버튼이 보이지 않도록 수정 2023-10-31 16:32:56 +09:00
Yu Sung
6583e07f45 휴대폰 결제 추가 2023-10-27 02:20:08 +09:00
Yu Sung
902b772267 사용하지 않는 isAdult 파라미터 제거 2023-10-24 20:33:13 +09:00
Yu Sung
cdad53ae7b 콘텐츠 등록 - 대여만 가능한 콘텐츠 등록 기능 추가 2023-10-22 17:57:31 +09:00
Yu Sung
995c6adab7 콘텐츠 상세 - 대여만 가능한 콘텐츠의 경우 소장 버튼이 보이지 않고 가격의 100%가 보이도록 수정 2023-10-22 17:41:56 +09:00
Yu Sung
115a30a7b6 채금 시간이 설정 되지 않던 버그 수정 2023-10-15 07:28:00 +09:00
Yu Sung
c78b804678 탐색 - 인기 크리에이터 설명 글 UI 수정 2023-10-15 06:53:47 +09:00
Yu Sung
1a01244d85 탐색 - 인기 크리에이터 설명 글 UI 수정 2023-10-15 06:40:09 +09:00
Yu Sung
fea557560c 인기콘텐츠 전체 보기 페이지 추가 2023-10-15 06:34:08 +09:00
Yu Sung
c440e8abd9 콘텐츠 메인 - 인기 콘텐츠 영역 추가 2023-10-15 05:50:54 +09:00
Yu Sung
41d5bad46f 탐색 - 크리에이터 랭킹 UI 추가 2023-10-14 18:34:10 +09:00
Yu Sung
6c8e19aed5 Admob 제거 2023-10-14 17:31:28 +09:00
Yu Sung
282ee73de1 채금 기능 추가 2023-10-11 19:25:12 +09:00
Yu Sung
91c43e679f 라이브 예약중 - 예약중 글자색, 내가 개설한 라이브 글자색 3bb9f1로 변경 2023-10-06 20:31:13 +09:00
Yu Sung
02835c4b2e 라이브 예약 중 전체보기 - 선택된 날짜 배경색 3bb9f1로 변경 2023-10-06 20:28:02 +09:00
Yu Sung
a4d15be57a 메시지 발송 버튼 색 변경, 입력창 커서 색 변경 2023-10-06 20:26:12 +09:00
Yu Sung
219128ea8d 라이브 방 - 팔로우 버튼 위치 수정 2023-10-06 20:19:16 +09:00
Yu Sung
47ae2ec8e1 유료 콘텐츠 미리 듣기 재생 버튼 추가 2023-10-06 01:22:56 +09:00
Yu Sung
962197d319 후원랭킹 전체보기 - 채널에 후원랭킹 활성화 스위치 추가 2023-10-06 01:02:32 +09:00
Yu Sung
c75f94722b 배경색 2b2635 -> 13181b 로 변경 2023-10-05 23:35:45 +09:00
Yu Sung
c00931761c 라이브 상세 - 공유 버튼 제거 2023-10-05 02:03:41 +09:00
Yu Sung
8255065bba 비공개 라이브 입장 - 비밀번호 입력창 나오지 않던 버그 수정 2023-10-04 20:25:19 +09:00
Yu Sung
1e1b97e2d4 새로운 콘텐츠 전체보기, 큐레이션 전체보기 - grid item alignment top으로 설정 2023-09-27 22:17:47 +09:00
Yu Sung
f653667df2 새로운 콘텐츠 전체보기, 콘텐츠 큐레이션 전체보기 - 스크롤 로딩 추가 2023-09-27 21:22:26 +09:00
Yu Sung
658cff20eb 큐레이션 전체보기 페이지 추가 2023-09-27 21:16:39 +09:00
Yu Sung
fd356451ae 새로운 콘텐츠 전체보기 페이지 추가 2023-09-27 19:25:00 +09:00
Yu Sung
91cd3fe995 콘텐츠 업로드 - 미리듣기 시간 설정 안내 문구 추가 2023-09-27 18:13:15 +09:00
Yu Sung
5f7924880e 콘텐츠 업로드 - 미리 듣기 시간 타입 옵셔널로 수정 2023-09-23 00:57:38 +09:00
Yu Sung
00a8f7e8ff 푸시토큰 잘못 불러오는 버그 수정 2023-09-23 00:29:26 +09:00
Yu Sung
d1b5ab31aa 콘텐츠 업로드 - 미리 듣기 시간 설정 기능 추가 2023-09-23 00:08:23 +09:00
Yu Sung
225efc34e4 라이브 방 후원 다이얼로그 - 캔 불러오는 방식 수정 2023-09-21 23:03:28 +09:00
Yu Sung
4e607ed624 라이브 상세 - 상단에 배너 광고 추가 2023-09-21 19:01:27 +09:00
Yu Sung
c7522aa7c9 .. 2023-09-19 15:37:28 +09:00
Yu Sung
b632a65a6f 캔 유효기간 설명 제거 2023-09-18 10:46:31 +09:00
Yu Sung
d3c5a5bfb9 콘텐츠 상세 - 배너 광고 간격 수정 2023-09-16 01:41:21 +09:00
Yu Sung
2449eb14d0 콘텐츠 상세 - 배너 광고 위치 수정 2023-09-16 01:31:11 +09:00
Yu Sung
4c9e78f960 탐색 - 배너 광고 추가 2023-09-16 01:11:50 +09:00
Yu Sung
6e9aaa0c8a 콘텐츠 메인 - 배너 광고 위치 수정 2023-09-16 00:53:59 +09:00
Yu Sung
0294bbf223 라이브 - 배너 광고 위치 변경 2023-09-16 00:10:58 +09:00
Yu Sung
36aa167e1d 라이브 방 - 배너 광고 제거 2023-09-15 23:36:21 +09:00
Yu Sung
8c20ce9c62 라이브 방 - 배너 광고 추가 2023-09-15 18:27:53 +09:00
Yu Sung
f44ef505cf 크리에이터 프로필 - 배너 광고 추가 2023-09-15 18:11:40 +09:00
Yu Sung
9a72e21fda 팔로잉 채널 리스트 - 배너 광고 추가 2023-09-15 18:03:46 +09:00
Yu Sung
1c4503bda1 콘텐츠 메인 - 배너 광고 추가 2023-09-15 17:59:23 +09:00
Yu Sung
b1773b117d 라이브, 지금 라이브 중 전체보기 - 배너 광고 추가 2023-09-15 17:03:16 +09:00
Yu Sung
a16c38f4ab 메시지 - 배너 광고 추가 2023-09-15 16:28:11 +09:00
Yu Sung
475882570a 구매목록 - 배너광고 추가 2023-09-15 16:04:21 +09:00
Yu Sung
5b0cb44645 contentShape 추가 2023-09-14 12:50:58 +09:00
Yu Sung
b2f0975ad1 콘텐츠 상세 - 배너 광고 추가 2023-09-14 12:16:01 +09:00
Yu Sung
48b1093dac 콘텐츠 답글 - 댓글이 랜덤으로 보이는 버그 수정 2023-09-13 16:54:24 +09:00
Yu Sung
3bcd2b7dba 메시지 추가 로딩 되지 않는 버그 수정 2023-09-13 14:39:35 +09:00
Yu Sung
9863fc66de 재생 수 업데이트 로직 추가 2023-09-13 12:14:03 +09:00
Yu Sung
58868f613a 푸시 터치 액션 수정 2023-09-13 11:45:41 +09:00
Yu Sung
1f992a11dc 응원글 전체보기 - 응원글 삭제기능 추가 2023-09-09 00:38:55 +09:00
Yu Sung
948b1fd2b3 응원글 수정 기능 추가 2023-09-09 00:10:22 +09:00
Yu Sung
5d95c0f1c9 응원글 삭제 기능 추가 2023-09-09 00:02:39 +09:00
Yu Sung
b31933715d 콘텐츠 댓글 - 수정/삭제 추가 2023-09-08 19:33:09 +09:00
Yu Sung
707b6f804c 구매목록 - 콘텐츠 크리에이터 표시 2023-09-04 23:10:34 +09:00
Yu Sung
05f5a4fe82 라이브 생성 푸시 - 예약중인 라이브의 경우 상세 페이지가 나오도록 수정 2023-09-04 19:03:02 +09:00
Yu Sung
f08d72745e 음성메시지 보관/삭제/답장 추가 2023-09-01 23:09:36 +09:00
Yu Sung
4611524f8f 라이브 예약이 되지 않던 버그 수정 2023-09-01 12:13:30 +09:00
Yu Sung
a41c423991 푸시, 딥링크 - 라이브 탭으로 이동하지 않아도 실행되도록 수정 2023-09-01 00:35:50 +09:00
Yu Sung
d76b1c7a59 라이브 - 상단 배너 터치 액션 추가 2023-08-30 22:05:23 +09:00
Yu Sung
6fa183b89a 코인 -> 캔 2023-08-29 23:38:01 +09:00
Yu Sung
371d6d538a 콘텐츠 대여가격 60%로 변경 2023-08-29 23:29:05 +09:00
Yu Sung
2aa3f944c8 응원 전체보기 추가 2023-08-29 15:30:21 +09:00
Yu Sung
e68961bd0d 후원랭킹 전체보기 추가 2023-08-29 14:10:16 +09:00
Yu Sung
88fcbc98f4 스피커 요청 버튼 제거 2023-08-28 23:13:43 +09:00
Yu Sung
3916a49e60 콘텐츠 등록 - 5캔(500원) 부터 등록되도록 수정, 대여가격 안내 60%로 수정 2023-08-28 18:20:58 +09:00
Yu Sung
594bcc27ca 빠진 아이콘 추가 2023-08-24 16:18:49 +09:00
Yu Sung
bcb934a155 마이페이지 구매목록 - 19표시 제거 2023-08-24 15:55:26 +09:00
Yu Sung
b31dcf901b 회원가입 - 프로필 이미지 정사각형 2023-08-24 14:42:07 +09:00
Yu Sung
2c8485a1cd 마이페이지 - 구매목록 추가 2023-08-24 14:30:09 +09:00
Yu Sung
f0d2bda024 내보내기, mute, noti_mute 파일 추가 2023-08-24 13:26:24 +09:00
Yu Sung
828c507742 콘텐츠 수정 request data 이름 변경 - audioContentId -> contentId 2023-08-24 13:12:31 +09:00
Yu Sung
65b43e4c0d 콘텐츠 후원 요청 데이터 이름 변경 - audioContentId -> contentId 2023-08-22 22:44:18 +09:00
Yu Sung
728510a72d 콘텐츠 리스트, 콘텐츠 구매 창에 캔 아이콘 변경 2023-08-22 00:41:27 +09:00
Yu Sung
89fd2f5f0d 콘텐츠 구매 - audioContentId -> contentId로 변경 2023-08-22 00:34:43 +09:00
Yu Sung
52921e78b6 pg 검증 API URL 변경 2023-08-21 23:56:29 +09:00
180 changed files with 4996 additions and 893 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_audio_content_preview_play.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 B

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -5,11 +5,11 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "loading_4.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_alarm.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_alarm_selected.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_blog_purple.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_heart_777.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_instagram_purple.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_kick_out.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_message_send.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

@@ -9,7 +9,7 @@
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_headphones_purple.png", "filename" : "ic_message_square_777.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_mic_paint.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

View File

@@ -5,11 +5,11 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "loading_2.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_mute.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_place_holder.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -5,11 +5,11 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "loading_3.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_record.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_record_pause.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_record_play.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_record_stop.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -5,11 +5,11 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "loading_1.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_save.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_website_purple.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_youtube_play_purple.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_compleate_book.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_noti_mute.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_thumb_default.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "loading_5.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -21,5 +21,206 @@
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-1299501215847962~3447556960</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4pfyvq9l8r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5a6flpkh64.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ludvb6z3bs.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cp8zw746q7.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v4nxqhlyqp.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>gta9lk7p23.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>vutu7akeur.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>y5ghdn5j9k.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n6fk4nfna4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v9wttpbfk9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n38lu8286q.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>47vhws6wlr.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>eh6m2bh4zr.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>a2p9lx4jpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>22mmun2rn5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ecpz2srf59.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>pwa73g5rt2.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>mlmmfzh3r3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>578prtvx9j.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4dzt52r2t5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8c4e2ghe7u.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>zq492l623r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3rd42ekr43.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
</dict> </dict>
</plist> </plist>

View File

@@ -21,5 +21,206 @@
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-1299501215847962~8852459715</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4pfyvq9l8r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5a6flpkh64.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ludvb6z3bs.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cp8zw746q7.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v4nxqhlyqp.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>gta9lk7p23.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>vutu7akeur.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>y5ghdn5j9k.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n6fk4nfna4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v9wttpbfk9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n38lu8286q.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>47vhws6wlr.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>eh6m2bh4zr.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>a2p9lx4jpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>22mmun2rn5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ecpz2srf59.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>pwa73g5rt2.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>mlmmfzh3r3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>578prtvx9j.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4dzt52r2t5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8c4e2ghe7u.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>zq492l623r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3rd42ekr43.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
</dict> </dict>
</plist> </plist>

View File

@@ -16,7 +16,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure() FirebaseApp.configure()
Messaging.messaging().delegate = self Messaging.messaging().delegate = self
// For iOS 10 display notification (sent via APNS) // For iOS 10 display notification (sent via APNS)
@@ -95,16 +94,26 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
Messaging.messaging().appDidReceiveMessage(userInfo) Messaging.messaging().appDidReceiveMessage(userInfo)
let roomIdString = userInfo["room_id"] as? String let roomIdString = userInfo["room_id"] as? String
let audioContentIdString = userInfo["audio_content_id"] as? String let contentIdString = userInfo["content_id"] as? String
let channelIdString = userInfo["channel_id"] as? String
let messageIdString = userInfo["message_id"] as? String
if let roomIdString = roomIdString, let roomId = Int(roomIdString), roomId > 0 { if let roomIdString = roomIdString, let roomId = Int(roomIdString), roomId > 0 {
AppState.shared.pushRoomId = roomId AppState.shared.pushRoomId = roomId
} }
if let audioContentIdString = audioContentIdString, let audioContentId = Int(audioContentIdString), audioContentId > 0 { if let contentIdString = contentIdString, let audioContentId = Int(contentIdString), audioContentId > 0 {
AppState.shared.pushAudioContentId = audioContentId AppState.shared.pushAudioContentId = audioContentId
} }
if let channelIdString = channelIdString, let channelId = Int(channelIdString), channelId > 0 {
AppState.shared.pushChannelId = channelId
}
if let messageIdString = messageIdString, let messageId = Int(messageIdString), messageId > 0 {
AppState.shared.pushMessageId = messageId
}
completionHandler() completionHandler()
} }
} }

View File

@@ -26,6 +26,7 @@ class AppState: ObservableObject {
@Published var pushRoomId = 0 @Published var pushRoomId = 0
@Published var pushChannelId = 0 @Published var pushChannelId = 0
@Published var pushMessageId = 0
@Published var pushAudioContentId = 0 @Published var pushAudioContentId = 0
@Published var roomId = 0 { @Published var roomId = 0 {
didSet { didSet {

View File

@@ -105,4 +105,12 @@ enum AppStep {
case profileUpdate(refresh: () -> Void) case profileUpdate(refresh: () -> Void)
case followingList case followingList
case orderListAll
case newContentAll
case curationAll(title: String, curationId: Int)
case contentRankingAll
} }

View File

@@ -26,7 +26,8 @@ struct SodaLiveApp: App {
let queryItems = URLComponents(url: url, resolvingAgainstBaseURL: true)?.queryItems let queryItems = URLComponents(url: url, resolvingAgainstBaseURL: true)?.queryItems
let roomId = queryItems?.filter({$0.name == "room_id"}).first?.value let roomId = queryItems?.filter({$0.name == "room_id"}).first?.value
let channelId = queryItems?.filter({$0.name == "channel_id"}).first?.value let channelId = queryItems?.filter({$0.name == "channel_id"}).first?.value
let audioContentId = queryItems?.filter({$0.name == "audio_content_id"}).first?.value let messageId = queryItems?.filter({$0.name == "message_id"}).first?.value
let audioContentId = queryItems?.filter({$0.name == "content_id"}).first?.value
if let roomId = roomId { if let roomId = roomId {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
@@ -40,6 +41,12 @@ struct SodaLiveApp: App {
} }
} }
if let messageId = messageId {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
AppState.shared.pushMessageId = Int(messageId) ?? 0
}
}
if let audioContentId = audioContentId { if let audioContentId = audioContentId {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
AppState.shared.pushAudioContentId = Int(audioContentId) ?? 0 AppState.shared.pushAudioContentId = Int(audioContentId) ?? 0

View File

@@ -13,7 +13,7 @@ struct AddAllPlaybackTrackingRequest: Encodable {
} }
struct PlaybackTrackingData: Encodable { struct PlaybackTrackingData: Encodable {
let audioContentId: Int let contentId: Int
let playDateTime: String let playDateTime: String
let isPreview: Bool let isPreview: Bool
} }

View File

@@ -0,0 +1,54 @@
//
// ContentNewAllItemView.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
import SwiftUI
import Kingfisher
struct ContentNewAllItemView: View {
let item: GetAudioContentMainItem
@State var width: CGFloat = 0
var body: some View {
VStack(alignment: .leading, spacing: 8) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: width, height: width, alignment: .top)
.cornerRadius(2.7)
Text(item.title)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
.frame(width: width, alignment: .leading)
.multilineTextAlignment(.leading)
.fixedSize(horizontal: false, vertical: true)
.lineLimit(2)
HStack(spacing: 5.3) {
KFImage(URL(string: item.creatorProfileImageUrl))
.resizable()
.scaledToFill()
.frame(width: 21.3, height: 21.3)
.clipShape(Circle())
.onTapGesture { AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId)) }
Text(item.creatorNickname)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "777777"))
.lineLimit(1)
}
.padding(.bottom, 10)
}
.frame(width: width)
.onTapGesture { AppState.shared.setAppStep(step: .contentDetail(contentId: item.contentId)) }
.onAppear {
width = (screenSize().width - 40) / 2
}
}
}

View File

@@ -0,0 +1,86 @@
//
// ContentNewAllView.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
import SwiftUI
struct ContentNewAllView: View {
@StateObject var viewModel = ContentNewAllViewModel()
let columns = [
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top)
]
var body: some View {
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
DetailNavigationBar(title: "새로운 콘텐츠")
Text("※ 최근 2주간 등록된 새로운 콘텐츠 입니다.")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color(hex: "bbbbbb"))
.padding(.horizontal, 13.3)
.padding(.vertical, 8)
.frame(width: screenSize().width, alignment: .leading)
.background(Color(hex: "222222"))
.padding(.top, 13.3)
ContentMainNewContentThemeView(
themes: viewModel.themeList,
selectTheme: {
viewModel.selectedTheme = $0
},
selectedTheme: $viewModel.selectedTheme
).padding(.top, 13.3)
HStack(spacing: 0) {
Text("전체")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "ff5c49"))
.padding(.leading, 8)
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
.padding(.leading, 2)
Spacer()
}
.padding(.vertical, 13.3)
.padding(.horizontal, 20)
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 13.3) {
ForEach(0..<viewModel.newContentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.newContentList[index])
.onAppear {
if index == viewModel.newContentList.count - 1 {
viewModel.getNewContentList()
}
}
}
}
}
}
.onAppear {
viewModel.getThemeList()
viewModel.getNewContentList()
}
}
}
}
struct ContentNewAllView_Previews: PreviewProvider {
static var previews: some View {
ContentNewAllView()
}
}

View File

@@ -0,0 +1,130 @@
//
// ContentNewAllViewModel.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
import Foundation
import Combine
final class ContentNewAllViewModel: ObservableObject {
private let repository = ContentRepository()
private var subscription = Set<AnyCancellable>()
@Published var errorMessage = ""
@Published var isShowPopup = false
@Published var isLoading = false
@Published var themeList = [String]()
@Published var newContentList = [GetAudioContentMainItem]()
@Published var selectedTheme = "전체" {
didSet {
page = 1
isLast = false
getNewContentList()
}
}
@Published var totalCount = 0
var page = 1
var isLast = false
private let pageSize = 10
func getNewContentList() {
if (!isLast && !isLoading) {
isLoading = true
repository.getNewContentAllOfTheme(
theme: selectedTheme == "전체" ? "" : selectedTheme,
page: page,
size: pageSize
)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
self.isLoading = false
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<GetNewContentAllResponse>.self, from: responseData)
self.isLoading = false
if let data = decoded.data, decoded.success {
if page == 1 {
newContentList.removeAll()
}
self.totalCount = data.totalCount
if !data.items.isEmpty {
page += 1
self.newContentList.append(contentsOf: data.items)
} else {
isLast = true
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
self.isLoading = false
}
}
.store(in: &subscription)
} else {
isLoading = false
}
}
func getThemeList() {
repository.getNewContentThemeList()
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<[String]>.self, from: responseData)
if let data = decoded.data, decoded.success {
self.themeList.append("전체")
self.themeList.append(contentsOf: data)
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
}
}
.store(in: &subscription)
}
}

View File

@@ -0,0 +1,162 @@
//
// ContentRankingAllView.swift
// SodaLive
//
// Created by klaus on 2023/10/15.
//
import SwiftUI
import Kingfisher
struct ContentRankingAllView: View {
@StateObject var viewModel = ContentRankingAllViewModel()
var body: some View {
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
DetailNavigationBar(title: "인기 콘텐츠")
VStack(spacing: 8) {
Text("\(viewModel.dateString)")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color(hex: "eeeeee"))
Text("※ 인기 콘텐츠의 순위는 매주 업데이트됩니다.")
.font(.custom(Font.light.rawValue, size: 13.3))
.foregroundColor(Color(hex: "bbbbbb"))
}
.padding(.vertical, 8)
.frame(width: screenSize().width - 26.7)
.background(Color(hex: "222222"))
.padding(.top, 13.3)
ContentMainRankingSortView(
sorts: viewModel.contentRankingSortList,
selectSort: { viewModel.selectedContentRankingSort = $0 },
selectedSort: $viewModel.selectedContentRankingSort
)
.frame(width: screenSize().width - 26.7)
.padding(.vertical, 16.7)
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 20) {
ForEach(0..<viewModel.contentRankingItemList.count, id: \.self) { index in
let item = viewModel.contentRankingItemList[index]
HStack(spacing: 0) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: 66.7, height: 66.7, alignment: .top)
.clipped()
.cornerRadius(5.3)
Text("\(index + 1)")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "3bb9f1"))
.padding(.horizontal, 12)
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 8) {
Text(item.themeStr)
.font(.custom(Font.medium.rawValue, size: 8))
.foregroundColor(Color(hex: "3bac6a"))
.padding(2.6)
.background(Color(hex: "28312b"))
.cornerRadius(2.6)
Text(item.duration)
.font(.custom(Font.medium.rawValue, size: 8))
.foregroundColor(Color(hex: "777777"))
.padding(2.6)
.background(Color(hex: "222222"))
.cornerRadius(2.6)
}
Text(item.creatorNickname)
.font(.custom(Font.medium.rawValue, size: 10.7))
.foregroundColor(Color(hex: "777777"))
.padding(.vertical, 8)
Text(item.title)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "d2d2d2"))
.lineLimit(2)
.padding(.top, 2.7)
}
Spacer()
if item.price > 0 {
HStack(spacing: 8) {
Image("ic_can")
.resizable()
.frame(width: 17, height: 17)
Text("\(item.price)")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "909090"))
}
} else {
Text("무료")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "ffffff"))
.padding(.horizontal, 5.3)
.padding(.vertical, 2.7)
.background(Color(hex: "cf5c37"))
.cornerRadius(2.6)
}
}
.frame(height: 66.7)
.contentShape(Rectangle())
.onTapGesture {
AppState
.shared
.setAppStep(step: .contentDetail(contentId: item.contentId))
}
.onAppear {
if index == viewModel.contentRankingItemList.count - 1 {
viewModel.getContentRanking()
}
}
}
}
}
.padding(13.3)
}
if viewModel.isLoading {
LoadingView()
}
}
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .top, autohideIn: 2) {
GeometryReader { geo in
HStack {
Spacer()
Text(viewModel.errorMessage)
.padding(.vertical, 13.3)
.padding(.horizontal, 6.7)
.frame(width: geo.size.width - 66.7, alignment: .center)
.font(.custom(Font.medium.rawValue, size: 12))
.background(Color(hex: "9970ff"))
.foregroundColor(Color.white)
.multilineTextAlignment(.leading)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(20)
.padding(.top, 66.7)
Spacer()
}
}
}
.onAppear {
viewModel.getContentRankingSortType()
viewModel.getContentRanking()
}
}
}
struct ContentRankingAllView_Previews: PreviewProvider {
static var previews: some View {
ContentRankingAllView()
}
}

View File

@@ -0,0 +1,124 @@
//
// ContentRankingAllViewModel.swift
// SodaLive
//
// Created by klaus on 2023/10/15.
//
import Foundation
import Combine
final class ContentRankingAllViewModel: ObservableObject {
private let repository = ContentRepository()
private var subscription = Set<AnyCancellable>()
@Published var errorMessage = ""
@Published var isShowPopup = false
@Published var isLoading = false
@Published var dateString = ""
@Published var contentRankingItemList = [GetAudioContentRankingItem]()
@Published var contentRankingSortList = [String]()
@Published var selectedContentRankingSort = "매출" {
didSet {
page = 1
isLast = false
getContentRanking()
}
}
var page = 1
var isLast = false
private let pageSize = 10
func getContentRanking() {
if (!isLast && !isLoading && page <= 5) {
isLoading = true
repository.getContentRanking(page: page, size: pageSize, sortType: selectedContentRankingSort)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
self.isLoading = false
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<GetAudioContentRanking>.self, from: responseData)
self.isLoading = false
if let data = decoded.data, decoded.success {
if page == 1 {
contentRankingItemList.removeAll()
}
dateString = "\(data.startDate)~\(data.endDate)"
if !data.items.isEmpty {
page += 1
self.contentRankingItemList.append(contentsOf: data.items)
} else {
isLast = true
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
self.isLoading = false
}
}
.store(in: &subscription)
}
}
func getContentRankingSortType() {
repository.getContentRankingSortType()
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<[String]>.self, from: responseData)
if let data = decoded.data, decoded.success {
self.contentRankingSortList.removeAll()
self.contentRankingSortList.append(contentsOf: data)
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
}
}
.store(in: &subscription)
}
}

View File

@@ -0,0 +1,11 @@
//
// GetNewContentAllResponse.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
struct GetNewContentAllResponse: Decodable {
let totalCount: Int
let items: [GetAudioContentMainItem]
}

View File

@@ -25,6 +25,12 @@ enum ContentApi {
case getMain case getMain
case getNewContentOfTheme(theme: String) case getNewContentOfTheme(theme: String)
case donation(request: AudioContentDonationRequest) case donation(request: AudioContentDonationRequest)
case modifyComment(request: ModifyCommentRequest)
case getNewContentThemeList
case getNewContentAllOfTheme(theme: String, page: Int, size: Int)
case getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort)
case getContentRanking(page: Int, size: Int, sortType: String)
case getContentRankingSortType
} }
extension ContentApi: TargetType { extension ContentApi: TargetType {
@@ -81,15 +87,36 @@ extension ContentApi: TargetType {
case .donation: case .donation:
return "/audio-content/donation" return "/audio-content/donation"
case .modifyComment:
return "/audio-content/comment"
case .getNewContentThemeList:
return "/audio-content/main/theme"
case .getNewContentAllOfTheme:
return "/audio-content/main/new/all"
case .getAudioContentListByCurationId(let curationId, _, _, _):
return "/audio-content/curation/\(curationId)"
case .getContentRanking:
return "/audio-content/ranking"
case .getContentRankingSortType:
return "/audio-content/ranking-sort-type"
} }
} }
var method: Moya.Method { var method: Moya.Method {
switch self { switch self {
case .getAudioContentList, .getAudioContentDetail, .getOrderList, .getAudioContentThemeList, .getAudioContentCommentList, .getAudioContentCommentReplyList, .getMain, .getNewContentOfTheme: case .getAudioContentList, .getAudioContentDetail, .getOrderList, .getAudioContentThemeList,
.getAudioContentCommentList, .getAudioContentCommentReplyList, .getMain, .getNewContentOfTheme,
.getNewContentThemeList, .getNewContentAllOfTheme, .getAudioContentListByCurationId, .getContentRanking,
.getContentRankingSortType:
return .get return .get
case .likeContent, .modifyAudioContent: case .likeContent, .modifyAudioContent, .modifyComment:
return .put return .put
case .registerComment, .orderAudioContent, .addAllPlaybackTracking, .uploadAudioContent, .donation: case .registerComment, .orderAudioContent, .addAllPlaybackTracking, .uploadAudioContent, .donation:
@@ -173,6 +200,42 @@ extension ContentApi: TargetType {
case .donation(let request): case .donation(let request):
return .requestJSONEncodable(request) return .requestJSONEncodable(request)
case .modifyComment(let request):
return .requestJSONEncodable(request)
case .getNewContentThemeList:
return .requestPlain
case .getNewContentAllOfTheme(let theme, let page, let size):
let parameters = [
"theme": theme,
"page": page - 1,
"size": size
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getAudioContentListByCurationId(_, let page, let size, let sort):
let parameters = [
"page": page - 1,
"size": size,
"sort-type": sort
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getContentRanking(let page, let size, let sortType):
let parameters = [
"page": page - 1,
"size": size,
"sort-type": sortType
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getContentRankingSortType:
return .requestPlain
} }
} }

View File

@@ -49,7 +49,7 @@ struct ContentListItemView: View {
HStack(spacing: 13.3) { HStack(spacing: 13.3) {
HStack(spacing: 6) { HStack(spacing: 6) {
Image("ic_heart") Image("ic_heart_777")
.resizable() .resizable()
.frame(width: 13.3, height: 13.3) .frame(width: 13.3, height: 13.3)
@@ -77,7 +77,7 @@ struct ContentListItemView: View {
if item.price > 0 { if item.price > 0 {
HStack(spacing: 8) { HStack(spacing: 8) {
Image("ic_coin_w") Image("ic_can")
.resizable() .resizable()
.frame(width: 17, height: 17) .frame(width: 17, height: 17)

View File

@@ -29,8 +29,8 @@ final class ContentRepository {
return api.requestPublisher(.registerComment(request: RegisterAudioContentCommentRequest(comment: comment, contentId: audioContentId, parentId: parentId))) return api.requestPublisher(.registerComment(request: RegisterAudioContentCommentRequest(comment: comment, contentId: audioContentId, parentId: parentId)))
} }
func orderAudioContent(audioContentId: Int, orderType: OrderType) -> AnyPublisher<Response, MoyaError> { func orderAudioContent(contentId: Int, orderType: OrderType) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.orderAudioContent(request: OrderRequest(audioContentId: audioContentId, orderType: orderType))) return api.requestPublisher(.orderAudioContent(request: OrderRequest(contentId: contentId, orderType: orderType)))
} }
func getOrderList(page: Int, size: Int) -> AnyPublisher<Response, MoyaError> { func getOrderList(page: Int, size: Int) -> AnyPublisher<Response, MoyaError> {
@@ -74,6 +74,30 @@ final class ContentRepository {
} }
func donation(contentId: Int, can: Int, comment: String) -> AnyPublisher<Response, MoyaError> { func donation(contentId: Int, can: Int, comment: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.donation(request: AudioContentDonationRequest(audioContentId: contentId, donationCan: can, comment: comment))) return api.requestPublisher(.donation(request: AudioContentDonationRequest(contentId: contentId, donationCan: can, comment: comment)))
}
func modifyComment(request: ModifyCommentRequest) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.modifyComment(request: request))
}
func getNewContentThemeList() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getNewContentThemeList)
}
func getNewContentAllOfTheme(theme: String, page: Int, size: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getNewContentAllOfTheme(theme: theme, page: page, size: size))
}
func getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getAudioContentListByCurationId(curationId: curationId, page: page, size: size, sort: sort))
}
func getContentRankingSortType() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getContentRankingSortType)
}
func getContentRanking(page: Int, size: Int, sortType: String = "매출") -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getContentRanking(page: page, size: size, sortType: sortType))
} }
} }

View File

@@ -214,14 +214,36 @@ struct ContentCreateView: View {
} }
if !viewModel.isFree { if !viewModel.isFree {
VStack(spacing: 13.3) {
Text("소장 설정")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
.frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 13.3) {
SelectButtonView(title: "소장/대여", isChecked: !viewModel.isOnlyRental) {
if viewModel.isOnlyRental {
viewModel.isOnlyRental = false
}
}
SelectButtonView(title: "대여만", isChecked: viewModel.isOnlyRental) {
if !viewModel.isOnlyRental {
viewModel.isOnlyRental = true
}
}
}
}
.padding(.top, 13.3)
VStack(spacing: 0) { VStack(spacing: 0) {
Text("소장가격") Text(viewModel.isOnlyRental ? "대여 가격" : "소장 가격")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2")) .foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 0) { HStack(spacing: 0) {
TextField("가격을 입력하세요(10캔 이상)", text: $viewModel.priceString) TextField("가격을 입력하세요(5캔 이상)", text: $viewModel.priceString)
.autocapitalization(.none) .autocapitalization(.none)
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.bold.rawValue, size: 14.7)) .font(.custom(Font.bold.rawValue, size: 14.7))
@@ -247,18 +269,18 @@ struct ContentCreateView: View {
.frame(height: 1) .frame(height: 1)
.padding(.top, 11) .padding(.top, 11)
Text("※ 이용기간 대여 (7일) | 소장 (서비스종료시까지)") Text("※ 이용기간 대여 (15일) | 소장 (서비스종료시까지)")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.padding(.top, 13.3) .padding(.top, 13.3)
Text("※ 대여가격은 소장가격의 70%로 자동 반영") Text("※ 대여가격은 소장가격의 60%로 자동 반영")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
Text("※ 콘텐츠의 최소금액은 10캔 입니다") Text("※ 콘텐츠의 최소금액은 5캔 입니다")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@@ -321,6 +343,63 @@ struct ContentCreateView: View {
.padding(.top, 26.7) .padding(.top, 26.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
if !viewModel.isFree {
VStack(spacing: 10) {
Text("미리듣기 시간 설정")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
.frame(maxWidth: .infinity, alignment: .leading)
Text("미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다.")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 13.3) {
VStack(spacing: 5.3) {
Text("시작 시간")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading)
TextField("00:00:00", text: $viewModel.previewStartTime)
.autocapitalization(.none)
.disableAutocorrection(true)
.font(.custom(Font.bold.rawValue, size: 14.6))
.foregroundColor(Color(hex: "777777"))
.padding(.vertical, 16.7)
.padding(.horizontal, 13.3)
.background(Color(hex: "222222"))
.cornerRadius(6.7)
.keyboardType(.default)
.multilineTextAlignment(.center)
}
VStack(spacing: 5.3) {
Text("종료 시간")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading)
TextField("00:00:30", text: $viewModel.previewEndTime)
.autocapitalization(.none)
.disableAutocorrection(true)
.font(.custom(Font.bold.rawValue, size: 14.6))
.foregroundColor(Color(hex: "777777"))
.padding(.vertical, 16.7)
.padding(.horizontal, 13.3)
.background(Color(hex: "222222"))
.cornerRadius(6.7)
.keyboardType(.default)
.multilineTextAlignment(.center)
}
}
.padding(.top, 3.3)
}
.padding(.top, 26.7)
.padding(.horizontal, 13.3)
}
VStack(spacing: 0) { VStack(spacing: 0) {
HStack(alignment: .top, spacing: 0) { HStack(alignment: .top, spacing: 0) {
Text("등록") Text("등록")

View File

@@ -54,10 +54,16 @@ final class ContentCreateViewModel: ObservableObject {
didSet { didSet {
if isFree { if isFree {
priceString = "0" priceString = "0"
isOnlyRental = false
} }
} }
} }
@Published var isOnlyRental = false
@Published var previewStartTime: String = ""
@Published var previewEndTime: String = ""
var placeholder = "내용을 입력하세요" var placeholder = "내용을 입력하세요"
func uploadAudioContent() { func uploadAudioContent() {
@@ -71,7 +77,10 @@ final class ContentCreateViewModel: ObservableObject {
price: price, price: price,
themeId: theme!.id, themeId: theme!.id,
isAdult: isAdult, isAdult: isAdult,
isCommentAvailable: isAvailableComment isOnlyRental: isOnlyRental,
isCommentAvailable: isAvailableComment,
previewStartTime: previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil,
previewEndTime: previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil
) )
var multipartData = [MultipartFormData]() var multipartData = [MultipartFormData]()
@@ -205,12 +214,68 @@ final class ContentCreateViewModel: ObservableObject {
return false return false
} }
if !isFree && price < 10 { if !isFree && price < 5 {
errorMessage = "콘텐츠의 최소금액은 10캔 입니다." errorMessage = "콘텐츠의 최소금액은 5캔 입니다."
isShowPopup = true isShowPopup = true
return false return false
} }
if previewStartTime.count > 0 && previewEndTime.count > 0 {
let startTimeArray = previewStartTime.split(separator: ":")
if startTimeArray.count != 3 {
errorMessage = "미리 듣기 시간 형식은 00:30:00 과 같아야 합니다"
isShowPopup = true
return false
}
for time in startTimeArray {
if time.count != 2 {
errorMessage = "미리 듣기 시간 형식은 00:30:00 과 같아야 합니다"
isShowPopup = true
return false
}
}
let endTimeArray = previewStartTime.split(separator: ":")
if endTimeArray.count != 3 {
errorMessage = "미리 듣기 시간 형식은 00:30:00 과 같아야 합니다"
isShowPopup = true
return false
}
for time in endTimeArray {
if time.count != 2 {
errorMessage = "미리 듣기 시간 형식은 00:30:00 과 같아야 합니다"
isShowPopup = true
return false
}
}
let timeDifference = timeDifference(startTime: previewStartTime, endTime: previewEndTime)
if timeDifference < 30.0 {
errorMessage = "미리 듣기의 최소 시간은 30초 입니다"
isShowPopup = true
return false
}
} else {
if previewStartTime.count > 0 || previewEndTime.count > 0 {
errorMessage = "미리 듣기 시작 시간과 종료 시간 둘 다 입력을 하거나 둘 다 입력 하지 않아야 합니다."
isShowPopup = true
return false
}
}
return true return true
} }
private func timeDifference(startTime: String, endTime: String) -> Double {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "HH:mm:ss"
if let date1 = dateFormatter.date(from: startTime), let date2 = dateFormatter.date(from: endTime) {
return date2.timeIntervalSince(date1)
}
return 0
}
} }

View File

@@ -14,5 +14,8 @@ struct CreateAudioContentRequest: Encodable {
let price: Int let price: Int
let themeId: Int let themeId: Int
let isAdult: Bool let isAdult: Bool
let isOnlyRental: Bool
let isCommentAvailable: Bool let isCommentAvailable: Bool
let previewStartTime: String?
let previewEndTime: String?
} }

View File

@@ -0,0 +1,110 @@
//
// ContentCurationView.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
import SwiftUI
struct ContentCurationView: View {
@StateObject var viewModel = ContentCurationViewModel()
let title: String
let curationId: Int
let columns = [
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top)
]
var body: some View {
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
DetailNavigationBar(title: title)
HStack(spacing: 13.3) {
Spacer()
Text("최신순")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(
Color(hex: "e2e2e2")
.opacity(viewModel.sort == .NEWEST ? 1 : 0.5)
)
.onTapGesture {
if viewModel.sort != .NEWEST {
viewModel.sort = .NEWEST
}
}
Text("높은 가격순")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(
Color(hex: "e2e2e2")
.opacity(viewModel.sort == .PRICE_HIGH ? 1 : 0.5)
)
.onTapGesture {
if viewModel.sort != .PRICE_HIGH {
viewModel.sort = .PRICE_HIGH
}
}
Text("낮은 가격순")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(
Color(hex: "e2e2e2")
.opacity(viewModel.sort == .PRICE_LOW ? 1 : 0.5)
)
.onTapGesture {
if viewModel.sort != .PRICE_LOW {
viewModel.sort = .PRICE_LOW
}
}
}
.padding(.vertical, 13.3)
.padding(.horizontal, 20)
.background(Color(hex: "161616"))
.padding(.top, 13.3)
HStack(spacing: 0) {
Text("전체")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "ff5c49"))
.padding(.leading, 8)
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
.padding(.leading, 2)
Spacer()
}
.padding(.vertical, 13.3)
.padding(.horizontal, 20)
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 13.3) {
ForEach(0..<viewModel.contentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.contentList[index])
.onAppear {
if index == viewModel.contentList.count - 1 {
viewModel.getContentList()
}
}
}
}
}
}
.onAppear {
viewModel.curationId = curationId
viewModel.getContentList()
}
}
}
}

View File

@@ -0,0 +1,95 @@
//
// ContentCurationViewModel.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
import Foundation
import Combine
final class ContentCurationViewModel: ObservableObject {
enum Sort: String {
case NEWEST, PRICE_HIGH, PRICE_LOW
}
private let repository = ContentRepository()
private var subscription = Set<AnyCancellable>()
@Published var errorMessage = ""
@Published var isShowPopup = false
@Published var isLoading = false
@Published var totalCount = 0
@Published var sort = Sort.NEWEST {
didSet {
page = 1
isLast = false
getContentList()
}
}
@Published var contentList: [GetAudioContentMainItem] = []
var curationId = 0
var page = 1
var isLast = false
private let pageSize = 10
func getContentList() {
if (!isLast && !isLoading) {
isLoading = true
repository.getAudioContentListByCurationId(
curationId: curationId,
page: page,
size: pageSize,
sort: sort
)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<GetCurationContentResponse>.self, from: responseData)
if let data = decoded.data, decoded.success {
if page == 1 {
self.contentList.removeAll()
}
if !data.items.isEmpty {
page += 1
self.totalCount = data.totalCount
self.contentList.append(contentsOf: data.items)
} else {
isLast = true
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
}
self.isLoading = false
}
.store(in: &subscription)
}
}
}

View File

@@ -0,0 +1,11 @@
//
// GetCurationContentResponse.swift
// SodaLive
//
// Created by klaus on 2023/09/27.
//
struct GetCurationContentResponse: Decodable {
let totalCount: Int
let items: [GetAudioContentMainItem]
}

View File

@@ -9,51 +9,66 @@ import SwiftUI
import Kingfisher import Kingfisher
struct AudioContentCommentItemView: View { struct AudioContentCommentItemView: View {
let contentCreatorId: Int
let comment: GetAudioContentCommentListItem let audioContentId: Int
let commentItem: GetAudioContentCommentListItem
let isReplyComment: Bool let isReplyComment: Bool
let isShowPopupMenuButton: Bool
let modifyComment: (Int, String) -> Void
let onClickDelete: (Int) -> Void
@State var isShowPopupMenu: Bool = false
@State var isModeModify: Bool = false
@State var comment: String = ""
var body: some View { var body: some View {
ZStack(alignment: .topTrailing) {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 6.7) { HStack(spacing: 6.7) {
KFImage(URL(string: comment.profileUrl)) KFImage(URL(string: commentItem.profileUrl))
.resizable() .resizable()
.frame(width: 40, height: 40) .frame(width: 40, height: 40)
.clipShape(Circle()) .clipShape(Circle())
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
Text(comment.nickname) Text(commentItem.nickname)
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
Text(comment.date) Text(commentItem.date)
.font(.custom(Font.medium.rawValue, size: 10.3)) .font(.custom(Font.medium.rawValue, size: 10.3))
.foregroundColor(Color(hex: "525252")) .foregroundColor(Color(hex: "525252"))
.padding(.top, 4) .padding(.top, 4)
} }
Spacer() Spacer()
if isShowPopupMenuButton && (contentCreatorId == UserDefaults.int(forKey: .userId) || commentItem.writerId == UserDefaults.int(forKey: .userId)) {
Image("ic_seemore_vertical")
.onTapGesture { isShowPopupMenu.toggle() }
}
} }
if comment.donationCan > 0 { if commentItem.donationCan > 0 {
HStack(spacing: 3) { HStack(spacing: 3) {
Image("ic_can") Image("ic_can")
.resizable() .resizable()
.frame(width: 13.3, height: 13.3) .frame(width: 13.3, height: 13.3)
Text("\(comment.donationCan)") Text("\(commentItem.donationCan)")
.font(.custom(Font.bold.rawValue, size: 12)) .font(.custom(Font.bold.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
} }
.padding(.horizontal, 6.7) .padding(.horizontal, 6.7)
.padding(.vertical, 2.7) .padding(.vertical, 2.7)
.background( .background(
comment.donationCan >= 100000 ? Color(hex: "973a3a") : commentItem.donationCan >= 100000 ? Color(hex: "973a3a") :
comment.donationCan >= 50000 ? Color(hex: "d85e37") : commentItem.donationCan >= 50000 ? Color(hex: "d85e37") :
comment.donationCan >= 10000 ? Color(hex: "d38c38") : commentItem.donationCan >= 10000 ? Color(hex: "d38c38") :
comment.donationCan >= 5000 ? Color(hex: "59548f") : commentItem.donationCan >= 5000 ? Color(hex: "59548f") :
comment.donationCan >= 1000 ? Color(hex: "4d6aa4") : commentItem.donationCan >= 1000 ? Color(hex: "4d6aa4") :
comment.donationCan >= 500 ? Color(hex: "2d7390") : commentItem.donationCan >= 500 ? Color(hex: "2d7390") :
Color(hex: "548f7d") Color(hex: "548f7d")
) )
.cornerRadius(10.7) .cornerRadius(10.7)
@@ -62,19 +77,61 @@ struct AudioContentCommentItemView: View {
} }
HStack(spacing: 0) { HStack(spacing: 0) {
if isModeModify {
HStack(spacing: 0) {
TextField("댓글을 입력해 보세요.", text: $comment)
.autocapitalization(.none)
.disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
.accentColor(Color(hex: "3bb9f1"))
.keyboardType(.default)
.padding(.horizontal, 13.3)
Spacer()
Image("btn_message_send")
.resizable()
.frame(width: 35, height: 35)
.padding(6.7)
.onTapGesture {
hideKeyboard()
if commentItem.comment != comment {
modifyComment(commentItem.id, comment)
}
isModeModify = false
}
}
.background(Color(hex: "232323"))
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.strokeBorder(lineWidth: 1)
.foregroundColor(Color(hex: "3bb9f1"))
)
} else {
VStack(alignment: .leading, spacing: 13.3) { VStack(alignment: .leading, spacing: 13.3) {
Text(comment.comment) Text(commentItem.comment)
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
.padding(.top, comment.donationCan > 0 ? 0 : 13.3) .padding(.top, commentItem.donationCan > 0 ? 0 : 13.3)
if !isReplyComment { if !isReplyComment {
Text(comment.replyCount > 0 ? "답글 \(comment.replyCount)" : "답글 쓰기") NavigationLink(
destination: AudioContentListReplyView(
creatorId: contentCreatorId,
audioContentId: audioContentId,
parentComment: commentItem
)
) {
Text(commentItem.replyCount > 0 ? "답글 \(commentItem.replyCount)" : "답글 쓰기")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff")) .foregroundColor(Color(hex: "9970ff"))
} }
} }
}
}
Spacer() Spacer()
} }
@@ -85,5 +142,35 @@ struct AudioContentCommentItemView: View {
.frame(height: 0.5) .frame(height: 0.5)
.padding(.top, 16.7) .padding(.top, 16.7)
} }
if isShowPopupMenu {
VStack(spacing: 10) {
if commentItem.writerId == UserDefaults.int(forKey: .userId) {
Text("수정")
.font(.custom(Font.medium.rawValue, size: 14))
.foregroundColor(Color(hex: "777777"))
.onTapGesture {
isModeModify = true
isShowPopupMenu = false
}
}
if contentCreatorId == UserDefaults.int(forKey: .userId) ||
commentItem.writerId == UserDefaults.int(forKey: .userId)
{
Text("삭제")
.font(.custom(Font.medium.rawValue, size: 14))
.foregroundColor(Color(hex: "777777"))
.onTapGesture {
onClickDelete(commentItem.id)
isShowPopupMenu = false
}
}
}
.padding(10)
.background(Color(hex: "222222"))
}
}
.onAppear { comment = commentItem.comment }
} }
} }

View File

@@ -11,10 +11,15 @@ import Kingfisher
struct AudioContentCommentListView: View { struct AudioContentCommentListView: View {
@Binding var isPresented: Bool @Binding var isPresented: Bool
let creatorId: Int
let audioContentId: Int let audioContentId: Int
@StateObject var viewModel = AudioContentCommentListViewModel() @StateObject var viewModel = AudioContentCommentListViewModel()
@State private var commentId: Int = 0
@State private var isShowDeletePopup: Bool = false
var body: some View { var body: some View {
NavigationView { NavigationView {
ZStack { ZStack {
@@ -59,7 +64,7 @@ struct AudioContentCommentListView: View {
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
.accentColor(Color(hex: "9970ff")) .accentColor(Color(hex: "3bb9f1"))
.keyboardType(.default) .keyboardType(.default)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
@@ -79,7 +84,7 @@ struct AudioContentCommentListView: View {
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.strokeBorder(lineWidth: 1) .strokeBorder(lineWidth: 1)
.foregroundColor(Color(hex: "9970ff")) .foregroundColor(Color(hex: "3bb9f1"))
) )
Spacer() Spacer()
@@ -97,13 +102,22 @@ struct AudioContentCommentListView: View {
LazyVStack(spacing: 13.3) { LazyVStack(spacing: 13.3) {
ForEach(0..<viewModel.commentList.count, id: \.self) { index in ForEach(0..<viewModel.commentList.count, id: \.self) { index in
let comment = viewModel.commentList[index] let comment = viewModel.commentList[index]
NavigationLink { VStack {
AudioContentListReplyView( AudioContentCommentItemView(
contentCreatorId: creatorId,
audioContentId: audioContentId, audioContentId: audioContentId,
parentComment: comment commentItem: comment,
isReplyComment: false,
isShowPopupMenuButton: true,
modifyComment: { commentId, comment in
hideKeyboard()
viewModel.modifyComment(commentId: commentId, audioContentId: audioContentId, comment: comment)
},
onClickDelete: {
commentId = $0
isShowDeletePopup = true
}
) )
} label: {
AudioContentCommentItemView(comment: comment, isReplyComment: false)
.padding(.horizontal, 26.7) .padding(.horizontal, 26.7)
.onAppear { .onAppear {
if index == viewModel.commentList.count - 1 { if index == viewModel.commentList.count - 1 {
@@ -116,6 +130,24 @@ struct AudioContentCommentListView: View {
} }
} }
if isShowDeletePopup && commentId > 0 {
SodaDialog(
title: "댓글 삭제",
desc: "삭제하시겠습니까?",
confirmButtonTitle: "삭제",
confirmButtonAction: {
viewModel.modifyComment(commentId: commentId, audioContentId: audioContentId, isActive: false)
commentId = 0
isShowDeletePopup = false
},
cancelButtonTitle: "취소",
cancelButtonAction: {
commentId = 0
isShowDeletePopup = false
}
)
}
if viewModel.isLoading { if viewModel.isLoading {
LoadingView() LoadingView()
} }

View File

@@ -121,4 +121,77 @@ class AudioContentCommentListViewModel: ObservableObject {
} }
.store(in: &subscription) .store(in: &subscription)
} }
func modifyComment(
commentId: Int,
audioContentId: Int,
comment: String? = nil,
isActive: Bool? = nil
) {
if comment == nil && isActive == nil {
errorMessage = "변경사항이 없습니다."
isShowPopup = true
return
}
if let comment = comment, comment.trimmingCharacters(in: .whitespaces).isEmpty {
errorMessage = "내용을 입력하세요."
isShowPopup = true
return
}
isLoading = true
var request = ModifyCommentRequest(commentId: commentId)
if let comment = comment {
request.comment = comment
}
if let isActive = isActive {
request.isActive = isActive
}
repository.modifyComment(request: request)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
self.isLoading = false
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
if decoded.success {
self.comment = ""
self.page = 1
self.isLast = false
self.commentList.removeAll()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.getCommentList()
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.isLoading = false
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
}
}
.store(in: &subscription)
}
} }

View File

@@ -10,12 +10,16 @@ import Kingfisher
struct AudioContentListReplyView: View { struct AudioContentListReplyView: View {
let creatorId: Int
let audioContentId: Int let audioContentId: Int
let parentComment: GetAudioContentCommentListItem let parentComment: GetAudioContentCommentListItem
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode> @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
@StateObject var viewModel = AudioContentListReplyViewModel() @StateObject var viewModel = AudioContentListReplyViewModel()
@State private var commentId: Int = 0
@State private var isShowDeletePopup: Bool = false
var body: some View { var body: some View {
ZStack { ZStack {
VStack(spacing: 0) { VStack(spacing: 0) {
@@ -53,7 +57,7 @@ struct AudioContentListReplyView: View {
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
.accentColor(Color(hex: "9970ff")) .accentColor(Color(hex: "3bb9f1"))
.keyboardType(.default) .keyboardType(.default)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
@@ -73,7 +77,7 @@ struct AudioContentListReplyView: View {
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.strokeBorder(lineWidth: 1) .strokeBorder(lineWidth: 1)
.foregroundColor(Color(hex: "9970ff")) .foregroundColor(Color(hex: "3bb9f1"))
) )
Spacer() Spacer()
@@ -87,7 +91,15 @@ struct AudioContentListReplyView: View {
.padding(.bottom, 13.3) .padding(.bottom, 13.3)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
AudioContentCommentItemView(comment: parentComment, isReplyComment: true) AudioContentCommentItemView(
contentCreatorId: creatorId,
audioContentId: audioContentId,
commentItem: parentComment,
isReplyComment: true,
isShowPopupMenuButton: false,
modifyComment: { _, _ in },
onClickDelete: { _ in }
)
.padding(.horizontal, 26.7) .padding(.horizontal, 26.7)
.padding(.bottom, 13.3) .padding(.bottom, 13.3)
@@ -95,7 +107,21 @@ struct AudioContentListReplyView: View {
LazyVStack(spacing: 13.3) { LazyVStack(spacing: 13.3) {
ForEach(0..<viewModel.commentList.count, id: \.self) { index in ForEach(0..<viewModel.commentList.count, id: \.self) { index in
let comment = viewModel.commentList[index] let comment = viewModel.commentList[index]
AudioContentCommentItemView(comment: comment, isReplyComment: true) AudioContentCommentItemView(
contentCreatorId: creatorId,
audioContentId: audioContentId,
commentItem: comment,
isReplyComment: true,
isShowPopupMenuButton: true,
modifyComment: { commentId, comment in
hideKeyboard()
viewModel.modifyComment(commentId: commentId, audioContentId: audioContentId, comment: comment)
},
onClickDelete: {
commentId = $0
isShowDeletePopup = true
}
)
.padding(.horizontal, 40) .padding(.horizontal, 40)
.onAppear { .onAppear {
if index == viewModel.commentList.count - 1 { if index == viewModel.commentList.count - 1 {
@@ -108,6 +134,28 @@ struct AudioContentListReplyView: View {
} }
.navigationTitle("") .navigationTitle("")
.navigationBarBackButtonHidden() .navigationBarBackButtonHidden()
if isShowDeletePopup && commentId > 0 {
SodaDialog(
title: "댓글 삭제",
desc: "삭제하시겠습니까?",
confirmButtonTitle: "삭제",
confirmButtonAction: {
viewModel.modifyComment(commentId: commentId, audioContentId: audioContentId, isActive: false)
commentId = 0
isShowDeletePopup = false
},
cancelButtonTitle: "취소",
cancelButtonAction: {
commentId = 0
isShowDeletePopup = false
}
)
}
if viewModel.isLoading {
LoadingView()
}
} }
.onAppear { .onAppear {
viewModel.audioContentId = audioContentId viewModel.audioContentId = audioContentId

View File

@@ -121,4 +121,77 @@ final class AudioContentListReplyViewModel: ObservableObject {
} }
.store(in: &subscription) .store(in: &subscription)
} }
func modifyComment(
commentId: Int,
audioContentId: Int,
comment: String? = nil,
isActive: Bool? = nil
) {
if comment == nil && isActive == nil {
errorMessage = "변경사항이 없습니다."
isShowPopup = true
return
}
if let comment = comment, comment.trimmingCharacters(in: .whitespaces).isEmpty {
errorMessage = "내용을 입력하세요."
isShowPopup = true
return
}
isLoading = true
var request = ModifyCommentRequest(commentId: commentId)
if let comment = comment {
request.comment = comment
}
if let isActive = isActive {
request.isActive = isActive
}
repository.modifyComment(request: request)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
self.isLoading = false
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
if decoded.success {
self.comment = ""
self.page = 1
self.isLast = false
self.commentList.removeAll()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.getCommentList()
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
}
self.isShowPopup = true
}
} catch {
self.isLoading = false
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
self.isShowPopup = true
}
}
.store(in: &subscription)
}
} }

View File

@@ -58,7 +58,7 @@ struct ContentDetailCommentView: View {
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
.accentColor(Color(hex: "9970ff")) .accentColor(Color(hex: "3bb9f1"))
.keyboardType(.default) .keyboardType(.default)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
@@ -78,7 +78,7 @@ struct ContentDetailCommentView: View {
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.strokeBorder(lineWidth: 1) .strokeBorder(lineWidth: 1)
.foregroundColor(Color(hex: "9970ff")) .foregroundColor(Color(hex: "3bb9f1"))
) )
} }

View File

@@ -0,0 +1,12 @@
//
// ModifyCommentRequest.swift
// SodaLive
//
// Created by klaus on 2023/09/08.
//
struct ModifyCommentRequest: Encodable {
let commentId: Int
var comment: String? = nil
var isActive: Bool? = nil
}

View File

@@ -43,7 +43,7 @@ struct ContentDetailOtherContentView: View {
} }
.padding(13.3) .padding(13.3)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.background(Color(hex: "2b2635")) .background(Color(hex: "13181b"))
.cornerRadius(4.7) .cornerRadius(4.7)
} }
} }

View File

@@ -12,6 +12,7 @@ import Sliders
struct ContentDetailPlayView: View { struct ContentDetailPlayView: View {
let audioContent: GetAudioContentDetailResponse let audioContent: GetAudioContentDetailResponse
let isAlertPreview: Bool
@Binding var isShowPreviewAlert: Bool @Binding var isShowPreviewAlert: Bool
@StateObject var contentPlayManager = ContentPlayManager.shared @StateObject var contentPlayManager = ContentPlayManager.shared
@@ -34,7 +35,7 @@ struct ContentDetailPlayView: View {
) )
.cornerRadius(10.7, corners: [.topLeft, .topRight]) .cornerRadius(10.7, corners: [.topLeft, .topRight])
Image(isPlaying() ? "btn_audio_content_pause" : "btn_audio_content_play") Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
.onTapGesture { .onTapGesture {
if isPlaying() { if isPlaying() {
contentPlayManager.pauseAudio() contentPlayManager.pauseAudio()

View File

@@ -10,6 +10,7 @@ import SwiftUI
struct ContentDetailPurchaseButton: View { struct ContentDetailPurchaseButton: View {
let price: Int let price: Int
let isOnlyRental: Bool
var body: some View { var body: some View {
HStack(spacing: 0) { HStack(spacing: 0) {
@@ -26,7 +27,7 @@ struct ContentDetailPurchaseButton: View {
.font(.custom(Font.light.rawValue, size: 12)) .font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
Text(" 구매하기") Text(isOnlyRental ? " 대여하기" : " 구매하기")
.font(.custom(Font.bold.rawValue, size: 14.7)) .font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(.white) .foregroundColor(.white)
} }

View File

@@ -66,9 +66,9 @@ struct ContentDetailView: View {
viewModel.getAudioContentDetail() viewModel.getAudioContentDetail()
}) { }) {
VStack(spacing: 0) { VStack(spacing: 0) {
LazyVStack(spacing: 0) {
ContentDetailPlayView( ContentDetailPlayView(
audioContent: audioContent, audioContent: audioContent,
isAlertPreview: audioContent.price > 0 && !audioContent.existOrdered && audioContent.orderType == nil && audioContent.creator.creatorId != UserDefaults.int(forKey: .userId),
isShowPreviewAlert: $viewModel.isShowPreviewAlert isShowPreviewAlert: $viewModel.isShowPreviewAlert
) )
@@ -85,13 +85,15 @@ struct ContentDetailView: View {
}, },
onClickDonation: { viewModel.isShowDonationPopup = true } onClickDonation: { viewModel.isShowDonationPopup = true }
) )
.padding(.horizontal, 13.3)
if audioContent.price > 0 && if audioContent.price > 0 &&
!audioContent.existOrdered && !audioContent.existOrdered &&
audioContent.orderType == nil && audioContent.orderType == nil &&
audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) { audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) {
ContentDetailPurchaseButton(price: audioContent.price) ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental)
.contentShape(Rectangle()) .contentShape(Rectangle())
.padding(.horizontal, 13.3)
.onTapGesture { isShowOrderView = true } .onTapGesture { isShowOrderView = true }
} }
@@ -108,19 +110,13 @@ struct ContentDetailView: View {
.cornerRadius(5.3) .cornerRadius(5.3)
.padding(.top, 13.3) .padding(.top, 13.3)
.contentShape(Rectangle()) .contentShape(Rectangle())
.padding(.horizontal, 13.3)
.onTapGesture { .onTapGesture {
if audioContent.commentCount > 0 { if audioContent.commentCount > 0 {
isShowCommentListView = true isShowCommentListView = true
} }
} }
} }
}
.padding(.horizontal, 13.3)
Rectangle()
.foregroundColor(Color(hex: "232323"))
.frame(height: 6.7)
.padding(.top, 24)
ContentDetailOtherContentView( ContentDetailOtherContentView(
title: "크리에이터의 다른 콘텐츠", title: "크리에이터의 다른 콘텐츠",
@@ -165,6 +161,7 @@ struct ContentDetailView: View {
ContentOrderDialogView( ContentOrderDialogView(
isShowing: $isShowOrderView, isShowing: $isShowOrderView,
price: audioContent.price, price: audioContent.price,
isOnlyRental: audioContent.isOnlyRental,
onTapPurchase: { onTapPurchase: {
viewModel.orderType = $0 viewModel.orderType = $0
isShowOrderConfirmView = true isShowOrderConfirmView = true
@@ -190,6 +187,7 @@ struct ContentDetailView: View {
isShowing: $isShowOrderConfirmView, isShowing: $isShowOrderConfirmView,
audioContent: audioContent, audioContent: audioContent,
orderType: orderType, orderType: orderType,
isOnlyRental: audioContent.isOnlyRental,
onClickConfirm: { onClickConfirm: {
viewModel.order(orderType: orderType) viewModel.order(orderType: orderType)
} }
@@ -282,6 +280,7 @@ struct ContentDetailView: View {
content: { content: {
AudioContentCommentListView( AudioContentCommentListView(
isPresented: $isShowCommentListView, isPresented: $isShowCommentListView,
creatorId: viewModel.audioContent!.creator.creatorId,
audioContentId: viewModel.audioContent!.contentId audioContentId: viewModel.audioContent!.contentId
) )
} }

View File

@@ -280,7 +280,7 @@ final class ContentDetailViewModel: ObservableObject {
isShowPreviewAlert = false isShowPreviewAlert = false
isLoading = true isLoading = true
repository.orderAudioContent(audioContentId: contentId, orderType: orderType) repository.orderAudioContent(contentId: contentId, orderType: orderType)
.sink { result in .sink { result in
switch result { switch result {
case .finished: case .finished:
@@ -298,13 +298,18 @@ final class ContentDetailViewModel: ObservableObject {
if decoded.success { if decoded.success {
self.orderType = nil self.orderType = nil
self.errorMessage = "구매가 완료되었습니다." self.errorMessage = orderType == .RENTAL ? "대여가 완료되었습니다." : "구매가 완료되었습니다."
self.isShowPopup = true self.isShowPopup = true
self.getAudioContentDetail() self.getAudioContentDetail()
ContentPlayManager.shared.conditionalStopAudio(contentId: contentId) ContentPlayManager.shared.conditionalStopAudio(contentId: contentId)
} else { } else {
if let message = decoded.message { if let message = decoded.message {
self.errorMessage = message self.errorMessage = message
if message.contains("캔이 부족합니다") {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
AppState.shared.setAppStep(step: .canCharge(refresh: {}, afterCompletionToGoBack: true))
}
}
} else { } else {
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다." self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
} }

View File

@@ -14,6 +14,7 @@ struct ContentOrderConfirmDialogView: View {
let audioContent: GetAudioContentDetailResponse let audioContent: GetAudioContentDetailResponse
let orderType: OrderType let orderType: OrderType
let isOnlyRental: Bool
let onClickConfirm: () -> Void let onClickConfirm: () -> Void
var body: some View { var body: some View {
@@ -90,9 +91,15 @@ struct ContentOrderConfirmDialogView: View {
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
Text("\(orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.7)) : audioContent.price)") if orderType == .RENTAL {
Text("\(isOnlyRental ? audioContent.price : Int(ceil(Double(audioContent.price) * 0.6)))")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
} else {
Text("\(audioContent.price)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
}
Spacer() Spacer()
} }

View File

@@ -12,6 +12,7 @@ struct ContentOrderDialogView: View {
@Binding var isShowing: Bool @Binding var isShowing: Bool
let price: Int let price: Int
let isOnlyRental: Bool
let onTapPurchase: (OrderType) -> Void let onTapPurchase: (OrderType) -> Void
var body: some View { var body: some View {
@@ -31,7 +32,7 @@ struct ContentOrderDialogView: View {
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white) .foregroundColor(.white)
Text("(이용기간 7일)") Text("(이용기간 15일)")
.font(.custom(Font.light.rawValue, size: 12)) .font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
} }
@@ -43,7 +44,7 @@ struct ContentOrderDialogView: View {
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
Text("\(Int(ceil(Double(price) * 0.7)))") Text(isOnlyRental ? "\(price)" : "\(Int(ceil(Double(price) * 0.6)))")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
} }
@@ -57,6 +58,7 @@ struct ContentOrderDialogView: View {
} }
} }
if !isOnlyRental {
HStack(spacing: 0) { HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 5.3) { VStack(alignment: .leading, spacing: 5.3) {
Text("소장") Text("소장")
@@ -71,7 +73,7 @@ struct ContentOrderDialogView: View {
Spacer() Spacer()
HStack(spacing: 8) { HStack(spacing: 8) {
Image("ic_coin_w") Image("ic_can")
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
@@ -89,6 +91,7 @@ struct ContentOrderDialogView: View {
} }
} }
} }
}
.padding(24) .padding(24)
.background(Color(hex: "222222")) .background(Color(hex: "222222"))
} }

View File

@@ -19,6 +19,7 @@ struct GetAudioContentDetailResponse: Decodable {
let duration: String let duration: String
let isAdult: Bool let isAdult: Bool
let isMosaic: Bool let isMosaic: Bool
let isOnlyRental: Bool
let existOrdered: Bool let existOrdered: Bool
let orderType: OrderType? let orderType: OrderType?
let remainingTime: String? let remainingTime: String?

View File

@@ -12,11 +12,12 @@ import Kingfisher
struct LiveRoomDonationDialogView: View { struct LiveRoomDonationDialogView: View {
@AppStorage("can") private var can: Int = UserDefaults.int(forKey: .can)
@State private var donationCan = "" @State private var donationCan = ""
@State private var donationMessage = "" @State private var donationMessage = ""
@State private var isShowErrorPopup = false @State private var isShowErrorPopup = false
@State private var errorMessage = "" @State private var errorMessage = ""
@State private var can = 0
@Binding var isShowing: Bool @Binding var isShowing: Bool
let isAudioContentDonation: Bool let isAudioContentDonation: Bool
@@ -59,7 +60,7 @@ struct LiveRoomDonationDialogView: View {
Image("ic_forward") Image("ic_forward")
} }
.onTapGesture { .onTapGesture {
AppState.shared.setAppStep(step: .canCharge(refresh: {})) AppState.shared.setAppStep(step: .canCharge(refresh: {}, afterCompletionToGoBack: true))
self.isShowing = false self.isShowing = false
} }
} }
@@ -243,9 +244,6 @@ struct LiveRoomDonationDialogView: View {
} }
.offset(y: isAudioContentDonation ? 0 : 0 - keyboardHandler.keyboardHeight) .offset(y: isAudioContentDonation ? 0 : 0 - keyboardHandler.keyboardHeight)
} }
.onAppear {
self.can = UserDefaults.int(forKey: .can)
}
} }
func limitText() { func limitText() {

View File

@@ -8,7 +8,7 @@
import Foundation import Foundation
struct AudioContentDonationRequest: Encodable { struct AudioContentDonationRequest: Encodable {
let audioContentId: Int let contentId: Int
let donationCan: Int let donationCan: Int
let comment: String let comment: String
let container: String = "ios" let container: String = "ios"

View File

@@ -13,10 +13,27 @@ struct ContentMainCurationItemView: View {
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 0) {
Text(item.title) Text(item.title)
.font(.custom(Font.bold.rawValue, size: 18.3)) .font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
.onTapGesture {
AppState.shared
.setAppStep(
step: .curationAll(
title: item.title,
curationId: item.curationId
)
)
}
}
Text(item.description) Text(item.description)
.font(.custom(Font.medium.rawValue, size: 13)) .font(.custom(Font.medium.rawValue, size: 13))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))

View File

@@ -14,8 +14,8 @@ struct ContentMainCurationView: View {
var body: some View { var body: some View {
LazyVStack(spacing: 40) { LazyVStack(spacing: 40) {
ForEach(0..<items.count, id: \.self) { ForEach(0..<items.count, id: \.self) {
let item = items[$0] ContentMainCurationItemView(item: items[$0])
ContentMainCurationItemView(item: item) .padding(.horizontal, 13.3)
} }
} }
} }

View File

@@ -57,7 +57,6 @@ struct ContentMainItemView_Previews: PreviewProvider {
contentId: 2, contentId: 2,
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
title: "ㅓ처랴햐햫햐햐", title: "ㅓ처랴햐햫햐햐",
isAdult: true,
creatorId: 8, creatorId: 8,
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
creatorNickname: "유저2" creatorNickname: "유저2"

Some files were not shown because too many files have changed in this diff Show More