add wallet information to custom amount and addresses view

This commit is contained in:
Gabriel Bazán 2017-05-04 14:45:21 -03:00
commit 813d89a139
6 changed files with 10 additions and 9 deletions

View file

@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.currency = data.stateParams.currency; $scope.currency = data.stateParams.currency;
$scope.forceCurrency = data.stateParams.forceCurrency; $scope.forceCurrency = data.stateParams.forceCurrency;
$scope.showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' || $scope.showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' ||
$ionicHistory.backView().stateName == 'tabs.bitpayCard'); $ionicHistory.backView().stateName == 'tabs.bitpayCard');
$scope.recipientType = data.stateParams.recipientType || null; $scope.recipientType = data.stateParams.recipientType || null;
$scope.toAddress = data.stateParams.toAddress; $scope.toAddress = data.stateParams.toAddress;
@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.toEmail = data.stateParams.toEmail; $scope.toEmail = data.stateParams.toEmail;
$scope.showAlternativeAmount = !!$scope.nextStep; $scope.showAlternativeAmount = !!$scope.nextStep;
$scope.toColor = data.stateParams.toColor; $scope.toColor = data.stateParams.toColor;
$scope.walletId = data.stateParams.walletId;
$scope.showSendMax = false; $scope.showSendMax = false;
$scope.customAmount = data.stateParams.customAmount; $scope.customAmount = data.stateParams.customAmount;
@ -236,6 +237,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount; var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount;
if ($scope.customAmount) { if ($scope.customAmount) {
$state.transitionTo('tabs.receive.customAmount', { $state.transitionTo('tabs.receive.customAmount', {
walletId: $scope.walletId,
toAmount: (amount * unitToSatoshi).toFixed(0), toAmount: (amount * unitToSatoshi).toFixed(0),
toAddress: $scope.toAddress toAddress: $scope.toAddress
}); });

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('customAmountController', function($rootScope, $scope, $stateParams, $ionicHistory, txFormatService, platformInfo) { angular.module('copayApp.controllers').controller('customAmountController', function($rootScope, $scope, $stateParams, $ionicHistory, txFormatService, platformInfo, profileService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
var satToBtc = 1 / 100000000; var satToBtc = 1 / 100000000;
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func
$scope.amountBtc = ($scope.amount * satToBtc).toFixed(8); $scope.amountBtc = ($scope.amount * satToBtc).toFixed(8);
$scope.amountStr = txFormatService.formatAmountStr($scope.amount); $scope.amountStr = txFormatService.formatAmountStr($scope.amount);
$scope.altAmountStr = txFormatService.formatAlternativeStr($scope.amount); $scope.altAmountStr = txFormatService.formatAlternativeStr($scope.amount);
$scope.wallet = profileService.getWallet($stateParams.walletId);
}); });
$scope.finish = function() { $scope.finish = function() {

View file

@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.requestSpecificAmount = function() { $scope.requestSpecificAmount = function() {
$state.go('tabs.receive.amount', { $state.go('tabs.receive.amount', {
walletId: $scope.wallet.credentials.walletId,
customAmount: true, customAmount: true,
toAddress: $scope.addr toAddress: $scope.addr
}); });

View file

@ -681,7 +681,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*/ */
.state('tabs.receive.amount', { .state('tabs.receive.amount', {
url: '/amount/:customAmount/:toAddress', url: '/amount/:walletId/:customAmount/:toAddress',
views: { views: {
'tab-receive@tabs': { 'tab-receive@tabs': {
controller: 'amountController', controller: 'amountController',
@ -690,7 +690,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
.state('tabs.receive.customAmount', { .state('tabs.receive.customAmount', {
url: '/customAmount/:toAmount/:toAddress', url: '/customAmount/:walletId/:toAmount/:toAddress',
views: { views: {
'tab-receive@tabs': { 'tab-receive@tabs': {
controller: 'customAmountController', controller: 'customAmountController',

View file

@ -11,11 +11,7 @@
</ion-nav-bar> </ion-nav-bar>
<ion-content> <ion-content>
<div class="text-center banner-icon"> <div ng-include="'views/includes/walletItem.html'"></div>
<i class="icon zero-state-icon">
<img src="img/tab-icons/ico-receive-selected.svg"/>
</i>
</div>
<div class="addr-list"> <div class="addr-list">
<div class="addr-explanation"> <div class="addr-explanation">

View file

@ -12,6 +12,7 @@
</ion-nav-buttons> </ion-nav-buttons>
</ion-nav-bar> </ion-nav-bar>
<ion-content scroll="false"> <ion-content scroll="false">
<div ng-include="'views/includes/walletItem.html'"></div>
<div class="item head text-center" copy-to-clipboard="'bitcoin:' + address + '?amount=' + amountBtc"> <div class="item head text-center" copy-to-clipboard="'bitcoin:' + address + '?amount=' + amountBtc">
<qrcode size="220" data="bitcoin:{{address + '?amount=' + amountBtc}}" color="#334"></qrcode> <qrcode size="220" data="bitcoin:{{address + '?amount=' + amountBtc}}" color="#334"></qrcode>
</div> </div>