-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8.8. Дополнительная функциональность
- Loading branch information
1 parent
fb74a83
commit c825529
Showing
7 changed files
with
105 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
import AbstractView from '../framework/view/abstract-view.js'; | ||
|
||
function createInfoTemplate() { | ||
function createInfoTemplate(route, routeDates, totalPrice) { | ||
return ` | ||
<section class="trip-main__trip-info trip-info"> | ||
<div class="trip-info__main"> | ||
<h1 class="trip-info__title">Amsterdam — Chamonix — Geneva</h1> | ||
<p class="trip-info__dates">Mar 18 — 20</p> | ||
<h1 class="trip-info__title">${route}</h1> | ||
<p class="trip-info__dates">${routeDates}</p> | ||
</div> | ||
<p class="trip-info__cost"> | ||
Total: € <span class="trip-info__cost-value">1230</span> | ||
Total: € <span class="trip-info__cost-value">${totalPrice}</span> | ||
</p> | ||
</section> | ||
`; | ||
} | ||
|
||
export default class InfoView extends AbstractView { | ||
constructor() { | ||
#route = null; | ||
#routeDates = null; | ||
#totalPrice = null; | ||
|
||
constructor({route, routeDates, totalPrice}) { | ||
super(); | ||
this.#route = route; | ||
this.#routeDates = routeDates; | ||
this.#totalPrice = totalPrice; | ||
} | ||
|
||
get template() { | ||
return createInfoTemplate(); | ||
return createInfoTemplate(this.#route, this.#routeDates, this.#totalPrice); | ||
} | ||
} |