캔, 충전현황 페이지 API 연동
This commit is contained in:
@@ -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 || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
|
Reference in New Issue
Block a user