add transaction result

This commit is contained in:
donne 2022-04-03 23:54:53 +08:00
parent c8435f964b
commit 20f787e1b8
2 changed files with 179 additions and 3 deletions

View File

@ -0,0 +1,153 @@
<template>
<div>
<div class="board">
<div
v-if="1"
class="data"
>
<div class="board-row">
<div class="key">
AMOUNT
</div>
<div class="value">
1,233,000 USDT
</div>
</div>
<div class="board-row">
<div class="key">
BRIDGE FEE
</div>
<div class="value">
3,000 USDT
</div>
</div>
</div>
<div class="sum">
<div class="key">
TRANSFER AMOUNT
</div>
<div class="value">
1,213,000 USDT
</div>
</div>
</div>
<p
v-if="1"
class="result-text"
>
Congratulations! Transfer completed successfully.
</p>
<div class="status">
<!-- <b-progress
:value="100"
:variant="progressColor"
:animated="isLoading"
/> -->
<b-progress :animated="isLoading">
<b-progress-bar
variant="success"
:value="progresBar[0]"
/>
<b-progress-bar
variant="danger"
:value="progresBar[1]"
/>
<b-progress-bar
variant="info"
:value="progresBar[2]"
/>
</b-progress>
<div class="status-text">
<span>SUBMITED</span>
<span>COMPLETED</span>
</div>
</div>
<div class="link">
<router-link
to="/"
>
View on explorer
</router-link>
</div>
</div>
</template>
<script>
import { BProgress, BProgressBar } from 'bootstrap-vue'
export default {
components: {
BProgress,
BProgressBar,
},
data() {
return {
isLoading: true,
}
},
computed: {
progresBar() {
// success: [100, 0, 0]
// fail: [50, 50, 0]
// pending: [0, 0, 100]
return [0, 0, 100]
},
},
}
</script>
<style lang="scss" scoped>
.board {
background: #f8f8f8;
border-radius: 8px;
padding: 0 12px;
margin: 35px 0;
.data {
padding: 10px 0;
border-bottom: 1px solid #607d8b;
}
.board-row {
display: flex;
justify-content: space-between;
font-size: 16px;
line-height: 34px;
.key {
color: #666;
}
.value {
font-weight: bold;
}
}
.sum {
display: flex;
justify-content: space-between;
font-size: 18px;
font-weight: bold;
padding: 15px 0;
}
}
.result-text {
text-align: center;
font-size: 16px;
}
.status {
margin-top: 30px;
.status-text {
display: flex;
justify-content: space-between;
margin-top: 20px;
font-weight: 500;
}
}
.link {
margin-top: 20px;
text-align: center;
a {
text-decoration: underline;
color: var(--purple)
}
}
</style>

View File

@ -5,8 +5,10 @@
size="md" size="md"
:title="modalTitle" :title="modalTitle"
:ok-title="actionName" :ok-title="actionName"
hide-header-close
scrollable scrollable
:hide-header-close="!showResult"
:hide-footer="showResult"
modal-class="custom-transaction-modal"
:ok-disabled="isOwner" :ok-disabled="isOwner"
@hidden="resetModal" @hidden="resetModal"
@ok="handleOk" @ok="handleOk"
@ -35,7 +37,10 @@
</b-button> </b-button>
</div> </div>
</template> </template>
<validation-observer ref="simpleRules"> <validation-observer
v-if="!showResult"
ref="simpleRules"
>
<b-form> <b-form>
<component <component
:is="type" :is="type"
@ -130,8 +135,13 @@
</b-col> </b-col>
</b-row> </b-row>
</b-form> </b-form>
</validation-observer>
{{ error }} {{ error }}
</validation-observer>
<TransactionResult v-else />
<b-button @click="showResult = !showResult">
toggle
</b-button>
</b-overlay> </b-overlay>
</b-modal> </b-modal>
</template> </template>
@ -162,6 +172,7 @@ import IBCTransfer from './components/IBCTransfer.vue'
import Vote from './components/Vote.vue' import Vote from './components/Vote.vue'
import WithdrawCommission from './components/WithdrawCommission.vue' import WithdrawCommission from './components/WithdrawCommission.vue'
import GovDeposit from './components/GovDeposit.vue' import GovDeposit from './components/GovDeposit.vue'
import TransactionResult from './TransactionResult.vue'
export default { export default {
name: 'DelegateDialogue', name: 'DelegateDialogue',
@ -196,6 +207,7 @@ export default {
Vote, Vote,
WithdrawCommission, WithdrawCommission,
GovDeposit, GovDeposit,
TransactionResult,
}, },
directives: { directives: {
Ripple, Ripple,
@ -243,6 +255,7 @@ export default {
memo: '', memo: '',
blockingMsg: this.address ? 'You are not the owner' : 'No available account found.', blockingMsg: this.address ? 'You are not the owner' : 'No available account found.',
actionName: 'Send', actionName: 'Send',
showResult: false,
required, required,
password, password,
@ -402,4 +415,14 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@core/scss/vue/libs/vue-select.scss'; @import '@core/scss/vue/libs/vue-select.scss';
.custom-transaction-modal {
.modal-header {
.modal-title {
font-size: 24px;
}
.close {
margin: 0;
}
}
}
</style> </style>