2017-07-27 17:41:23 +00:00
|
|
|
<template lang="pug">
|
2017-07-31 23:04:40 +00:00
|
|
|
b-modal#buy-quest-modal(
|
2017-07-27 17:41:23 +00:00
|
|
|
:visible="true",
|
|
|
|
|
v-if="item != null",
|
|
|
|
|
:hide-header="true",
|
|
|
|
|
@change="onChange($event)"
|
|
|
|
|
)
|
|
|
|
|
span.badge.badge-pill.badge-dialog(
|
|
|
|
|
:class="{'item-selected-badge': true}",
|
|
|
|
|
v-if="withPin"
|
|
|
|
|
)
|
|
|
|
|
span.svg-icon.inline.color.icon-10(v-html="icons.pin")
|
|
|
|
|
|
|
|
|
|
div.close
|
|
|
|
|
span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close", @click="hideDialog()")
|
|
|
|
|
|
|
|
|
|
div.content(v-if="item != null")
|
|
|
|
|
|
|
|
|
|
div.inner-content
|
|
|
|
|
slot(name="item", :item="item")
|
|
|
|
|
|
|
|
|
|
h4.title {{ itemText }}
|
2017-07-31 23:04:40 +00:00
|
|
|
div.text(v-html="itemNotes")
|
2017-07-27 17:41:23 +00:00
|
|
|
|
|
|
|
|
slot(name="additionalInfo", :item="item")
|
|
|
|
|
|
|
|
|
|
div
|
|
|
|
|
span.svg-icon.inline.icon-32(aria-hidden="true", v-html="(priceType === 'gems') ? icons.gem : icons.gold")
|
|
|
|
|
span.value(:class="priceType") {{ item.value }}
|
|
|
|
|
|
|
|
|
|
button.btn.btn-primary(@click="buyItem()") {{ $t('buyNow') }}
|
|
|
|
|
|
2017-07-31 23:04:40 +00:00
|
|
|
div.right-sidebar(v-if="item.drop")
|
|
|
|
|
h3(v-once) {{ $t('rewards') }}
|
|
|
|
|
div.reward-item
|
|
|
|
|
span.svg-icon.inline.icon(v-html="icons.experience")
|
|
|
|
|
span.reward-text {{ $t('amountExperience', { amount: item.drop.exp }) }}
|
|
|
|
|
div.reward-item(v-if="item.drop.gp != 0")
|
|
|
|
|
span.svg-icon.inline.icon(v-html="icons.gold")
|
|
|
|
|
span.reward-text {{ $t('amountGold', { amount: item.drop.gp }) }}
|
|
|
|
|
div.reward-item(v-for="drop in item.drop.items")
|
|
|
|
|
span.icon
|
|
|
|
|
div(:class="getDropIcon(drop)")
|
|
|
|
|
span.reward-text {{ getDropName(drop) }}
|
|
|
|
|
|
2017-07-27 17:41:23 +00:00
|
|
|
div.clearfix(slot="modal-footer")
|
|
|
|
|
span.balance.float-left {{ $t('yourBalance') }}
|
|
|
|
|
balanceInfo.float-right
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
@import '~client/assets/scss/colors.scss';
|
|
|
|
|
@import '~client/assets/scss/modal.scss';
|
|
|
|
|
|
2017-07-31 23:04:40 +00:00
|
|
|
#buy-quest-modal {
|
2017-07-27 17:41:23 +00:00
|
|
|
@include centeredModal();
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-wrapper {
|
|
|
|
|
margin-bottom: 0 !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.inner-content {
|
|
|
|
|
margin: 33px auto auto;
|
|
|
|
|
width: 282px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content-text {
|
|
|
|
|
font-family: 'Roboto', sans-serif;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
line-height: 1.43;
|
|
|
|
|
width: 400px;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 23:04:40 +00:00
|
|
|
.right-sidebar {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: -350px;
|
|
|
|
|
top: 25px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
background-color: $gray-600;
|
|
|
|
|
box-shadow: 0 2px 16px 0 rgba(26, 24, 29, 0.32);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
width: 364px;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.reward-item {
|
|
|
|
|
width: 306px;
|
|
|
|
|
height: 84px;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
background-color: $white;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
|
margin: 18px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
width: 48px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.reward-text {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-27 17:41:23 +00:00
|
|
|
span.svg-icon.inline.icon-32 {
|
|
|
|
|
height: 32px;
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.value {
|
|
|
|
|
width: 28px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
font-family: Roboto;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
line-height: 1.33;
|
|
|
|
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
|
|
&.gems {
|
|
|
|
|
color: $green-10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.gold {
|
|
|
|
|
color: $yellow-10
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button.btn.btn-primary {
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.balance {
|
|
|
|
|
width: 74px;
|
|
|
|
|
height: 16px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
line-height: 1.33;
|
|
|
|
|
color: $gray-200;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.modal-footer {
|
|
|
|
|
height: 48px;
|
|
|
|
|
background-color: $gray-700;
|
|
|
|
|
border-bottom-right-radius: 8px;
|
|
|
|
|
border-bottom-left-radius: 8px;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.badge-dialog {
|
|
|
|
|
color: $gray-300;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: -14px;
|
|
|
|
|
padding: 8px 10px;
|
|
|
|
|
top: -12px;
|
|
|
|
|
background: white;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
2017-07-31 23:04:40 +00:00
|
|
|
|
|
|
|
|
import {mapState} from 'client/libs/store';
|
|
|
|
|
|
2017-07-27 17:41:23 +00:00
|
|
|
import bModal from 'bootstrap-vue/lib/components/modal';
|
|
|
|
|
|
|
|
|
|
import svgClose from 'assets/svg/close.svg';
|
|
|
|
|
import svgGold from 'assets/svg/gold.svg';
|
|
|
|
|
import svgGem from 'assets/svg/gem.svg';
|
|
|
|
|
import svgPin from 'assets/svg/pin.svg';
|
2017-07-31 23:04:40 +00:00
|
|
|
import svgExperience from 'assets/svg/experience.svg';
|
2017-07-27 17:41:23 +00:00
|
|
|
|
2017-07-31 23:04:40 +00:00
|
|
|
import BalanceInfo from '../balanceInfo.vue';
|
2017-07-27 17:41:23 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
bModal,
|
|
|
|
|
BalanceInfo,
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
icons: Object.freeze({
|
|
|
|
|
close: svgClose,
|
|
|
|
|
gold: svgGold,
|
|
|
|
|
gem: svgGem,
|
|
|
|
|
pin: svgPin,
|
2017-07-31 23:04:40 +00:00
|
|
|
experience: svgExperience,
|
2017-07-27 17:41:23 +00:00
|
|
|
}),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
2017-07-31 23:04:40 +00:00
|
|
|
...mapState({
|
|
|
|
|
content: 'content',
|
|
|
|
|
}),
|
2017-07-27 17:41:23 +00:00
|
|
|
itemText () {
|
|
|
|
|
if (this.item.text instanceof Function) {
|
|
|
|
|
return this.item.text();
|
|
|
|
|
} else {
|
|
|
|
|
return this.item.text;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
itemNotes () {
|
|
|
|
|
if (this.item.notes instanceof Function) {
|
|
|
|
|
return this.item.notes();
|
|
|
|
|
} else {
|
|
|
|
|
return this.item.notes;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onChange ($event) {
|
|
|
|
|
this.$emit('change', $event);
|
|
|
|
|
},
|
|
|
|
|
buyItem () {
|
2017-07-31 23:04:40 +00:00
|
|
|
this.$emit('buyPressed', this.item);
|
2017-07-27 17:41:23 +00:00
|
|
|
this.hideDialog();
|
|
|
|
|
},
|
|
|
|
|
hideDialog () {
|
2017-07-31 23:04:40 +00:00
|
|
|
this.$root.$emit('hide::modal', 'buy-quest-modal');
|
|
|
|
|
},
|
|
|
|
|
getDropIcon (drop) {
|
|
|
|
|
switch (drop.type) {
|
|
|
|
|
case 'gear':
|
|
|
|
|
return `shop_${drop.key}`;
|
|
|
|
|
case 'hatchingPotions':
|
|
|
|
|
return `Pet_HatchingPotion_${drop.key}`;
|
|
|
|
|
case 'food':
|
|
|
|
|
return `Pet_Food_${drop.key}`;
|
|
|
|
|
case 'eggs':
|
|
|
|
|
return `Pet_Egg_${drop.key}`;
|
|
|
|
|
case 'quests':
|
|
|
|
|
return `inventory_quest_scroll_${drop.key}`;
|
|
|
|
|
default:
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getDropName (drop) {
|
|
|
|
|
switch (drop.type) {
|
|
|
|
|
case 'gear':
|
|
|
|
|
return this.content.gear.flat[drop.key].text();
|
|
|
|
|
case 'quests':
|
|
|
|
|
return this.content.quests[drop.key].text();
|
|
|
|
|
case 'hatchingPotions':
|
|
|
|
|
return this.$t('namedHatchingPotion', { type: this.content.hatchingPotions[drop.key].text() });
|
|
|
|
|
case 'food':
|
|
|
|
|
return this.content.food[drop.key].text();
|
|
|
|
|
case 'eggs':
|
|
|
|
|
return this.content.eggs[drop.key].text();
|
|
|
|
|
default:
|
|
|
|
|
return `Unknown type: ${drop.type}`;
|
|
|
|
|
}
|
2017-07-27 17:41:23 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
item: {
|
|
|
|
|
type: Object,
|
|
|
|
|
},
|
|
|
|
|
priceType: {
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
withPin: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|