캔, 충전현황 페이지 API 연동

This commit is contained in:
Yu Sung
2023-08-06 14:27:31 +09:00
parent f66bfd8524
commit fb08221aa3
7 changed files with 81 additions and 151 deletions

View File

@@ -2,7 +2,7 @@
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>코인 충전</v-toolbar-title>
<v-toolbar-title> 충전</v-toolbar-title>
<v-spacer />
</v-toolbar>
@@ -23,8 +23,8 @@
/>
<v-text-field
v-model="coin"
label="지급할 코인 수"
v-model="can"
label="지급할 수"
outlined
required
/>
@@ -39,7 +39,7 @@
depressed
@click="confirm"
>
코인 지급
지급
</v-btn>
</v-col>
</v-row>
@@ -50,7 +50,7 @@
persistent
>
<v-card>
<v-card-title>코인 지급 확인</v-card-title>
<v-card-title> 지급 확인</v-card-title>
<v-card-text>
회원번호: {{ account_id }}
</v-card-text>
@@ -58,7 +58,7 @@
기록내용: {{ method }}
</v-card-text>
<v-card-text>
지급할 코인 : {{ coin }}코인
지급할 : {{ can }}
</v-card-text>
<v-card-actions v-show="!isLoading">
<v-spacer />
@@ -67,7 +67,7 @@
text
@click="submit"
>
코인 지급
지급
</v-btn>
<v-spacer />
<v-btn
@@ -87,10 +87,10 @@
</template>
<script>
import * as api from '@/api/coin'
import * as api from '@/api/can'
export default {
name: "CoinCharge",
name: "CanCharge",
data() {
return {
@@ -98,7 +98,7 @@ export default {
isLoading: false,
account_id: '',
method: '',
coin: ''
can: ''
}
},
@@ -113,15 +113,15 @@ export default {
confirm() {
if (this.account_id.trim() === '' || isNaN(this.account_id)) {
return this.notifyError('코인을 지급할 회원의 회원번호를 입력하세요.')
return this.notifyError('을 지급할 회원의 회원번호를 입력하세요.')
}
if (this.method.trim() === '') {
return this.notifyError('기록할 내용을 입력하세요')
}
if (isNaN(this.coin)) {
return this.notifyError('코인은 숫자만 넣을 수 있습니다.')
if (isNaN(this.can)) {
return this.notifyError('은 숫자만 넣을 수 있습니다.')
}
if (!this.isLoading) {
@@ -140,12 +140,12 @@ export default {
try {
this.show_confirm = false
const res = await api.paymentCoin(Number(this.coin), this.method, this.account_id)
const res = await api.paymentCan(Number(this.can), this.method, this.account_id)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('코인이 지급되었습니다.')
this.notifySuccess('이 지급되었습니다.')
this.account_id = ''
this.method = ''
this.coin = ''
this.can = ''
this.is_loading = false
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')