Merge branch 'beta' into taro/cleanup-imports
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
This commit is contained in:
commit
762a4313e4
|
@ -1,107 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { onMounted, ref, inject } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
searchFn: {
|
|
||||||
type: Function,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
placeholder: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
sqlQuery: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
searchField: {
|
|
||||||
type: String,
|
|
||||||
default: 'search'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['onSearch', 'onSearchError']);
|
|
||||||
|
|
||||||
const jApi = inject('jApi');
|
|
||||||
const { t } = useI18n();
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const searchTerm = ref('');
|
|
||||||
|
|
||||||
const search = async () => {
|
|
||||||
try {
|
|
||||||
let data = null;
|
|
||||||
router.replace({
|
|
||||||
query: searchTerm.value ? { search: searchTerm.value } : {}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!searchTerm.value) {
|
|
||||||
emit('onSearchError');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (props.sqlQuery) {
|
|
||||||
data = await jApi.query(props.sqlQuery, {
|
|
||||||
[props.searchField]: searchTerm.value
|
|
||||||
});
|
|
||||||
} else if (props.searchFn) {
|
|
||||||
data = props.searchFn(searchTerm.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('onSearch', data);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error searching:', error);
|
|
||||||
emit('onSearchError');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (route.query.search) {
|
|
||||||
searchTerm.value = route.query.search;
|
|
||||||
search();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<VnInput
|
|
||||||
v-model="searchTerm"
|
|
||||||
@keyup.enter="search()"
|
|
||||||
:placeholder="props.placeholder || t('search')"
|
|
||||||
bg-color="white"
|
|
||||||
is-outlined
|
|
||||||
:clearable="false"
|
|
||||||
class="searchbar"
|
|
||||||
data-cy="searchBar"
|
|
||||||
>
|
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="search" class="cursor-pointer" @click="search()" />
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import 'src/css/responsive';
|
|
||||||
|
|
||||||
.searchbar {
|
|
||||||
@include mobile {
|
|
||||||
max-width: 120px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<i18n lang="yaml">
|
|
||||||
en-US:
|
|
||||||
search: Search
|
|
||||||
es-ES:
|
|
||||||
search: Buscar
|
|
||||||
ca-ES:
|
|
||||||
search: Cercar
|
|
||||||
fr-FR:
|
|
||||||
search: Rechercher
|
|
||||||
pt-PT:
|
|
||||||
search: Pesquisar
|
|
||||||
</i18n>
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
|
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
import VnForm from 'src/components/common/VnForm.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import FormModel from 'src/components/common/FormModel.vue';
|
import FormModel from 'src/components/common/FormModel.vue';
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
<template>
|
|
||||||
<div style="padding: 0">
|
|
||||||
<div class="q-pa-sm row items-start">
|
|
||||||
<div class="new-card q-pa-sm" v-for="myNew in news" :key="myNew.id">
|
|
||||||
<QCard>
|
|
||||||
<QImg :src="`${$app.imageUrl}/news/full/${myNew.image}`">
|
|
||||||
</QImg>
|
|
||||||
<QCardSection>
|
|
||||||
<div class="text-h5">{{ myNew.title }}</div>
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection class="new-body">
|
|
||||||
<div v-html="myNew.text" />
|
|
||||||
</QCardSection>
|
|
||||||
</QCard>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<QPageSticky>
|
|
||||||
<QBtn
|
|
||||||
fab
|
|
||||||
icon="add_shopping_cart"
|
|
||||||
color="accent"
|
|
||||||
to="/ecomerce/catalog"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('startOrder') }}</QTooltip></QBtn
|
|
||||||
>
|
|
||||||
</QPageSticky>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.new-card {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
@media screen and (min-width: 800px) and (max-width: 1400px) {
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 1401px) and (max-width: 1920px) {
|
|
||||||
width: 33.33%;
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 19021) {
|
|
||||||
width: 25%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.new-body {
|
|
||||||
font-family: 'Open Sans';
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'PageIndex',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
news: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
this.news = await this.$jApi.query(
|
|
||||||
`SELECT title, text, image, id
|
|
||||||
FROM news
|
|
||||||
ORDER BY priority, created DESC`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<i18n lang="yaml">
|
|
||||||
en-US:
|
|
||||||
startOrder: Start order
|
|
||||||
es-ES:
|
|
||||||
startOrder: Empezar pedido
|
|
||||||
ca-ES:
|
|
||||||
startOrder: Començar comanda
|
|
||||||
fr-FR:
|
|
||||||
startOrder: Lancer une commande
|
|
||||||
pt-PT:
|
|
||||||
startOrder: Comece uma encomenda
|
|
||||||
</i18n>
|
|
|
@ -24,7 +24,7 @@ const router = useRouter();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const orders = ref([]);
|
const orders = ref([]);
|
||||||
|
|
||||||
const getOrders = async (clientFk) => {
|
const getOrders = async clientFk => {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
|
@ -32,21 +32,21 @@ const getOrders = async (clientFk) => {
|
||||||
where: {
|
where: {
|
||||||
clientFk,
|
clientFk,
|
||||||
isConfirmed: false,
|
isConfirmed: false,
|
||||||
source_app: 'WEB',
|
source_app: 'WEB'
|
||||||
},
|
},
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'address',
|
relation: 'address',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['nickname', 'city'],
|
fields: ['nickname', 'city']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
relation: 'agencyMode',
|
relation: 'agencyMode',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['description'],
|
fields: ['description']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
],
|
],
|
||||||
fields: [
|
fields: [
|
||||||
'id',
|
'id',
|
||||||
|
@ -88,7 +88,6 @@ const loadOrder = orderId => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onUserId(getOrders);
|
onUserId(getOrders);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue