feat: basic orders
This commit is contained in:
parent
aed65dd65e
commit
bce0b342d0
4 changed files with 106 additions and 37 deletions
|
|
@ -5,16 +5,32 @@ async function customerOrders(path) {
|
|||
name: 'orders',
|
||||
template,
|
||||
|
||||
props: ['orders'],
|
||||
props: ['orders', 'products', 'stalls'],
|
||||
data: function () {
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
|
||||
computed: {
|
||||
merchantOrders: function () {
|
||||
return Object.keys(this.orders).map(pubkey => ({ pubkey, orders: this.orders[pubkey] }))
|
||||
}
|
||||
},
|
||||
created() {
|
||||
methods: {
|
||||
stallNameForOrder: function (order) {
|
||||
console.log('### stallNameForOrder', order)
|
||||
const productId = order.items[0]?.product_id
|
||||
if (!productId) return 'Stall Name'
|
||||
const product = this.products.find(p => p.id === productId)
|
||||
if (!product) return 'Stall Name'
|
||||
const stall = this.stalls.find(s => s.id === product.stall_id)
|
||||
if (!stall) return 'Stall Name'
|
||||
return stall.name
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
console.log('### orders', this.orders)
|
||||
console.log('### products', this.products)
|
||||
console.log('### stall', this.stalls)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue