flaschengeist-frontend/src/components/baruser/CreditLists.vue

102 lines
4.2 KiB
Vue
Raw Normal View History

2019-12-21 07:20:25 +00:00
<template>
<v-content>
2019-12-21 12:16:37 +00:00
<v-container v-for="user in users" :key="user.id">
<v-card raised shaped>
2019-12-21 11:22:21 +00:00
<v-list-item three-line>
<v-list-item-content>
<v-list-item-title class="title">{{user.firstname}} {{user.lastname}}</v-list-item-title>
<v-row>
<v-spacer/>
<v-row>
<v-col>
<v-container>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 200)" :color="color">2 </v-btn>
</v-container>
</v-row>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 100)" :color="color">1 </v-btn>
</v-container>
</v-row>
</v-container>
</v-col>
<v-col>
<v-container>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 50)" :color="color">0,50 </v-btn>
</v-container>
</v-row>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 40)" :color="color">0,40 </v-btn>
</v-container>
</v-row>
</v-container>
</v-col>
<v-col>
<v-container>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 20)" :color="color">0,20 </v-btn>
</v-container>
</v-row>
<v-row>
<v-container>
<v-btn @click="addAmount(user.username, 10)" :color="color">0,10 </v-btn>
</v-container>
</v-row>
</v-container>
</v-col>
</v-row>
<v-col align-self="center">
<v-container>
<v-row>
<v-container>
2019-12-21 12:16:37 +00:00
<v-list-item-action-text :class="getColor(user.type)">{{(user.amount/100).toFixed(2)}} </v-list-item-action-text>
2019-12-21 11:22:21 +00:00
</v-container>
</v-row>
</v-container>
</v-col>
</v-row>
</v-list-item-content>
</v-list-item>
</v-card>
2019-12-21 07:20:25 +00:00
</v-container>
</v-content>
</template>
<script>
2019-12-21 12:16:37 +00:00
2019-12-21 07:20:25 +00:00
export default {
2019-12-21 11:22:21 +00:00
name: "CreditLists",
props: {
users: Array
},
data () {
return {
color: 'green accent-4'
}
},
methods: {
addAmount(username, amount) {
this.$emit("add:amount", username, amount)
2019-12-21 12:16:37 +00:00
},
getColor(type) {
return type === 'credit' ? 'title green--text' : 'title red--text'
2019-12-21 11:22:21 +00:00
}
2019-12-21 12:16:37 +00:00
},
computed: {
2019-12-21 11:22:21 +00:00
}
2019-12-21 07:20:25 +00:00
}
</script>
<style scoped>
</style>