Browse Source

added ordering-proxy

pull/56/head
Galip Tolga Erdem 5 years ago
parent
commit
e1706cc808
  1. 3
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml
  2. 11
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js
  3. 47
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js

3
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml

@ -8,6 +8,7 @@
@section scripts { @section scripts {
<abp-script src="/client-proxies/basket-proxy.js"/> <abp-script src="/client-proxies/basket-proxy.js"/>
<abp-script src="/client-proxies/ordering-proxy.js"/>
<abp-script src="/Pages/myOrders.js"/> <abp-script src="/Pages/myOrders.js"/>
} }
@ -23,7 +24,7 @@
<abp-row> <abp-row>
<abp-column size="_9"><span class="order-title"><strong>@Model.MyOrders.Count sipariş</strong> verildi.</span></abp-column> <abp-column size="_9"><span class="order-title"><strong>@Model.MyOrders.Count sipariş</strong> verildi.</span></abp-column>
<abp-column size="_3"> <abp-column size="_3">
<select class="form-select"> <select class="form-select" id="date-filter-selecter">
<option value="last30">@L["Last30Days"]</option> <option value="last30">@L["Last30Days"]</option>
<option value="m1">@L["LastMonth"]</option> <option value="m1">@L["LastMonth"]</option>
<option value="m3">@L["Last3Months"]</option> <option value="m3">@L["Last3Months"]</option>

11
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js

@ -15,5 +15,16 @@
abp.notify.success("Added product to your basket.", "Successfully added"); abp.notify.success("Added product to your basket.", "Successfully added");
}); });
}); });
$('#date-filter-selecter').on("change", el => {
const filter = el.target.value;
console.log(filter);
eShopOnAbp.orderingService.orders.order.getMyOrders({
filter: filter
}).then(res => {
console.log(res);
});
})
}); });
})(); })();

47
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js

@ -0,0 +1,47 @@
/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */
// module ordering
(function(){
// controller eShopOnAbp.orderingService.orders.order
(function(){
abp.utils.createNamespace(window, 'eShopOnAbp.orderingService.orders.order');
eShopOnAbp.orderingService.orders.order.get = function(id, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/ordering/order/' + id + '',
type: 'GET'
}, ajaxParams));
};
eShopOnAbp.orderingService.orders.order.getMyOrders = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/ordering/order/my-orders' + abp.utils.buildQueryString([{ name: 'filter', value: input.filter }]) + '',
type: 'GET'
}, ajaxParams));
};
eShopOnAbp.orderingService.orders.order.getByOrderNo = function(orderNo, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/ordering/order/by-order-no' + abp.utils.buildQueryString([{ name: 'orderNo', value: orderNo }]) + '',
type: 'GET'
}, ajaxParams));
};
eShopOnAbp.orderingService.orders.order.create = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/ordering/order',
type: 'POST',
data: JSON.stringify(input)
}, ajaxParams));
};
})();
})();
Loading…
Cancel
Save