Config.xml angepasst, Kaufabwicklung funktioniert jetzt reibungslos
This commit is contained in:
@@ -59,20 +59,47 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter
|
||||
}
|
||||
|
||||
|
||||
function successHandler (result) {
|
||||
|
||||
/*
|
||||
* Google-Stroe Initialisieren START
|
||||
*/
|
||||
function StoreInitsuccessHandler (result) {
|
||||
$rootScope.storeinit=1;
|
||||
inappbilling.getPurchases(purchasessuccess, purchasesfail)
|
||||
}
|
||||
|
||||
function errorHandler (error) {
|
||||
//alert("ERROR: \r\n"+error );
|
||||
function StoreIniterrorHandler (error) {
|
||||
$rootScope.storeinit=0;
|
||||
}
|
||||
|
||||
|
||||
if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") {
|
||||
inappbilling.init(successHandler, errorHandler, {showLog:true});
|
||||
inappbilling.init(StoreInitsuccessHandler, StoreIniterrorHandler, {showLog:true});
|
||||
}
|
||||
|
||||
|
||||
function purchasessuccess (result) {
|
||||
var strResult = "";
|
||||
if(typeof result === 'object') {
|
||||
strResult = JSON.stringify(result);
|
||||
} else {
|
||||
strResult = result;
|
||||
}
|
||||
|
||||
alert("SUCCESS: \r\n"+strResult );
|
||||
}
|
||||
|
||||
function purchasesfail (error) {
|
||||
alert("ERROR: \r\n"+error );
|
||||
}
|
||||
|
||||
/*
|
||||
* Google-Stroe Initialisieren ENDE
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// Initialize database through $database service
|
||||
db = $database.initDB();
|
||||
|
||||
|
||||
@@ -13,18 +13,26 @@ angular.module('starter.controllers', [])
|
||||
$scope.rosen1titel="";
|
||||
$scope.rosen1preis="";
|
||||
$scope.rosen1beschreibung="";
|
||||
$scope.rosen1preiscurrency="";
|
||||
$scope.rosen1preistag="";
|
||||
|
||||
$scope.rosen3titel="";
|
||||
$scope.rosen3preis="";
|
||||
$scope.rosen3beschreibung="";
|
||||
$scope.rosen3preiscurrency="";
|
||||
$scope.rosen3preistag="";
|
||||
|
||||
$scope.rosen9titel="";
|
||||
$scope.rosen9preis="";
|
||||
$scope.rosen9beschreibung="";
|
||||
$scope.rosen9preiscurrency="";
|
||||
$scope.rosen9preistag="";
|
||||
|
||||
$scope.flateraterosentitel="";
|
||||
$scope.flateraterosenpreis="";
|
||||
$scope.flateraterosenbeschreibung="";
|
||||
$scope.flateraterosenpreiscurrency="";
|
||||
$scope.flateraterosenpreistag="";
|
||||
|
||||
$scope.showrosen = false;
|
||||
$scope.showflatrate = true;
|
||||
@@ -83,18 +91,26 @@ $scope.show = function() {
|
||||
$scope.rosen1titel=$scope.producitems[2].title;
|
||||
$scope.rosen1preis=$scope.producitems[2].price;
|
||||
$scope.rosen1beschreibung=$scope.producitems[2].description;
|
||||
$scope.rosen1preiscurrency=$scope.producitems[2].price_currency_code;
|
||||
$scope.rosen1preistag="Preis: " + $scope.rosen1preis + " " + $scope.rosen1preiscurrency + " (inkl. MwSt.)";
|
||||
|
||||
$scope.rosen3titel=$scope.producitems[1].title;
|
||||
$scope.rosen3preis=$scope.producitems[1].price;
|
||||
$scope.rosen3beschreibung=$scope.producitems[1].description;
|
||||
$scope.rosen3preiscurrency=$scope.producitems[2].price_currency_code;
|
||||
$scope.rosen3preistag="Preis: " + $scope.rosen3preis + " " + $scope.rosen3preiscurrency + " (inkl. MwSt.)";
|
||||
|
||||
$scope.rosen9titel=$scope.producitems[0].title;
|
||||
$scope.rosen9preis=$scope.producitems[0].price;
|
||||
$scope.rosen9beschreibung=$scope.producitems[0].description;
|
||||
$scope.rosen9preiscurrency=$scope.producitems[2].price_currency_code;
|
||||
$scope.rosen9preistag="Preis: " + $scope.rosen9preis + " " + $scope.rosen9preiscurrency + " (inkl. MwSt.)";
|
||||
|
||||
$scope.flateraterosentitel=$scope.producitems[3].title;
|
||||
$scope.flateraterosenpreis=$scope.producitems[3].price;
|
||||
$scope.flateraterosenbeschreibung=$scope.producitems[3].description;
|
||||
$scope.flateraterosenpreiscurrency=$scope.producitems[2].price_currency_code;
|
||||
$scope.flateraterosenpreistag="Preis: " + $scope.flateraterosenpreis + " " + $scope.flateraterosenpreiscurrency + " (inkl. MwSt.)";
|
||||
|
||||
$scope.showrosen = true;
|
||||
$timeout(function(){
|
||||
@@ -275,17 +291,24 @@ $scope.show = function() {
|
||||
|
||||
})
|
||||
|
||||
.controller('BuysCtrl', function($scope, $database,$location,$ionicModal,$ionicLoading) {
|
||||
.controller('BuysCtrl', function($scope, $database,$location,$ionicModal,$ionicLoading,$timeout) {
|
||||
|
||||
/*
|
||||
$scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
|
||||
|
||||
|
||||
if ($location.path() == "/tab/buys") {
|
||||
$scope.show($ionicLoading);
|
||||
fill_list();
|
||||
$scope.hide($ionicLoading);
|
||||
$timeout(fill_list, 1000);
|
||||
}
|
||||
|
||||
});
|
||||
*/
|
||||
|
||||
$scope.$on( "$ionicView.enter", function( scopes, states ) {
|
||||
$scope.show($ionicLoading);
|
||||
$timeout(fill_list, 1000);
|
||||
});
|
||||
|
||||
|
||||
function fill_list(){
|
||||
@@ -299,6 +322,7 @@ function fill_list(){
|
||||
$scope.items=[];
|
||||
}
|
||||
});
|
||||
$scope.hide($ionicLoading);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,25 +23,25 @@
|
||||
<img src="img/rose1.png">
|
||||
<h2 class="oleo">{{ rosen1titel }}</h2>
|
||||
<span class="oleo-vsmall">{{ rosen1beschreibung }}</span><br>
|
||||
<span class="oleo-vsmall">Preis: {{ rosen1preis }} € (inkl. MwSt.)</span>
|
||||
<span class="oleo-vsmall">{{ rosen1preistag }}</span>
|
||||
</ion-radio>
|
||||
<ion-radio ng-model="$parent.preis" ng-value="'3xrose'" class="item item-thumbnail-left item-text-wrap">
|
||||
<img src="img/rose3.png">
|
||||
<h2 class="oleo">{{ rosen3titel }}</h2>
|
||||
<span class="oleo-vsmall">{{ rosen3beschreibung }}</span><br>
|
||||
<span class="oleo-vsmall">Preis: {{ rosen3preis }} € (inkl. MwSt.)</span>
|
||||
<span class="oleo-vsmall">{{ rosen3preistag }}</span>
|
||||
</ion-radio>
|
||||
<ion-radio ng-model="$parent.preis" ng-value="'9xrose'" class="item item-thumbnail-left item-text-wrap">
|
||||
<img src="img/rose10.png">
|
||||
<h2 class="oleo">{{ rosen9titel }}</h2>
|
||||
<span class="oleo-vsmall">{{ rosen9beschreibung }}</span><br>
|
||||
<span class="oleo-vsmall">Preis: {{ rosen9preis }} € (inkl. MwSt.)</span>
|
||||
<span class="oleo-vsmall">{{ rosen9preistag }}</span>
|
||||
</ion-radio>
|
||||
<ion-radio ng-model="$parent.preis" ng-value="'rosenflatrate'" class="item item-thumbnail-left item-text-wrap" ng-show="showflatrate">
|
||||
<img src="img/rose10.png">
|
||||
<h2 class="oleo">{{ flateraterosentitel }}</h2>
|
||||
<span class="oleo-vsmall">{{ flateraterosenbeschreibung }}</span><br>
|
||||
<span class="oleo-vsmall">Preis: {{ flateraterosenpreis }} € (inkl. MwSt.)</span>
|
||||
<span class="oleo-vsmall">{{ flateraterosenpreistag }}</span>
|
||||
</ion-radio>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user