BitPay Card Intro (slides)

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-04 12:06:06 -03:00
commit 6d97ef57d5
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
7 changed files with 222 additions and 2 deletions

View file

@ -0,0 +1,57 @@
'use strict';
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $state, $timeout, $ionicHistory, storageService, externalLinkService, bitpayCardService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.data = {
index: 0
};
$scope.options = {
loop: false,
effect: 'flip',
speed: 500,
spaceBetween: 100
};
storageService.getNextStep('BitpayCard', function(err, value) {
if (value) {
$ionicHistory.nextViewOptions({
disableAnimate: true
});
$state.go('tabs.home');
$timeout(function() {
$state.transitionTo('tabs.bitpayCard');
}, 100);
}
});
});
$scope.orderBitPayCard = function() {
var url = 'https://bitpay.com/visa/';
var target = '_system';
externalLinkService.open(url, target);
};
$scope.connectBitPayCard = function() {};
$scope.goBack = function() {
if ($scope.data.index != 0) $scope.slider.slidePrev();
else $state.go('tabs.home');
};
$scope.slideNext = function() {
if ($scope.data.index != 2) $scope.slider.slideNext();
else $state.go('tabs.home');
};
$scope.$on("$ionicSlides.sliderInitialized", function(event, data) {
$scope.slider = data.slider;
});
$scope.$on("$ionicSlides.slideChangeStart", function(event, data) {
$scope.data.index = data.slider.activeIndex;
});
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {});
});

View file

@ -35,6 +35,7 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
'tabs.receive.backup',
'tabs.bitpayCard.amount',
'tabs.bitpayCard.confirm',
'tabs.bitpayCardIntro'
];
$rootScope.$on('$ionicView.beforeEnter', function() {

View file

@ -846,7 +846,16 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*
*/
.state('tabs.bitpayCard', {
.state('tabs.bitpayCardIntro', {
url: '/bitpay-card-intro',
views: {
'tab-home@tabs': {
controller: 'bitpayCardIntroController',
templateUrl: 'views/bitpayCardIntro.html'
}
}
})
.state('tabs.bitpayCard', {
url: '/bitpay-card',
views: {
'tab-home@tabs': {