Add services page
This commit is contained in:
parent
10a6f59057
commit
4cd2aa7ccb
@ -9,7 +9,7 @@ function openOffersAsync(routeTo, routeFrom, resolve, reject) {
|
||||
app.dialog.preloader("Fetching latest deals...");
|
||||
|
||||
apirequest(
|
||||
SETTINGS.apis.offers,
|
||||
SETTINGS.apis.offers_services,
|
||||
{},
|
||||
function (resp) {
|
||||
app.dialog.close();
|
||||
@ -48,4 +48,39 @@ function openOffersAsync(routeTo, routeFrom, resolve, reject) {
|
||||
}
|
||||
reject();
|
||||
}, "GET");
|
||||
}
|
||||
|
||||
function openServicesAsync(routeTo, routeFrom, resolve, reject) {
|
||||
app.dialog.preloader("Just a second...");
|
||||
|
||||
apirequest(
|
||||
SETTINGS.apis.offers_services,
|
||||
{},
|
||||
function (resp) {
|
||||
app.dialog.close();
|
||||
if (resp.status == "ERROR") {
|
||||
app.dialog.alert(resp.msg, "Error");
|
||||
reject();
|
||||
} else {
|
||||
var context = {
|
||||
services: resp.services
|
||||
};
|
||||
|
||||
resolve({
|
||||
templateUrl: "pages/services.html",
|
||||
}, {
|
||||
context: context
|
||||
});
|
||||
}
|
||||
},
|
||||
function (xhr) {
|
||||
app.dialog.close();
|
||||
var error = $.parseJSON(xhr.responseText);
|
||||
if (error && typeof error.msg != 'undefined') {
|
||||
app.dialog.alert(error.msg, "Error");
|
||||
} else {
|
||||
app.dialog.alert("A server or network error occurred.", "Error");
|
||||
}
|
||||
reject();
|
||||
}, "GET");
|
||||
}
|
@ -46,7 +46,7 @@
|
||||
<script src="assets/js/util.js"></script>
|
||||
<script src="assets/js/linkaccount.js"></script>
|
||||
<script src="assets/js/track.js"></script>
|
||||
<script src="assets/js/offers.js"></script>
|
||||
<script src="assets/js/offers_services.js"></script>
|
||||
|
||||
<script src="routes.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
53
www/pages/services.html
Normal file
53
www/pages/services.html
Normal file
@ -0,0 +1,53 @@
|
||||
<!-- 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="services">
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner text-color-white color-white">
|
||||
<div class="left">
|
||||
<a class="link back" href="#">
|
||||
<i class="icon icon-back"></i>
|
||||
<span class="if-not-md">Back</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="title">Services</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content noselect">
|
||||
<div class="row justify-content-center margin-top">
|
||||
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||
<a name="top"></a>
|
||||
{{#each services}}
|
||||
<h2 class="margin-left display-flex justify-content-space-between">
|
||||
<span>{{cat}}</span>
|
||||
<span onclick="$('.page[data-name=services] .page-content').animate({scrollTop: '0'});" class="margin-top-half"><i class="material-icons">arrow_upward</i></span>
|
||||
</h2>
|
||||
<div class="row justify-content-center">
|
||||
{{#each services}}
|
||||
<div class="col-100 small-50 xlarge-33">
|
||||
<div class="card margin">
|
||||
<div class="card-content text-align-center padding-vertical">
|
||||
<div>
|
||||
<div class="card-header display-block no-hairlines">
|
||||
<h1 class="no-margin"><i class="{{icon}}"></i></h1>
|
||||
<h1 class="no-margin">{{title}}</h1>
|
||||
<small style="opacity: 0.7">{{price}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content-padding">
|
||||
<p>{{text}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -94,6 +94,11 @@ var routes = [
|
||||
JsBarcode(".offerbarcode").init();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/services',
|
||||
name: 'services',
|
||||
async: openServicesAsync
|
||||
},
|
||||
{
|
||||
path: '/track/:id',
|
||||
|
@ -8,7 +8,7 @@ var SETTINGS = {
|
||||
apis: {
|
||||
track: "https://track.netsyms.com/public/api.php",
|
||||
getmachines: "https://apis.netsyms.net/repairapp/getmachines.php",
|
||||
offers: "https://apis.netsyms.net/repairapp/offers.php",
|
||||
offers_services: "https://apis.netsyms.net/repairapp/offers_services.php",
|
||||
registernew: "https://apis.netsyms.net/repairapp/registernew.php",
|
||||
registerexisting: "https://apis.netsyms.net/repairapp/registerexisting.php"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user