diff --git a/hackatonApp/www/home-categories.json b/hackatonApp/www/home-categories.json index 068778d..b0e10c0 100644 --- a/hackatonApp/www/home-categories.json +++ b/hackatonApp/www/home-categories.json @@ -50,38 +50,44 @@ "id":"Emozione3", "title":"Pacchetto Emozione3", "description":"20% di sconto sul cofanetto regalo Avventura", - "image":"img/promozioni/emozione.png" + "image":"img/promozioni/emozione.png", + "price":"400" }, { "id":"Chagall", "title":"Mostra di Chagall", "description":"Biglietto scontato del 10%", - "image":"img/promozioni/chagall.png" + "image":"img/promozioni/chagall.png", + "price":"100" }, { "id":"Fiorentina", "title":"Fiorentina Calcio", "description":"Vieni a vedere la Viola allo stadio! Il biglietto ti costa solo 10€ e ti offriamo la birra", - "image":"img/promozioni/fiorentina.png" + "image":"img/promozioni/fiorentina.png", + "price":"1700" }, { "id":"NaturaSi", "title":"NaturaSi", "description":"3 confezioni di ragù Alce Nero per te!", - "image":"img/promozioni/naturasi.png" + "image":"img/promozioni/naturasi.png", + "price":"2000" }, { "id":"Comisc", "title":"Lucca Comics And Games", "description":"Sconto del 15% sul prezzo del biglietto", - "image":"img/promozioni/comics.png" + "image":"img/promozioni/comics.png", + "price":"1000" }, { "id":"Trenitalia", "title":"Trenitalia", "description":"Biglietto per tratta regionale - 15% di sconto!", - "image":"img/promozioni/trenitalia.png" + "image":"img/promozioni/trenitalia.png", + "price":"1500" } ] }, @@ -89,15 +95,5 @@ "id":"settings", "title":"Impostazioni", "image":"img/Settings.png" - }, - { - "id":"allTickets", - "title":"Tutti I Biglietti", - "image":"" - }, - { - "id":"allShop", - "title":"Tutti Gli Acquisti", - "image":"" } ] diff --git a/hackatonApp/www/img/Camera.png b/hackatonApp/www/img/Camera.png index ee42a53..5a41c8e 100644 Binary files a/hackatonApp/www/img/Camera.png and b/hackatonApp/www/img/Camera.png differ diff --git a/hackatonApp/www/img/inttrenitalia.png b/hackatonApp/www/img/inttrenitalia.png new file mode 100644 index 0000000..810485d Binary files /dev/null and b/hackatonApp/www/img/inttrenitalia.png differ diff --git a/hackatonApp/www/img/logo.png b/hackatonApp/www/img/logo.png index e269713..cb886c9 100644 Binary files a/hackatonApp/www/img/logo.png and b/hackatonApp/www/img/logo.png differ diff --git a/hackatonApp/www/index.html b/hackatonApp/www/index.html index a7d5ec2..696ed7d 100644 --- a/hackatonApp/www/index.html +++ b/hackatonApp/www/index.html @@ -22,6 +22,7 @@ + diff --git a/hackatonApp/www/js/controllers.js b/hackatonApp/www/js/controllers.js index 3b4e55f..369e578 100644 --- a/hackatonApp/www/js/controllers.js +++ b/hackatonApp/www/js/controllers.js @@ -5,7 +5,7 @@ angular.module('your_app_name.controllers', []) }) // APP -.controller('AppCtrl', function($scope, $ionicConfig) { +.controller('AppCtrl', function($scope, $ionicConfig, $ionicLoading, $state, $rootScope) { $scope.user={}; $scope.user.name="Laura"; @@ -13,28 +13,60 @@ angular.module('your_app_name.controllers', []) $scope.user.email="laura.rossi@email.it"; $scope.user.telephone="3477608470"; $scope.user.picture="img/laura.jpg"; - $scope.user.score="2450"; - $scope.takePicture = function(){ - var cameraOptions = { + $scope.user.score=2450; + $rootScope.fine=false; +function startTimer(duration, $scope, $state) { + $rootScope.fine=false; + + var timer = duration, minutes, seconds; + var a = setInterval(function ($scope, $state) { + minutes = parseInt(timer / 60, 10); + seconds = parseInt(timer % 60, 10); + + minutes = minutes < 10 ? "0" + minutes : minutes; + seconds = seconds < 10 ? "0" + seconds : seconds; + + console.log(seconds); + $ionicLoading.show({ + template: '

