|
@@ -5,14 +5,14 @@
|
|
|
<div class="scroll-track">
|
|
<div class="scroll-track">
|
|
|
<q-card
|
|
<q-card
|
|
|
v-for="item in data"
|
|
v-for="item in data"
|
|
|
- :key="item.id"
|
|
|
|
|
|
|
+ :key="item.provider_id"
|
|
|
class="fav-card shadow-card bg-surface card-border"
|
|
class="fav-card shadow-card bg-surface card-border"
|
|
|
:flat="false"
|
|
:flat="false"
|
|
|
>
|
|
>
|
|
|
<q-card-section class="q-pa-sm column text-text">
|
|
<q-card-section class="q-pa-sm column text-text">
|
|
|
<div class="row items-start no-wrap">
|
|
<div class="row items-start no-wrap">
|
|
|
<div class="col-3 q-my-auto">
|
|
<div class="col-3 q-my-auto">
|
|
|
- <q-avatar :style="avatarColors[item.provider_id % avatarColors.length]" size="46px" class="text-weight-bold">
|
|
|
|
|
|
|
+ <q-avatar :style="avatarColors[item.provider_provider_id % avatarColors.length]" size="46px" class="text-weight-bold">
|
|
|
{{ item.provider_name?.slice(0,1).toUpperCase() ?? '—' }}
|
|
{{ item.provider_name?.slice(0,1).toUpperCase() ?? '—' }}
|
|
|
</q-avatar>
|
|
</q-avatar>
|
|
|
</div>
|
|
</div>
|
|
@@ -44,10 +44,15 @@
|
|
|
// import { formatCurrency } from 'src/helpers/utils';
|
|
// import { formatCurrency } from 'src/helpers/utils';
|
|
|
// import { useI18n } from 'vue-i18n';
|
|
// import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
|
|
|
|
+import { formatCurrency } from 'src/helpers/utils';
|
|
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
|
|
|
+
|
|
|
defineProps({ data: { type: Array, default: () => [] } });
|
|
defineProps({ data: { type: Array, default: () => [] } });
|
|
|
|
|
|
|
|
// const { t } = useI18n();
|
|
// const { t } = useI18n();
|
|
|
|
|
|
|
|
|
|
+const { t } = useI18n();
|
|
|
|
|
+
|
|
|
const avatarColors = [
|
|
const avatarColors = [
|
|
|
{ background: '#ffd5df', color: '#932e57' },
|
|
{ background: '#ffd5df', color: '#932e57' },
|
|
|
{ background: '#d7e8ff', color: '#2158a8' },
|
|
{ background: '#d7e8ff', color: '#2158a8' },
|
|
@@ -67,6 +72,19 @@ const avatarColors = [
|
|
|
// const min = Math.min(...prices.map(Number));
|
|
// const min = Math.min(...prices.map(Number));
|
|
|
// return t('dashboard_client.favorites.from') + ' ' + formatCurrency(min);
|
|
// return t('dashboard_client.favorites.from') + ' ' + formatCurrency(min);
|
|
|
// };
|
|
// };
|
|
|
|
|
+
|
|
|
|
|
+const bestPrice = (item) => {
|
|
|
|
|
+ const prices = [
|
|
|
|
|
+ item.daily_price_2h,
|
|
|
|
|
+ item.daily_price_4h,
|
|
|
|
|
+ item.daily_price_6h,
|
|
|
|
|
+ item.daily_price_8h,
|
|
|
|
|
+ ].filter(p => p != null && Number(p) > 0);
|
|
|
|
|
+
|
|
|
|
|
+ if (!prices.length) return t('dashboard_client.favorites.no_price');
|
|
|
|
|
+ const min = Math.min(...prices.map(Number));
|
|
|
|
|
+ return t('dashboard_client.favorites.from') + ' ' + formatCurrency(min);
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|