Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Product detail): new tab with map view #693

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
"FilterPriceMoreThan30DaysHide": "Hide prices older than 30 days",
"Help": "Help",
"Image": "Image",
"List": "List",
"Map": "Map",
"Order": "Order",
"OrderProductUniqueScansDESC": "Number of scans",
"OrderProductPriceCountDESC": "Number of prices",
Expand Down
64 changes: 42 additions & 22 deletions src/views/ProductDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,48 @@

<br>

<v-row>
<v-col>
<h2 class="text-h6 d-inline mr-2">
{{ $t('ProductDetail.LatestPrices') }}
</h2>
<v-progress-circular v-if="loading" indeterminate :size="30" />
<FilterMenu v-if="!loading" kind="price" :currentFilter="currentFilter" @update:currentFilter="togglePriceFilter($event)" />
<OrderMenu v-if="!loading" kind="price" :currentOrder="currentOrder" @update:currentOrder="selectPriceOrder($event)" />
</v-col>
</v-row>
<v-tabs v-model="tab" align-tabs="start" grow>
<v-tab value="tab-list">
<v-icon icon="mdi-database-outline" />
{{ $t('Common.List') }}
</v-tab>
<v-tab value="tab-map">
<v-icon icon="mdi-map-marker-outline" />
{{ $t('Common.Map') }}
</v-tab>
</v-tabs>

<v-row class="mt-0">
<v-col v-for="price in productPriceList" :key="price" cols="12" sm="6" md="4">
<PriceCard :price="price" :product="product" :hideProductImage="true" :hideProductTitle="true" :hideProductDetails="productIsCategory ? false : true" elevation="1" height="100%" />
</v-col>
</v-row>
<v-window v-model="tab">
<v-window-item value="tab-list">
<v-container fluid>
<v-row>
<v-col>
<h2 class="text-h6 d-inline mr-2">
{{ $t('ProductDetail.LatestPrices') }}
</h2>
<v-progress-circular v-if="loading" indeterminate :size="30" />
<FilterMenu v-if="!loading" kind="price" :currentFilter="currentFilter" @update:currentFilter="togglePriceFilter($event)" />
<OrderMenu v-if="!loading" kind="price" :currentOrder="currentOrder" @update:currentOrder="selectPriceOrder($event)" />
</v-col>
</v-row>

<v-row v-if="productPriceList.length < productPriceTotal" class="mb-2">
<v-col align="center">
<v-btn size="small" :loading="loading" @click="getProductPrices">
{{ $t('ProductDetail.LoadMore') }}
</v-btn>
</v-col>
</v-row>
<v-row class="mt-0">
<v-col v-for="price in productPriceList" :key="price" cols="12" sm="6" md="4">
<PriceCard :price="price" :product="product" :hideProductImage="true" :hideProductTitle="true" :hideProductDetails="productIsCategory ? false : true" elevation="1" height="100%" />
</v-col>
</v-row>

<v-row v-if="productPriceList.length < productPriceTotal" class="mb-2">
<v-col align="center">
<v-btn size="small" :loading="loading" @click="getProductPrices">
{{ $t('ProductDetail.LoadMore') }}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-window-item>
<v-window-item key="tab-map" value="tab-map" />
</v-window>
</template>

<script>
Expand Down Expand Up @@ -92,6 +110,8 @@ export default {
loading: false,
// share
shareLinkCopySuccessMessage: false,
// tabs
tab: null,
// filter & order
currentFilter: '',
currentOrder: constants.PRICE_ORDER_LIST[1].key,
Expand Down
Loading