fix: breadcrumbs
This commit is contained in:
parent
6c02e58f84
commit
ff9891302a
4 changed files with 67 additions and 55 deletions
|
|
@ -24,11 +24,7 @@
|
||||||
<q-banner v-if="styles?.ui?.banner" class="row q-pa-none q-mb-md">
|
<q-banner v-if="styles?.ui?.banner" class="row q-pa-none q-mb-md">
|
||||||
<q-img :src="styles.ui.banner" style="width: 100%; height: 250px" cover></q-img>
|
<q-img :src="styles.ui.banner" style="width: 100%; height: 250px" cover></q-img>
|
||||||
</q-banner>
|
</q-banner>
|
||||||
<q-toolbar>
|
|
||||||
<q-breadcrumbs>
|
|
||||||
<q-breadcrumbs-el :label="styles.name ?? 'Market'" icon="home"></q-breadcrumbs-el>
|
|
||||||
</q-breadcrumbs>
|
|
||||||
</q-toolbar>
|
|
||||||
<div class="row q-col-gutter-md">
|
<div class="row q-col-gutter-md">
|
||||||
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3" v-for="(item, idx) in products" :key="idx">
|
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3" v-for="(item, idx) in products" :key="idx">
|
||||||
<product-card :product="item" @change-page="changePageM"></product-card>
|
<product-card :product="item" @change-page="changePageM"></product-card>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
<div>
|
<div>
|
||||||
<q-toolbar>
|
<q-toolbar>
|
||||||
<q-breadcrumbs class="cursor">
|
|
||||||
<q-breadcrumbs-el :label="styles.name ?? 'Market'" icon="home" @click="$emit('change-page', 'market')"
|
|
||||||
style="cursor: pointer"></q-breadcrumbs-el>
|
|
||||||
<q-breadcrumbs-el :label="stall?.name || 'Stall'" icon="widgets"></q-breadcrumbs-el>
|
|
||||||
</q-breadcrumbs>
|
|
||||||
<q-toolbar-title></q-toolbar-title>
|
<q-toolbar-title></q-toolbar-title>
|
||||||
<chat-dialog v-if="this.customerPrivkey || this.customerUseExtension" :account="account ? account : dropIn"
|
<chat-dialog v-if="this.customerPrivkey || this.customerUseExtension" :account="account ? account : dropIn"
|
||||||
:merchant="stall.pubkey" :relays="relays" :pool="pool" />
|
:merchant="stall.pubkey" :relays="relays" :pool="pool" />
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,8 @@ const market = async () => {
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
resetConfig() {
|
resetConfig() {
|
||||||
this.configDialog = {show: false,
|
this.configDialog = {
|
||||||
|
show: false,
|
||||||
identifier: null,
|
identifier: null,
|
||||||
data: {
|
data: {
|
||||||
name: null,
|
name: null,
|
||||||
|
|
@ -312,7 +313,8 @@ const market = async () => {
|
||||||
banner: null,
|
banner: null,
|
||||||
theme: null
|
theme: null
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async updateData(events) {
|
async updateData(events) {
|
||||||
if (events.length < 1) {
|
if (events.length < 1) {
|
||||||
|
|
@ -423,6 +425,7 @@ const market = async () => {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
navigateTo(page, opts = { stall: null, product: null, pubkey: null }) {
|
navigateTo(page, opts = { stall: null, product: null, pubkey: null }) {
|
||||||
|
console.log("### navigateTo", page, opts)
|
||||||
let { stall, product, pubkey } = opts
|
let { stall, product, pubkey } = opts
|
||||||
let url = new URL(window.location)
|
let url = new URL(window.location)
|
||||||
|
|
||||||
|
|
@ -437,8 +440,9 @@ const market = async () => {
|
||||||
if (stall) {
|
if (stall) {
|
||||||
this.activeStall = stall
|
this.activeStall = stall
|
||||||
url.searchParams.set('stall_id', stall)
|
url.searchParams.set('stall_id', stall)
|
||||||
if (product) {
|
|
||||||
this.activeProduct = product
|
this.activeProduct = product
|
||||||
|
if (product) {
|
||||||
url.searchParams.set('product_id', product)
|
url.searchParams.set('product_id', product)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,20 @@
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="q-mt-xl">
|
||||||
|
<q-breadcrumbs class="cursor">
|
||||||
|
<q-breadcrumbs-el :label="'Market'" icon="home" @click="navigateTo('market')"
|
||||||
|
class="cursor-pointer"></q-breadcrumbs-el>
|
||||||
|
<q-breadcrumbs-el v-if="activeStall" :label="stallName" @click="navigateTo('stall', {stall: activeStall})"
|
||||||
|
icon="widgets" class="cursor-pointer"></q-breadcrumbs-el>
|
||||||
|
<q-breadcrumbs-el v-if="activeProduct" :label="productName"
|
||||||
|
@click="navigateTo('product', {product: activeStall})" class="cursor-pointer"
|
||||||
|
icon="widgets"></q-breadcrumbs-el>
|
||||||
|
</q-breadcrumbs>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-separator class="q-mt-md q-mb-md"></q-separator>
|
||||||
|
|
||||||
<market-config v-if="showMarketConfig"></market-config>
|
<market-config v-if="showMarketConfig"></market-config>
|
||||||
<customer-stall v-else-if="!isLoading && activeStall" :stall="stalls.find(stall => stall.id == activeStall)"
|
<customer-stall v-else-if="!isLoading && activeStall" :stall="stalls.find(stall => stall.id == activeStall)"
|
||||||
:products="filterProducts" :stall-products="products.filter(p => p.stall_id == activeStall)"
|
:products="filterProducts" :stall-products="products.filter(p => p.stall_id == activeStall)"
|
||||||
|
|
@ -191,7 +205,9 @@
|
||||||
@login-dialog="openAccountDialog" @change-page="navigateTo"></customer-stall>
|
@login-dialog="openAccountDialog" @change-page="navigateTo"></customer-stall>
|
||||||
<customer-market v-else :search-nostr="searchNostr" :relays="relays" :products="filterProducts"
|
<customer-market v-else :search-nostr="searchNostr" :relays="relays" :products="filterProducts"
|
||||||
:styles="config?.opts ?? {}" @change-page="navigateTo" @update-data="updateData"></customer-market>
|
:styles="config?.opts ?? {}" @change-page="navigateTo" @update-data="updateData"></customer-market>
|
||||||
|
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
|
|
||||||
<!-- ACCOUNT DIALOG -->
|
<!-- ACCOUNT DIALOG -->
|
||||||
<q-dialog v-model="accountDialog.show" persistent>
|
<q-dialog v-model="accountDialog.show" persistent>
|
||||||
<q-card style="min-width: 350px">
|
<q-card style="min-width: 350px">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue