+
+
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
-
-
-
-
+
+
-
-
-
-
+
@@ -210,6 +266,7 @@ import nftMixin from '~/mixins/nft';
import walletMixin from '~/mixins/wallet';
const NFT_CLAIM_STATE = {
+ GIFTING: 'GIFTING',
INITIAL: 'INITIAL',
CLAIMING: 'CLAIMING',
CLAIMED: 'CLAIMED',
@@ -253,6 +310,7 @@ export default {
claimingAddressInput: '',
claimingAddress: '',
claimingFreeEmail: '',
+ giftInfo: null,
};
},
computed: {
@@ -322,20 +380,24 @@ export default {
},
async mounted() {
const { redirect, free, from, ...query } = this.$route.query;
- if (!free && redirect && query.type === 'nft_book') {
- let price;
- try {
- const { data } = await this.$api.get(
- getNFTBookPaymentStatusEndpoint({
- classId: this.classId,
- paymentId: this.paymentId,
- })
- );
- ({ price } = data);
- } catch (err) {
- // eslint-disable-next-line no-console
- console.error(err);
+ let price;
+ try {
+ const { data } = await this.$api.get(
+ getNFTBookPaymentStatusEndpoint({
+ classId: this.classId,
+ paymentId: this.paymentId,
+ })
+ );
+ ({ price } = data);
+ this.giftInfo = data.giftInfo;
+ if (this.giftInfo) {
+ this.state = NFT_CLAIM_STATE.GIFTING;
}
+ } catch (err) {
+ // eslint-disable-next-line no-console
+ console.error(err);
+ }
+ if (!free && redirect && query.type === 'nft_book') {
logPurchaseFlowEvent(this, 'purchase', {
items: [
{
@@ -582,6 +644,9 @@ export default {
handleClickViewContentDirectly(e, contentUrl, type) {
logTrackerEvent(this, 'NFT', 'ClaimViewContentDirect', this.classId, 1);
},
+ handleClickNext() {
+ this.state = NFT_CLAIM_STATE.INITIAL;
+ },
},
};
diff --git a/src/pages/nft/class/_classId/index.vue b/src/pages/nft/class/_classId/index.vue
index 6ca86b961..ce3531a7c 100644
--- a/src/pages/nft/class/_classId/index.vue
+++ b/src/pages/nft/class/_classId/index.vue
@@ -79,6 +79,7 @@
:value="defaultSelectedValue"
@change="handleEditionSelectChange"
@click-collect="handleCollectFromEditionSelector"
+ @click-gift="handleGiftFromEditionSelector"
@click-compare="handleClickCompareItemsButton"
/>
@@ -290,6 +291,12 @@