feat: add basic stall list

This commit is contained in:
Vlad Stan 2023-07-14 14:28:26 +03:00
parent e37d385a2c
commit ad0ac073ab
4 changed files with 94 additions and 6 deletions

View file

@ -0,0 +1,57 @@
<div class="row q-col-gutter-md">
<div v-for="stall of stalls" :key="stall.id" class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card class="card--product">
<!-- <q-img
:src="(product.images && product.images.length > 0 && product.images[0]) ? product.images[0] : '/nostrmarket/static/images/placeholder.png'"
alt="Product Image" loading="lazy" spinner-color="white" fit="contain" height="300px"></q-img> -->
<q-card-section class="q-pb-xs q-pt-md">
<div class="row no-wrap items-center">
<div class="col text-subtitle2 ellipsis-2-lines">{{ stall.name }}</div>
</div>
</q-card-section>
<q-card-section class="q-py-sm">
<div>
<span v-if="stall.currency == 'sat'">
<!-- <span class="text-h6">{{ product.price }} sats</span><q-tooltip> BTC {{ (product.price /
1e8).toFixed(8) }}</q-tooltip> -->
currency sat
</span>
<span v-else>
<span class="text-h6">currency fiat</span>
</span>
<span class="q-ml-md text-caption text-green-8 text-weight-bolder q-mt-md">product count</span>
</div>
<div v-if="stall.categories" class="text-subtitle1">
<q-virtual-scroll :items="product.categories || []" virtual-scroll-horizontal>
<template v-slot="{ item, index }">
<q-chip :key="index" dense><span v-text="item"></span></q-chip>
</template>
</q-virtual-scroll>
</div>
<div v-else class="text-subtitle1">
&nbsp
</div>
<div class="text-caption text-grey ellipsis-2-lines" style="min-height: 40px">
<p v-if="stall.description">{{ stall.description }}</p>
</div>
</q-card-section>
<q-separator></q-separator>
<q-card-actions>
<div class="q-ml-auto">
<q-btn flat class="text-weight-bold text-capitalize q-ml-auto float-left" dense color="primary"
@click="$emit('change-page', 'stall', {stall: stall.id})">
Visit Stall
</q-btn>
</div>
</q-card-actions>
</q-card>
</div>
</div>

View file

@ -0,0 +1,20 @@
async function customerStallList(path) {
const template = await loadTemplateAsync(path)
Vue.component('customer-stall-list', {
name: 'customer-stall-list',
template,
props: ['stalls'],
data: function () {
return {}
},
computed: {},
methods: {
},
created() {
console.log('### stalls', this.stalls)
}
})
}

View file

@ -29,6 +29,7 @@ const market = async () => {
productCard('static/components/product-card/product-card.html'),
customerMarket('static/components/customer-market/customer-market.html'),
customerStall('static/components/customer-stall/customer-stall.html'),
customerStallList('static/components/customer-stall-list/customer-stall-list.html'),
productDetail('static/components/product-detail/product-detail.html'),
shoppingCart('static/components/shopping-cart/shopping-cart.html'),
shoppingCartList('static/components/shopping-cart-list/shopping-cart-list.html'),
@ -75,6 +76,7 @@ const market = async () => {
searchNostr: false,
filterCategories: [],
groupByStall: false,
drawer: true,
pubkeys: new Set(),
@ -233,7 +235,6 @@ const market = async () => {
if (product_id) {
this.activeProduct = product_id
}
this.activePage = 'stall'
this.activeStall = stall_id
}
if (merchant_pubkey && !this.pubkeys.has(merchant_pubkey)) {