show data
This commit is contained in:
parent
f3dd69b510
commit
f28b14a9d9
3 changed files with 92 additions and 52 deletions
|
|
@ -21,10 +21,9 @@
|
|||
<ion-content class="calculator" scroll="false" ng-show="!specificAmount && !sending">
|
||||
<div>
|
||||
<h2>Recipient</h2>
|
||||
|
||||
<a class="item item-icon-left item-icon-right">
|
||||
<i class="icon ion-person-stalker"></i>
|
||||
Javier
|
||||
<i class="icon ion-ios-person-outline"></i>
|
||||
{{recipientName}}
|
||||
<i class="icon ion-close"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -121,30 +120,39 @@
|
|||
</ion-content>
|
||||
|
||||
<ion-content ng-show="sending">
|
||||
<i class="icon ion-arrow-up-c"></i> <span>Sending</span>
|
||||
<h3>{{sendingAmount}} {{unitName}}</h3>
|
||||
<h4>{{sendingAlternativeAmount}} {{alternativeIsoCode}}</h4>
|
||||
<div class="card">
|
||||
<div class="item item-text-wrap">
|
||||
<i class="icon ion-arrow-up-c"></i> <span class="text-bold size-16">Sending</span>
|
||||
<div class="text-bold size-28 m15t">{{sendingAmount}} {{unitName}}</div>
|
||||
<div class="text-light size-20 m5t">{{sendingAlternativeAmount}} {{alternativeIsoCode}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list">
|
||||
<span class="item">Fee: Economy (97 bits)</span>
|
||||
|
||||
<span>To</span>
|
||||
<span class="item item-icon-left">
|
||||
<i class="icon ion-person-stalker"></i>
|
||||
Javier
|
||||
<i class="icon ion-ios-person-outline"></i>
|
||||
{{recipientName}}
|
||||
</span>
|
||||
|
||||
<span>From</span>
|
||||
<span class="item item-icon-left item-icon-right">
|
||||
<i class="icon icon-wallet size-21"></i>
|
||||
Personal Wallet
|
||||
<i class="icon ion-chevron-right size-21"></i>
|
||||
<i class="icon icon-wallet size-21" ng-style="{'color':recipientColor}"></i>
|
||||
Focused Wallet (Default Wallet)
|
||||
<i class="icon ion-ios-arrow-right size-21"></i>
|
||||
</span>
|
||||
|
||||
<span class="item item-icon-right">
|
||||
Add Memo
|
||||
<i class="icon ion-chevron-right size-21"></i>
|
||||
<i class="icon ion-ios-arrow-right size-21"></i>
|
||||
</span>
|
||||
|
||||
<div class="card">
|
||||
<div class="item item-text-wrap item-icon-right">
|
||||
<div class="item item-text-wrap item-icon-right" ng-click="cancel()">
|
||||
Slide to complete
|
||||
<i class="icon ion-arrow-right-c size-21"></i>
|
||||
<i class="icon ion-ios-arrow-thin-right size-21"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<ion-view view-title="Home">
|
||||
<ion-content class="send" ng-controller="tabSendController">
|
||||
<ion-content class="send" ng-controller="tabSendController" ng-init="init()">
|
||||
<h2>Recipient</h2>
|
||||
|
||||
<label class="item item-input">
|
||||
|
|
@ -7,37 +7,35 @@
|
|||
<input type="text" placeholder="Search">
|
||||
</label>
|
||||
|
||||
<h2>Recently used</h2>
|
||||
|
||||
<div class="list card">
|
||||
<a class="item item-icon-left" href="#">
|
||||
<i class="icon icon-wallet size-21"></i>
|
||||
Personal Wallet
|
||||
<span class="item-note">
|
||||
123,424.91 bits
|
||||
</span>
|
||||
</a>
|
||||
<a class="item item-icon-left" href="#">
|
||||
<i class="icon icon-wallet size-21"></i>
|
||||
Testnet Wallet
|
||||
<span class="item-note">
|
||||
123,424.91 bits
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<h2>Contacts</h2>
|
||||
|
||||
<div class="list card">
|
||||
<a class="item item-icon-left item-icon-right" ng-click="openInputAmountModal()">
|
||||
<i class="icon ion-person-stalker"></i>
|
||||
Javier
|
||||
<i class="icon ion-chevron-right size-21"></i>
|
||||
<!-- <a class="item item-icon-left" ng-repeat="contact in contactList" ng-click="openInputAmountModal(contact)">
|
||||
<i class="icon ion-ios-person-outline"></i>
|
||||
{{contact.label}}
|
||||
</a>
|
||||
<a class="item item-icon-left item-icon-right" ng-click="openInputAmountModal()">
|
||||
<i class="icon ion-person-stalker"></i>
|
||||
Javier 2
|
||||
<i class="icon ion-chevron-right size-21"></i>
|
||||
|
||||
<a class="item item-icon-left" ng-repeat="wallet in wallets" ng-click="openInputAmountModal(wallet)">
|
||||
<i class="icon icon-wallet size-21" ng-style="{'color':wallet.color}"></i>
|
||||
{{wallet.name || wallet.alias}}
|
||||
<span class="item-note">
|
||||
{{wallet.balance || '123,999.91 bits'}}
|
||||
</span>
|
||||
</a> -->
|
||||
|
||||
<a class="item item-icon-left" ng-repeat="item in list" ng-click="openInputAmountModal(item)">
|
||||
<div ng-show="!item.id">
|
||||
<i class="icon ion-ios-person-outline"></i>
|
||||
{{item.label}}
|
||||
</div>
|
||||
|
||||
<div ng-show="item.id">
|
||||
<i class="icon icon-wallet size-21" ng-style="{'color':item.color}"></i>
|
||||
{{item.name || item.alias}}
|
||||
<span class="item-note">
|
||||
{{item.balance || '123,999.91 bits'}}
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,53 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal) {
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, addressbookService, profileService, configService, lodash) {
|
||||
|
||||
$scope.init = function() {
|
||||
addressbookService.list(function(err, ab) {
|
||||
if (err) {
|
||||
console.log('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
// $scope.contactList = lodash.isEmpty(ab) ? null : ab;
|
||||
$scope.contactList = [{
|
||||
label: 'Javier',
|
||||
address: '123456'
|
||||
}, {
|
||||
label: 'Javier 2',
|
||||
address: '654321'
|
||||
}, {
|
||||
label: 'Javier 3',
|
||||
address: '7891011'
|
||||
}, {
|
||||
label: 'Javier 4',
|
||||
address: '1101987'
|
||||
}];
|
||||
});
|
||||
|
||||
var config = configService.getSync();
|
||||
config.colorFor = config.colorFor || {};
|
||||
config.aliasFor = config.aliasFor || {};
|
||||
|
||||
// Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes)
|
||||
var credentials = lodash.filter(profileService.profile.credentials, 'walletName');
|
||||
var ret = lodash.map(credentials, function(c) {
|
||||
return {
|
||||
m: c.m,
|
||||
n: c.n,
|
||||
name: config.aliasFor[c.walletId] || c.walletName,
|
||||
id: c.walletId,
|
||||
color: config.colorFor[c.walletId] || '#4A90E2',
|
||||
};
|
||||
});
|
||||
|
||||
$scope.wallets = lodash.sortBy(ret, 'name');
|
||||
$scope.list = $scope.contactList.concat($scope.wallets);
|
||||
};
|
||||
|
||||
$scope.openInputAmountModal = function(recipient) {
|
||||
$scope.recipientName = recipient.name || recipient.label;
|
||||
$scope.recipientColor = recipient.color;
|
||||
|
||||
$scope.openInputAmountModal = function(addr) {
|
||||
$ionicModal.fromTemplateUrl('views/modals/inputAmount.html', {
|
||||
scope: $scope
|
||||
}).then(function(modal) {
|
||||
|
|
@ -10,15 +55,4 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
$scope.inputAmountModal.show();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.options = {
|
||||
loop: false,
|
||||
effect: 'fade',
|
||||
speed: 500,
|
||||
};
|
||||
|
||||
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {
|
||||
// note: the indexes are 0-based
|
||||
console.log('CHANGEDD');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue