hintergrundauswahl eingbaut, Vorschau jetzt modal.

This commit is contained in:
2016-02-04 11:29:08 +01:00
parent 4439b7320c
commit 3729b6cf63
34 changed files with 352 additions and 84 deletions

View File

@@ -7,7 +7,7 @@
// 'starter.controllers' is found in controllers.js
var db;
angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter.services'])
angular.module('starter', ['ionic', 'ngCordova', 'ionic-modal-select', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform, $window, $ionicHistory, $database, $ionicPopup, $state, $localstorage, $rootScope) {
$ionicPlatform.ready(function() {

View File

@@ -1,6 +1,6 @@
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer,$cordovaFile,$ionicLoading,$state,$filter) {
.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer,$cordovaFile,$ionicLoading,$state,$filter,$ionicModal) {
$scope.preis="";
$scope.name="";
@@ -8,6 +8,22 @@ angular.module('starter.controllers', [])
$scope.items=[];
$scope.item=[];
$scope.backgroundpic = "1";
$scope.backgrounds = [
{ name : "Hintergrund 1", backvalue : "1", beschreibung: "Herzen und Tiere"},
{ name : "Hintergrund 2", backvalue : "2", beschreibung: "geflügeltes Herz"},
{ name : "Hintergrund 3", backvalue : "3", beschreibung: "Herzenmuster"},
{ name : "Hintergrund 4", backvalue : "4", beschreibung: "Herzpflanzen"},
{ name : "Hintergrund 5", backvalue : "5", beschreibung: "Neutral dunkel"},
{ name : "Hintergrund 6", backvalue : "6", beschreibung: "Springendes Paar"},
{ name : "Hintergrund 7", backvalue : "7", beschreibung: "Herzen mit Verzierung"},
{ name : "Hintergrund 8", backvalue : "8", beschreibung: "Hände die sich halten"},
{ name : "Hintergrund 9", backvalue : "9", beschreibung: "Stoffmuster"},
{ name : "Hintergrund 10", backvalue : "10", beschreibung: "Ballons mit Herzen"},
];
$scope.producitems=[];
$scope.rosen1titel="";
@@ -55,17 +71,52 @@ $scope.show = function() {
$scope.validate = function() {
var link = 'http://api.raataar.de/rosen/vorschau.php';
$http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){
$http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis, bg: $scope.backgroundpic}).then(function (res){
$scope.response = res.data;
window.open($scope.response, '_system', 'location=yes');
//window.open($scope.response, '_system', 'location=yes');
//return false;
$scope.showVorschauImages($scope.response);
return false;
});
};
/*
* Vorschau-Modal
*/
$scope.showVorschauImages = function(imagesrc) {
//Bild im dialog anzeigen
$scope.imagesrc=imagesrc;
$scope.showVorschauModal('templates/image-vorschau-popover.html');
}
$scope.showVorschauModal = function(templateUrl) {
$ionicModal.fromTemplateUrl(templateUrl, {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
$scope.modal.show();
});
}
// Close the modal
$scope.closeVorschauModal = function() {
$scope.modal.hide();
$scope.modal.remove()
};
/*
* Vorschau-Modal ENDE
*/
//Getter für Selectbox
$scope.getBackgroundOpt = function(option){
$scope.backgroundpic=option.backvalue;
return option.backvalue;
};
//Flatrate resetten DEBUGGING
$scope.resetflat = function() {
inappbilling.consumePurchase(function(result) {}, function(result) {}, 'rosenflatrate');
$rootScope.flatrate=0;
@@ -74,6 +125,9 @@ $scope.show = function() {
};
/*
* Zitat in Text-Box laden
*/
$scope.loadzitat = function() {
$http({
@@ -149,9 +203,9 @@ $scope.show = function() {
if($rootScope.flatrate==1) {
$scope.showflatrate = false;
$scope.rosen1preistag="kostenlos - Flaterate";
$scope.rosen3preistag="kostenlos - Flaterate";
$scope.rosen9preistag="kostenlos - Flaterate";
$scope.rosen1preistag="kostenlos - Flatrate";
$scope.rosen3preistag="kostenlos - Flatrate";
$scope.rosen9preistag="kostenlos - Flatrate";
}
@@ -177,7 +231,7 @@ $scope.show = function() {
}
$timeout(getProducts, 1000);
$timeout(getProducts, 2000);
/*
* Produkt-Details abrufen ENDE
*/
@@ -226,7 +280,7 @@ $scope.show = function() {
}
function errorBuyHandler (error) {
/*
var strResult = "";
var returnBool=false;
@@ -235,7 +289,7 @@ $scope.show = function() {
} else {
strResult = error;
}
*/
/*
* Prüfen ob Kauf schonmal durchgeführt wurde, aber noch nicht konsumiert
*/
@@ -276,9 +330,9 @@ $scope.show = function() {
$rootScope.flatrate=1;
$scope.showflatrate = false;
$scope.rosen1preistag="kostenlos - Flaterate";
$scope.rosen3preistag="kostenlos - Flaterate";
$scope.rosen9preistag="kostenlos - Flaterate";
$scope.rosen1preistag="kostenlos - Flatrate";
$scope.rosen3preistag="kostenlos - Flatrate";
$scope.rosen9preistag="kostenlos - Flatrate";
$timeout(getProducts, 300);
@@ -297,7 +351,7 @@ $scope.show = function() {
$scope.show($ionicLoading);
var link = 'http://api.raataar.de/rosen/kauf.php';
$http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){
$http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis, bg: $scope.backgroundpic}).then(function (res){
$scope.filetodownload = res.data;
// File for download
@@ -372,7 +426,7 @@ $scope.show = function() {
inappbilling.consumePurchase(successConsumeHandler, errorConsumeHandler, $scope.preis);
}
/*
* Rosen konsuieren ENDE
* Rosen konsumieren ENDE
*/
})

File diff suppressed because one or more lines are too long