feat: basic shipping zones UI
This commit is contained in:
parent
7c15f8ff45
commit
dcda99830e
5 changed files with 59 additions and 2 deletions
|
|
@ -58,6 +58,7 @@ async def m001_initial(db):
|
||||||
CREATE TABLE nostrmarket.zones (
|
CREATE TABLE nostrmarket.zones (
|
||||||
id TEXT PRIMARY KEY,
|
id TEXT PRIMARY KEY,
|
||||||
user_id TEXT NOT NULL,
|
user_id TEXT NOT NULL,
|
||||||
|
name TEXT NOT NULL,
|
||||||
cost REAL NOT NULL,
|
cost REAL NOT NULL,
|
||||||
countries TEXT NOT NULL
|
countries TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
|
||||||
31
static/components/shipping-zones/shipping-zones.html
Normal file
31
static/components/shipping-zones/shipping-zones.html
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<div>
|
||||||
|
<q-btn-dropdown
|
||||||
|
split
|
||||||
|
unelevated
|
||||||
|
color="primary"
|
||||||
|
icon="public"
|
||||||
|
label="Shipping Zones"
|
||||||
|
@click="createShippingZone"
|
||||||
|
>
|
||||||
|
<q-list>
|
||||||
|
<q-item clickable v-close-popup @click="createShippingZone">
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label>New Shipping Zone</q-item-label>
|
||||||
|
<q-item-label caption>Create a new shipping zone</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item
|
||||||
|
v-for="zone of zones"
|
||||||
|
:key="zone.id"
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="editShippingZone"
|
||||||
|
>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label>XXX</q-item-label>
|
||||||
|
<q-item-label caption>xxxxxxxxxxxxx</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list></q-btn-dropdown
|
||||||
|
>
|
||||||
|
</div>
|
||||||
19
static/components/shipping-zones/shipping-zones.js
Normal file
19
static/components/shipping-zones/shipping-zones.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
async function shippingZones(path) {
|
||||||
|
const template = await loadTemplateAsync(path)
|
||||||
|
Vue.component('shipping-zones', {
|
||||||
|
name: 'shipping-zones',
|
||||||
|
template,
|
||||||
|
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
zones: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
createShippingZone: async function () {
|
||||||
|
console.log('### createShippingZone', createShippingZone)
|
||||||
|
},
|
||||||
|
editShippingZone: async function () {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ const merchant = async () => {
|
||||||
|
|
||||||
await stallDetails('static/components/stall-details/stall-details.html')
|
await stallDetails('static/components/stall-details/stall-details.html')
|
||||||
await keyPair('static/components/key-pair/key-pair.html')
|
await keyPair('static/components/key-pair/key-pair.html')
|
||||||
|
await shippingZones('static/components/shipping-zones/shipping-zones.html')
|
||||||
|
|
||||||
const nostr = window.NostrTools
|
const nostr = window.NostrTools
|
||||||
|
|
||||||
|
|
@ -12,6 +13,7 @@ const merchant = async () => {
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
merchant: {},
|
merchant: {},
|
||||||
|
shippingZones: [],
|
||||||
showKeys: false
|
showKeys: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,15 @@
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-6"></div>
|
||||||
|
<div class="col-4">
|
||||||
|
<shipping-zones></shipping-zones>
|
||||||
|
</div>
|
||||||
|
<div class="col-2">
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="showKeys = !showKeys"
|
@click="showKeys = !showKeys"
|
||||||
:label="showKeys ? 'Hide Keys' : 'Show Keys'"
|
:label="showKeys ? 'Hide Keys' : 'Show Keys'"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="float-right"
|
|
||||||
>
|
>
|
||||||
<q-tooltip> Show Public or Private keys </q-tooltip>
|
<q-tooltip> Show Public or Private keys </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -103,6 +106,7 @@
|
||||||
<script src="{{ url_for('nostrmarket_static', path='js/utils.js') }}"></script>
|
<script src="{{ url_for('nostrmarket_static', path='js/utils.js') }}"></script>
|
||||||
<script src="{{ url_for('nostrmarket_static', path='components/stall-details/stall-details.js') }}"></script>
|
<script src="{{ url_for('nostrmarket_static', path='components/stall-details/stall-details.js') }}"></script>
|
||||||
<script src="{{ url_for('nostrmarket_static', path='components/key-pair/key-pair.js') }}"></script>
|
<script src="{{ url_for('nostrmarket_static', path='components/key-pair/key-pair.js') }}"></script>
|
||||||
|
<script src="{{ url_for('nostrmarket_static', path='components/shipping-zones/shipping-zones.js') }}"></script>
|
||||||
<script src="{{ url_for('nostrmarket_static', path='js/index.js') }}"></script>
|
<script src="{{ url_for('nostrmarket_static', path='js/index.js') }}"></script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue