feat(can): 캔 등록시 결제 화폐단위 추가
This commit is contained in:
@@ -8,8 +8,8 @@ async function getCans() {
|
||||
return Vue.axios.get('/can');
|
||||
}
|
||||
|
||||
async function insertCan(can, rewardCan, price) {
|
||||
const request = {can: can, rewardCan: rewardCan, price: price}
|
||||
async function insertCan(can, rewardCan, price, currency) {
|
||||
const request = {can: can, rewardCan: rewardCan, price: price, currency}
|
||||
return Vue.axios.post('/admin/can', request);
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
color="#3bb9f1"
|
||||
dark
|
||||
depressed
|
||||
v-bind="attrs"
|
||||
@@ -40,7 +40,8 @@
|
||||
hide-default-footer
|
||||
>
|
||||
<template v-slot:item.price="{ item }">
|
||||
{{ item.price.toLocaleString('en-US') }} 원
|
||||
<span v-if="item.currency === 'KRW'">₩ {{ item.price.toLocaleString('en-US') }}</span>
|
||||
<span v-else>$ {{ item.price.toLocaleString('en-US') }}</span>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.can="{ item }">
|
||||
@@ -70,7 +71,13 @@
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="price"
|
||||
label="원화"
|
||||
label="가격"
|
||||
required
|
||||
/>
|
||||
<v-select
|
||||
v-model="currency"
|
||||
:items="currencies"
|
||||
label="화폐 단위"
|
||||
required
|
||||
/>
|
||||
</v-card-text>
|
||||
@@ -125,9 +132,14 @@ export default {
|
||||
price: null,
|
||||
can: null,
|
||||
reward_can: null,
|
||||
currency: 'KRW',
|
||||
currencies: [
|
||||
{ text: 'KRW (한국 원)', value: 'KRW' },
|
||||
{ text: 'USD (미국 달러)', value: 'USD' }
|
||||
],
|
||||
headers: [
|
||||
{
|
||||
text: '원화(VAT포함)',
|
||||
text: '가격(VAT포함)',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'price',
|
||||
@@ -173,6 +185,7 @@ export default {
|
||||
this.can = null
|
||||
this.price = null
|
||||
this.reward_can = null
|
||||
this.currency = 'KRW'
|
||||
this.selected_can = null
|
||||
},
|
||||
|
||||
@@ -204,13 +217,14 @@ export default {
|
||||
async submit() {
|
||||
this.isLoading = true
|
||||
|
||||
const res = await api.insertCan(this.can, this.reward_can, this.price)
|
||||
const res = await api.insertCan(this.can, this.reward_can, this.price, this.currency)
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_dialog = false
|
||||
this.can = null
|
||||
this.price = null
|
||||
this.reward_can = null
|
||||
this.currency = 'KRW'
|
||||
this.selected_can = null
|
||||
this.notifySuccess(res.data.message || '등록되었습니다.')
|
||||
|
||||
|
Reference in New Issue
Block a user