diff --git a/src/components/NFTBook/ItemCardV2.vue b/src/components/NFTBook/ItemCardV2.vue index 8ecf9b0bb..4aa757f03 100644 --- a/src/components/NFTBook/ItemCardV2.vue +++ b/src/components/NFTBook/ItemCardV2.vue @@ -67,7 +67,7 @@ export default { type: Boolean, default: true, }, - medium: { + linkMedium: { type: String, default: '', }, @@ -78,9 +78,6 @@ export default { }; }, computed: { - linkMedium() { - return this.medium || undefined; - }, classId() { return this.itemId.startsWith('likenft1') ? this.itemId : ''; }, diff --git a/src/mixins/nft-or-collection.js b/src/mixins/nft-or-collection.js index b7332a242..acf53b445 100644 --- a/src/mixins/nft-or-collection.js +++ b/src/mixins/nft-or-collection.js @@ -73,7 +73,7 @@ export default { collectionId: this.collectionId, }, query: { - ll_medium: this.linkMedium, + ll_medium: this.mixinLinkMedium, }, }) : this.localeLocation({ @@ -82,7 +82,7 @@ export default { classId: this.classId, }, query: { - ll_medium: this.linkMedium, + ll_medium: this.mixinLinkMedium, }, }); }, diff --git a/src/mixins/utm.js b/src/mixins/utm.js index 40a0591b1..9a9b66951 100644 --- a/src/mixins/utm.js +++ b/src/mixins/utm.js @@ -11,14 +11,18 @@ export default { return { utmCampaign: this.$route.query.utm_campaign, utmSource: this.$route.query.utm_source, - utmMedium: this.$route.query.utm_medium || this.linkMedium, + utmMedium: this.$route.query.utm_medium || this.mixinLinkMedium, documentReferrer: '', fbClickId: this.formattedFbcQs, }; }, computed: { - linkMedium() { - return this.$route.query.ll_medium; + mixinLinkMedium() { + return ( + this.$route.query.ll_medium || + // NOTE: To be injected by the mixin user + this.linkMedium + ); }, gadClickId() { return this.$route.query.gclid; @@ -37,7 +41,7 @@ export default { this.storeUTMToSessionStorage(); this.getFbClickIdFromCookie(); // TODO: split linkMedium into a new separate field - this.utmMedium = this.utmMedium || this.linkMedium; + this.utmMedium = this.utmMedium || this.mixinLinkMedium; }, methods: { setUTMProps({ utmCampaign, utmSource, utmMedium }) { diff --git a/src/pages/index.vue b/src/pages/index.vue index c49be8e7f..5a468ddd5 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -400,7 +400,7 @@ :cover-resize="300" :is-link-disabled="stickyBookstoreItem.isMultiple" :is-lazy-loaded="false" - medium="index_sticky_item" + link-medium="index_sticky_item" @click-cover="handleClickItem($event, stickyBookstoreItem)" /> @@ -422,7 +422,7 @@ class-cover-frame-aspect-ratio="min-h-[360px] laptop:min-h-[0] aspect-[4/5]" :cover-resize="300" :is-link-disabled="item.isMultiple" - medium="index_grid_item" + link-medium="index_grid_item" @click-cover="handleClickItem($event, item)" /> @@ -454,7 +454,7 @@ diff --git a/src/pages/store/index.vue b/src/pages/store/index.vue index 2fd222cf9..03c1faf54 100644 --- a/src/pages/store/index.vue +++ b/src/pages/store/index.vue @@ -309,7 +309,7 @@ :item-id="item.classId" class-cover-frame-aspect-ratio="aspect-[4/5]" :is-link-disabled="item.isMultiple" - :medium="linkMedium" + :link-medium="linkMedium" @click-cover="handleClickItem($event, item)" /> @@ -719,18 +719,9 @@ export default { return baseUrl; }, linkMedium() { - const { - query: { ll_medium: qsMedium, tag, q }, - } = this.$route; - if (qsMedium) { - return qsMedium; - } - if (tag) { - return `tag-${tag}`; - } - if (q) { - return 'search'; - } + const { tag, q } = this.$route.query; + if (tag) return `tag-${tag}`; + if (q) return 'search'; return 'listing'; }, // Price filter related