mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
refctor link result
This commit is contained in:
parent
75b435456e
commit
f7b74d8e63
@ -1,22 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="clipboard-copy">
|
<div class="clipboard-copy">
|
||||||
<div v-if="canCopyLink" size="lg" class="mb-5">
|
<div v-if="canCopyLink" class="mb-5">
|
||||||
<div class="d-flex">
|
<div>
|
||||||
<div>
|
<label>{{ $t('gdd_per_link.copy-link') }}</label>
|
||||||
<label>{{ $t('gdd_per_link.copy-link') }}</label>
|
<div class="pointer text-center bg-secondary gradido-border-radius p-3" @click="copyLink">
|
||||||
<div class="pointer text-center bg-secondary gradido-border-radius p-4" @click="copyLink">
|
{{ link }}
|
||||||
{{ link }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ml-5">
|
|
||||||
<label>{{ $t('gdd_per_link.copy-link-with-text') }}</label>
|
|
||||||
<div>
|
<div>
|
||||||
<b-button @click="copyLinkWithText" class="p-4">
|
<b-button class="p-4">
|
||||||
<b-icon icon="link45deg"></b-icon>
|
<b-icon icon="link45deg"></b-icon>
|
||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mt-5">
|
||||||
|
<label>{{ $t('gdd_per_link.copy-link-with-text') }}</label>
|
||||||
|
<div
|
||||||
|
class="pointer text-center bg-secondary gradido-border-radius p-3"
|
||||||
|
@click="copyLinkWithText"
|
||||||
|
>
|
||||||
|
{{ text }}
|
||||||
|
<div>
|
||||||
|
<b-button class="p-4">
|
||||||
|
<b-icon icon="link45deg"></b-icon>
|
||||||
|
</b-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="alert-danger p-3">{{ $t('gdd_per_link.not-copied') }}</div>
|
<div class="alert-danger p-3">{{ $t('gdd_per_link.not-copied') }}</div>
|
||||||
|
|||||||
@ -6,7 +6,9 @@
|
|||||||
:amount="amount"
|
:amount="amount"
|
||||||
:memo="memo"
|
:memo="memo"
|
||||||
:validUntil="validUntil"
|
:validUntil="validUntil"
|
||||||
|
:text="text"
|
||||||
></clipboard-copy>
|
></clipboard-copy>
|
||||||
|
<label>{{ $t('qrCode') }}</label>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<div><figure-qr-code :link="link" /></div>
|
<div><figure-qr-code :link="link" /></div>
|
||||||
<div>
|
<div>
|
||||||
@ -33,5 +35,16 @@ export default {
|
|||||||
memo: { type: String, required: true },
|
memo: { type: String, required: true },
|
||||||
validUntil: { type: String, required: true },
|
validUntil: { type: String, required: true },
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
text: `${this.link}
|
||||||
|
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
||||||
|
"${this.memo}"
|
||||||
|
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
||||||
|
date: this.$d(new Date(this.validUntil), 'short'),
|
||||||
|
})}
|
||||||
|
${this.$t('gdd_per_link.link-hint')}`,
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -4,6 +4,7 @@ export const copyLinks = {
|
|||||||
amount: { type: String, required: true },
|
amount: { type: String, required: true },
|
||||||
memo: { type: String, required: true },
|
memo: { type: String, required: true },
|
||||||
validUntil: { type: String, required: true },
|
validUntil: { type: String, required: true },
|
||||||
|
text: { type: String, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -24,15 +25,7 @@ export const copyLinks = {
|
|||||||
},
|
},
|
||||||
copyLinkWithText() {
|
copyLinkWithText() {
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.writeText(
|
.writeText(this.text)
|
||||||
`${this.link}
|
|
||||||
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
|
||||||
"${this.memo}"
|
|
||||||
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
|
||||||
date: this.$d(new Date(this.validUntil), 'short'),
|
|
||||||
})}
|
|
||||||
${this.$t('gdd_per_link.link-hint')}`,
|
|
||||||
)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toastSuccess(this.$t('gdd_per_link.link-and-text-copied'))
|
this.toastSuccess(this.$t('gdd_per_link.link-and-text-copied'))
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user