Add package pickup request form
parent
358c961f91
commit
8a327701b7
@ -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");
|
||||
}
|
@ -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>
|
Loading…
Reference in New Issue