From 256f65e3708d7790304192e437d0465c9b08cf56 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 16 May 2025 21:28:27 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=95=EC=B1=85=20=EB=93=B1=EB=A1=9D=20-=20=EC=A7=80?= =?UTF-8?q?=EA=B8=89=EC=9C=A0=ED=98=95(=EB=A7=A4=EC=9D=BC,=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4),=20=EC=B0=B8=EC=97=AC=20=EA=B0=80=EB=8A=A5=20?= =?UTF-8?q?=ED=9A=9F=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Promotion/PointPolicyView.vue | 106 +++++++++++++++++++++--- 1 file changed, 96 insertions(+), 10 deletions(-) diff --git a/src/views/Promotion/PointPolicyView.vue b/src/views/Promotion/PointPolicyView.vue index 5ac9aed..713dcbd 100644 --- a/src/views/Promotion/PointPolicyView.vue +++ b/src/views/Promotion/PointPolicyView.vue @@ -39,6 +39,10 @@ {{ item.title }} + + @@ -47,6 +51,10 @@ {{ item.threshold }} 번 + + @@ -101,6 +109,19 @@ required /> + + + + + + + + @@ -210,24 +238,51 @@ export default { show_write_dialog: false, action_type_list: [ - { - name: '회원가입', - value: 'SIGN_UP' - }, { name: '본인인증', value: 'USER_AUTHENTICATION' }, + { + name: '콘텐츠 댓글', + value: 'CONTENT_COMMENT' + }, + { + name: '구매한 콘텐츠 댓글', + value: 'ORDER_CONTENT_COMMENT' + }, + { + name: '라이브 연속 청취 30분', + value: 'LIVE_CONTINUOUS_LISTEN_30' + }, ], action_type_map: { - 'SIGN_UP': '회원가입', - 'USER_AUTHENTICATION': '본인인증' + 'USER_AUTHENTICATION': '본인인증', + 'CONTENT_COMMENT': '콘텐츠 댓글', + 'ORDER_CONTENT_COMMENT': '구매한 콘텐츠 댓글', + 'LIVE_CONTINUOUS_LISTEN_30': 'LIVE_CONTINUOUS_LISTEN_30', + }, + + policy_type_list: [ + { + name: '매일', + value: 'DAILY' + }, + { + name: '전체', + value: 'TOTAL' + }, + ], + policy_type_map: { + 'DAILY': '매일', + 'TOTAL': '전체', }, point_policy: { title: '', + policy_type: '', action_type: '', threshold: 0, + available_count: 0, point: 0, start_date: '', end_date: '' @@ -245,6 +300,12 @@ export default { sortable: false, value: 'title', }, + { + text: '지급유형', + align: 'center', + sortable: false, + value: 'policyType', + }, { text: '액션', align: 'center', @@ -257,6 +318,12 @@ export default { sortable: false, value: 'threshold', }, + { + text: '참여 가능 횟수', + align: 'center', + sortable: false, + value: 'availableCount', + }, { text: '기간', align: 'center', @@ -306,8 +373,10 @@ export default { this.selected_point_policy = item; this.point_policy = { title: item.title, + policy_type: item.policyType, action_type: item.actionType, threshold: item.threshold, + available_count: item.availableCount, point: item.pointAmount, start_date: item.startDate, end_date: item.endDate, @@ -322,18 +391,23 @@ export default { return } + if (this.point_policy.policy_type.trim() === '') { + this.notifyError('지급유형을 선택하세요') + return + } + if (this.point_policy.action_type.trim() === '') { this.notifyError('액션을 선택하세요') return } if (isNaN(this.point_policy.threshold)) { - this.notifyError('참여 횟수는 숫자만 입력 가능합니다.') + this.notifyError('참여 해야하는 횟수는 숫자만 입력 가능합니다.') return } if (this.point_policy.threshold <= 0) { - this.notifyError('참여 횟수는 1이상 입력 가능합니다.') + this.notifyError('참여 해야하는 횟수는 1이상 입력 가능합니다.') return } @@ -342,6 +416,16 @@ export default { return } + if (isNaN(this.point_policy.available_count)) { + this.notifyError('참여 가능 횟수는 숫자만 입력 가능합니다.') + return + } + + if (this.point_policy.available_count <= 0) { + this.notifyError('참여 가능 횟수는 1이상 입력 가능합니다.') + return + } + if (this.point_policy.start_date.trim() === '') { this.notifyError('정책 시작 날짜를 입력하세요') return @@ -354,8 +438,10 @@ export default { this.selected_charge_event = null; this.point_policy = { title: '', + policy_type: '', action_type: '', threshold: 0, + available_count: 0, point: 0, start_date: '', end_date: '' @@ -371,8 +457,10 @@ export default { try { const request = { 'title': this.point_policy.title, + 'policyType': this.point_policy.policy_type, 'actionType': this.point_policy.action_type, 'threshold': this.point_policy.threshold, + 'availableCount': this.point_policy.available_count, 'pointAmount': this.point_policy.point, 'startDate': this.point_policy.start_date, 'endDate': this.point_policy.end_date @@ -418,8 +506,6 @@ export default { request.isActive = this.point_policy.is_active } - console.log(request); - const res = await api.updatePointPolicyList(this.selected_point_policy.id, request) if (res.status === 200 && res.data.success === true) { -- 2.40.1 From d8e75f299bf133a405de72740638f3e033920593 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Sat, 17 May 2025 17:35:26 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20-=20=EC=88=98=EC=A0=95=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=9D=84=20=EB=88=8C=EB=A0=80=EB=8B=A4=EA=B0=80=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=ED=96=88=EC=9D=84=20=EB=95=8C=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EA=B0=80=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=95=84=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=EC=9D=B4=20=EB=B6=88=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Promotion/PointPolicyView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Promotion/PointPolicyView.vue b/src/views/Promotion/PointPolicyView.vue index 713dcbd..ed0d875 100644 --- a/src/views/Promotion/PointPolicyView.vue +++ b/src/views/Promotion/PointPolicyView.vue @@ -435,7 +435,6 @@ export default { }, cancel() { - this.selected_charge_event = null; this.point_policy = { title: '', policy_type: '', @@ -447,6 +446,7 @@ export default { end_date: '' } this.show_write_dialog = false + this.selected_point_policy = null; }, async submit() { -- 2.40.1 From d3f98ec9cb1c81f7ad373b0a20fad73c2c03d733 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Sat, 17 May 2025 17:51:24 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20-=20=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/point_policy.js | 2 +- src/views/Promotion/PointPolicyView.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/point_policy.js b/src/api/point_policy.js index 2c03df5..1a7e485 100644 --- a/src/api/point_policy.js +++ b/src/api/point_policy.js @@ -1,7 +1,7 @@ import Vue from 'vue'; async function getPointPolicyList(page) { - return Vue.axios.get("/admin/point-policies?page=" + page + "&page_size=20") + return Vue.axios.get("/admin/point-policies?page=" + (page - 1) + "&page_size=20") } async function createPointPolicyList(request) { diff --git a/src/views/Promotion/PointPolicyView.vue b/src/views/Promotion/PointPolicyView.vue index ed0d875..59842d6 100644 --- a/src/views/Promotion/PointPolicyView.vue +++ b/src/views/Promotion/PointPolicyView.vue @@ -259,7 +259,7 @@ export default { 'USER_AUTHENTICATION': '본인인증', 'CONTENT_COMMENT': '콘텐츠 댓글', 'ORDER_CONTENT_COMMENT': '구매한 콘텐츠 댓글', - 'LIVE_CONTINUOUS_LISTEN_30': 'LIVE_CONTINUOUS_LISTEN_30', + 'LIVE_CONTINUOUS_LISTEN_30': '라이브 연속 청취 30분', }, policy_type_list: [ @@ -530,7 +530,7 @@ export default { this.is_loading = true try { - const res = await api.getPointPolicyList(); + const res = await api.getPointPolicyList(this.page); if (res.status === 200 && res.data.success === true) { const data = res.data.data -- 2.40.1 From cea0887d9066ef73b836b335bcdfc918d9689238 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 19 May 2025 22:02:58 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20-=20=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Promotion/PointPolicyView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/Promotion/PointPolicyView.vue b/src/views/Promotion/PointPolicyView.vue index 59842d6..e1b8246 100644 --- a/src/views/Promotion/PointPolicyView.vue +++ b/src/views/Promotion/PointPolicyView.vue @@ -512,7 +512,6 @@ export default { this.cancel() this.notifySuccess(res.data.message || '수정되었습니다.') - this.page = 1 this.point_policy_list = [] await this.getPointPolicyList() } else { -- 2.40.1 From 0aff527266a51e39f9dbfd460f063b375079adfa Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 19 May 2025 22:49:05 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20-=20=EC=A0=95=EC=B1=85=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=ED=9B=84=20=EC=9D=91=EB=8B=B5=EC=9D=B4=20?= =?UTF-8?q?=EC=98=A4=EB=A9=B4=20=EB=B0=94=EB=A1=9C=20is=5Floading=EC=9D=84?= =?UTF-8?q?=20false=EB=A1=9C=20=EB=B3=80=EA=B2=BD=ED=95=98=EC=97=AC=20?= =?UTF-8?q?=EC=8B=A0=EA=B7=9C=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EB=A5=BC=20=EB=B6=88?= =?UTF-8?q?=EB=9F=AC=EC=98=AC=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Promotion/PointPolicyView.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/views/Promotion/PointPolicyView.vue b/src/views/Promotion/PointPolicyView.vue index e1b8246..7d74887 100644 --- a/src/views/Promotion/PointPolicyView.vue +++ b/src/views/Promotion/PointPolicyView.vue @@ -451,7 +451,6 @@ export default { async submit() { if (this.is_loading) return; - this.is_loading = true try { @@ -466,6 +465,7 @@ export default { 'endDate': this.point_policy.end_date } const res = await api.createPointPolicyList(request) + this.is_loading = false if (res.status === 200 && res.data.success === true) { this.cancel() @@ -480,12 +480,11 @@ export default { } catch (e) { this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") } - - this.is_loading = false }, async modify() { if (this.is_loading) return; + this.is_loading = true try { const request = {} @@ -507,6 +506,7 @@ export default { } const res = await api.updatePointPolicyList(this.selected_point_policy.id, request) + this.is_loading = false if (res.status === 200 && res.data.success === true) { this.cancel() @@ -520,8 +520,6 @@ export default { } catch (e) { this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") } - - this.is_loading = false }, async getPointPolicyList() { -- 2.40.1