feat: add basic customer orders

This commit is contained in:
Vlad Stan 2023-07-11 12:00:45 +03:00
parent 127f4148ea
commit 4817e594c9
4 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1 @@
<div>xxxx</div>

View file

@ -0,0 +1,18 @@
async function customerOrders(path) {
const template = await loadTemplateAsync(path)
Vue.component('customer-orders', {
name: 'customer-orders',
template,
props: ['orders'],
data: function () {
return {}
},
computed: {},
methods: {
},
created() { }
})
}

View file

@ -32,6 +32,7 @@ const market = async () => {
shoppingCart('static/components/shopping-cart/shopping-cart.html'),
shoppingCartList('static/components/shopping-cart-list/shopping-cart-list.html'),
shoppingCartCheckout('static/components/shopping-cart-checkout/shopping-cart-checkout.html'),
customerOrders('static/components/customer-orders/customer-orders.html'),
chatDialog('static/components/chat-dialog/chat-dialog.html'),
marketConfig('static/components/market-config/market-config.html')
])

View file

@ -181,6 +181,8 @@
<q-btn v-else @click="accountDialog.show = true" color="gray" icon="person_add" flat
size="lg"><q-tooltip>User
Config</q-tooltip></q-btn>
<q-btn @click="setActivePage('customer-orders')" color="gray" icon="receipt_long" flat
size="lg"><q-tooltip>Orders</q-tooltip></q-btn>
<q-btn color="gray" icon="shopping_cart" dense round flat size="lg"
@click="setActivePage('shopping-cart-list')">
<q-tooltip>Shopping Cart</q-tooltip>
@ -216,6 +218,7 @@
<shopping-cart-checkout v-else-if="activePage === 'shopping-cart-checkout'" :cart="checkoutCart"
:stall="checkoutStall" :customer-pubkey="account?.pubkey" @login-required="openAccountDialog"
@place-order="placeOrder"></shopping-cart-checkout>
<customer-orders v-else-if="activePage === 'customer-orders'"></customer-orders>
<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)"
:product-detail="activeProduct" :relays="relays" :account="account" :pool="pool" :styles="config?.opts ?? {}"
@ -320,6 +323,7 @@
<script src="{{ url_for('nostrmarket_static', path='components/shopping-cart-list/shopping-cart-list.js') }}"></script>
<script
src="{{ url_for('nostrmarket_static', path='components/shopping-cart-checkout/shopping-cart-checkout.js') }}"></script>
<script src="{{ url_for('nostrmarket_static', path='components/customer-orders/customer-orders.js') }}"></script>
<script src="{{ url_for('nostrmarket_static', path='components/chat-dialog/chat-dialog.js') }}"></script>
<script src="{{ url_for('nostrmarket_static', path='components/market-config/market-config.js') }}"></script>
<script src="{{ url_for('nostrmarket_static', path='js/market.js') }}"></script>