fix: more UI stuff

This commit is contained in:
Vlad Stan 2023-07-12 16:03:10 +03:00
parent 3864200ffa
commit c3c141cac4
4 changed files with 35 additions and 16 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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')
}
},