Fix card intro

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-07 11:33:39 -03:00
parent 35cd6ce4cc
commit 9196e07f3a
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
5 changed files with 47 additions and 125 deletions

View File

@ -1,74 +1,45 @@
<ion-view id="bitpayCard-intro">
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-title></ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button back-button button-clear" ng-click="goBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button class="button back-button button-clear" ng-click="openExternalInfo()">
<button class="button back-button button-clear" ng-click="orderBitPayCard()">
<i class="icon ion-ios-information-outline"></i>
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-slides class="slides" options="options" slider="data.slider">
<ion-slide-page>
<ion-content scroll="false">
<div class="text-center">
<img src="img/bitpay-card-visa.svg" width="200">
</div>
<ion-content scroll="false">
<div class="text-center padding">
<img src="img/bitpay-card-visa.svg" width="100%">
</div>
<ion-slide-box>
<ion-slide>
<p translate>
Turn bitcoin into dollars, swipe anywhere Visa&reg; is accepted.
Turn bitcoin into dollars, swipe anywhere Visa&reg; is accepted.
</p>
<div class="cta-button">
<button class="button button-block button-primary" ng-click="orderBitPayCard()" translate>
Order the BitPay Card
</button>
<button class="button button-block button-transparent text-white m10t" ng-click="connectBitPayCard()" translate>
Connect my BitPay Card
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content scroll="false">
<div class="text-center">
<img src="img/bitpay-card-visa.svg" width="200">
</div>
</ion-slide>
<ion-slide>
<p translate>
<span translate>Get local cash anywhere you go, from any Visa&reg;-compatible ATM.</span>
<div translate class="size-10 m20t text-center">
*ATM bank fees may apply
</div>
<span translate>Get local cash anywhere you go, from any Visa&reg;-compatible ATM.</span>
<div translate class="size-10 m20t text-center">
*ATM bank fees may apply
</div>
</p>
<div class="cta-button">
<button class="button button-block button-primary" ng-click="orderBitPayCard()" translate>
Order the BitPay Card
</button>
<button class="button button-block button-transparent text-white m10t" ng-click="connectBitPayCard()" translate>
Connect my BitPay Card
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content scroll="false">
<div class="text-center">
<img src="img/bitpay-card-visa.svg" width="200">
</div>
</ion-slide>
<ion-slide>
<p translate>
Pay 0% fees to turn bitcoin into dollars.
Pay 0% fees to turn bitcoin into dollars.
</p>
<div class="cta-button">
<button class="button button-block button-primary" ng-click="orderBitPayCard()" translate>
Order the BitPay Card
</button>
<button class="button button-block button-transparent text-white m10t" ng-click="connectBitPayCard()" translate>
Connect my BitPay Card
</button>
</div>
</ion-content>
</ion-slide-page>
</ion-slides>
</ion-slide>
</ion-slide-box>
<div class="cta-button">
<button class="button button-block button-primary" ng-click="orderBitPayCard()" translate>
Order the BitPay Card
</button>
<button class="button button-block button-transparent text-white m10t" ng-click="connectBitPayCard()" translate>
Connect my BitPay Card
</button>
</div>
</ion-content>
</ion-view>

View File

@ -2,16 +2,6 @@
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $state, $timeout, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.data = {
index: 0
};
$scope.options = {
loop: false,
effect: 'flip',
speed: 500,
spaceBetween: 100
};
if (data.stateParams && data.stateParams.secret) {
var obj = {
@ -25,11 +15,13 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
return;
}
var title = gettextCatalog.getString('Add BitPay Cards?');
var msg = gettextCatalog.getString('Would you like to add this account to your wallet?');
var msg = gettextCatalog.getString('Would you like to add this account ({{email}}) to your wallet?', {email: obj.email});
var ok = gettextCatalog.getString('Add cards');
var cancel = gettextCatalog.getString('Go back');
popupService.showConfirm(title, msg, ok, cancel, function(res) {
if (res) {
// Set flag for nextStep
storageService.setNextStep('BitpayCard', true, function(err) {});
// Save data
bitpayCardService.setBitpayDebitCards(data, function(err) {
if (err) return;
@ -71,25 +63,5 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
var target = '_system';
externalLinkService.open(url, target);
};
$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,27 +35,6 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
return error;
};
var _getUser = function(cb) {
_setCredentials();
storageService.getBitpayCard(credentials.NETWORK, function(err, user) {
if (err) return cb(err);
if (lodash.isString(user)) {
user = JSON.parse(user);
}
return cb(null, user);
});
};
var _setUser = function(user, cb) {
_setCredentials();
user = JSON.stringify(user);
storageService.setBitpayCard(credentials.NETWORK, user, function(err) {
return cb(err);
});
// Show pending task from the UI
storageService.setNextStep('BitpayCard', true, function(err) {});
};
var _getSession = function(cb) {
_setCredentials();
$http({
@ -179,8 +158,6 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
data: userData
}).then(function(data) {
$log.info('BitPay Card BitAuth: SUCCESS');
// Set an UI flag
storageService.setNextStep('BitpayCard', true, function(err) {});
// Get cards
_afterBitAuthSuccess(obj, cb);
}, function(data) {

View File

@ -1,11 +1,11 @@
#bitpayCard-intro {
.swiper-container-horizontal > .swiper-pagination {
bottom: 150px;
.slider-pager .slider-pager-page {
color: #fff;
}
.cta-button{
text-align: center;
position: absolute;
bottom: 45px;
bottom: 55px;
padding: 0 1.5rem;
width: 100%;
}
@ -34,14 +34,6 @@
border-color: transparent;
border:none;
}
.swiper-pagination {
&-bullet {
background: rgb(100, 124, 232);
&-active {
background: rgb(100, 124, 232);
}
}
}
.button-transparent{
background: none !important;
}

View File

@ -97,10 +97,20 @@
<i class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div>
</i>
<h2>BitPay Card</h2>
<h2>BitPay Visa&reg; Card</h2>
<p>{{card.lastFourDigits}}</p>
<i class="icon bp-arrow-right"></i>
</a>
<a ui-sref="tabs.bitpayCardIntro"
ng-if="bitpayCardEnabled && !bitpayCards[0]"
class="item item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div>
</i>
<h2>BitPay Visa&reg; Card</h2>
<p translate>Add your cards</p>
<i class="icon bp-arrow-right"></i>
</a>
</div>
</div>