Add package type option to load screen (close #2)
This commit is contained in:
parent
bd588b09ba
commit
5f63387592
@ -42,7 +42,7 @@ $("#addpackagebtn").click(function () {
|
||||
}
|
||||
|
||||
var address = ($("input[name=number]").val() + " " + $("input[name=street]").val()).toUpperCase();
|
||||
addPackageByAddress(address, $("input[name=citystate]").val().toUpperCase());
|
||||
addPackageByAddress(address, $("input[name=citystate]").val().toUpperCase(), $("input[name=itemtype]:checked").val());
|
||||
});
|
||||
|
||||
// Restore user's last entered city/state combo
|
||||
|
@ -201,13 +201,13 @@ function countPackages() {
|
||||
return count;
|
||||
}
|
||||
|
||||
function addPackageByAddress(address, citystate) {
|
||||
function addPackageByAddress(address, citystate, type) {
|
||||
$.getJSON(SETTINGS.geocodeapi, {
|
||||
address: address + " " + citystate
|
||||
}, function (resp) {
|
||||
if (resp.status == "OK") {
|
||||
if (resp.accuracy.ok) {
|
||||
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
||||
addPackage(resp.address.street, resp.coords[0], resp.coords[1], type);
|
||||
} else {
|
||||
playSound("error");
|
||||
app.dialog.confirm(
|
||||
@ -215,9 +215,9 @@ function addPackageByAddress(address, citystate) {
|
||||
"Accuracy Warning",
|
||||
function (ok) {
|
||||
if (resp.address.street == "") {
|
||||
addPackage(address, resp.coords[0], resp.coords[1]);
|
||||
addPackage(address, resp.coords[0], resp.coords[1], type);
|
||||
} else {
|
||||
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
||||
addPackage(resp.address.street, resp.coords[0], resp.coords[1], type);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -45,6 +45,33 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<label class="item-radio item-content">
|
||||
<input type="radio" name="itemtype" value="package" checked />
|
||||
<i class="icon icon-radio"></i>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><i class="fas fa-box"></i> Package</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="item-radio item-content">
|
||||
<input type="radio" name="itemtype" value="letter" />
|
||||
<i class="icon icon-radio"></i>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><i class="fas fa-envelope"></i> Letter</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="item-radio item-content">
|
||||
<input type="radio" name="itemtype" value="express" />
|
||||
<i class="icon icon-radio"></i>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><i class="fas fa-shipping-fast"></i> Express</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<a class="item-link list-button" id="addpackagebtn"><i class="fas fa-plus"></i> Add Package</a>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user