food/src/views/Scan.vue

20 lines
537 B
Vue
Raw Normal View History

2017-09-19 02:41:00 +02:00
<template>
<div>
<h2>Let's scan something!</h2>
<p>Loading scanning app</p>
</div>
</template>
<script>
export default {
mounted() {
// TODO: Rework this
const host = encodeURIComponent(`${window.location.protocol}//${window.location.host}`);
let href = this.$router.resolve({ name: 'Product', params: { barcode: 'CODE' } }).href;
href = encodeURIComponent(href.replace('CODE', '{CODE}'));
window.location = `zxing://scan/?ret=${host}${href}`;
},
};
</script>