mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
feature: informacja przy braku podglądu; SW
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ export default defineComponent({
|
||||
}),
|
||||
|
||||
async created() {
|
||||
const stockData = await (await fetch('https://spythere.github.io/api/stockData.json')).json();
|
||||
const stockData = await (await fetch('https://spythere.github.io/api/stockDataNew.json')).json();
|
||||
|
||||
this.store.stockData = stockData;
|
||||
},
|
||||
|
||||
@@ -3,18 +3,20 @@
|
||||
<div class="train-image__wrapper">
|
||||
<div class="train-image__content">
|
||||
<transition name="img-message-anim">
|
||||
<div class="empty-message" v-if="store.imageLoading">ŁADOWANIE OBRAZU...</div>
|
||||
<div class="empty-message" v-if="store.imageLoading && store.chosenVehicle?.imageSrc">ŁADOWANIE OBRAZU...</div>
|
||||
</transition>
|
||||
|
||||
<div class="no-img" v-if="!store.chosenVehicle">PODGLĄD WYBRANEGO POJAZDU</div>
|
||||
|
||||
<img
|
||||
v-if="store.chosenVehicle"
|
||||
v-if="store.chosenVehicle && store.chosenVehicle.imageSrc"
|
||||
:src="store.chosenVehicle.imageSrc"
|
||||
:alt="store.chosenVehicle.type"
|
||||
@load="onImageLoad"
|
||||
@click="onImageClick"
|
||||
/>
|
||||
|
||||
<div class="empty-message" v-if="store.chosenVehicle && !store.chosenVehicle.imageSrc">Ten pojazd nie ma jeszcze podglądu!</div>
|
||||
</div>
|
||||
|
||||
<div class="train-image__info" v-if="store.chosenVehicle">
|
||||
|
||||
@@ -48,7 +48,7 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
|
||||
previewStock(stock: IStock) {
|
||||
previewStock(stock: IStock) {
|
||||
if (this.store.chosenVehicle?.imageSrc != stock.imgSrc) this.store.imageLoading = true;
|
||||
|
||||
if (stock.isLoco) {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ export interface IStock {
|
||||
isLoco: boolean;
|
||||
supportersOnly: boolean;
|
||||
count: number;
|
||||
imgSrc: string;
|
||||
imgSrc?: string;
|
||||
}
|
||||
|
||||
export interface IReadyStockList {
|
||||
|
||||
Reference in New Issue
Block a user