multiple market fixes (#9468)

* show `selectMemberModal` to send a card, even if the user doesn't have a party yet

* market - prevent filter reset on pinning items

* hide buy amount for gear, backgrounds, mystery_set, card, rebirth_orb, fortify, armoire - fix mystery set preview in timetravelers

* purchase confirmation on gem / hourglass purchases

* fix lint
This commit is contained in:
negue
2017-11-28 02:54:55 +01:00
committed by Sabe Jones
parent 29dc56c12f
commit b3870e5f34
6 changed files with 45 additions and 15 deletions
+25 -3
View File
@@ -42,10 +42,10 @@
)
.purchase-amount(:class="{'notEnough': !this.enoughCurrency(getPriceClass(), item.value * selectedAmountToBuy)}")
.how-many-to-buy(v-if='["fortify", "gear"].indexOf(item.purchaseType) === -1')
.how-many-to-buy(v-if='showAmountToBuy(item)')
strong {{ $t('howManyToBuy') }}
div(v-if='item.purchaseType !== "gear"')
.box(v-if='["fortify", "gear"].indexOf(item.purchaseType) === -1')
div(v-if='showAmountToBuy(item)')
.box
input(type='number', min='0', v-model='selectedAmountToBuy')
span.svg-icon.inline.icon-32(aria-hidden="true", v-html="icons[getPriceClass()]")
span.value(:class="getPriceClass()") {{ item.value }}
@@ -285,6 +285,11 @@
import moment from 'moment';
const hideAmountSelectionForPurchaseTypes = [
'gear', 'backgrounds', 'mystery_set', 'card',
'rebirth_orb', 'fortify', 'armoire',
];
export default {
mixins: [currencyMixin, notifications, spellsMixin, buyMixin],
components: {
@@ -363,6 +368,16 @@
this.$emit('change', $event);
},
buyItem () {
if (this.item.currency === 'gems' &&
!confirm(this.$t('purchaseFor', { cost: this.item.value }))) {
return;
}
if (this.item.currency === 'hourglasses' &&
!confirm(this.$t('purchaseForHourglasses', { cost: this.item.value }))) {
return;
}
if (this.item.cast) {
this.castStart(this.item);
} else if (this.genericPurchase) {
@@ -403,6 +418,13 @@
return 'gold';
}
},
showAmountToBuy (item) {
if (hideAmountSelectionForPurchaseTypes.includes(item.purchaseType)) {
return false;
} else {
return true;
}
},
getAvatarOverrides (item) {
switch (item.purchaseType) {
case 'gear':
@@ -506,9 +506,11 @@ export default {
}
categories.map((category) => {
this.$set(this.viewOptions, category.identifier, {
selected: true,
});
if (!this.viewOptions[category.identifier]) {
this.$set(this.viewOptions, category.identifier, {
selected: true,
});
}
});
return categories;
@@ -333,7 +333,7 @@
currency: 'hourglasses',
key: c.identifier,
class: `shop_set_mystery_${c.identifier}`,
purchaseType: 'set_mystery',
purchaseType: 'mystery_set',
};
}),
};