hacer que se vean las imagenes desde google drive #5
|
@ -13,7 +13,7 @@ class ProductController {
|
|||
name: item.name,
|
||||
description: item.description,
|
||||
type: item.type,
|
||||
price: item.size,
|
||||
price: item.price,
|
||||
specialPrice: item.specialPrice,
|
||||
isNew: item.isNew,
|
||||
slug: item.slug,
|
||||
|
|
|
@ -53,7 +53,8 @@ export default defineComponent({
|
|||
setup({ price, discount }) {
|
||||
const isLoaded = ref(false);
|
||||
const percent = +discount / 100;
|
||||
const priceWithoutLetter = ~~price.replaceAll("€", "");
|
||||
//const priceWithoutLetter = ~~price.replaceAll("€", "");
|
||||
const priceWithoutLetter = price;
|
||||
const finalValue = ~~(priceWithoutLetter - priceWithoutLetter * percent);
|
||||
|
||||
const onLoad = () => {
|
||||
|
@ -81,7 +82,7 @@ export default defineComponent({
|
|||
<img
|
||||
class="card-img"
|
||||
:class="[imgClass]"
|
||||
:src="imgSrc ? imgSrc : '../../assets/empty-img.jpg'"
|
||||
:src="imgSrc ? imgSrc.replace('https://drive.google.com/file/d/', 'https://drive.google.com/thumbnail?id=').replace('/view?usp=drive_link', '') : '../../assets/empty-img.jpg'"
|
||||
:alt="alt"
|
||||
:key="imgSrc"
|
||||
@load="onLoad"
|
||||
|
@ -104,8 +105,8 @@ export default defineComponent({
|
|||
|
||||
<div class="card-values">
|
||||
<p class="price" v-if="finalValue">{{ finalValue }}€</p>
|
||||
<p class="price offer tachado" v-if="priceWithoutLetter !== finalValue">
|
||||
{{ priceWithoutLetter }}€
|
||||
<p class="price offer tachado" v-if="price !== finalValue">
|
||||
{{ price }}€
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue