diff --git a/static/components/stall-details/stall-details.html b/static/components/stall-details/stall-details.html index e69de29..73a11d2 100644 --- a/static/components/stall-details/stall-details.html +++ b/static/components/stall-details/stall-details.html @@ -0,0 +1,109 @@ +
+ + + + + + + +
+
+
Name:
+
+ +
+
+
+
+
Description:
+
+ +
+
+
+
+
Wallet:
+
+ + +
+
+
+
+
Currency:
+
+ +
+
+
+
+
Shipping Zones:
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+ +
diff --git a/static/components/stall-details/stall-details.js b/static/components/stall-details/stall-details.js index 5b929e1..ab81ef1 100644 --- a/static/components/stall-details/stall-details.js +++ b/static/components/stall-details/stall-details.js @@ -1,15 +1,50 @@ async function stallDetails(path) { const template = await loadTemplateAsync(path) + Vue.component('stall-details', { name: 'stall-details', template, - //props: ['stall-id', 'adminkey', 'inkey', 'wallet-options'], + props: [ + 'stall-id', + 'adminkey', + 'inkey', + 'wallet-options', + 'zone-options', + 'currencies' + ], data: function () { return { tab: 'info', - relay: null + stall: null + // currencies: [], } + }, + computed: { + filteredZoneOptions: function () { + if (!this.stall) return [] + return this.zoneOptions.filter(z => z.currency === this.stall.currency) + } + }, + methods: { + getStall: async function () { + try { + const {data} = await LNbits.api.request( + 'GET', + '/nostrmarket/api/v1/stall/' + this.stallId, + this.inkey + ) + this.stall = data + console.log('### this.stall', this.stall) + } catch (error) { + LNbits.utils.notifyApiError(error) + } + } + + }, + created: async function () { + await this.getStall() + console.log('### this.zoneOptions', this.zoneOptions) } }) } diff --git a/static/components/stall-list/stall-list.html b/static/components/stall-list/stall-list.html index a039c30..9ef981a 100644 --- a/static/components/stall-list/stall-list.html +++ b/static/components/stall-list/stall-list.html @@ -86,7 +86,16 @@
- + +
diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index 6ebd25c..41fa040 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -76,7 +76,7 @@ color="primary" class="float-right" > - Show Public or Private keys + Show Public and Private keys @@ -115,6 +115,7 @@ {% endblock%}{% block scripts %} {{ window_vars(user) }} +