Refactor buying process
This commit is contained in:
parent
420a063017
commit
e42d09574b
8 changed files with 329 additions and 123 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<ion-view id="view-amount" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>
|
||||
{{'Enter Amount' | translate}}
|
||||
{{coinbase ? (coinbase == 'buy' ? 'Buy bitcoin' : 'Sell bitcoin') : ('Enter Amount' | translate)}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<ion-content scroll="false">
|
||||
|
||||
<div ng-if="!customAmount && !isGlidera && !isCoinbase">
|
||||
<div ng-if="!customAmount && !isGlidera && !coinbase">
|
||||
<div class="item item-no-bottom-border recipient-label" translate>Recipient</div>
|
||||
|
||||
<div class="item item-text-wrap item-icon-left bitcoin-address" ng-class="{'item-big-icon-left':cardId}">
|
||||
|
|
@ -39,11 +39,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-class="{'amount-pane-recipient': !customAmount && !isGlidera && !isCoinbase, 'amount-pane-no-recipient': customAmount || isGlidera || isCoinbase}">
|
||||
<div ng-class="{'amount-pane-recipient': !customAmount && !isGlidera && !coinbase,
|
||||
'amount-pane-no-recipient': customAmount || isGlidera || coinbase}">
|
||||
|
||||
<div class="amount-bar oh">
|
||||
<div class="title">
|
||||
<span ng-show="!isCoinbase" translate>Amount</span>
|
||||
<span translate>Amount</span>
|
||||
<div class="size-12" ng-show="isGiftCard">Purchase Amount is limited to USD 1000 per day</div>
|
||||
<div class="size-12" ng-if="cardId" ng-init="getRates()">{{exchangeRate}}</div>
|
||||
<div ng-show="isGlidera">
|
||||
|
|
@ -66,26 +67,6 @@
|
|||
(remaining {{limits.monthlySellRemaining|currency:'':2}} {{limits.currency}})
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="isCoinbase">
|
||||
<div class="list select">
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label">
|
||||
<span ng-show="isCoinbase == 'buy'">Payment Method</span>
|
||||
<span ng-show="isCoinbase == 'sell'">Deposit into</span>
|
||||
</div>
|
||||
<select ng-model="coinbaseSelectedPaymentMethodId.value"
|
||||
ng-options="item.id as item.name for item in coinbasePaymentMethods">
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="limits" ng-show="coinbaseBuyPrice && isCoinbase == 'buy'">
|
||||
1 BTC ~ {{coinbaseBuyPrice.amount}} {{coinbaseBuyPrice.currency}}
|
||||
</div>
|
||||
<div class="limits" ng-show="coinbaseSellPrice && isCoinbase == 'sell'">
|
||||
1 BTC ~ {{coinbaseSellPrice.amount}} {{coinbaseSellPrice.currency}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
96
www/views/buyCoinbase.html
Normal file
96
www/views/buyCoinbase.html
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<ion-view id="coinbase" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Buy bitcoin</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content>
|
||||
<!-- BUY -->
|
||||
<div class="list" ng-show="!buySuccess">
|
||||
<div class="item item-divider">
|
||||
Purchase Info
|
||||
</div>
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label">
|
||||
Payment Method
|
||||
</div>
|
||||
<select ng-model="selectedPaymentMethodId.value"
|
||||
ng-options="item.id as item.name for item in paymentMethods"
|
||||
ng-change="buyRequest()">
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div ng-if="buyRequestInfo">
|
||||
<div class="item">
|
||||
Amount
|
||||
<span class="item-note">
|
||||
{{buyRequestInfo.amount.amount}} {{buyRequestInfo.amount.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Payout at
|
||||
<span class="item-note">
|
||||
{{buyRequestInfo.payout_at | amCalendar}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item" ng-click="showWalletSelector()">
|
||||
<span>Receive in</span>
|
||||
<span class="item-note">{{wallet ? wallet.name : '...'}}</span>
|
||||
</div>
|
||||
|
||||
<div class="item item-divider">
|
||||
Fees
|
||||
</div>
|
||||
<div class="item" ng-repeat="fee in buyRequestInfo.fees">
|
||||
{{fee.type}}
|
||||
<span class="item-note">
|
||||
{{fee.amount.amount}} {{fee.amount.currency}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item item-divider">
|
||||
Total
|
||||
</div>
|
||||
<div class="item">
|
||||
Subtotal
|
||||
<span class="item-note">
|
||||
{{buyRequestInfo.subtotal.amount}} {{buyRequestInfo.subtotal.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Total
|
||||
<span class="item-note">
|
||||
{{buyRequestInfo.total.amount}} {{buyRequestInfo.total.currency}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
ng-show="buyRequestInfo && !buySuccess"
|
||||
ng-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet"
|
||||
class="button button-standard button-primary"
|
||||
ng-click="buyConfirm()">
|
||||
Confirm
|
||||
</button>
|
||||
|
||||
<div ng-show="buySuccess">
|
||||
<div class="p20">
|
||||
Bitcoin purchase completed. Coinbase has queued the transfer to your selected wallet
|
||||
</div>
|
||||
<button
|
||||
class="button button-standard button-primary"
|
||||
ng-click="goBackHome()">
|
||||
Done
|
||||
</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
|
|
@ -59,16 +59,22 @@
|
|||
<img src="img/coinbase-logo.png" width="200">
|
||||
</div>
|
||||
|
||||
<div class="m10t size-12 text-center text-gray" ng-if="buyPrice && sellPrice">
|
||||
{{buyPrice.amount}} {{buyPrice.currency}}
|
||||
|
|
||||
{{sellPrice.amount}} {{sellPrice.currency}}
|
||||
</div>
|
||||
|
||||
<div class="list card"
|
||||
ng-show="accountId">
|
||||
<a class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({isCoinbase: 'buy'})">
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({coinbase: 'buy', currency: currency})">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="35" class="item-img-buy">
|
||||
Buy Bitcoin
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<a class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({isCoinbase: 'sell'})">
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({coinbase: 'sell', currency: currency})">
|
||||
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="35" class="item-img-sell">
|
||||
Sell Bitcoin
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue