1
0
mirror of https://github.com/robonen/metr.git synced 2026-03-20 10:54:41 +00:00

Vue, back edited,added

This commit is contained in:
Konstantin Vinokurov
2022-05-31 00:39:41 +07:00
parent 2825c1a4c8
commit 9de12f2c3f
6 changed files with 99 additions and 22 deletions

View File

@@ -66,7 +66,7 @@
</template>
<script>
import TheHeader from "../components/TheHeader.vue";
import TheHeader from "@/components/TheHeader.vue";
import TheFooter from "@/components/TheFooter.vue";
import CatalogType from "@/components/CatalogType.vue";

View File

@@ -6,11 +6,11 @@
<div class="adv__main">
<div class="adv__main__title">
<div class="mtitle">
<h2>4-к. квартира, 78,4 м², 20/28 эт.</h2>
<h2>{{ offer.name }}</h2>
</div>
<div class="mprice__fav">
<div class="price">
<h2>40 610 000 </h2>
<h2>{{ offer.price }} </h2>
</div>
<!-- <a href="#" class="favoritext"><div class="favorite">-->
<!-- <h4>Добавить в избранное</h4>-->
@@ -110,10 +110,34 @@
import RatingStars from "@/components/RatingStars.vue";
import TheHeader from "@/components/TheHeader.vue";
import TheFooter from "@/components/TheFooter.vue";
import offerService from "@/services/offer";
export default {
name: "OfferView",
components: {TheFooter, TheHeader, RatingStars},
name: "OfferView"
data() {
return {
offer: {}
};
},
computed: {
offerType() {
return {
'Flat': 'Квартира',
'House': 'Дом',
'Land': 'Участок',
}[this.offer.type];
}
},
async mounted() {
const id = this.$route.params.id;
if (id === undefined)
return this.$router.back();
const resp = await offerService.getById(id);
this.offer = resp.data.data;
}
}
</script>

View File

@@ -80,7 +80,7 @@ export default {
this.$router.push('/');
});
}
}
},
}
</script>>