Compare commits

...

2 commits

Author SHA1 Message Date
Brendon Duncan
accb594c10 Starting to handle payment request. 2018-07-24 16:53:12 -07:00
Brendon Duncan
770116c942 Starting on generic wallet selection screen for all sending scenarios. 2018-07-24 16:16:56 -07:00
4 changed files with 124 additions and 2 deletions

View file

@ -0,0 +1,58 @@
'use strict';
angular.module('copayApp.controllers').controller('sendWalletController', sendWalletController);
function sendWalletController(gettextCatalog, configService, $filter, $ionicHistory, $ionicModal, $ionicScrollDelegate, lodash, $log, nodeWebkitService, rateService, $scope, $state, $stateParams, $timeout, txFormatService, platformInfo, popupService, profileService, walletService, $window) {
var vm = this;
vm.headerTitle = '';
vm.isPaymentRequest = false;
vm.isSendFrom = true;
vm.walletsBch = [];
vm.walletsBtc = [];
vm.walletsEmpty = [];
vm.useWallet = useWallet;
$scope.$on('$ionicView.beforeEnter', onBeforeEnter);
var fromWalletId = '';
var thirdParty = null;
function onBeforeEnter(event, data) {
thirdParty = data.stateParams.thirdParty
fromWalletId =data.stateParams.fromWalletId;
vm.isSendFrom = !!fromWalletId;
if (vm.isSendFrom) {
vm.headerTitle = gettextCatalog.getString('From:');
} else {
vm.headerTitle = gettextCatalog.getString('To:');
}
vm.walletsBch = profileService.getWallets({
coin: 'bch',
hasFunds: true
});
vm.walletsBtc = profileService.getWallets({
coin: 'btc',
hasFunds: true
});
vm.walletsEmpty = profileService.getWallets({
hasFunds: false
});
// Will make this generic for other third party services later, but
// this is where it will happen
if (thirdParty && thirdParty.id === 'shapeshift') {
} else {
headerTitle = 'Wallet-to-Wallet transfer'
}
}
function useWallet(wallet) {
}
}

View file

@ -285,7 +285,16 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
* Send
*
*/
.state('tabs.send.wallet', {
url: '/send-wallet/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:fromWalletId/:minShapeshiftAmount/:maxShapeshiftAmount/:shapeshiftOrderId/:displayAddress/:noPrefix',
views: {
'tab-send@tabs' : {
controller: 'sendWalletController',
controllerAs: 'vm',
templateUrl: 'views/sendWallet.html'
}
}
})
.state('tabs.send.amount', {
url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:fromWalletId/:minShapeshiftAmount/:maxShapeshiftAmount/:shapeshiftOrderId/:displayAddress/:noPrefix',
views: {

55
www/views/sendWallet.html Normal file
View file

@ -0,0 +1,55 @@
<ion-view id="send-wallet" show-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Wallet to wallet transfer' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content>
<div class="header--request" ng-if="vm.isPaymentRequest">
<div class="header--request__title" translate>Paying</div>
<div class="header--request__amount" translate>$37.42 USD</div>
<div class="header--request__amount-alt" translate>0.04580000 BCH {{requestAmount}}</div>
</div>
<div class="wallets-header">
<div class="title">
{{vm.headerTitle}}
</div>
</div>
<div class="list card">
<div class="item item-icon-right item-heading">
<div translate>Bitcoin Cash (BCH)</div>
<div translate class="subtitle">Instant transactions with low fees</div>
</div>
<div>
<a ng-repeat="wallet in vm.walletsBch track by $index"
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
ng-click="vm.useWallet(wallet)">
<span ng-include="'views/includes/walletList.html'"></span>
</a>
</div>
</div>
<div class="list card" ng-if="vm.walletsBtc.length > 0">
<div class="item item-icon-right item-heading">
<div translate>Bitcoin Core (BTC)</div>
</div>
<div>
<a ng-repeat="wallet in vm.walletsBtc track by $index"
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
ng-click="vm.useWallet(wallet)">
<span ng-include="'views/includes/walletList.html'"></span>
</a>
</div>
</div>
<div class="list card card-insufficient" ng-if="vm.walletsEmpty.length > 0">
<div class="item item-icon-right item-heading">
<span class="card-insufficient__dot"></span><div translate>Insufficient funds</div>
</div>
<div>
<a ng-repeat="wallet in vm.walletsEmpty track by $index"
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet">
<span ng-include="'views/includes/walletList.html'"></span>
</a>
</div>
</div>
</ion-content>
</ion-view>

View file

@ -22,7 +22,7 @@
</button>
</div>
<div class="col-60">
<button class="button button-standard button-primary button-outline" ng-click="showWalletSelector()">
<button class="button button-standard button-primary button-outline" ui-sref="tabs.send.wallet">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
</button>