feat(scan): create Scan tab and scannerService, implement QRScanner and controls
This commit is contained in:
parent
ceac7c2c2b
commit
f901c95f67
13 changed files with 393 additions and 23 deletions
22
public/views/tab-scan.html
Normal file
22
public/views/tab-scan.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<ion-view id="tab-scan">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>{{'Scan' | translate}}</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
<ion-content scroll="false">
|
||||
<div class="guides">
|
||||
<img class="qr-scan-guides" src="img/bitpay-wallet-qr-scan-guides.svg">
|
||||
</div>
|
||||
<div class="scanner-controls">
|
||||
<a ng-click="toggleLight()" ng-show="canEnableLight">
|
||||
<i class="icon">
|
||||
<div class="icon-flash" ng-class="{'active': lightActive}"></div>
|
||||
</i>
|
||||
</a>
|
||||
<a ng-click="toggleCamera()" ng-show="canChangeCamera">
|
||||
<i class="icon">
|
||||
<div class="icon-camera-toggle" ng-class="{'active': cameraToggleActive}"></div>
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
<label class="item item-input bitcoin-address">
|
||||
<i class="icon ion-social-bitcoin placeholder-icon"></i>
|
||||
<div class="qr-scan-icon" ng-style="{'width': '100%'}">
|
||||
<qr-scanner class="qr-icon size-24" ng-style="{'top': '3px'}" on-scan="onQrCodeScanned(data)"></qr-scanner>
|
||||
<a ui-sref="tabs.scan" ng-style="{'top': '6px'}"><i class="icon ion-qr-scanner"></i></a>
|
||||
<input type="text"
|
||||
placeholder="{{'Search or enter bitcoin address' | translate}}"
|
||||
ng-model="formData.search"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
<!--
|
||||
Create tabs with an icon and label, using the tabs-positive style.
|
||||
Each tab's child <ion-nav-view> directive will have its own
|
||||
navigation history that also transitions its views in and out.
|
||||
-->
|
||||
<ion-tabs class="tabs-icon-top tabs-color-active-positive" ng-class="{'tabs-item-hide': hideTabs}">
|
||||
<ion-tabs class="tabs-icon-top tabs-color-active-positive ion-tabs-transparent" ng-class="{'tabs-item-hide': hideTabs}">
|
||||
|
||||
<ion-tab title="Home" icon-off="ico-home" icon-on="ico-home-selected" ui-sref="tabs.home">
|
||||
<ion-nav-view name="tab-home"></ion-nav-view>
|
||||
|
|
@ -13,12 +8,8 @@ navigation history that also transitions its views in and out.
|
|||
<ion-nav-view name="tab-receive"></ion-nav-view>
|
||||
</ion-tab>
|
||||
|
||||
|
||||
<!-- this actually NEVER gets rendered -->
|
||||
<qr-scanner class="qr-icon size-24" style="display:none" set-fn="setScanFn(theScanFn)" on-scan="onScan(data)"></qr-scanner>
|
||||
|
||||
|
||||
<ion-tab title="Scan" icon-off="ico-scan" ng-click="scan()" >
|
||||
<ion-tab title="Scan" icon-off="ico-scan" icon-on="ico-scan-selected" ui-sref="tabs.scan">
|
||||
<ion-nav-view name="tab-scan"></ion-nav-view>
|
||||
</ion-tab>
|
||||
|
||||
<ion-tab title="Send" icon-off="ico-send" icon-on="ico-send-selected" ui-sref="tabs.send">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue