This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
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.
Merge pull request #32 from WellCheck-Co/develop
Added price simulator #22
- Loading branch information
Showing
5 changed files
with
225 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
Author: W3layouts | ||
Author URL: http://w3layouts.com | ||
License: Creative Commons Attribution 3.0 Unported | ||
License URL: http://creativecommons.org/licenses/by/3.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Basket - Wellcheck</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="keywords" content="" /> | ||
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> | ||
<!-- Custom Theme files --> | ||
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> | ||
<link href="css/font-awesome.css" rel="stylesheet" type="text/css"> | ||
|
||
<link rel="icon" href="imgs/logo.png" type="image/gipng"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> | ||
<script src="./js/assets/chart.min.js"></script> | ||
<script src="./js/assets/utils.js"></script> | ||
<style> | ||
canvas { | ||
-moz-user-select: none; | ||
-webkit-user-select: none; | ||
-ms-user-select: none; | ||
} | ||
</style> | ||
<style type="text/css">/* Chart.js */ | ||
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}</style> | ||
<!-- //Custom Theme files --> | ||
</head> | ||
<body> | ||
<!-- main --> | ||
<div id="stats" style="" class="main-w3layouts wrapper"> | ||
<leftnav ref="nav"></leftnav> | ||
<mod ref="modal"></mod> | ||
<stats id="vuestats" :data=data ref="main"></stats> | ||
<msg ref="extern"></msg> | ||
</div> | ||
<!-- //main --> | ||
<script src="./js/conf.js"></script> | ||
<script src="./js/vue.js"></script> | ||
<script src="./js/axios.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js" integrity="sha384-6khuMg9gaYr5AxOqhkVIODVIvm9ynTT5J4V1cfthmT+emCG6yVmEZsRHdxlotUnm" crossorigin="anonymous"></script> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vue-css-donut-chart@1/dist/vcdonut.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/vue-css-donut-chart@1/dist/vcdonut.umd.min.js"></script> | ||
<script src="./js/commons/comp_messages.js"></script> | ||
<script src="./js/commons/comp_warning.js"></script> | ||
<script src="./js/commons/comp_container.js"></script> | ||
<script src="./js/commons/location.js"></script> | ||
<script src="./js/commons/cred.js"></script> | ||
<script src="./js/commons/user.js"></script> | ||
<script src="./js/profil/comp_mod_infos.js"></script> | ||
<script src="./js/profil/comp_mod_billing.js"></script> | ||
<script src="./js/commons/comp_modale.js"></script> | ||
<script src="./js/commons/comp_nav.js"></script> | ||
<script src="./js/basket/comp_basket.js"></script> | ||
<script src="./js/basket/basket.js"></script> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
Wellcheck/Webapps/dashboard.wellcheck/front/js/basket/basket.js
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,25 @@ | ||
let vm = new Vue({ | ||
el: '#stats', | ||
|
||
data: function(){ | ||
return { | ||
email: localStorage.email, | ||
data: '' | ||
} | ||
}, | ||
|
||
components: {msg, leftnav, mod, stats}, | ||
|
||
methods: { | ||
store: function(data) { | ||
if (data != '') { | ||
localStorage.points = JSON.stringify(data['points']); | ||
this.data = data['points']; | ||
} | ||
}, | ||
}, | ||
mounted(){ | ||
cred.methods.api_cred() | ||
cred.methods.usr_cred() | ||
} | ||
}) |
67 changes: 67 additions & 0 deletions
67
Wellcheck/Webapps/dashboard.wellcheck/front/js/basket/comp_basket.js
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,67 @@ | ||
let stats = { | ||
data: function() { | ||
return { | ||
prices: { | ||
"device": 249, | ||
"subscription": 10 | ||
} | ||
} | ||
}, | ||
|
||
components: {container, warning}, | ||
|
||
props: {data: {default: void 0}}, | ||
|
||
methods: { | ||
handleChanges: function() { | ||
$("#number").on("change", (event) => { | ||
$("#numberSpan").text(event.target.value); | ||
$("#devicesPrice").text(event.target.value * this.prices.device); | ||
$("#subscriptionPrice").text(event.target.value * this.prices.subscription); | ||
$("#buyButton").attr("disabled", event.target.value <= 0); | ||
}); | ||
$("#buyButton").on("click", () => { | ||
alert("You just bought " + $("#number").val() + " devices !"); | ||
}); | ||
} | ||
}, | ||
|
||
mounted(){ | ||
this.handleChanges(); | ||
}, | ||
|
||
template: ` | ||
<div class="main"> | ||
<div class="hidden" style=""> | ||
</div> | ||
<div class="usualcenter infos"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<h1 class="txt-lt">Basket</h1> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="marge" style="height: inherit;"> | ||
<container note="Your basket" | ||
name="My basket" | ||
hover=true | ||
style="height: 100%"> | ||
<div class="row justify-content-md-center"> | ||
<label class="col-md-4">Number of devices</label> | ||
<input id="number" type="range" class="custom-range col-md-6" min="0" max="10" value="0"> | ||
<span id="numberSpan" class="col-md-2">0</span> | ||
</div> | ||
<br> | ||
<span>249€ / device + 10€ / month / device</span> | ||
<br><br> | ||
<span><span id="devicesPrice">0</span>€ now + <span id="subscriptionPrice">0</span>€ / month</span> | ||
<br><br> | ||
<button id="buyButton" type="button" class="btn btn-primary col-md-4" disabled>Buy</button> | ||
</container> | ||
</div> | ||
</div> | ||
</div> | ||
` | ||
} | ||
|
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