|
@ -5,10 +5,13 @@ |
|
|
<!-- CONTENT --> |
|
|
<!-- CONTENT --> |
|
|
<section id="Content" class="p-6 pb-24 max-w-3xl mx-auto"> |
|
|
<section id="Content" class="p-6 pb-24 max-w-3xl mx-auto"> |
|
|
<!-- Back --> |
|
|
<!-- Back --> |
|
|
<div class="text-lg text-center font-light relative px-7"> |
|
|
<div |
|
|
|
|
|
v-if="!hideBackButton" |
|
|
|
|
|
class="text-lg text-center font-light relative px-7" |
|
|
|
|
|
> |
|
|
<h1 |
|
|
<h1 |
|
|
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1" |
|
|
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1" |
|
|
@click="cancel()" |
|
|
@click="cancelBack()" |
|
|
> |
|
|
> |
|
|
<fa icon="chevron-left" class="fa-fw"></fa> |
|
|
<fa icon="chevron-left" class="fa-fw"></fa> |
|
|
</h1> |
|
|
</h1> |
|
@ -31,7 +34,7 @@ |
|
|
class="rounded-l border border-r-0 border-slate-400 bg-slate-200 text-center text-blue-500 px-2 py-2 w-20" |
|
|
class="rounded-l border border-r-0 border-slate-400 bg-slate-200 text-center text-blue-500 px-2 py-2 w-20" |
|
|
@click="changeUnitCode()" |
|
|
@click="changeUnitCode()" |
|
|
> |
|
|
> |
|
|
{{ libsUtil.UNIT_SHORT[unitCode] }} |
|
|
{{ libsUtil.UNIT_SHORT[unitCode] || unitCode }} |
|
|
</span> |
|
|
</span> |
|
|
<div |
|
|
<div |
|
|
class="border border-r-0 border-slate-400 bg-slate-200 px-4 py-2" |
|
|
class="border border-r-0 border-slate-400 bg-slate-200 px-4 py-2" |
|
@ -144,9 +147,11 @@ export default class GiftedDetails extends Vue { |
|
|
|
|
|
|
|
|
amountInput = "0"; |
|
|
amountInput = "0"; |
|
|
description = ""; |
|
|
description = ""; |
|
|
|
|
|
destinationNameAfter = ""; |
|
|
givenToUser = false; |
|
|
givenToUser = false; |
|
|
giverDid: string | undefined; |
|
|
giverDid: string | undefined; |
|
|
giverName = ""; |
|
|
giverName = ""; |
|
|
|
|
|
hideBackButton = false; |
|
|
imageUrl = ""; |
|
|
imageUrl = ""; |
|
|
isTrade = false; |
|
|
isTrade = false; |
|
|
message = ""; |
|
|
message = ""; |
|
@ -161,24 +166,20 @@ export default class GiftedDetails extends Vue { |
|
|
libsUtil = libsUtil; |
|
|
libsUtil = libsUtil; |
|
|
|
|
|
|
|
|
async mounted() { |
|
|
async mounted() { |
|
|
this.amountInput = this.$route.query.amountInput as string; |
|
|
this.amountInput = |
|
|
this.description = this.$route.query.description as string; |
|
|
(this.$route.query.amountInput as string) || this.amountInput; |
|
|
|
|
|
this.description = (this.$route.query.description as string) || ""; |
|
|
|
|
|
this.destinationNameAfter = this.$route.query |
|
|
|
|
|
.destinationNameAfter as string; |
|
|
this.giverDid = this.$route.query.giverDid as string; |
|
|
this.giverDid = this.$route.query.giverDid as string; |
|
|
this.giverName = this.$route.query.giverName as string; |
|
|
this.giverName = (this.$route.query.giverName as string) || ""; |
|
|
if (this.giverDid && !this.giverName) { |
|
|
this.hideBackButton = this.$route.query.hideBackButton === "true"; |
|
|
this.giverName = |
|
|
this.message = (this.$route.query.message as string) || ""; |
|
|
this.giverDid === this.activeDid ? "you" : "someone not named"; |
|
|
|
|
|
} |
|
|
|
|
|
this.message = this.$route.query.message as string; |
|
|
|
|
|
this.offerId = this.$route.query.offerId as string; |
|
|
this.offerId = this.$route.query.offerId as string; |
|
|
this.projectId = this.$route.query.projectId as string; |
|
|
this.projectId = this.$route.query.projectId as string; |
|
|
this.recipientDid = this.$route.query.recipientDid as string; |
|
|
this.recipientDid = this.$route.query.recipientDid as string; |
|
|
this.recipientName = this.$route.query.recipientName as string; |
|
|
this.recipientName = (this.$route.query.recipientName as string) || ""; |
|
|
if (this.recipientDid && !this.recipientName) { |
|
|
this.unitCode = (this.$route.query.unitCode as string) || this.unitCode; |
|
|
this.recipientName = |
|
|
|
|
|
this.recipientDid === this.activeDid ? "you" : "someone not named"; |
|
|
|
|
|
} |
|
|
|
|
|
this.unitCode = this.$route.query.unitCode as string; |
|
|
|
|
|
|
|
|
|
|
|
this.imageUrl = |
|
|
this.imageUrl = |
|
|
(this.$route.query.imageUrl as string) || |
|
|
(this.$route.query.imageUrl as string) || |
|
@ -205,7 +206,15 @@ export default class GiftedDetails extends Vue { |
|
|
this.apiServer = settings?.apiServer || ""; |
|
|
this.apiServer = settings?.apiServer || ""; |
|
|
this.activeDid = settings?.activeDid || ""; |
|
|
this.activeDid = settings?.activeDid || ""; |
|
|
|
|
|
|
|
|
|
|
|
if (this.giverDid && !this.giverName) { |
|
|
|
|
|
this.giverName = |
|
|
|
|
|
this.giverDid === this.activeDid ? "you" : "someone not named"; |
|
|
|
|
|
} |
|
|
this.givenToUser = this.recipientDid === this.activeDid; |
|
|
this.givenToUser = this.recipientDid === this.activeDid; |
|
|
|
|
|
if (this.recipientDid && !this.recipientName) { |
|
|
|
|
|
this.recipientName = |
|
|
|
|
|
this.recipientDid === this.activeDid ? "you" : "someone not named"; |
|
|
|
|
|
} |
|
|
this.showGivenToUser = |
|
|
this.showGivenToUser = |
|
|
!this.projectId && this.recipientDid === this.activeDid; |
|
|
!this.projectId && this.recipientDid === this.activeDid; |
|
|
|
|
|
|
|
@ -257,6 +266,15 @@ export default class GiftedDetails extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cancel() { |
|
|
cancel() { |
|
|
|
|
|
this.deleteImage(); // not awaiting, so they'll go back immediately |
|
|
|
|
|
if (this.destinationNameAfter) { |
|
|
|
|
|
this.$router.push({ name: this.destinationNameAfter }); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cancelBack() { |
|
|
this.deleteImage(); // not awaiting, so they'll go back immediately |
|
|
this.deleteImage(); // not awaiting, so they'll go back immediately |
|
|
this.$router.back(); |
|
|
this.$router.back(); |
|
|
} |
|
|
} |
|
@ -301,7 +319,7 @@ export default class GiftedDetails extends Vue { |
|
|
// don't bother with a notification |
|
|
// don't bother with a notification |
|
|
// (either they'll simply continue or they're canceling and going back) |
|
|
// (either they'll simply continue or they're canceling and going back) |
|
|
} else { |
|
|
} else { |
|
|
console.error("Non-success deleting image:", response); |
|
|
console.error("Problem deleting image:", response); |
|
|
this.$notify( |
|
|
this.$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
@ -452,7 +470,11 @@ export default class GiftedDetails extends Vue { |
|
|
5000, |
|
|
5000, |
|
|
); |
|
|
); |
|
|
localStorage.removeItem("imageUrl"); |
|
|
localStorage.removeItem("imageUrl"); |
|
|
this.$router.back(); |
|
|
if (this.destinationNameAfter) { |
|
|
|
|
|
this.$router.push({ name: this.destinationNameAfter }); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
} catch (error: any) { |
|
|
} catch (error: any) { |
|
|