Browse Source

added initial myOrder page

pull/56/head
Galip Tolga Erdem 5 years ago
parent
commit
8c62e6e145
  1. 39
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml
  2. 22
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml.cs
  3. 0
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js

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

@ -0,0 +1,39 @@
@page
@using EShopOnAbp.Localization
@using Microsoft.Extensions.Localization
@model EShopOnAbp.PublicWeb.Pages.MyOrdersModel
@inject IStringLocalizer<EShopOnAbpResource> L
@section scripts {
<abp-script src="/Pages/myOrders.js"/>
}
<h3>Hello</h3>
@foreach (var item in Model.MyOrders)
{
<abp-card>
<abp-card-body>
<h5>@item.OrderDate</h5>
<p>@item.OrderStatus</p>
<p>@item.Buyer.Name</p>
<abp-row>
@foreach (var product in item.Items)
{
<abp-column>
<abp-card>
<abp-card-title>
<img style="width: 200px" src="/product-images/@product.PictureUrl"/>
</abp-card-title>
<abp-card-body>
<p>@product.ProductName x @product.Units</p>
</abp-card-body>
</abp-card>
</abp-column>
}
</abp-row>
</abp-card-body>
</abp-card>
<hr/>
}

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

@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using EShopOnAbp.OrderingService.Orders;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace EShopOnAbp.PublicWeb.Pages;
public class MyOrdersModel : AbpPageModel
{
private readonly IOrderAppService _orderAppService;
public List<OrderDto> MyOrders { get; set; }
public MyOrdersModel(IOrderAppService orderAppService)
{
_orderAppService = orderAppService;
}
public async Task OnGet()
{
MyOrders = await _orderAppService.GetMyOrdersAsync(new GetMyOrdersInput());
}
}

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

Loading…
Cancel
Save