Merge pull request #6363 from cmgustavo/feat/mercadolibre-01
Feat/mercadolibre 01
This commit is contained in:
commit
9654336a6a
21 changed files with 3737 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<ion-view id="view-amount" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>
|
||||
{{'Enter Amount' | translate}}
|
||||
{{'Enter amount' | translate}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
|
|
|
|||
110
www/views/buyMercadoLibre.html
Normal file
110
www/views/buyMercadoLibre.html
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<ion-view id="mercadolibre" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>
|
||||
{{'Buy'|translate}}
|
||||
</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- BUY -->
|
||||
<div class="list">
|
||||
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<i class="icon big-icon-svg">
|
||||
<div class="bg icon-amazon"></div>
|
||||
</i>
|
||||
<span>Mercado Livre Brazil Gift Cards</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label" translate>From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
<div ng-show="totalAmountStr">
|
||||
<div class="item item-divider" translate>
|
||||
Details
|
||||
</div>
|
||||
<div class="item">
|
||||
<span translate>Gift card</span>
|
||||
<span class="item-note">
|
||||
{{amount | currency:'$ ':2}}<span ng-if="amount"> {{currencyIsoCode}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span translate>Invoice Fee</span>
|
||||
<span class="item-note">
|
||||
<span>{{invoiceFee | currency:'$ ':2}}<span ng-if="invoiceFee"> {{currencyIsoCode}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span translate>Network Fee</span>
|
||||
<span class="item-note">
|
||||
<span>{{networkFee | currency:'$ ':2}}<span ng-if="networkFee"> {{currencyIsoCode}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span translate>Total</span>
|
||||
<span class="item-note">
|
||||
<span ng-if="totalAmount">{{totalAmount | currency:'$ ':2}} {{currencyIsoCode}}</span>
|
||||
<span ng-if="totalAmountStr">({{totalAmountStr}})</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
is-disabled="!wallet || !totalAmountStr"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova"
|
||||
click-send-status="sendStatus">
|
||||
{{'Confirm purchase'|translate}}
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-if="isCordova && wallet && totalAmountStr"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus">
|
||||
{{'Slide to buy'|translate}}
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span ng-show="mlGiftCard.status == 'FAILURE'">
|
||||
Your purchase could not be completed
|
||||
</span>
|
||||
<span ng-show="mlGiftCard.status == 'PENDING'">
|
||||
Your purchase was added to the list of pending
|
||||
</span>
|
||||
<span ng-show="mlGiftCard.status == 'SUCCESS' || mlGiftCard.status == 'active'">
|
||||
Bought {{mlGiftCard.amount}} {{mlGiftCard.currency}}
|
||||
</span>
|
||||
<div class="m10 size-14" ng-show="mlGiftCard.status == 'SUCCESS' || mlGiftCard.cardStatus == 'active'">
|
||||
Gift card generated and ready to use.
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
<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>
|
||||
63
www/views/mercadoLibre.html
Normal file
63
www/views/mercadoLibre.html
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<ion-view>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>
|
||||
{{'Mercado Livre Brazil Gift Cards'|translate}}
|
||||
</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="!giftCards">
|
||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||
Sandbox version. Only for testing purpose.
|
||||
</div>
|
||||
<div class="integration-onboarding">
|
||||
<div class="integration-onboarding-logo">
|
||||
<img src="img/mercado-libre/mlbr.svg" alt="Mercado Libre" width="250">
|
||||
</div>
|
||||
<div class="integration-onboarding-description" translate>
|
||||
<b>Only</b> redeemable on Mercado Livre (Brazil)
|
||||
</div>
|
||||
<div class="integration-onboarding-cta" ng-show="!showOauthForm">
|
||||
<button class="button button-standard button-primary" ui-sref="tabs.giftcards.mercadoLibre.amount" no-low-fee
|
||||
translate>
|
||||
Buy a Gift Card
|
||||
</button>
|
||||
<button class="button button-standard button-secondary"
|
||||
ng-click="openExternalLink('https://www.mercadolivre.com.br')" translate>
|
||||
Visit mercadolivre.com.br →
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-content class="ng-hide" ng-show="giftCards">
|
||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||
Sandbox version. Only for testing purpose.
|
||||
</div>
|
||||
|
||||
<div class="m20t text-center">
|
||||
<img src="img/mercado-libre/mlbr.svg" alt="Mercado Libre" width="250">
|
||||
<div class="size-12 m10t" translate>
|
||||
<b>Only</b> redeemable on Mercado Livre (Brazil)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m20t" ng-if="giftCards">
|
||||
<div class="list card">
|
||||
<a class="item item-icon-left item-icon-right" href
|
||||
ui-sref="tabs.giftcards.mercadoLibre.amount" no-low-fee>
|
||||
<i class="icon ion-ios-pricetags-outline"></i>
|
||||
<span translate>Buy a Gift Card</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-icon-right item-icon-left"
|
||||
ui-sref="tabs.giftcards.mercadoLibre.cards">
|
||||
<i class="icon ion-ios-folder-outline"></i>
|
||||
<span translate>Your Gift Cards</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
34
www/views/mercadoLibreCards.html
Normal file
34
www/views/mercadoLibreCards.html
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<ion-view id="meli-list-cards">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>
|
||||
{{'Your Gift Cards'|translate}}
|
||||
</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content>
|
||||
<div class="list card">
|
||||
<div ng-repeat="(id, item) in giftCards | orderObjectBy:'date':true track by $index"
|
||||
ng-click="openCardModal(item)"
|
||||
class="item item-avatar"
|
||||
ng-hide="hideCards">
|
||||
<img class="item-logo" src="img/mercado-libre/meli-card-24px.png" alt="{{id}}">
|
||||
|
||||
<span class="item-note">
|
||||
<span class="assertive" ng-if="item.status == 'FAILURE'" translate>Error</span>
|
||||
<span class="dark" ng-if="item.status == 'expired'" translate>Invoice expired</span>
|
||||
<span class="calm" ng-if="item.status == 'invalid'" translate>Still pending</span>
|
||||
<span class="positive" ng-if="item.status == 'PENDING'" translate>Pending</span>
|
||||
|
||||
<span class="assertive" ng-if="item.cardStatus == 'inactive'" translate>Inactive</span>
|
||||
<span class="assertive" ng-if="item.cardStatus == 'expired'" translate>Expired</span>
|
||||
</span>
|
||||
<h2 ng-if="item.amount">
|
||||
{{item.amount | currency : '' : 2}} {{item.currency}}
|
||||
</h2>
|
||||
<p class="dark">{{item.date | amTimeAgo}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
75
www/views/modals/mercadolibre-card-details.html
Normal file
75
www/views/modals/mercadolibre-card-details.html
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<ion-modal-view id="meli-card" ng-controller="mercadoLibreCardDetailsController">
|
||||
<ion-header-bar align-title="center" class="bar-royal">
|
||||
<button class="button button-back button-clear" ng-click="close()" translate>
|
||||
Close
|
||||
</button>
|
||||
<h1 class="title" translate>Details</h1>
|
||||
</ion-header-bar>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<div class="card-head">
|
||||
<img src="img/mercado-libre/giftcard-pt.svg" alt="Mercado Livre Brazil Gift Card" width="230">
|
||||
|
||||
<div class="amount">
|
||||
{{card.amount | currency : '' : 2}} {{card.currency}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-status">
|
||||
<div ng-show="card.cardStatus == 'active'">
|
||||
<div class="redeem-pin" copy-to-clipboard="card.pin">{{card.pin}}</div>
|
||||
<button class="button-redeem"
|
||||
ng-click="openExternalLink('https://www.mercadolivre.com.br/redeem?pin=' + card.pin)" translate>
|
||||
Redeem Now
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div ng-show="card.cardStatus == 'inactive'">
|
||||
<span class="assertive" translate>Inactive</span>
|
||||
<div class="card-status-desc" translate>Gift Card is not available to use anymore</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="card.cardStatus == 'expired'">
|
||||
<span class="assertive" translate>Expired</span>
|
||||
<div class="card-status-desc" translate>Gift Card is not available to use anymore</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="card.status">
|
||||
<span class="positive" ng-show="card.status == 'PENDING'" translate>
|
||||
Pending
|
||||
</span>
|
||||
<span class="calm" ng-show="card.status=='invalid'" translate>
|
||||
Still pending
|
||||
</span>
|
||||
<span class="assertive" ng-show="card.status == 'FAILURE'" translate>
|
||||
Error
|
||||
</span>
|
||||
<span class="dark" ng-show="card.status == 'expired'" translate>
|
||||
Invoice expired
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list">
|
||||
<div class="item">
|
||||
<span translate>Created</span>
|
||||
<span class="item-note">
|
||||
{{card.date | amTimeAgo}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="item item-icon-right" ng-click="openExternalLink(card.invoiceUrl)">
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
<span translate>See invoice</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-remove" ng-show="card.status == 'FAILURE' || card.cardStatus == 'inactive' || card.cardStatus == 'expired' || card.status == 'expired'">
|
||||
<button class="button-remove" ng-click="remove()" translate>
|
||||
Remove
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue