Skip to content
Snippets Groups Projects
Commit 82bcd8aa authored by henrikburmann's avatar henrikburmann
Browse files

Price added

parent 97bbd85e
Branches
No related tags found
1 merge request!81Renting
<template> <template>
<div class="confirmationBox"> <div id="confirmationBox">
<div class="rentTitle"> <div id="rentTitle">
<h1> <h1>
<<<<<<< HEAD
{{ title }} {{ title }}
</h1> </h1>
</div> </div>
<div class="fromTime"> <div id="fromTime">
<p>Fra: {{ fromTime }}</p> <p>Fra: {{ fromTimeString }}</p>
</div> </div>
<div class="toTime"> <div id="toTime">
<p>Til: {{ toTime }}</p> <p>Til: {{ toTimeString }}</p>
</div> </div>
<div class="message"> <div id="price">
<label <p>Totaltpris: {{ price }} kr</p>
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
id="descriptionLabel"
>Skriv en melding til utleier:</label
=======
{{ title }}
</h1>
</div>
<div class = "fromTime">
<p>Fra: {{ from_time }}</p>
</div> </div>
<div class = "toTime"> <div id="message">
<p>Til: {{ to_time }}</p>
</div>
<div class = "message">
<label <label
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
id="descriptionLabel" id="descriptionLabel"
>Skriv en melding til utleier</label >Skriv en melding til utleier:</label
>>>>>>> main
> >
<textarea <textarea
id="description" id="description"
...@@ -44,8 +29,8 @@ ...@@ -44,8 +29,8 @@
required required
></textarea> ></textarea>
</div> </div>
<button class="cancelButton">Tilbake</button> <button id="cancelButton" class="text-primary-medium">Tilbake</button>
<div class="confirmButton"> <div id="confirmButton">
<colored-button @click="sendRent" :text="'Send'"></colored-button> <colored-button @click="sendRent" :text="'Send'"></colored-button>
</div> </div>
</div> </div>
...@@ -63,11 +48,13 @@ export default { ...@@ -63,11 +48,13 @@ export default {
return { return {
title: this.newRentBox.title, title: this.newRentBox.title,
fromTime: this.newRentBox.fromTime, fromTime: this.newRentBox.fromTime,
fromTimeString: "",
toTime: this.newRentBox.toTime, toTime: this.newRentBox.toTime,
toTimeString: "",
fromTimeMilliseconds: new Date(this.newRentBox.fromTime).valueOf(), fromTimeMilliseconds: new Date(this.newRentBox.fromTime).valueOf(),
toTimeMilliseconds: new Date(this.newRentBox.toTime).valueOf(), toTimeMilliseconds: new Date(this.newRentBox.toTime).valueOf(),
message: "", message: "",
price: this.newRentBox.price_per_day, price: this.newRentBox.price,
}; };
}, },
props: { props: {
...@@ -77,14 +64,68 @@ export default { ...@@ -77,14 +64,68 @@ export default {
description: String, description: String,
fromTime: Date, fromTime: Date,
toTime: Date, toTime: Date,
pricePerDay: Number,
listingId: Number, listingId: Number,
isAccepted: Boolean, isAccepted: Boolean,
price: Number,
}, },
}, },
created() {
this.fromTimeString = this.convertDates(this.fromTime);
this.toTimeString = this.convertDates(this.toTime);
},
methods: { methods: {
convertDates(date) {
const dateCopy = new Date(date);
const dateDate = dateCopy.getDate();
const dateMonth = dateCopy.getMonth();
let monthString = "";
switch (dateMonth) {
case 1:
monthString = "Januar";
break;
case 2:
monthString = "Februar";
break;
case 3:
monthString = "Mars";
break;
case 4:
monthString = "April";
break;
case 5:
monthString = "Mai";
break;
case 6:
monthString = "Juni";
break;
case 7:
monthString = "Juli";
break;
case 8:
monthString = "August";
break;
case 9:
monthString = "September";
break;
case 10:
monthString = "Oktober";
break;
case 11:
monthString = "November";
break;
case 12:
monthString = "Desember";
break;
default:
monthString = "Noe feil";
break;
}
const dateYear = dateCopy.getFullYear();
return dateDate + ". " + monthString + " " + dateYear;
},
cancelRent() { cancelRent() {
console.log("Canceled"); console.log;
}, },
sendRent: async function () { sendRent: async function () {
const rent = { const rent = {
...@@ -104,7 +145,7 @@ export default { ...@@ -104,7 +145,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.confirmationBox { #confirmationBox {
border: 1px solid silver; border: 1px solid silver;
margin-top: 60fr; margin-top: 60fr;
padding: 10%; padding: 10%;
...@@ -112,39 +153,42 @@ export default { ...@@ -112,39 +153,42 @@ export default {
margin: auto; margin: auto;
display: grid; display: grid;
grid-template-columns: 1fr 3fr; grid-template-columns: 1fr 3fr;
grid-template-rows: 0.5fr 1.5fr 1fr 1fr 3fr 1fr; grid-template-rows: 0.5fr 1.5fr 0.7fr 0.7fr 0.7fr 3fr 1fr;
/* max-height: 100%; */ /* max-height: 100%; */
margin-top: 10%; margin-top: 10%;
} }
.cancelButton { #cancelButton {
grid-column: 1/2; grid-column: 1/2;
grid-row: 1/2; grid-row: 1/2;
} }
.rentTitle { #rentTitle {
margin-top: 10%; margin-top: 10%;
text-align: center; text-align: center;
grid-column: 1/3; grid-column: 1/3;
grid-row: 2/3; grid-row: 2/3;
font-weight: bold; font-weight: bold;
} }
.fromTime { #fromTime {
grid-row: 3/4; grid-row: 3/4;
grid-column: 1/3; grid-column: 1/3;
display: block; display: block;
} }
.toTime { #toTime {
grid-row: 4/5; grid-row: 4/5;
grid-column: 1/3; grid-column: 1/3;
display: block; display: block;
} }
#price {
.message {
grid-column: 1/3;
grid-row: 5/6; grid-row: 5/6;
grid-column: 1/3;
} }
.confirmButton { #message {
grid-column: 1/3; grid-column: 1/3;
grid-row: 6/7; grid-row: 6/7;
}
#confirmButton {
grid-column: 1/3;
grid-row: 7/8;
align-content: center; align-content: center;
margin: auto; margin: auto;
margin-top: 10px; margin-top: 10px;
......
...@@ -229,7 +229,6 @@ export async function GetMembersOfCommunity(communityID) { ...@@ -229,7 +229,6 @@ export async function GetMembersOfCommunity(communityID) {
} }
export function JoinOpenCommunity(communityId) { export function JoinOpenCommunity(communityId) {
if (tokenHeader().Authorization == "Bearer " + null) { if (tokenHeader().Authorization == "Bearer " + null) {
console.log("ikke logget på!"); console.log("ikke logget på!");
return "Login to join any community"; return "Login to join any community";
......
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
description: "Typ transport", description: "Typ transport",
fromTime: "2022-07-26", fromTime: "2022-07-26",
toTime: "2022-08-01", toTime: "2022-08-01",
pricePerDay: 4.0, price: 4.0,
listingId: 157, listingId: 157,
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment