Ref BitPay Card TX list
This commit is contained in:
parent
299ef8ab7c
commit
15c20f38ac
4 changed files with 48 additions and 21 deletions
|
|
@ -3,6 +3,7 @@
|
|||
angular.module('copayApp.controllers').controller('bitpayCardController', function($scope, $timeout, $log, $state, lodash, bitpayCardService, moment, popupService, gettextCatalog, $ionicHistory) {
|
||||
|
||||
var self = this;
|
||||
var runningBalance;
|
||||
$scope.dateRange = { value: 'last30Days'};
|
||||
$scope.network = bitpayCardService.getEnvironment();
|
||||
|
||||
|
|
@ -68,10 +69,14 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
self.getStarted = getStarted;
|
||||
|
||||
var txs = lodash.clone(history.txs);
|
||||
runningBalance = parseFloat(history.endingBalance);
|
||||
for (var i = 0; i < txs.length; i++) {
|
||||
txs[i] = _getMerchantInfo(txs[i]);
|
||||
txs[i].icon = _getIconName(txs[i]);
|
||||
txs[i].desc = _processDescription(txs[i]);
|
||||
txs[i].price = _price(txs[i]);
|
||||
txs[i].runningBalance = runningBalance;
|
||||
_runningBalance(txs[i]);
|
||||
}
|
||||
self.bitpayCardTransactionHistory = txs;
|
||||
self.bitpayCardCurrentBalance = history.currentCardBalance;
|
||||
|
|
@ -117,6 +122,14 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
return tx.description;
|
||||
};
|
||||
|
||||
var _price = function(tx) {
|
||||
return parseFloat(tx.amount) + parseFloat(tx.fee)
|
||||
};
|
||||
|
||||
var _runningBalance = function(tx) {
|
||||
runningBalance -= parseFloat(tx.amount);
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.cardId = data.stateParams.id;
|
||||
if (!$scope.cardId) {
|
||||
|
|
|
|||
|
|
@ -401,6 +401,14 @@ input[type=number] {
|
|||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.text-italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.no-border {
|
||||
border-style: none;
|
||||
background-color: transparent !important;
|
||||
|
|
|
|||
|
|
@ -34,4 +34,7 @@
|
|||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.item-select select {
|
||||
color: #667;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue