-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#25-CTS Add layout, add vuex state, add a new route
- Loading branch information
1 parent
53c084e
commit 6fa8e9f
Showing
6 changed files
with
150 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template lang="html"> | ||
<div id="basket"> | ||
<div class="columns"> | ||
<div class="column is-9-desktop is-8-tablet"> | ||
<h1 class="title is-1 has-text-centered"> | ||
<span>Basket</span> | ||
<span class="icon is-large"> | ||
<i class="fa fa-shopping-cart"></i> | ||
</span> | ||
</h1> | ||
|
||
<!-- v-for="(basketArtcile, index) in basketArticles" --> | ||
<div class="card"> | ||
<div class="card-content"> | ||
<a class="delete is-pulled-right is-large"></a> | ||
<div class="columns"> | ||
<div class="column is-5"> | ||
<h3 class="title is-3"><u>Basic with custom "My custom 5"</u></h3> | ||
<table> | ||
<tr> | ||
<td>Shoe model: basic</td> | ||
</tr> | ||
<tr> | ||
<td>Size: 40</td> | ||
</tr> | ||
<tr> | ||
<td>Address: Chemin des rue 27</td> | ||
</tr> | ||
</table> | ||
<img src="http://localhost:10010/shoes/model.png" alt=""> | ||
</div> | ||
<div class="column"> | ||
<h3 class="title is-3">100 CHF</h3> | ||
<span class="select is-small"> | ||
<select> | ||
<option value="" disabled selected>Quantity</option> | ||
<option>1</option> | ||
<option>2</option> | ||
</select> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
<div class="column is-3-desktop is-4-tablet summary"> | ||
<h2 class="title is-2">Summary</h2> | ||
<div class="horizontal-separator"></div> | ||
<p>Basic x 2</p> | ||
<div class="horizontal-separator"></div> | ||
<div> | ||
<p class="is-pulled-left">Total</p> | ||
<p class="is-pulled-right title is-2">200 CHF</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { | ||
mapGetters, | ||
mapActions | ||
} from 'vuex' | ||
export default { | ||
name: 'CTSBasket', | ||
computed: mapGetters([ | ||
]), | ||
methods: mapActions([ | ||
]), | ||
created () { | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass"> | ||
.summary | ||
background-color: lightgrey | ||
.horizontal-separator | ||
width: 100% | ||
height: 2px | ||
border-radius: 100% | ||
background-color: black | ||
margin-bottom: 20px | ||
margin-top: 20px | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as types from '../mutations-types' | ||
|
||
/* eslint key-spacing: ["error", { "align": "colon" }] */ | ||
|
||
// initial state | ||
const state = { | ||
basket: { | ||
articles : [ ], | ||
isLoading : true, | ||
totalPrice: 0, | ||
quantity : 1 | ||
} | ||
} | ||
|
||
// getters | ||
const getters = { | ||
basket: state => state.basket | ||
} | ||
|
||
// actions | ||
const actions = { | ||
getBasketArticles ({ commit }) { | ||
const basketArticles = '' | ||
commit(types.UPDATE_SHOPPING_CART, basketArticles) | ||
}, | ||
updateArticleQuantity ({ commit }, newQuantity) { | ||
commit(types.UPDATE_ARTICLE_QUANTITY, newQuantity) | ||
} | ||
} | ||
|
||
// mutations | ||
const mutations = { | ||
[types.UPDATE_SHOPPING_CART] (state, basketArticles) { | ||
state.basket.articles = basketArticles | ||
}, | ||
[types.UPDATE_ARTICLE_QUANTITY] (state, newQuantity) { | ||
state.basket.quantity = newQuantity | ||
} | ||
} | ||
|
||
export default { | ||
state, | ||
getters, | ||
actions, | ||
mutations | ||
} |
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