14 changed files with 198 additions and 55 deletions
@ -1,39 +1,114 @@ |
|||
@page |
|||
@using EShopOnAbp.Localization |
|||
@using Microsoft.Extensions.Localization |
|||
@using System.Globalization |
|||
@model EShopOnAbp.PublicWeb.Pages.MyOrdersModel |
|||
|
|||
@inject IStringLocalizer<EShopOnAbpResource> L |
|||
|
|||
@section scripts { |
|||
<abp-script src="/client-proxies/basket-proxy.js"/> |
|||
<abp-script src="/Pages/myOrders.js"/> |
|||
} |
|||
|
|||
<h3>Hello</h3> |
|||
@section styles{ |
|||
<abp-style src="/Pages/myOrders.css"/> |
|||
} |
|||
|
|||
<div> |
|||
<strong>@Model.MyOrders.Count sipariş</strong> verildi. |
|||
</div> |
|||
|
|||
@foreach (var item in Model.MyOrders) |
|||
@foreach (var order 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> |
|||
<div class="card order-item"> |
|||
<div class="card-header"> |
|||
<div class="row"> |
|||
<div class="col"> |
|||
<div>Sipariş Tarihi</div> |
|||
<div>@order.OrderDate.ToString("dd MMMM yyyy")</div> |
|||
</div> |
|||
<div class="col"> |
|||
<div>TOPLAM</div> |
|||
<div>@order.Items.Sum(q => q.UnitPrice)</div> |
|||
</div> |
|||
<div class="col"> |
|||
<div>TESLİMAT ADRESİ</div> |
|||
<div>@order.Address.Description</div> |
|||
</div> |
|||
<div class="col"> |
|||
<div>SİPARİŞ NO @order.OrderNo.ToString("N0", new NumberFormatInfo() {NumberGroupSeparator = " "})</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="card-body"> |
|||
@foreach (var item in order.Items) |
|||
{ |
|||
<abp-card class="order-item m-3"> |
|||
<abp-card-body> |
|||
<div class="row m-3"> |
|||
<h3>@order.OrderStatus</h3> |
|||
</div> |
|||
<abp-row> |
|||
<abp-column size="_2"> |
|||
<img class="img-size" src="/product-images/@item.PictureUrl"/> |
|||
</abp-column> |
|||
<abp-column size-lg="_4"> |
|||
<div>@item.ProductName</div> |
|||
<div>Ürünü iade edebileceğiniz son tarih: @order.OrderDate.AddMonths(1).ToString("dd MMMM yyyy")</div> |
|||
<div class="mt-3"> |
|||
<abp-button icon="fas fa-cart-plus" class="btn btn-warning buy-again" text="Tekrar Satın Alın" data-product-id="@item.ProductId"></abp-button> |
|||
</div> |
|||
</abp-column> |
|||
<abp-column offset="_3" size="_2"> |
|||
<abp-row class="pb-3"><abp-button class="btn btn-light shadow" disabled="true" abp-tooltip-right="Not available yet">Ürünleri iade et</abp-button></abp-row> |
|||
<abp-row><abp-button class="btn btn-light shadow" disabled="true" abp-tooltip-right="Not available yet">Ürün yorumu yazın</abp-button></abp-row> |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
} |
|||
</div> |
|||
</div> |
|||
<hr/> |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@* @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/> *@ |
|||
@* } *@ |
|||
@ -0,0 +1,16 @@ |
|||
.img-size { |
|||
width: 80%; |
|||
} |
|||
.order-item { |
|||
width:-webkit-fill-available; |
|||
background-color: #fff; |
|||
border: 1px solid #eee; |
|||
border-radius: 3px; |
|||
box-shadow: 0 0 10px rgba(0, 0, 0, .05); |
|||
transition: all .2s; |
|||
cursor: default; |
|||
} |
|||
|
|||
.order-item:hover { |
|||
box-shadow: 0 0 20px rgba(0, 0, 0, .1); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
(function () { |
|||
const anonymousId = abp.utils.getCookieValue("anonymous_id"); |
|||
$(function () { |
|||
$('.buy-again').click(function () { |
|||
const $this = $(this); |
|||
const productId = $this.attr('data-product-id'); |
|||
eShopOnAbp.basketService.basket.addProduct({ |
|||
productId: productId, |
|||
anonymousId: anonymousId, |
|||
}).then(function () { |
|||
$('.abp-widget-wrapper[data-widget-name="CartWidget"]') |
|||
.data('abp-widget-manager') |
|||
.refresh(); |
|||
|
|||
abp.notify.success("Added product to your basket.", "Successfully added"); |
|||
}); |
|||
}); |
|||
}); |
|||
})(); |
|||
@ -0,0 +1,9 @@ |
|||
|
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace EShopOnAbp.PublicWeb.ServiceProviders; |
|||
|
|||
public class DiscountProvider : ITransientDependency |
|||
{ |
|||
// TODO: Configure or remove discount logic
|
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace EShopOnAbp.PublicWeb.Basket; |
|||
namespace EShopOnAbp.PublicWeb.ServiceProviders; |
|||
|
|||
public class UserAddressProvider : ITransientDependency |
|||
{ |
|||
@ -1,13 +1,13 @@ |
|||
using EShopOnAbp.BasketService; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EShopOnAbp.BasketService; |
|||
using EShopOnAbp.Shared.Hosting.AspNetCore; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace EShopOnAbp.PublicWeb.Basket |
|||
namespace EShopOnAbp.PublicWeb.ServiceProviders |
|||
{ |
|||
public class UserBasketProvider : ITransientDependency |
|||
{ |
|||
Loading…
Reference in new issue