feat: navigate from chat to orders
This commit is contained in:
parent
2d522f8c47
commit
4974192b21
5 changed files with 34 additions and 3 deletions
|
|
@ -1,7 +1,21 @@
|
||||||
<div>
|
<div>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<h6 class="text-subtitle1 q-my-none">Messages</h6>
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<h6 class="text-subtitle1 q-my-none">Messages</h6>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<q-btn
|
||||||
|
v-if="activePublicKey"
|
||||||
|
@click="showClientOrders"
|
||||||
|
unelevated
|
||||||
|
outline
|
||||||
|
class="float-right"
|
||||||
|
>Client Orders</q-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-card-section class="q-pa-none">
|
<q-card-section class="q-pa-none">
|
||||||
<q-separator></q-separator>
|
<q-separator></q-separator>
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,9 @@ async function directMessages(path) {
|
||||||
LNbits.utils.notifyApiError(error)
|
LNbits.utils.notifyApiError(error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
showClientOrders: function () {
|
||||||
|
this.$emit('customer-selected', this.activePublicKey)
|
||||||
|
},
|
||||||
selectActiveCustomer: async function () {
|
selectActiveCustomer: async function () {
|
||||||
await this.getDirectMessages(this.activePublicKey)
|
await this.getDirectMessages(this.activePublicKey)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,18 @@ async function orderList(path) {
|
||||||
const template = await loadTemplateAsync(path)
|
const template = await loadTemplateAsync(path)
|
||||||
Vue.component('order-list', {
|
Vue.component('order-list', {
|
||||||
name: 'order-list',
|
name: 'order-list',
|
||||||
props: ['stall-id', 'adminkey', 'inkey'],
|
props: ['stall-id', 'customer-pubkey-filter', 'adminkey', 'inkey'],
|
||||||
template,
|
template,
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
customerPubkeyFilter: async function (n) {
|
||||||
|
this.search.publicKey = n
|
||||||
|
this.search.isPaid = {label: 'All', id: null}
|
||||||
|
this.search.isShipped = {label: 'All', id: null}
|
||||||
|
await this.getOrders()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
orders: [],
|
orders: [],
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ const merchant = async () => {
|
||||||
merchant: {},
|
merchant: {},
|
||||||
shippingZones: [],
|
shippingZones: [],
|
||||||
activeChatCustomer: '',
|
activeChatCustomer: '',
|
||||||
|
orderPubkey: null,
|
||||||
showKeys: false,
|
showKeys: false,
|
||||||
importKeyDialog: {
|
importKeyDialog: {
|
||||||
show: false,
|
show: false,
|
||||||
|
|
@ -103,6 +104,9 @@ const merchant = async () => {
|
||||||
customerSelectedForOrder: function (customerPubkey) {
|
customerSelectedForOrder: function (customerPubkey) {
|
||||||
this.activeChatCustomer = customerPubkey
|
this.activeChatCustomer = customerPubkey
|
||||||
},
|
},
|
||||||
|
filterOrdersForCustomer: function (customerPubkey) {
|
||||||
|
this.orderPubkey = customerPubkey
|
||||||
|
},
|
||||||
waitForNotifications: function () {
|
waitForNotifications: function () {
|
||||||
try {
|
try {
|
||||||
const scheme = location.protocol === 'http:' ? 'ws' : 'wss'
|
const scheme = location.protocol === 'http:' ? 'ws' : 'wss'
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@
|
||||||
<order-list
|
<order-list
|
||||||
:adminkey="g.user.wallets[0].adminkey"
|
:adminkey="g.user.wallets[0].adminkey"
|
||||||
:inkey="g.user.wallets[0].inkey"
|
:inkey="g.user.wallets[0].inkey"
|
||||||
|
:customer-pubkey-filter="orderPubkey"
|
||||||
@customer-selected="customerSelectedForOrder"
|
@customer-selected="customerSelectedForOrder"
|
||||||
></order-list>
|
></order-list>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -149,8 +150,8 @@
|
||||||
:inkey="g.user.wallets[0].inkey"
|
:inkey="g.user.wallets[0].inkey"
|
||||||
:adminkey="g.user.wallets[0].adminkey"
|
:adminkey="g.user.wallets[0].adminkey"
|
||||||
:active-chat-customer="activeChatCustomer"
|
:active-chat-customer="activeChatCustomer"
|
||||||
|
@customer-selected="filterOrdersForCustomer"
|
||||||
>
|
>
|
||||||
|
|
||||||
</direct-messages>
|
</direct-messages>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue