New more better quick send
This commit is contained in:
parent
f25a2a07db
commit
35fbcca41b
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function showAddressQRCode() {
|
|
||||||
var fromqrstring = $("#addresscodeform #from_name").val() + "\t"
|
|
||||||
+ $("#addresscodeform #from_company").val() + "\t"
|
|
||||||
+ $("#addresscodeform #from_street1").val() + "\t"
|
|
||||||
+ $("#addresscodeform #from_street2").val() + "\t"
|
|
||||||
+ "\t"
|
|
||||||
+ "\t"
|
|
||||||
+ $("#addresscodeform #from_zip").val();
|
|
||||||
|
|
||||||
var toqrstring = $("#addresscodeform #to_name").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_company").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_street1").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_street2").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_city").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_state").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_zip").val() + "\t"
|
|
||||||
+ $("#addresscodeform #to_country").val();
|
|
||||||
|
|
||||||
var canvas = document.createElement('canvas');
|
|
||||||
|
|
||||||
bwipjs.toCanvas(canvas, {
|
|
||||||
bcid: 'qrcode', // Barcode type
|
|
||||||
text: fromqrstring, // Text to encode
|
|
||||||
scale: 5,
|
|
||||||
includetext: false, // Show human-readable text
|
|
||||||
textxalign: 'center', // Always good to set this
|
|
||||||
eclevel: 'M'
|
|
||||||
});
|
|
||||||
document.getElementById("addresscode-barcode-from").src = canvas.toDataURL('image/png');
|
|
||||||
|
|
||||||
canvas = document.createElement('canvas');
|
|
||||||
bwipjs.toCanvas(canvas, {
|
|
||||||
bcid: 'qrcode', // Barcode type
|
|
||||||
text: toqrstring, // Text to encode
|
|
||||||
scale: 5,
|
|
||||||
includetext: false, // Show human-readable text
|
|
||||||
textxalign: 'center', // Always good to set this
|
|
||||||
eclevel: 'M'
|
|
||||||
});
|
|
||||||
document.getElementById("addresscode-barcode-to").src = canvas.toDataURL('image/png');
|
|
||||||
|
|
||||||
app.popup.create({el: document.getElementById("qrCodePopup")}).open();
|
|
||||||
}
|
|
51
www/assets/js/quicksend.js
Normal file
51
www/assets/js/quicksend.js
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function showAddressQRCode() {
|
||||||
|
var content = "QSv1|tofrom"
|
||||||
|
+ "|" + $("#addresscodeform #to_name").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_company").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_street1").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_street2").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_city").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_state").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_zip").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_country").val()
|
||||||
|
+ "|" + $("#addresscodeform #to_phone").val()
|
||||||
|
+ "|" // email
|
||||||
|
+ "|" + $("#addresscodeform #from_name").val()
|
||||||
|
+ "|" + $("#addresscodeform #from_company").val()
|
||||||
|
+ "|" + $("#addresscodeform #from_street1").val()
|
||||||
|
+ "|" + $("#addresscodeform #from_street2").val()
|
||||||
|
+ "|" // city
|
||||||
|
+ "|" // state
|
||||||
|
+ "|" + $("#addresscodeform #from_zip").val()
|
||||||
|
+ "|" // country
|
||||||
|
+ "|" + $("#addresscodeform #from_phone").val()
|
||||||
|
+ "|"; // email
|
||||||
|
|
||||||
|
setStorage("quicksend_name", $("#addresscodeform #from_name").val());
|
||||||
|
setStorage("quicksend_company", $("#addresscodeform #from_company").val());
|
||||||
|
setStorage("quicksend_street1", $("#addresscodeform #from_street1").val());
|
||||||
|
setStorage("quicksend_street2", $("#addresscodeform #from_street2").val());
|
||||||
|
setStorage("quicksend_zip", $("#addresscodeform #from_zip").val());
|
||||||
|
setStorage("quicksend_phone", $("#addresscodeform #from_phone").val());
|
||||||
|
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
|
||||||
|
bwipjs.toCanvas(canvas, {
|
||||||
|
bcid: 'pdf417', // Barcode type
|
||||||
|
text: content, // Text to encode
|
||||||
|
scale: 5,
|
||||||
|
includetext: false, // Show human-readable text
|
||||||
|
textxalign: 'center', // Always good to set this
|
||||||
|
eclevel: 'M'
|
||||||
|
});
|
||||||
|
document.getElementById("addresscode-barcode").src = canvas.toDataURL('image/png');
|
||||||
|
|
||||||
|
app.popup.create({el: document.getElementById("qrCodePopup")}).open();
|
||||||
|
}
|
@ -71,7 +71,7 @@
|
|||||||
<script src="assets/js/crypto.js"></script>
|
<script src="assets/js/crypto.js"></script>
|
||||||
<script src="assets/js/serviceareamap.js"></script>
|
<script src="assets/js/serviceareamap.js"></script>
|
||||||
<script src="assets/js/moneyorder.js"></script>
|
<script src="assets/js/moneyorder.js"></script>
|
||||||
<script src="assets/js/address_qrcode.js"></script>
|
<script src="assets/js/quicksend.js"></script>
|
||||||
<script src="assets/js/labelmaker.js"></script>
|
<script src="assets/js/labelmaker.js"></script>
|
||||||
|
|
||||||
<script src="routes.js"></script>
|
<script src="routes.js"></script>
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">Name (or care of)</div>
|
<div class="item-title item-floating-label">Name (or care of)</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap">
|
||||||
<input type="text" id="from_name" placeholder="" />
|
<input type="text" id="from_name" placeholder="" value="{{from_name}}" />
|
||||||
<span class="input-clear-button"></span>
|
<span class="input-clear-button"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">Company (or name)</div>
|
<div class="item-title item-floating-label">Company (or name)</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap">
|
||||||
<input type="text" id="from_company" placeholder="" />
|
<input type="text" id="from_company" placeholder="" value="{{from_company}}" />
|
||||||
<span class="input-clear-button"></span>
|
<span class="input-clear-button"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">Street Address</div>
|
<div class="item-title item-floating-label">Street Address</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap">
|
||||||
<input type="text" id="from_street1" placeholder="1234 Example Rd" />
|
<input type="text" id="from_street1" placeholder="1234 Example Rd" value="{{from_street1}}" />
|
||||||
<span class="input-clear-button"></span>
|
<span class="input-clear-button"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">Address Line 2</div>
|
<div class="item-title item-floating-label">Address Line 2</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap">
|
||||||
<input type="text" id="from_street2" placeholder="Apt 37" />
|
<input type="text" id="from_street2" placeholder="Apt 37" value="{{from_street2}}" />
|
||||||
<span class="input-clear-button"></span>
|
<span class="input-clear-button"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -78,7 +78,16 @@
|
|||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">ZIP Code</div>
|
<div class="item-title item-floating-label">ZIP Code</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap">
|
||||||
<input type="text" id="from_zip" inputmode="numeric" />
|
<input type="text" id="from_zip" inputmode="numeric" value="{{from_zip}}" />
|
||||||
|
<span class="input-clear-button"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="item-content item-input item-input-outline">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title item-floating-label">Phone Number</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<input type="tel" id="from_phone" value="{{from_phone}}" />
|
||||||
<span class="input-clear-button"></span>
|
<span class="input-clear-button"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -413,6 +422,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="item-content item-input item-input-outline">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title item-floating-label">Phone Number</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<input type="tel" id="to_phone" />
|
||||||
|
<span class="input-clear-button"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -428,12 +446,8 @@
|
|||||||
|
|
||||||
<div class="popup" id="qrCodePopup">
|
<div class="popup" id="qrCodePopup">
|
||||||
<div class="block text-align-center">
|
<div class="block text-align-center">
|
||||||
<b>From</b><br>
|
<img id="addresscode-barcode" style="max-width: 90%;" />
|
||||||
<img id="addresscode-barcode-from" style="max-width: 90%;" />
|
<p>Present this code for scanning.</p>
|
||||||
<br><br><br>
|
|
||||||
<b>To</b><br>
|
|
||||||
<img id="addresscode-barcode-to" style="max-width: 90%;" />
|
|
||||||
<p>Present these codes for scanning.</p>
|
|
||||||
<p><a class="button popup-close" href="#">Close</a></p>
|
<p><a class="button popup-close" href="#">Close</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -33,7 +33,7 @@ var pagesToCompile = [
|
|||||||
"trailer",
|
"trailer",
|
||||||
"money",
|
"money",
|
||||||
"moneyorder",
|
"moneyorder",
|
||||||
"address_qrcode"
|
"quicksend"
|
||||||
];
|
];
|
||||||
console.log("Compiling page templates...");
|
console.log("Compiling page templates...");
|
||||||
for (var i = 0; i < pagesToCompile.length; i++) {
|
for (var i = 0; i < pagesToCompile.length; i++) {
|
||||||
@ -192,7 +192,7 @@ var routes = [
|
|||||||
title: "My Account",
|
title: "My Account",
|
||||||
href: "/account",
|
href: "/account",
|
||||||
icon: "fa-duotone fa-user-circle",
|
icon: "fa-duotone fa-user-circle",
|
||||||
text: "Get account number, check rewards points, update payment method, and more."
|
text: "View receipts, get account number, update payment method, and more."
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -316,8 +316,19 @@ var routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/quicksend',
|
path: '/quicksend',
|
||||||
content: compiledPages.address_qrcode(),
|
name: 'quicksend',
|
||||||
name: 'quicksend'
|
async: function ( {resolve}) {
|
||||||
|
resolve({
|
||||||
|
content: compiledPages.quicksend({
|
||||||
|
from_name: inStorage("quicksend_name") ? getStorage("quicksend_name") : "",
|
||||||
|
from_company: inStorage("quicksend_company") ? getStorage("quicksend_company") : "",
|
||||||
|
from_street1: inStorage("quicksend_street1") ? getStorage("quicksend_street1") : (inStorage("lastpickupaddress") ? getStorage("lastpickupaddress") : ""),
|
||||||
|
from_street2: inStorage("quicksend_street2") ? getStorage("quicksend_street2") : "",
|
||||||
|
from_zip: inStorage("quicksend_zip") ? getStorage("quicksend_zip") : (inStorage("lastpickupzipcode") ? getStorage("lastpickupzipcode") : ""),
|
||||||
|
from_phone: inStorage("quicksend_phone") ? getStorage("quicksend_phone") : ""
|
||||||
|
})
|
||||||
|
}, {});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/appointment',
|
path: '/appointment',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user