Laser cut cost calculator

James Peret 8 years ago
parent
commit
31fbe7d189
7 changed files with 65 additions and 10 deletions
  1. 8 5
      app/index.html
  2. 2 1
      app/scripts/app.js
  3. 25 2
      app/scripts/controllers/main.js
  4. 4 0
      app/styles/main.css
  5. 23 1
      app/views/corte-laser.html
  6. 2 1
      bower.json
  7. 1 0
      test/karma.conf.js

+ 8 - 5
app/index.html

@@ -9,6 +9,7 @@
9 9
     <!-- build:css(.) styles/vendor.css -->
10 10
     <!-- bower:css -->
11 11
     <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
12
+    <link rel="stylesheet" href="bower_components/angularjs-slider/dist/rzslider.css" />
12 13
     <!-- endbower -->
13 14
     <!-- endbuild -->
14 15
     <!-- build:css(.tmp) styles/main.css -->
@@ -54,16 +55,17 @@
54 55
     <div class="footer" ng-controller="FooterCtrl">
55 56
       <div class="container">
56 57
         <div class="row">
57
-          <div class="col-md-4">
58
-            <h4>Contato</h4>
59
-            <p><a href="mailto:oficina.itapeti@gmail.com">oficina.itapeti@gmail.com</a></p>
60
-            <p>(11) 5693 6161</p>
61
-          </div>
58
+
62 59
           <div class="col-md-4" style="text-align: center;">
63 60
             <h4>Endereço</h4>
64 61
             <p><i>Estrada José benedito dos Santos 4000 - Guararema, SP</i></p>
65 62
           </div>
66 63
           <div class="col-md-4" style="text-align: center;">
64
+            <h4>Contato</h4>
65
+            <p style="text-align: center;"><a href="mailto:oficina.itapeti@gmail.com">oficina.itapeti@gmail.com</a></p>
66
+            <p style="text-align: center;">(11) 5693 6161</p>
67
+          </div>
68
+          <div class="col-md-4" style="text-align: center;">
67 69
             <h4>Links</h4>
68 70
             <a href="https://www.instagram.com/oficina.itapeti/" target="_blank"><img src="images/logo-instagram.png" style="width: 50px;"></a>
69 71
             <a href="http://youtube.com" target="_blank"><img src="images/logo-youtube.png" style="width: 50px;"></a>
@@ -101,6 +103,7 @@
101 103
     <script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
102 104
     <script src="bower_components/angular-touch/angular-touch.js"></script>
103 105
     <script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
106
+    <script src="bower_components/angularjs-slider/dist/rzslider.js"></script>
104 107
     <!-- endbower -->
105 108
     <!-- endbuild -->
106 109
 

+ 2 - 1
app/scripts/app.js

@@ -18,7 +18,8 @@ angular
18 18
     'ngRoute',
19 19
     'ngSanitize',
20 20
     'ngTouch',
21
-    'ui.router'
21
+    'ui.router',
22
+    'rzModule'
22 23
   ])
23 24
   .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
24 25
     // Configs

+ 25 - 2
app/scripts/controllers/main.js

@@ -8,6 +8,29 @@
8 8
  * Controller of the siteOficinaItapetiApp
9 9
  */
10 10
 angular.module('siteOficinaItapetiApp')