Verifico il biglietto...

' + }); + if (--timer < 0) { + timer = duration; + console.log("diidi"); + clearInterval(a); + $ionicLoading.hide(); + $rootScope.fine=true; + + + } + }, 1000); +} + + $scope.takePicture = function($scope, $state){ + /* var cameraOptions = { quality: 50, destinationType: Camera.DestinationType.DATA_URL }; var success = function(data){ $scope.$apply(function () { - /* - remember to set the image ng-src in $apply, - i tried to set it from outside and it doesn't work. - */ + $scope.cameraPic = "data:image/jpeg;base64," + data; + }); }; var failure = function(message){ alert('Failed because: ' + message); }; //call the cordova camera plugin to open the device's camera - navigator.camera.getPicture( success , failure , cameraOptions ); + navigator.camera.getPicture( success , failure , cameraOptions ); */ + var fiveMinutes = 3; + + startTimer(fiveMinutes, $scope, $state); }; + + + }) @@ -557,9 +589,9 @@ angular.module('your_app_name.controllers', []) console.log("HOME"); }) -.controller('CategoryCtrl', function($scope, $http, $stateParams) { +.controller('CategoryCtrl', function($scope, $http, $stateParams, $state, $rootScope, $location) { $scope.category_sources = []; - + $rootScope.fine=false; $scope.categoryId = $stateParams.categoryId; console.log($scope.categoryId); $scope.modifica=false; @@ -567,7 +599,19 @@ angular.module('your_app_name.controllers', []) { $scope.modifica=!$scope.modifica; - } + }; + $scope.clickFine = function() + { + $rootScope.fine=false; + $location.url('/app/home'); + $scope.user.score+=100; + + }; + $scope.compra= function() + { + alert("comprato"); + }; + switch($scope.categoryId) { case "addticketwithphoto": diff --git a/hackatonApp/www/views/app/category-entries.html b/hackatonApp/www/views/app/category-entries.html index 22da492..2577bfe 100644 --- a/hackatonApp/www/views/app/category-entries.html +++ b/hackatonApp/www/views/app/category-entries.html @@ -3,6 +3,7 @@ {{entriesTitle | capitalize}} - + + diff --git a/hackatonApp/www/views/app/category.html b/hackatonApp/www/views/app/category.html index c166cc8..fdfea6a 100644 --- a/hackatonApp/www/views/app/category.html +++ b/hackatonApp/www/views/app/category.html @@ -1,4 +1,4 @@ - + {{categoryTitle}} @@ -7,7 +7,7 @@ -
+ + + @@ -32,6 +48,9 @@
+
{{fine}}
+
@@ -56,23 +75,23 @@
-
- - -gfgr \ No newline at end of file +
\ No newline at end of file diff --git a/hackatonApp/www/views/app/home.html b/hackatonApp/www/views/app/home.html index 750f792..3e25eb7 100644 --- a/hackatonApp/www/views/app/home.html +++ b/hackatonApp/www/views/app/home.html @@ -3,7 +3,7 @@ - + Home
diff --git a/hackatonApp/www/views/auth/walkthrough.html b/hackatonApp/www/views/auth/walkthrough.html index eeae51c..cd731e7 100644 --- a/hackatonApp/www/views/auth/walkthrough.html +++ b/hackatonApp/www/views/auth/walkthrough.html @@ -2,7 +2,7 @@
- +