From 256f65e3708d7790304192e437d0465c9b08cf56 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 16 May 2025 21:28:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20=EB=93=B1=EB=A1=9D=20-=20=EC=A7=80=EA=B8=89?= =?UTF-8?q?=EC=9C=A0=ED=98=95(=EB=A7=A4=EC=9D=BC,=20=EC=A0=84=EC=B2=B4),?= =?UTF-8?q?=20=EC=B0=B8=EC=97=AC=20=EA=B0=80=EB=8A=A5=20=ED=9A=9F=EC=88=98?= =?UTF-8?q?=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) {