11
-  .controller('MainCtrl', [ '$window', function ($window) {
12
-      $window.scrollTo(0, 0)
11
+  .controller('MainCtrl', [ '$window', '$scope', function ($window, $scope) {
12
+      $window.scrollTo(0, 0);
13
+
14
+      $scope.laser_cut = {
15
+        value: 1,
16
+        options: {
17
+           floor: 0,
18
+           ceil: 20,
19
+           step: 1,
20
+           minLimit: 1,
21
+           maxLimit: 20
22
+        },
23
+        cost: [120, 120, 120, 110, 110, 100, 100, 100, 100, 90, 90, 90, 90, 90, 80, 80, 80, 80, 80, 70],
24
+        value_project: 0.5,
25
+        options2: {
26
+           floor: 0,
27
+           ceil: 8,
28
+           step: 0.5,
29
+           minLimit: 0,
30
+           maxLimit: 8,
31
+           precision: 1
32
+        },
33
+        cost2: 50
34
+      }
35
+
13 36
   }]);

+ 4 - 0
app/styles/main.css

@@ -141,3 +141,7 @@ h1 a, h2 a, h3 a, h4 a, h5 a { cursor: pointer; }
141 141
 .last { padding-bottom: 50px;}
142 142
 
143 143
 .caption p { text-align: left;}
144
+
145
+.orcamento h5 { margin-top: 27px;}
146
+
147
+.orcamento .row { margin-bottom: 25px;}

+ 23 - 1
app/views/corte-laser.html

@@ -37,7 +37,29 @@
37 37
           e o prazo de entrega pode variar de acordo com a complexidade de vetorização do desenho.
38 38
         </p>
39 39
       </div>
40
-      <p style="text-align: center; margin-top: 45px;"><a class="btn btn-lg btn-success" ui-sref="contato">Faça um orçamento</a></p>
40
+      <p style="text-align: center; margin-top: 45px;">
41
+        <a class="btn btn-lg btn-success" type="button" data-toggle="collapse" data-target="#collapseOrcamento" aria-expanded="true" aria-controls="collapseOrcamento" ng-hide="hidden" ng-click="hidden = true">Faça um orçamento</a>
42
+      </p>
43
+
44
+      <div class="well orcamento collapse" id="collapseOrcamento">
45
+        <h2>Orçamento Corte Laser</h2>
46
+        <div class="row">
47
+          <div class="col-md-3"><h5>Horas de corte:</h5></div>
48
+          <div class="col-md-9"><rzslider rz-slider-model="laser_cut.value" rz-slider-options="laser_cut.options">></rzslider></div>
49
+        </div>
50
+        <div class="row">
51
+          <div class="col-md-3"><h5>Horas de Projeto:</h5></div>
52
+          <div class="col-md-9"><rzslider rz-slider-model="laser_cut.value_project" rz-slider-options="laser_cut.options2"></rzslider></rzslider></div>
53
+        </div>
54
+        <div class="row" style="margin-bottom: 0px;">
55
+          <div class="col-md-3"><h5>Total:</h5></div>
56
+          <div class="col-md-9">
57
+            <h3 style="text-align: right;">R$ {{(laser_cut.cost[laser_cut.value - 1] * laser_cut.value) + (laser_cut.value_project * laser_cut.cost2)}},00</h3>
58
+          </div>
59
+        </div>
60
+
61
+      </div>
62
+
41 63
 
42 64
 
43 65
 

+ 2 - 1
bower.json

@@ -12,7 +12,8 @@
12 12
     "angular-route": "^1.4.0",
13 13
     "angular-sanitize": "^1.4.0",
14 14
     "angular-touch": "^1.4.0",
15
-    "angular-ui-router": "^0.3.1"
15
+    "angular-ui-router": "^0.3.1",
16
+    "angularjs-slider": "^5.4.1"
16 17
   },
17 18
   "devDependencies": {
18 19
     "angular-mocks": "^1.4.0"

+ 1 - 0
test/karma.conf.js

@@ -32,6 +32,7 @@ module.exports = function(config) {
32 32
       'bower_components/angular-sanitize/angular-sanitize.js',
33 33
       'bower_components/angular-touch/angular-touch.js',
34 34
       'bower_components/angular-ui-router/release/angular-ui-router.js',
35
+      'bower_components/angularjs-slider/dist/rzslider.js',
35 36
       'bower_components/angular-mocks/angular-mocks.js',
36 37
       // endbower
37 38
       'app/scripts/**/*.js',