Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Radu Turtoi authored and Radu Turtoi committed Oct 12, 2016
0 parents commit 6f1fdf3
Show file tree
Hide file tree
Showing 279 changed files with 149,385 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mobile Store
Binary file added app/.DS_Store
Binary file not shown.
45 changes: 45 additions & 0 deletions app/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use strict';
(function () {
var app = angular.module('app.config', ['ui.router']);

app.constant('TAPITOO_CONFIG', {
backend: 'http://139.59.165.6',
restaurantID: '9016e8c1-0c3d-4da2-9823-4a64d8dc5b43',
facebookID: '271360646354244'
});

// http://139.59.165.6/opencart-2.0.1.0/upload


app.constant('OC_CONFIG', (function() {
// var backend = 'http://185.16.40.144/opencart-2.0.0.0/upload/api/v1';
var backend = 'http://139.59.165.6/opencart-2.0.1.0/upload/api/v1';
// var backend = 'http://185.16.40.144/opencart-2.0.2.0/upload/api/v1';
var payment = 'http://139.59.165.6/opencart-2.0.1.0/upload/index.php?route=payment'
return {
CLIENT_ID: 'api',
CLIENT_SECRET: 'apiapiapiapiapiapiapiapi',
ONESIGNAL_ID : '161fb178-5a41-11e5-a09e-2b644f8bcad6',//'live onesignal',
// ONESIGNAL_ID : '179cfbf0-4038-11e5-9dad-9bd86f0ff0ef',//'test onesignal',
GOOGLE_PROJECT_NUMBER : '1049754901328',
BACKEND : backend,
CATEGORIES: backend + '/product/category/',
PRODUCT: backend + '/product/product/',
REVIEWS: backend + '/product/review/',
SPECIAL: backend + '/product/special/',
MANUFACTURER: backend + '/product/manufacturer/',
SEARCH: backend + '/product/search',
CART: backend + '/cart/product/',
EDIT_CART: backend + '/cart/',
GET_CART: backend + '/cart/cart/',
ACCOUNT: backend + '/account/',
CHECKOUT: backend + '/checkout/',
WISHLIST: backend + '/account/wishlist/',
COMMON: backend + '/common/',
MODULE: backend + '/module/',
OAUTH: backend + '/oauth2/token',
PAYMENT: payment + '/'
}
})());

})();
145 changes: 145 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
'use strict';
(function () {
var app = angular.module('TapitooPortal', ['ionic',
'app.routes',
'app.config',
'Tapitoo.StartUpService',
'Tapitoo.ShopService',
'Tapitoo.ProductService',
'Tapitoo.CartService',
'Tapitoo.CheckoutService',
'Tapitoo.CheckoutProcessService',
'Tapitoo.AccountService',
'Tapitoo.CommonService',
'Tapitoo.HomeViewController',
'Tapitoo.ManufacturersController',
'Tapitoo.WishlistCtrl',
'CategoriesCtrl',
'ProductsCtrl',
'ProductsDetailsCtrl',
'ProductsReviewsCtrl',
'CartCtrl',
'CheckoutCtrl',
'UserAccountCtrl',
'DeliveryDetailsCtrl',
'PaymentDetailsCtrl',
'AddressesCtrl',
'PersonalInfoCtrl',
'SettingsCtrl',
'GeocoderService',
'ngStorage',
'ngCordova',
'horizontalScroll',
'starRating',
'tabSlideBox',
'ionic.ion.imageCacheFactory',
'ionic-datepicker',
'ionic-timepicker',
'ionic-toast',
'angularPayments',
'pascalprecht.translate']);

app.run(function (StartUpService,$ionicPlatform,$rootScope,$localStorage, $http, OC_CONFIG, $state,$stateParams, $urlRouter) {
// $localStorage.ACCESS_TOKEN= 'X68AWVTSMNblJki5OzcSnYLtw3HxPWdgyGevyiE4';
$ionicPlatform.ready(function () {
// hide iOS status bar
if(window.StatusBar) {
StatusBar.hide();
ionic.Platform.fullScreen();
}

//set access token if it's not the first time the app is open
if($localStorage.ACCESS_TOKEN){
//console.log($localStorage.ACCESS_TOKEN);
OC_CONFIG.TOKEN = $localStorage.ACCESS_TOKEN;
console.log(OC_CONFIG.TOKEN);
StartUpService.initialization();
}
// generate access token if the app is opened for the first time
else {
var promise = StartUpService.generateToken();
promise.then(
function (response) {
StartUpService.initialization();
});

}
});


$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
$rootScope.$on("$stateChangeSuccess", function(event, toState, toParams, fromState, fromParams) {
// to be used for back button //won't work when page is reloaded.
// console.log(toState.name);
// console.log(toParams);
// console.log(fromState.name);
// console.log(fromParams);
if(toState.name === 'leftdrawer.productInfo' && fromState.name !== 'productDescription' && fromState.name !== 'productSpecifications' && fromState.name !== 'productReviews'){
$rootScope.stateBeforeProduct_name = fromState.name;
$rootScope.stateBeforeProduct_params = fromParams;
console.log("state: " + $rootScope.stateBeforeProduct_name);
}

$rootScope.previousState_name = fromState.name;
$rootScope.previousState_params = fromParams;
});
//back button function called from back button's ng-click="back()"
$rootScope.back = function() {
$state.go($rootScope.stateBeforeProduct_name,$rootScope.stateBeforeProduct_params);
};

});


app.config(function ($httpProvider, $stateProvider, $urlRouterProvider, $translateProvider, $ionicConfigProvider, $localStorageProvider) {

// disable views transition animation on android
if(ionic.Platform.isAndroid()===true){
$ionicConfigProvider.views.transition('none');
}
else
$ionicConfigProvider.views.transition('ios');

// center Header Logo
$ionicConfigProvider.navBar.alignTitle('center')

// disable swipe back on iOS
$ionicConfigProvider.views.swipeBackEnabled(false);

// configures staticFilesLoader
$translateProvider.useStaticFilesLoader({
prefix: 'languages/translate-',
suffix: '.json'
});
// load 'en' table on startup
$translateProvider.preferredLanguage('en');
});

app.controller('AppInitController', function ($scope, $rootScope,$ionicLoading, $state,ShopService, $ionicScrollDelegate, $timeout, $ionicSideMenuDelegate) {
$scope.toggleDrawer = function () {
$ionicSideMenuDelegate.toggleLeft();
};
$rootScope.noShadow = "header-shadow";

// show loading template after 100ms
$scope.$on('$stateChangeStart',
function(event, toState, toParams, fromState, fromParams){
$timeout(function(){
$ionicLoading.show({templateUrl: 'templates/loading.html', noBackdrop: false});
},100);
});

// hide loading template after 200ms
$scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
$timeout(function(){
$ionicLoading.hide()
},200);
});

});
})();

angular.element(document).ready(function () {
angular.bootstrap(document, ['TapitooPortal']);
});
Loading

0 comments on commit 6f1fdf3

Please sign in to comment.