- Invia e Ricevi RIS (grafica aggiornata)
- Visualizzazione Movimenti (ultimi e successivi), per singolo e di tutti
This commit is contained in:
17
src/components/CQRCode/CQRCode.scss
Executable file
17
src/components/CQRCode/CQRCode.scss
Executable file
@@ -0,0 +1,17 @@
|
||||
|
||||
.button_download{
|
||||
display: inline-block !important;
|
||||
padding: 10px 20px !important;
|
||||
font-size: 16px !important;
|
||||
font-weight: 500;
|
||||
color: #ffffff !important;
|
||||
background-color: #027be3 !important;
|
||||
/* Colore primario di Quasar */
|
||||
border: none !important;
|
||||
border-radius: 4px !important;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.3s, box-shadow 0.3s;
|
||||
|
||||
}
|
||||
87
src/components/CQRCode/CQRCode.ts
Executable file
87
src/components/CQRCode/CQRCode.ts
Executable file
@@ -0,0 +1,87 @@
|
||||
import {
|
||||
computed,
|
||||
provide, defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch, reactive
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import QrcodeVue from 'qrcode-vue3'
|
||||
|
||||
import { QrStream, QrCapture, QrDropzone } from 'vue3-qr-reader'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CQRCode',
|
||||
emits: [''],
|
||||
props: {
|
||||
link: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
textlink: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
read: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
QrcodeVue, QrStream,
|
||||
QrCapture,
|
||||
QrDropzone
|
||||
},
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
const globalStore = useGlobalStore()
|
||||
const userStore = useUserStore()
|
||||
const $router = useRouter()
|
||||
|
||||
const state = reactive({
|
||||
data: null
|
||||
})
|
||||
|
||||
function onDecode(data: any) {
|
||||
if (data)
|
||||
state.data = data
|
||||
}
|
||||
|
||||
const text = ref('');
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
function mounted() {
|
||||
// ...
|
||||
}
|
||||
|
||||
return {
|
||||
t,
|
||||
tools,
|
||||
costanti,
|
||||
toolsext,
|
||||
text,
|
||||
userStore,
|
||||
...toRefs(state),
|
||||
onDecode,
|
||||
naviga,
|
||||
}
|
||||
},
|
||||
})
|
||||
70
src/components/CQRCode/CQRCode.vue
Executable file
70
src/components/CQRCode/CQRCode.vue
Executable file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="read">
|
||||
<div class="stream">
|
||||
<qr-stream @decode="onDecode" class="mb">
|
||||
<div style="color: red" class="frame"></div>
|
||||
</qr-stream>
|
||||
|
||||
<br />
|
||||
<qr-capture @decode="onDecode" class="mb"></qr-capture>
|
||||
</div>
|
||||
<div class="row justify-center q-ma-sm">
|
||||
<q-btn
|
||||
v-if="data && data.startsWith('http')"
|
||||
class="q-ma-sm"
|
||||
dense
|
||||
color="positive"
|
||||
@click="tools.openUrl(data)"
|
||||
label="APRI PAGINA"
|
||||
>
|
||||
</q-btn>
|
||||
<br />
|
||||
<div v-if="data && data.startsWith('http')" class="result">
|
||||
Link: {{ data }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="q-ma-sm">
|
||||
{{textlink}}<br>
|
||||
{{link}}
|
||||
</div>
|
||||
<qrcode-vue
|
||||
:width="250"
|
||||
:height="250"
|
||||
:qrOptions="{ typeNumber: 0, mode: 'Byte', errorCorrectionLevel: 'H' }"
|
||||
:imageOptions="{ hideBackgroundDots: true, imageSize: 0.4, margin: 0 }"
|
||||
:dotsOptions="{
|
||||
type: 'dots',
|
||||
color: '#26249a',
|
||||
gradient: {
|
||||
type: 'linear',
|
||||
rotation: 0,
|
||||
colorStops: [
|
||||
{ offset: 0, color: '#26249a' },
|
||||
{ offset: 1, color: '#26249a' },
|
||||
],
|
||||
},
|
||||
}"
|
||||
:image="tools.getimglogo()"
|
||||
:cornersSquareOptions="{ type: 'dot', color: '#000000' }"
|
||||
:cornersDotOptions="{ type: undefined, color: '#000000' }"
|
||||
fileExt="png"
|
||||
:download="true"
|
||||
:value="link"
|
||||
downloadButton="button_download"
|
||||
:downloadOptions="{
|
||||
name: 'qrcode-riso-' + userStore.my.username,
|
||||
extension: 'png',
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CQRCode.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CQRCode.scss';
|
||||
</style>
|
||||
1
src/components/CQRCode/index.ts
Executable file
1
src/components/CQRCode/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CQRCode } from './CQRCode.vue'
|
||||
Reference in New Issue
Block a user