Add package pickup request form
This commit is contained in:
parent
358c961f91
commit
8a327701b7
@ -223,12 +223,8 @@ $("body").on("click", "#updateAccountBtn", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", "#connectExistingAccountBtn", function () {
|
$("body").on("click", "#connectExistingAccountBtn", function () {
|
||||||
app.dialog.prompt("Enter your phone number or account number:", "Connect Your Account", function (val) {
|
app.dialog.prompt("Enter your account number:", "Connect Your Account", function (val) {
|
||||||
var phone = val.replace(/\D/g, '');
|
var accountnumber = val.replace(/\D/g, '');
|
||||||
if (phone.length < 10) {
|
|
||||||
app.dialog.alert("Please enter a full 10-digit phone number.", "Oops!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setStorage("accountnumber", accountnumber);
|
setStorage("accountnumber", accountnumber);
|
||||||
router.refreshPage();
|
router.refreshPage();
|
||||||
}, function (cancel) {
|
}, function (cancel) {
|
||||||
|
47
www/assets/js/pickup.js
Normal file
47
www/assets/js/pickup.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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 requestPickup() {
|
||||||
|
if (isNaN($("#pickupRequestForm #packagecount").val())) {
|
||||||
|
app.dialog.alert("Tell us how many packages you're sending so we'll know if we miss any.", "Whoops!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($("#pickupRequestForm #streetaddress").val() == "") {
|
||||||
|
app.dialog.alert("We need an address to get the packages from. Don't have one? Find your location on fixphrase.com and use that.", "Whoops!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($("#pickupRequestForm #packagelocation").val() == "" && $("#pickupRequestForm #instructions").val() == "") {
|
||||||
|
app.dialog.alert("Give us some instructions so we know how to find your packages.", "Whoops!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var instructions = "";
|
||||||
|
instructions = $("#pickupRequestForm #packagelocation").val();
|
||||||
|
instructions += " " + $("#pickupRequestForm #instructions").val();
|
||||||
|
|
||||||
|
setStorage("lastpickupaddress", $("#pickupRequestForm #streetaddress").val());
|
||||||
|
setStorage("lastpickupzipcode", $("#pickupRequestForm #zipcode").val());
|
||||||
|
|
||||||
|
app.dialog.preloader("Requesting Pickup...");
|
||||||
|
apirequest(SETTINGS.apis.requestpickup, {
|
||||||
|
accountnumber: getStorage("accountnumber"),
|
||||||
|
accountkey: getStorage("accountkey"),
|
||||||
|
count: $("#pickupRequestForm #packagecount").val(),
|
||||||
|
address: $("#pickupRequestForm #streetaddress").val() + " " + $("#pickupRequestForm #zipcode").val(),
|
||||||
|
instructions: instructions
|
||||||
|
}, function (success) {
|
||||||
|
app.dialog.close();
|
||||||
|
if (success.status == "OK") {
|
||||||
|
app.dialog.alert(success.msg, "Pickup Requested!");
|
||||||
|
} else {
|
||||||
|
app.dialog.alert(success.msg, "Error");
|
||||||
|
}
|
||||||
|
}, function (error) {
|
||||||
|
app.dialog.close();
|
||||||
|
app.dialog.alert("There's a server or network problem. Check your Internet connection or try again later.", "Error");
|
||||||
|
}, "POST");
|
||||||
|
}
|
@ -55,6 +55,7 @@
|
|||||||
<script src="assets/js/util.js"></script>
|
<script src="assets/js/util.js"></script>
|
||||||
<script src="assets/js/track.js"></script>
|
<script src="assets/js/track.js"></script>
|
||||||
<script src="assets/js/dropandsend.js"></script>
|
<script src="assets/js/dropandsend.js"></script>
|
||||||
|
<script src="assets/js/pickup.js"></script>
|
||||||
<script src="assets/js/rates.js"></script>
|
<script src="assets/js/rates.js"></script>
|
||||||
<script src="assets/js/account.js"></script>
|
<script src="assets/js/account.js"></script>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<div id="hasaccountbox" style="display: none;">
|
<div id="hasaccountbox" style="display: none;">
|
||||||
<div id="addPaymentMethodBox" style="display: none;">
|
<div id="addPaymentMethodBox" style="display: none;">
|
||||||
Add a credit or debit card to use Drop and Send. It'll be securely saved for future use.
|
Add a credit or debit card to pay for postage and services. It'll be securely saved for future use.
|
||||||
<div class="button hapticbtn button-fill margin" onclick="openCheckoutWindowToSaveCard()"><i class="fas fa-credit-card fa-fw"></i> Add Card</div>
|
<div class="button hapticbtn button-fill margin" onclick="openCheckoutWindowToSaveCard()"><i class="fas fa-credit-card fa-fw"></i> Add Card</div>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
<div id="setupaccountbox" style="display: none;">
|
<div id="setupaccountbox" style="display: none;">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
Set up an account to use our Drop and Send service, earn rewards points, and more!
|
Set up an account to pay for services, earn rewards points, and more!
|
||||||
</div>
|
</div>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
Already have an account?
|
Already have an account?
|
||||||
|
110
www/pages/pickup.html
Normal file
110
www/pages/pickup.html
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<!-- 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/. -->
|
||||||
|
|
||||||
|
<div class="page" data-name="pickup">
|
||||||
|
|
||||||
|
<div class="navbar">
|
||||||
|
<div class="navbar-bg"></div>
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="left">
|
||||||
|
<a class="link back hapticbtn" href="#">
|
||||||
|
<i class="icon icon-back"></i>
|
||||||
|
<span class="if-not-md">Back</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="title">Request Pickup</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||||
|
<div class="card margin">
|
||||||
|
<div class="card-content text-align-center padding-vertical" id="pickupRequestForm">
|
||||||
|
<div class="list media-list">
|
||||||
|
<ul>
|
||||||
|
<li class="padding text-align-center">
|
||||||
|
Leave your package somewhere safe
|
||||||
|
(front porch, shed, garage, etc) and we'll come get it.
|
||||||
|
Your saved credit card will be billed automatically when we ship your package.
|
||||||
|
</li>
|
||||||
|
<li class="padding text-align-center" id="addPaymentMethodNag" style="display: none;">
|
||||||
|
<i class="fad fa-exclamation-circle fa-2x text-color-orange"></i><br>
|
||||||
|
You need an account with a linked credit card to use this service. <span class="taptext">Tap</span><span class="clicktext">Click</span> the button to update your account.
|
||||||
|
<a class="button hapticbtn button-fill margin" href="/account"><i class="fas fa-user-circle"></i> My Account</a>
|
||||||
|
</li>
|
||||||
|
<li class="item-content item-input item-input-outline">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title item-floating-label">Pickup Address</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<input type="text" id="streetaddress" placeholder="1234 Your Rd" value="{{streetaddress}}" />
|
||||||
|
<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">ZIP Code</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<input type="text" id="zipcode" value="{{zipcode}}"/>
|
||||||
|
<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">Number of Packages</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<input type="number" id="packagecount" min="1" max="200"/>
|
||||||
|
<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">Package Location</div>
|
||||||
|
<div class="item-input-wrap input-dropdown-wrap">
|
||||||
|
<select id="packagelocation">
|
||||||
|
<option></option>
|
||||||
|
<option>Porch</option>
|
||||||
|
<option>Front Door</option>
|
||||||
|
<option>Back Door</option>
|
||||||
|
<option>Side Door</option>
|
||||||
|
<option>Garage</option>
|
||||||
|
<option>Office</option>
|
||||||
|
<option>Reception</option>
|
||||||
|
<option>I'm home all day, knock on the door</option>
|
||||||
|
<option value="">Other (add instructions)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="item-content item-input item-input-outline">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title item-floating-label">Extra Instructions</div>
|
||||||
|
<div class="item-input-wrap">
|
||||||
|
<textarea id="instructions" class="resizable" placeholder="Where to find package, access code, etc"></textarea>
|
||||||
|
<span class="input-clear-button"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="padding">
|
||||||
|
By requesting a pickup, you confirm that you aren't sending any <a onclick="openExternalBrowser('https://helena.express/articles/restricted-items')">restricted items</a>.
|
||||||
|
You agree that we can bill your saved payment method for the shipping cost.
|
||||||
|
You also confirm that you've filled out a destination address on each package and indicated
|
||||||
|
any desired options (signature, insurance, etc).
|
||||||
|
We recommend using free Helena Express shipping labels, available upon request.
|
||||||
|
</li>
|
||||||
|
<li class="padding">
|
||||||
|
<div class="button hapticbtn button-fill" onclick="requestPickup()"><i class="far fa-dolly"></i> Request Pickup</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
@ -92,7 +92,7 @@
|
|||||||
<li class="item-content item-input item-input-outline">
|
<li class="item-content item-input item-input-outline">
|
||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-title item-floating-label">Country</div>
|
<div class="item-title item-floating-label">Country</div>
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap input-dropdown-wrap">
|
||||||
<select id="to_country" name="to_country">
|
<select id="to_country" name="to_country">
|
||||||
<option value="US" selected>United States of America</option>
|
<option value="US" selected>United States of America</option>
|
||||||
<option value="AF">Afghanistan</option>
|
<option value="AF">Afghanistan</option>
|
||||||
@ -357,7 +357,7 @@
|
|||||||
<li class="item-divider">Item Type:</li>
|
<li class="item-divider">Item Type:</li>
|
||||||
<li class="item-content item-input item-input-outline">
|
<li class="item-content item-input item-input-outline">
|
||||||
<div class="item-inner">
|
<div class="item-inner">
|
||||||
<div class="item-input-wrap">
|
<div class="item-input-wrap input-dropdown-wrap">
|
||||||
<select id="itemType" name="itemType">
|
<select id="itemType" name="itemType">
|
||||||
<option value="" selected>Choose Item Type</option>
|
<option value="" selected>Choose Item Type</option>
|
||||||
<option value="Parcel">Package/Parcel/Other</option>
|
<option value="Parcel">Package/Parcel/Other</option>
|
||||||
|
@ -10,6 +10,7 @@ var pagesToCompile = [
|
|||||||
"welcome",
|
"welcome",
|
||||||
"appointment",
|
"appointment",
|
||||||
"dropandsend",
|
"dropandsend",
|
||||||
|
"pickup",
|
||||||
"rateresult",
|
"rateresult",
|
||||||
"account",
|
"account",
|
||||||
"trackresult",
|
"trackresult",
|
||||||
@ -42,7 +43,7 @@ var routes = [
|
|||||||
on: {
|
on: {
|
||||||
pageBeforeIn: function () {
|
pageBeforeIn: function () {
|
||||||
// make sure it's not shown right after account setup
|
// make sure it's not shown right after account setup
|
||||||
var accountsetup = (inStorage("accountkey") && inStorage("phonenumber"));
|
var accountsetup = (inStorage("accountkey") && inStorage("accountnumber"));
|
||||||
if (accountsetup) {
|
if (accountsetup) {
|
||||||
$("#finishaccountsetupnag").css("display", "none");
|
$("#finishaccountsetupnag").css("display", "none");
|
||||||
}
|
}
|
||||||
@ -50,7 +51,7 @@ var routes = [
|
|||||||
},
|
},
|
||||||
async: function ( { resolve, reject }) {
|
async: function ( { resolve, reject }) {
|
||||||
// Show a nag message if no account is set up
|
// Show a nag message if no account is set up
|
||||||
var accountsetup = (inStorage("accountkey") && inStorage("phonenumber")) || getStorage("hideaccountnag") == "true";
|
var accountsetup = (inStorage("accountkey") && inStorage("accountnumber")) || getStorage("hideaccountnag") == "true";
|
||||||
// add escape hatch to regular website if running online
|
// add escape hatch to regular website if running online
|
||||||
var escapehatch = false;
|
var escapehatch = false;
|
||||||
if (window.location.hostname == "app.helena.express") {
|
if (window.location.hostname == "app.helena.express") {
|
||||||
@ -61,6 +62,12 @@ var routes = [
|
|||||||
accountsetup: accountsetup,
|
accountsetup: accountsetup,
|
||||||
escapehatch: escapehatch,
|
escapehatch: escapehatch,
|
||||||
pages: [
|
pages: [
|
||||||
|
{
|
||||||
|
title: "Package Pickup",
|
||||||
|
href: "/pickup",
|
||||||
|
icon: "fad fa-boxes",
|
||||||
|
text: "Leave your package somewhere and we'll pick it up and ship it for you. No postage or appointment needed."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Drop and Send",
|
title: "Drop and Send",
|
||||||
href: "/dropandsend",
|
href: "/dropandsend",
|
||||||
@ -145,6 +152,29 @@ var routes = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/pickup',
|
||||||
|
name: 'pickup',
|
||||||
|
async: function ( {resolve}) {
|
||||||
|
resolve({
|
||||||
|
content: compiledPages.pickup({
|
||||||
|
streetaddress: inStorage("lastpickupaddress") ? getStorage("lastpickupaddress") : "",
|
||||||
|
zipcode: inStorage("lastpickupzipcode") ? getStorage("lastpickupzipcode") : ""
|
||||||
|
})
|
||||||
|
}, {});
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
pageBeforeIn: function () {
|
||||||
|
checkIfAccountGoodWithPaymentMethod(function (ok) {
|
||||||
|
if (!ok) {
|
||||||
|
$("#addPaymentMethodNag").css("display", "");
|
||||||
|
}
|
||||||
|
}, function (error) {
|
||||||
|
$("#addPaymentMethodNag").css("display", "");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/track',
|
path: '/track',
|
||||||
url: './pages/track.html',
|
url: './pages/track.html',
|
||||||
@ -253,7 +283,7 @@ var routes = [
|
|||||||
{
|
{
|
||||||
path: '/display',
|
path: '/display',
|
||||||
name: 'settings',
|
name: 'settings',
|
||||||
async: function ({resolve}) {
|
async: function ( {resolve}) {
|
||||||
var settings = [
|
var settings = [
|
||||||
{
|
{
|
||||||
setting: "apptheme",
|
setting: "apptheme",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user