2017-08-20 22:32:32 +00:00
|
|
|
<template lang="pug">
|
2018-01-31 10:55:39 +00:00
|
|
|
.row(:class="{'small-version': smallVersion}")
|
|
|
|
|
template(v-if="quest.collect")
|
|
|
|
|
span.title(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('collect') + ':' }}
|
|
|
|
|
span.col-8
|
2017-08-20 22:32:32 +00:00
|
|
|
div(v-for="(collect, key) of quest.collect")
|
2017-09-16 21:09:31 +00:00
|
|
|
span {{ collect.count }} {{ getCollectText(collect) }}
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
template(v-if="quest.boss")
|
|
|
|
|
span.title(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('bossHP') + ':' }}
|
|
|
|
|
span.col-8 {{ quest.boss.hp }}
|
2017-12-05 20:09:34 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
span.title(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('difficulty') + ':' }}
|
|
|
|
|
span.col-8
|
|
|
|
|
.svg-icon.inline(
|
|
|
|
|
v-for="star of stars()", v-html="icons[star]",
|
|
|
|
|
:class="smallVersion ? 'icon-12' : 'icon-16'",
|
|
|
|
|
)
|
2017-08-20 22:32:32 +00:00
|
|
|
</template>
|
2018-01-31 10:55:39 +00:00
|
|
|
|
2017-08-20 22:32:32 +00:00
|
|
|
<style lang="scss" scoped>
|
2018-01-31 10:55:39 +00:00
|
|
|
@import '~client/assets/scss/colors.scss';
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
.title {
|
|
|
|
|
text-align: left;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
.col-8 {
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
.col-8:not(:last-child) {
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
}
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
.svg-icon {
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.small-version {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 1.33;
|
2017-08-20 22:32:32 +00:00
|
|
|
|
2018-01-31 10:55:39 +00:00
|
|
|
.svg-icon {
|
|
|
|
|
margin-top: 1px;
|
2017-08-20 22:32:32 +00:00
|
|
|
}
|
2018-01-31 10:55:39 +00:00
|
|
|
}
|
2017-08-20 22:32:32 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import svgStar from 'assets/svg/difficulty-star.svg';
|
|
|
|
|
import svgStarHalf from 'assets/svg/difficulty-star-half.svg';
|
|
|
|
|
import svgStarEmpty from 'assets/svg/difficulty-star-empty.svg';
|
|
|
|
|
|
|
|
|
|
export default {
|
2018-01-31 10:55:39 +00:00
|
|
|
props: {
|
|
|
|
|
quest: {
|
|
|
|
|
type: Object,
|
|
|
|
|
},
|
|
|
|
|
smallVersion: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
2017-08-20 22:32:32 +00:00
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
icons: Object.freeze({
|
|
|
|
|
star: svgStar,
|
|
|
|
|
starHalf: svgStarHalf,
|
|
|
|
|
starEmpty: svgStarEmpty,
|
|
|
|
|
}),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
difficulty () {
|
|
|
|
|
if (this.quest.boss) {
|
|
|
|
|
return this.quest.boss.str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
stars () {
|
|
|
|
|
let result = [];
|
|
|
|
|
let difficulty = this.difficulty;
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i <= 4; i++) {
|
|
|
|
|
let diff = difficulty - i;
|
|
|
|
|
|
|
|
|
|
if (diff >= 0) {
|
|
|
|
|
result.push('star');
|
|
|
|
|
} else if (diff <= -1) {
|
|
|
|
|
result.push('starEmpty');
|
|
|
|
|
} else {
|
|
|
|
|
result.push('starHalf');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
},
|
2017-09-16 21:09:31 +00:00
|
|
|
getCollectText (collect) {
|
|
|
|
|
if (collect.text instanceof Function) {
|
|
|
|
|
return collect.text();
|
|
|
|
|
} else {
|
|
|
|
|
return collect.text;
|
|
|
|
|
}
|
|
|
|
|
},
|
2017-08-20 22:32:32 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|