Add and fix a lot of things with accounts and drop and send. Add geolocation plugin. Remove pick up and redeliver.
This commit is contained in:
parent
d3c79c7865
commit
971ed994e0
11
config.xml
11
config.xml
@ -79,7 +79,16 @@
|
||||
<preference name="scheme" value="app" />
|
||||
<preference name="hostname" value="localhost" />
|
||||
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
|
||||
<string>Camera is used to scan receipts and redelivery notice slips</string>
|
||||
<string>Your camera is used to scan receipts and pickup codes.</string>
|
||||
</edit-config>
|
||||
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
|
||||
<string>Your location is used to pinpoint your location on a map. It does not leave your device.</string>
|
||||
</edit-config>
|
||||
<edit-config target="NSLocationAlwaysAndWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
|
||||
<string>Your location is used to pinpoint your location on a map. It does not leave your device.</string>
|
||||
</edit-config>
|
||||
<edit-config target="NSLocationAlwaysUsageDescription" file="*-Info.plist" mode="merge">
|
||||
<string>Your location is used to pinpoint your location on a map. It does not leave your device.</string>
|
||||
</edit-config>
|
||||
|
||||
<splash src="res/ios/splash/Default@2x~universal~anyany.png" />
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -622,6 +622,12 @@
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
|
||||
"integrity": "sha1-wrQbfv0EVd0Jf4k1bYW/3V2t6w8="
|
||||
},
|
||||
"cordova-plugin-geolocation": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.1.0.tgz",
|
||||
"integrity": "sha512-y5io/P10xGMxSn2KEqfv/fExK47eA1pmSonJdmDqDsaSADV9JpgdPx0mUSA08+5pzma/OS9R0LoODeDPx7Jvjg==",
|
||||
"dev": true
|
||||
},
|
||||
"cordova-plugin-headercolor": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-headercolor/-/cordova-plugin-headercolor-1.0.0.tgz",
|
||||
|
@ -35,7 +35,10 @@
|
||||
"ANDROID_SUPPORT_V4_VERSION": "27.+"
|
||||
},
|
||||
"cordova-plugin-x-socialsharing": {},
|
||||
"cordova-plugin-velda-devicefeedback": {}
|
||||
"cordova-plugin-velda-devicefeedback": {},
|
||||
"cordova-plugin-geolocation": {
|
||||
"GPS_REQUIRED": "true"
|
||||
}
|
||||
},
|
||||
"platforms": [
|
||||
"browser",
|
||||
@ -58,6 +61,7 @@
|
||||
"cordova-plugin-androidx": "^3.0.0",
|
||||
"cordova-plugin-androidx-adapter": "^1.1.3",
|
||||
"cordova-plugin-camera": "^5.0.1",
|
||||
"cordova-plugin-geolocation": "^4.1.0",
|
||||
"cordova-plugin-nativestorage": "^2.3.2",
|
||||
"cordova-plugin-splashscreen": "^6.0.0",
|
||||
"cordova-plugin-velda-devicefeedback": "0.0.2",
|
||||
|
@ -25,6 +25,9 @@ function checkAccountStatus(callback) {
|
||||
}
|
||||
} else {
|
||||
router.back();
|
||||
// Server is saying something's wrong, let's clear the account number in case
|
||||
// the user wants to try a different one.
|
||||
removeFromStorage("phonenumber");
|
||||
app.dialog.alert(resp.msg, "Error");
|
||||
}
|
||||
}, function (err) {
|
||||
|
@ -10,10 +10,12 @@ function captureAndSendPickupCode() {
|
||||
var coderegex = /^[0-9a-zA-Z]{5,40}$/;
|
||||
if (result.startsWith("https://helena.express/dropandsend#")) {
|
||||
code = result.split("#")[1];
|
||||
} else if (result.startsWith("https://helena.express/das/pickup#")) {
|
||||
code = result.split("#")[1];
|
||||
} else if (coderegex.test(result)) {
|
||||
code = result;
|
||||
} else {
|
||||
app.dialog.alert("That's not a valid drop box code.", "Error");
|
||||
app.dialog.alert("That's not a valid Drop and Send pickup code.", "Error");
|
||||
return;
|
||||
}
|
||||
sendPickupCode(code);
|
||||
|
@ -24,6 +24,10 @@ function getStorage(key) {
|
||||
return localStorage.getItem(key);
|
||||
}
|
||||
|
||||
function removeFromStorage(key) {
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an item is in the persistent storage.
|
||||
* @param {string} key
|
||||
|
48
www/assets/js/stripe.js
Normal file
48
www/assets/js/stripe.js
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
var stripeLoaded = false;
|
||||
|
||||
function loadStripeJs(callback) {
|
||||
if (stripeLoaded) {
|
||||
callback();
|
||||
} else {
|
||||
$.getScript("https://js.stripe.com/v3/", function () {
|
||||
stripeLoaded = true;
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initStripeJs(callback) {
|
||||
// Wait for Stripe to be loaded
|
||||
if (typeof Stripe == 'undefined') {
|
||||
setTimeout(initStripeJs, 500);
|
||||
return;
|
||||
}
|
||||
stripe = Stripe(SETTINGS["stripe_pubkey"]);
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
function initStripeElements(elementsselector, errormsgselector) {
|
||||
elements = stripe.elements();
|
||||
|
||||
card = elements.create('card');
|
||||
|
||||
// stop console warning "This Element will be mounted to a DOM element that contains child nodes."
|
||||
$(elementsselector).html("");
|
||||
|
||||
card.mount(elementsselector);
|
||||
|
||||
card.addEventListener('change', function (event) {
|
||||
if (event.error) {
|
||||
$(errormsgselector).text(event.error.message);
|
||||
} else {
|
||||
$(errormsgselector).text("");
|
||||
}
|
||||
});
|
||||
}
|
@ -54,7 +54,7 @@
|
||||
<script src="assets/js/dropandsend.js"></script>
|
||||
<script src="assets/js/addresscode.js"></script>
|
||||
<script src="assets/js/rates.js"></script>
|
||||
<script src="assets/js/noticeslip.js"></script>
|
||||
<!-- <script src="assets/js/noticeslip.js"></script> -->
|
||||
<script src="assets/js/account.js"></script>
|
||||
|
||||
<script src="routes.js"></script>
|
||||
|
@ -55,6 +55,9 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="block">
|
||||
By using Drop and Send you agree to the <a onclick="openBrowser('https://helena.express/das/terms')">terms of service</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -20,6 +20,22 @@
|
||||
<div class="row justify-content-center margin-top">
|
||||
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||
<div class="row justify-content-center">
|
||||
{{#if accountsetup}}{{else}}
|
||||
<div class="col-100 small-50 large-33 no-margin-vertical" id="finishaccountsetupnag">
|
||||
<div class="card hapticbtn pointercursor" onclick="router.navigate('/account');">
|
||||
<div class="card-content text-align-center padding">
|
||||
<h1 class="no-margin"><i class="fad fa-user-check"></i></h1>
|
||||
<br />
|
||||
<span style="font-weight: 700;">Finish Account Setup</span>
|
||||
<br />
|
||||
<span>You need to set up an account to use drop boxes
|
||||
and earn rewards points. It only takes a minute,
|
||||
<span class="clicktext">click</span><span class="taptext">tap</span>
|
||||
here to get started!</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="col-100 small-50 large-33 no-margin-vertical">
|
||||
<div class="card">
|
||||
<a class="button button-large" href="/track"><i class="fad fa-search"></i> Track Package</a>
|
||||
|
@ -8,12 +8,30 @@ var routes = [
|
||||
{
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
on: {
|
||||
pageBeforeIn: function () {
|
||||
// make sure it's not shown right after account setup
|
||||
var accountsetup = (inStorage("accountkey") && inStorage("phonenumber"));
|
||||
if (accountsetup) {
|
||||
$("#finishaccountsetupnag").css("display", "none");
|
||||
}
|
||||
}
|
||||
},
|
||||
async: function (routeTo, routeFrom, resolve, reject) {
|
||||
// Show a nag message if no account is set up
|
||||
var accountsetup = (inStorage("accountkey") && inStorage("phonenumber"));
|
||||
resolve({
|
||||
templateUrl: './pages/home.html'
|
||||
}, {
|
||||
context: {
|
||||
accountsetup: accountsetup,
|
||||
pages: [
|
||||
{
|
||||
title: "Drop and Send",
|
||||
href: "/dropandsend",
|
||||
icon: "fad fa-box-alt",
|
||||
text: "Bring your package to a secure drop location and we'll ship it for you. No postage or appointment needed."
|
||||
},
|
||||
{
|
||||
title: "Book Appointment",
|
||||
href: "/appointment",
|
||||
@ -21,10 +39,10 @@ var routes = [
|
||||
text: "Get mailing, shipping, and notary services on your schedule anywhere in the Helena area."
|
||||
},
|
||||
{
|
||||
title: "Drop and Send",
|
||||
href: "/dropandsend",
|
||||
icon: "fad fa-box-alt",
|
||||
text: "Bring your package to a secure drop location and we'll ship it for you. No postage or appointment needed."
|
||||
title: "My Account",
|
||||
href: "/account",
|
||||
icon: "fad fa-user-circle",
|
||||
text: "Manage your Helena Express account and check rewards points balance."
|
||||
},
|
||||
// {
|
||||
// title: "Track Package",
|
||||
@ -38,24 +56,18 @@ var routes = [
|
||||
// icon: "fad fa-calculator",
|
||||
// text: "Calculate postage and prices for your item."
|
||||
// },
|
||||
{
|
||||
title: "My Account",
|
||||
href: "/account",
|
||||
icon: "fad fa-user-circle",
|
||||
text: "Earn rewards and use Drop and Send with a Helena Express account."
|
||||
},
|
||||
// {
|
||||
// title: "Express Pickup",
|
||||
// href: "/addresscode",
|
||||
// icon: "fal fa-qrcode",
|
||||
// text: "Get a faster pickup and a discount by pre-typing the destination address here."
|
||||
// },
|
||||
{
|
||||
title: "Pick Up and Redeliver",
|
||||
href: "/noticeslip",
|
||||
icon: "fad fa-sticky-note",
|
||||
text: "Take a picture of your pink postal notice slip and we'll go get your missed delivery."
|
||||
}
|
||||
// {
|
||||
// title: "Pick Up and Redeliver",
|
||||
// href: "/noticeslip",
|
||||
// icon: "fad fa-sticky-note",
|
||||
// text: "Take a picture of your pink postal notice slip and we'll go get your missed delivery."
|
||||
// }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user