fix: more UI stuff
This commit is contained in:
parent
3864200ffa
commit
c3c141cac4
4 changed files with 35 additions and 16 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<div>
|
||||
<q-card v-if="!merchantOrders?.length" bordered class="q-mb-md">
|
||||
<q-card-section>
|
||||
<strong>No products in cart!</strong>
|
||||
<strong>No orders!</strong>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<div v-for="merchant in merchantOrders">
|
||||
|
|
@ -99,11 +99,16 @@
|
|||
</q-card-section>
|
||||
<q-separator vertical />
|
||||
<q-card-section>
|
||||
<q-item-section class="q-mt-sm q-ml-sm">
|
||||
<q-item-section class="q-mt-md q-ml-sm">
|
||||
<q-item-label> <strong>Shipping Zone: </strong>
|
||||
<span v-text="order.shippingZone?.name || ''"></span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section v-if="order.message" class="q-mt-md q-ml-sm">
|
||||
<q-item-label> <strong>Message: </strong>
|
||||
<span v-text="order.message"></span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section class="q-mt-md q-ml-sm">
|
||||
<q-item-label> <strong>Invoice: </strong>
|
||||
<q-badge @click="showInvoice(order)" v-if="order.invoice?.human_readable_part?.amount"
|
||||
|
|
@ -116,6 +121,17 @@
|
|||
</q-card-section>
|
||||
</q-card-section>
|
||||
<q-separator></q-separator>
|
||||
<q-card-section class="col-12">
|
||||
<q-item-section class="q-mt-sm q-ml-sm">
|
||||
<q-item-label> <strong>Order ID: </strong>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section class="q-mt-sm">
|
||||
<q-item-label>
|
||||
<span v-text="order.id"></span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-card-section>
|
||||
<q-card-section v-if="order.messages" class="col-12">
|
||||
<q-item-section class="q-mt-sm q-ml-sm">
|
||||
<q-item-label> <strong>Messages: </strong>
|
||||
|
|
@ -132,6 +148,7 @@
|
|||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-card-section>
|
||||
|
||||
</q-expansion-item>
|
||||
<q-separator></q-separator>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
<q-btn @click="goToShoppingCart" flat color="gray">
|
||||
Back
|
||||
</q-btn>
|
||||
<q-btn @click="orderConfirmed = true" flat color="primary">
|
||||
<q-btn @click="confirmOrder" flat color="primary">
|
||||
Confirm
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -61,6 +61,17 @@ async function shoppingCartCheckout(path) {
|
|||
this.shippingZone = zone
|
||||
},
|
||||
|
||||
confirmOrder: function () {
|
||||
if (!this.shippingZone) {
|
||||
this.$q.notify({
|
||||
timeout: 5000,
|
||||
type: 'warning',
|
||||
message: 'Please select a shipping zone!',
|
||||
})
|
||||
return
|
||||
}
|
||||
this.orderConfirmed = true
|
||||
},
|
||||
async placeOrder() {
|
||||
if (!this.shippingZone) {
|
||||
this.$q.notify({
|
||||
|
|
@ -103,7 +114,7 @@ async function shoppingCartCheckout(path) {
|
|||
this.$emit('place-order', { event, order })
|
||||
|
||||
},
|
||||
goToShoppingCart: function(){
|
||||
goToShoppingCart: function () {
|
||||
this.$emit('change-page', 'shopping-cart-list')
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -842,29 +842,20 @@ const market = async () => {
|
|||
orders.unshift({
|
||||
...orderUpdate,
|
||||
eventCreatedAt,
|
||||
createdAt: eventCreatedAt,
|
||||
messages: orderUpdate.message ? [orderUpdate.message] : []
|
||||
createdAt: eventCreatedAt
|
||||
})
|
||||
this.orders[pubkey] = orders
|
||||
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
||||
return
|
||||
}
|
||||
|
||||
if (orderUpdate.message) {
|
||||
order.messages.push(orderUpdate.message)
|
||||
}
|
||||
|
||||
if (orderUpdate.type === 0) {
|
||||
order.createdAt = eventCreatedAt
|
||||
order = { ...order, ...orderUpdate }
|
||||
} else if (orderUpdate.type === 1) {
|
||||
order = { ...order, ...orderUpdate, message: order.message || orderUpdate.message }
|
||||
} else {
|
||||
order = order.eventCreatedAt < eventCreatedAt ? { ...order, ...orderUpdate } : { ...orderUpdate, ...order }
|
||||
} else if (orderUpdate.type === 2) {
|
||||
order.paid = orderUpdate.paid
|
||||
order.shipped = orderUpdate.shipped
|
||||
}
|
||||
|
||||
|
||||
orders = [order].concat(orders.filter(o => o.id !== order.id))
|
||||
this.orders[pubkey] = orders
|
||||
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue