fix(potions): call out limited time

This commit is contained in:
Sabe Jones
2020-04-10 15:15:23 -05:00
parent 39765895ee
commit 9c6c90a2e9
6 changed files with 27 additions and 8 deletions

View File

@@ -11,6 +11,12 @@
<span slot="popoverContent"> <span slot="popoverContent">
<strong v-if="item.key === 'gem' && gemsLeft === 0">{{ $t('maxBuyGems') }}</strong> <strong v-if="item.key === 'gem' && gemsLeft === 0">{{ $t('maxBuyGems') }}</strong>
<h4 class="popover-content-title">{{ item.text }}</h4> <h4 class="popover-content-title">{{ item.text }}</h4>
<div
v-if="item.event"
class="mt-2"
>
{{ limitedString }}
</div>
</span> </span>
<template <template
slot="itemBadge" slot="itemBadge"
@@ -26,14 +32,15 @@
import _filter from 'lodash/filter'; import _filter from 'lodash/filter';
import _sortBy from 'lodash/sortBy'; import _sortBy from 'lodash/sortBy';
import _map from 'lodash/map'; import _map from 'lodash/map';
import moment from 'moment';
import { mapState } from '@/libs/store'; import { mapState } from '@/libs/store';
import pinUtils from '@/mixins/pinUtils'; import pinUtils from '@/mixins/pinUtils';
import planGemLimits from '@/../../common/script/libs/planGemLimits'; import planGemLimits from '@/../../common/script/libs/planGemLimits';
import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config';
import ShopItem from '../shopItem'; import ShopItem from '../shopItem';
import CategoryItem from './categoryItem'; import CategoryItem from './categoryItem';
export default { export default {
components: { components: {
CategoryItem, CategoryItem,
@@ -53,6 +60,9 @@ export default {
return planGemLimits.convCap return planGemLimits.convCap
+ this.user.purchased.plan.consecutive.gemCapExtra - this.user.purchased.plan.gemsBought; + this.user.purchased.plan.consecutive.gemCapExtra - this.user.purchased.plan.gemsBought;
}, },
limitedString () {
return this.$t('limitedOffer', { date: moment(seasonalShopConfig.dateRange.end).format('LL') });
},
sortedMarketItems () { sortedMarketItems () {
let result = _map(this.category.items, e => ({ let result = _map(this.category.items, e => ({
...e, ...e,

View File

@@ -299,7 +299,10 @@
<span slot="popoverContent"> <span slot="popoverContent">
<div class="questPopover"> <div class="questPopover">
<h4 class="popover-content-title">{{ item.text }}</h4> <h4 class="popover-content-title">{{ item.text }}</h4>
<questInfo :quest="item" /> <questInfo
:quest="item"
:popoverVersion="true"
/>
</div> </div>
</span> </span>
<template <template

View File

@@ -2,7 +2,6 @@
<div> <div>
<div <div
class="row" class="row"
:class="{'small-version': smallVersion}"
> >
<div <div
v-if="quest.collect" v-if="quest.collect"
@@ -31,14 +30,13 @@
<div <div
v-for="star of stars()" v-for="star of stars()"
:key="star" :key="star"
class="svg-icon inline" class="svg-icon inline icon-16"
:class="smallVersion ? 'icon-12' : 'icon-16'"
v-html="icons[star]" v-html="icons[star]"
></div> ></div>
</dd> </dd>
</div> </div>
</div> </div>
<div v-if="quest.limited"> <div v-if="quest.limited && popoverVersion">
{{ limitedString }} {{ limitedString }}
</div> </div>
</div> </div>
@@ -133,7 +131,7 @@ export default {
quest: { quest: {
type: Object, type: Object,
}, },
smallVersion: { popoverVersion: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },

View File

@@ -104,7 +104,7 @@
</div> </div>
<div <div
v-if="item.event" v-if="item.event"
class="mt-4" :class="item.purchaseType === 'gear' ? 'mt-4' : 'mt-2'"
> >
{{ limitedString }} {{ limitedString }}
</div> </div>

View File

@@ -3,6 +3,9 @@ import defaults from 'lodash/defaults';
import each from 'lodash/each'; import each from 'lodash/each';
import moment from 'moment'; import moment from 'moment';
import t from './translation'; import t from './translation';
import {
EVENTS,
} from './constants';
function hasQuestAchievementFunction (key) { function hasQuestAchievementFunction (key) {
return user => user.achievements.quests return user => user.achievements.quests
@@ -70,6 +73,7 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionShimmer'), text: t('hatchingPotionShimmer'),
limited: true, limited: true,
event: EVENTS.spring2020,
_addlNotes: t('eventAvailabilityReturning', { _addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndMarch'), availableDate: t('dateEndMarch'),
previousDate: t('marchYYYY', { year: 2018 }), previousDate: t('marchYYYY', { year: 2018 }),
@@ -205,6 +209,7 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionCelestial'), text: t('hatchingPotionCelestial'),
limited: true, limited: true,
event: EVENTS.spring2020,
_addlNotes: t('eventAvailabilityReturning', { _addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndMarch'), availableDate: t('dateEndMarch'),
previousDate: t('marchYYYY', { year: 2019 }), previousDate: t('marchYYYY', { year: 2019 }),
@@ -271,6 +276,7 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionBirchBark'), text: t('hatchingPotionBirchBark'),
limited: true, limited: true,
event: EVENTS.spring2020,
canBuy () { canBuy () {
return moment().isBefore('2020-05-02'); return moment().isBefore('2020-05-02');
}, },
@@ -284,6 +290,7 @@ const wacky = {
Veggie: { Veggie: {
text: t('hatchingPotionVeggie'), text: t('hatchingPotionVeggie'),
limited: true, limited: true,
event: EVENTS.spring2020,
_addlNotes: t('eventAvailabilityReturning', { _addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndMarch'), availableDate: t('dateEndMarch'),
previousDate: t('marchYYYY', { year: 2019 }), previousDate: t('marchYYYY', { year: 2019 }),

View File

@@ -94,6 +94,7 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
purchaseType: 'hatchingPotions', purchaseType: 'hatchingPotions',
path: item.wacky ? `wackyHatchingPotions.${item.key}` : `premiumHatchingPotions.${item.key}`, path: item.wacky ? `wackyHatchingPotions.${item.key}` : `premiumHatchingPotions.${item.key}`,
pinType: 'premiumHatchingPotion', pinType: 'premiumHatchingPotion',
event: item.event,
}; };
break; break;
case 'food': case 'food':