2019-10-12 14:33:05 +00:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div
|
|
|
|
|
:id="itemId"
|
|
|
|
|
class="item-wrapper"
|
|
|
|
|
@click="click()"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="item"
|
|
|
|
|
:class="getItemClasses()"
|
|
|
|
|
>
|
|
|
|
|
<slot
|
|
|
|
|
name="itemBadge"
|
|
|
|
|
:item="item"
|
|
|
|
|
:emptyItem="emptyItem"
|
2019-10-12 15:05:15 +00:00
|
|
|
></slot>
|
|
|
|
|
<span
|
2019-10-12 14:33:05 +00:00
|
|
|
v-if="item.event && item.owned == null && showEventBadge"
|
2020-04-30 17:38:59 +00:00
|
|
|
class="badge badge-round badge-item badge-clock"
|
2019-10-12 15:05:15 +00:00
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
class="svg-icon inline clock"
|
|
|
|
|
v-html="icons.clock"
|
|
|
|
|
></span>
|
|
|
|
|
</span>
|
2020-04-30 17:38:59 +00:00
|
|
|
<span
|
|
|
|
|
v-if="item.locked"
|
|
|
|
|
class="svg-icon inline lock"
|
|
|
|
|
v-html="icons.lock"
|
|
|
|
|
></span>
|
|
|
|
|
<span
|
|
|
|
|
v-if="item.isSuggested"
|
|
|
|
|
class="suggestedDot"
|
|
|
|
|
></span>
|
|
|
|
|
<div class="image">
|
|
|
|
|
<div
|
|
|
|
|
v-once
|
|
|
|
|
:class="item.class"
|
|
|
|
|
></div>
|
|
|
|
|
<slot
|
|
|
|
|
name="itemImage"
|
|
|
|
|
:item="item"
|
|
|
|
|
></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="price d-flex align-items-center justify-content-center"
|
|
|
|
|
:class="currencyClass"
|
|
|
|
|
>
|
2019-10-12 14:33:05 +00:00
|
|
|
<span
|
2020-04-30 17:38:59 +00:00
|
|
|
v-once
|
|
|
|
|
:class="{ 'w-0': currencyClass === 'unlock'}"
|
|
|
|
|
class="svg-icon inline icon-16 mr-1"
|
|
|
|
|
v-html="icons[currencyClass]"
|
2019-10-12 15:05:15 +00:00
|
|
|
></span>
|
|
|
|
|
<span
|
2020-04-30 17:38:59 +00:00
|
|
|
v-once
|
|
|
|
|
class="price-label"
|
|
|
|
|
:class="currencyClass"
|
|
|
|
|
>{{ getPrice() }}</span>
|
2019-10-12 14:33:05 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-10-12 15:05:15 +00:00
|
|
|
</div>
|
|
|
|
|
<b-popover
|
2019-10-12 14:33:05 +00:00
|
|
|
v-if="showPopover"
|
|
|
|
|
:target="itemId"
|
|
|
|
|
triggers="hover"
|
|
|
|
|
:placement="popoverPosition"
|
|
|
|
|
>
|
|
|
|
|
<slot
|
|
|
|
|
name="popoverContent"
|
2017-09-01 13:15:54 +00:00
|
|
|
:item="item"
|
2019-10-12 14:33:05 +00:00
|
|
|
>
|
|
|
|
|
<equipmentAttributesPopover
|
|
|
|
|
v-if="item.purchaseType === 'gear'"
|
|
|
|
|
:item="item"
|
2019-10-12 15:05:15 +00:00
|
|
|
/>
|
|
|
|
|
<div
|
2019-10-12 14:33:05 +00:00
|
|
|
v-else-if="item.purchaseType === 'quests'"
|
|
|
|
|
class="questPopover"
|
|
|
|
|
>
|
|
|
|
|
<h4 class="popover-content-title">
|
|
|
|
|
{{ item.text }}
|
2019-10-12 15:05:15 +00:00
|
|
|
</h4>
|
|
|
|
|
<questInfo :quest="item" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2019-10-12 14:33:05 +00:00
|
|
|
<h4
|
|
|
|
|
v-once
|
|
|
|
|
class="popover-content-title"
|
|
|
|
|
>
|
|
|
|
|
{{ item.text }}
|
2019-10-12 15:05:15 +00:00
|
|
|
</h4>
|
|
|
|
|
<div
|
2019-10-12 14:33:05 +00:00
|
|
|
v-if="showNotes && item.key !== 'armoire'"
|
|
|
|
|
v-once
|
|
|
|
|
class="popover-content-text"
|
|
|
|
|
>
|
|
|
|
|
{{ item.notes }}
|
2019-10-12 15:05:15 +00:00
|
|
|
</div>
|
|
|
|
|
<div
|
2019-10-12 14:33:05 +00:00
|
|
|
v-if="showNotes && item.key === 'armoire'"
|
|
|
|
|
class="popover-content-text"
|
|
|
|
|
>
|
|
|
|
|
{{ item.notes }}
|
|
|
|
|
</div>
|
2019-10-12 15:05:15 +00:00
|
|
|
</div>
|
|
|
|
|
<div
|
2019-10-12 14:33:05 +00:00
|
|
|
v-if="item.event"
|
2020-04-10 20:15:23 +00:00
|
|
|
:class="item.purchaseType === 'gear' ? 'mt-4' : 'mt-2'"
|
2019-10-12 14:33:05 +00:00
|
|
|
>
|
|
|
|
|
{{ limitedString }}
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</b-popover>
|
|
|
|
|
</div>
|
2017-07-27 17:41:23 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2019-10-01 13:38:48 +00:00
|
|
|
@import '~@/assets/scss/colors.scss';
|
2017-07-27 17:41:23 +00:00
|
|
|
|
2017-08-14 17:15:32 +00:00
|
|
|
.item-wrapper {
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item {
|
2020-04-30 17:38:59 +00:00
|
|
|
height: 7.5rem;
|
|
|
|
|
width: 94px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background-color: $white;
|
|
|
|
|
box-shadow: 0 1px 3px 0 rgba($black, 0.12), 0 1px 2px 0 rgba($black, 0.24);
|
2017-09-21 00:28:11 +00:00
|
|
|
cursor: pointer;
|
2017-07-27 17:41:23 +00:00
|
|
|
|
2020-04-30 17:38:59 +00:00
|
|
|
&.locked .price {
|
|
|
|
|
opacity: 0.5;
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 23:04:40 +00:00
|
|
|
.image {
|
2020-04-30 17:38:59 +00:00
|
|
|
margin: 12px 13px;
|
2017-07-31 23:04:40 +00:00
|
|
|
}
|
|
|
|
|
|
2017-07-27 17:41:23 +00:00
|
|
|
.price {
|
2020-04-30 17:38:59 +00:00
|
|
|
height: 1.75rem;
|
|
|
|
|
width: 94px;
|
|
|
|
|
margin-left: -1px;
|
|
|
|
|
margin-right: -1px;
|
|
|
|
|
border-radius: 0px 0px 4px 4px;
|
|
|
|
|
|
|
|
|
|
&.gems {
|
|
|
|
|
background-color: rgba($green-100, 0.15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.gold {
|
|
|
|
|
background-color: rgba($yellow-100, 0.15);
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-30 17:38:59 +00:00
|
|
|
&.hourglasses {
|
|
|
|
|
background-color: rgba($blue-50, 0.15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.unlock {
|
|
|
|
|
background-color: rgba($gray-400, 0.15);
|
|
|
|
|
}
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.price-label {
|
|
|
|
|
font-family: Roboto;
|
2020-04-30 17:38:59 +00:00
|
|
|
font-size: 12px;
|
2017-07-27 17:41:23 +00:00
|
|
|
font-weight: bold;
|
|
|
|
|
line-height: 1.33;
|
|
|
|
|
|
|
|
|
|
&.gems {
|
2020-04-30 17:38:59 +00:00
|
|
|
color: $green-1;
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.gold {
|
2020-04-30 17:38:59 +00:00
|
|
|
color: $yellow-1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.unlock {
|
|
|
|
|
color: $gray-100;
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
2017-08-08 01:04:46 +00:00
|
|
|
|
|
|
|
|
&.hourglasses {
|
2020-04-30 17:38:59 +00:00
|
|
|
color: $blue-1;
|
2017-08-08 01:04:46 +00:00
|
|
|
}
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
span.svg-icon.inline.lock {
|
|
|
|
|
height: 12px;
|
|
|
|
|
width: 10px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 8px;
|
|
|
|
|
top: 8px;
|
|
|
|
|
margin-top: 0;
|
2020-04-30 17:38:59 +00:00
|
|
|
color: $gray-200;
|
2017-07-27 17:41:23 +00:00
|
|
|
}
|
2017-09-21 00:28:11 +00:00
|
|
|
|
2020-04-30 17:38:59 +00:00
|
|
|
span.badge.badge-round.badge-item.badge-clock {
|
2017-09-21 00:28:11 +00:00
|
|
|
height: 24px;
|
|
|
|
|
width: 24px;
|
|
|
|
|
background-color: $purple-300;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: -8px;
|
|
|
|
|
top: -12px;
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
span.svg-icon.inline.clock {
|
|
|
|
|
height: 16px;
|
|
|
|
|
width: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.suggestedDot {
|
|
|
|
|
width: 6px;
|
|
|
|
|
height: 6px;
|
2020-04-30 17:38:59 +00:00
|
|
|
background-color: $purple-400;
|
2017-09-21 00:28:11 +00:00
|
|
|
border-radius: 4px;
|
|
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 8px;
|
|
|
|
|
top: 8px;
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
}
|
2017-09-25 18:12:49 +00:00
|
|
|
|
|
|
|
|
.icon-48 {
|
|
|
|
|
width: 48px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
}
|
2020-04-30 17:38:59 +00:00
|
|
|
|
|
|
|
|
.w-0 {
|
|
|
|
|
width: 0rem;
|
|
|
|
|
}
|
2017-07-27 17:41:23 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
2019-10-09 18:08:36 +00:00
|
|
|
import uuid from 'uuid';
|
2017-07-27 17:41:23 +00:00
|
|
|
|
2019-10-09 18:08:36 +00:00
|
|
|
import moment from 'moment';
|
|
|
|
|
import svgGem from '@/assets/svg/gem.svg';
|
|
|
|
|
import svgGold from '@/assets/svg/gold.svg';
|
|
|
|
|
import svgHourglasses from '@/assets/svg/hourglass.svg';
|
|
|
|
|
import svgLock from '@/assets/svg/lock.svg';
|
|
|
|
|
import svgClock from '@/assets/svg/clock.svg';
|
2017-07-27 17:41:23 +00:00
|
|
|
|
2019-10-09 18:08:36 +00:00
|
|
|
import EquipmentAttributesPopover from '@/components/inventory/equipment/attributesPopover';
|
2017-08-14 17:15:32 +00:00
|
|
|
|
2019-10-09 18:08:36 +00:00
|
|
|
import QuestInfo from './quests/questInfo.vue';
|
2017-09-25 18:12:49 +00:00
|
|
|
|
2019-10-09 18:08:36 +00:00
|
|
|
import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config';
|
2017-09-21 00:28:11 +00:00
|
|
|
|
2019-10-09 18:08:36 +00:00
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
EquipmentAttributesPopover,
|
|
|
|
|
QuestInfo,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
item: {
|
|
|
|
|
type: Object,
|
2017-07-27 17:41:23 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
price: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: -1,
|
2017-07-27 17:41:23 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
emptyItem: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
2017-07-27 17:41:23 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
highlightBorder: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
2017-08-24 05:16:18 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
popoverPosition: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: 'bottom',
|
|
|
|
|
},
|
|
|
|
|
showPopover: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
|
|
|
|
showEventBadge: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
2020-04-30 17:38:59 +00:00
|
|
|
owned: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return Object.freeze({
|
|
|
|
|
itemId: uuid.v4(),
|
|
|
|
|
icons: {
|
|
|
|
|
gems: svgGem,
|
|
|
|
|
gold: svgGold,
|
|
|
|
|
lock: svgLock,
|
|
|
|
|
hourglasses: svgHourglasses,
|
|
|
|
|
clock: svgClock,
|
2017-09-21 00:28:11 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
showNotes () {
|
|
|
|
|
if (['armoire', 'potion'].indexOf(this.item.path) > -1) return true;
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
currencyClass () {
|
2020-04-30 17:38:59 +00:00
|
|
|
if (this.item.unlockCondition && this.item.unlockCondition.condition === 'party invite' && !this.owned) return 'unlock';
|
2019-10-09 18:08:36 +00:00
|
|
|
if (this.item.currency && this.icons[this.item.currency]) {
|
|
|
|
|
return this.item.currency;
|
|
|
|
|
}
|
|
|
|
|
return 'gold';
|
|
|
|
|
},
|
|
|
|
|
limitedString () {
|
|
|
|
|
return this.item.owned === false ? ''
|
|
|
|
|
: this.$t('limitedOffer', { date: moment(seasonalShopConfig.dateRange.end).format('LL') });
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
click () {
|
|
|
|
|
this.$emit('click', {});
|
|
|
|
|
},
|
|
|
|
|
getPrice () {
|
2020-04-30 17:38:59 +00:00
|
|
|
if (this.item.unlockCondition && this.item.unlockCondition.condition === 'party invite' && !this.owned) return this.item.unlockCondition.text();
|
2019-10-09 18:08:36 +00:00
|
|
|
if (this.price === -1) {
|
|
|
|
|
return this.item.value;
|
|
|
|
|
}
|
|
|
|
|
return this.price;
|
|
|
|
|
},
|
|
|
|
|
getItemClasses () {
|
|
|
|
|
return {
|
|
|
|
|
'item-empty': this.emptyItem,
|
|
|
|
|
'highlight-border': this.highlightBorder,
|
|
|
|
|
suggested: this.item.isSuggested,
|
|
|
|
|
locked: this.item.locked,
|
|
|
|
|
};
|
2017-07-27 17:41:23 +00:00
|
|
|
},
|
2019-10-09 18:08:36 +00:00
|
|
|
},
|
|
|
|
|
};
|
2017-07-27 17:41:23 +00:00
|
|
|
</script>
|