5 changed files with 105 additions and 7 deletions
@ -0,0 +1,32 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace EShopOnAbp.PublicWeb.Basket; |
|||
|
|||
public class UserAddressProvider : ITransientDependency |
|||
{ |
|||
public List<AddressDto> GetDemoAddresses() |
|||
{ |
|||
return new List<AddressDto>() |
|||
{ |
|||
new() |
|||
{ |
|||
Name = "Home", |
|||
Description = "Cecilia Chapman Senior 711-2880 Nulla St. Mankato Mississippi 96522/USA", |
|||
IsDefault = true |
|||
}, |
|||
new() |
|||
{ |
|||
Name = "Work", |
|||
Description = "Yeşilköy Serbest Bölge Mah. E-Blok Sokak E1 Blok No:2, Bakırköy/İstanbul" |
|||
} |
|||
}; |
|||
} |
|||
} |
|||
|
|||
public class AddressDto |
|||
{ |
|||
public string Name { get; set; } |
|||
public string Description { get; set; } |
|||
public bool IsDefault { get; set; } = false; |
|||
} |
|||
@ -1,19 +1,47 @@ |
|||
@using EShopOnAbp.Localization |
|||
@using EShopOnAbp.PublicWeb.Components.Purchase |
|||
@using Microsoft.Extensions.Localization |
|||
@model EShopOnAbp.PublicWeb.Components.Payment.PaymentViewModel |
|||
|
|||
@inject IStringLocalizer<EShopOnAbpResource> L |
|||
|
|||
@{ |
|||
const int defaultColumnSize = 4; |
|||
} |
|||
|
|||
<div class="row"> |
|||
<div class="col-lg-9"> |
|||
<div class="address-list"> |
|||
<div class="address-list p-5"> |
|||
<h3>Select Address</h3> |
|||
@for (int i = 0; i < Math.Ceiling(Model.Address.Count / (double) defaultColumnSize); i++) |
|||
{ |
|||
<abp-row> |
|||
@for (int j = 0; j < defaultColumnSize; j++) |
|||
{ |
|||
<abp-column size-lg="_3" size-md="_4" size-sm="_6"> |
|||
@if ((i * defaultColumnSize) + j < Model.Address.Count) |
|||
{ |
|||
var address = Model.Address[(i * defaultColumnSize) + j]; |
|||
string isSelected = address.IsDefault ? "is-selected" : string.Empty; |
|||
<div class="card @isSelected"> |
|||
<div class="card-body"> |
|||
<h4 class="card-title">@address.Name</h4> |
|||
<p class="card-text">@address.Description</p> |
|||
</div> |
|||
</div> |
|||
} |
|||
</abp-column> |
|||
} |
|||
</abp-row> |
|||
} |
|||
|
|||
</div> |
|||
<div class="payment-list"> |
|||
<div class="payment-list p-5"> |
|||
<h3>Select Payment Method</h3> |
|||
</div> |
|||
</div> |
|||
<div class="col-lg-3"> |
|||
@await Component.InvokeAsync(typeof(PurchaseWidgetViewComponent), |
|||
new {Basket = Model, ButtonDescription = "CompleteOrder"}) |
|||
new {Basket = Model.Basket, ButtonDescription = "CompleteOrder"}) |
|||
</div> |
|||
</div> |
|||
@ -1,7 +1,12 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace EShopOnAbp.PublicWeb.Components.Payment; |
|||
|
|||
public class PaymentWidgetStyleContributor: BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/components/payment/payment-widget.css"); |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
.card { |
|||
/* Add shadows to create the "card" effect */ |
|||
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); |
|||
transition: 0.3s; |
|||
} |
|||
|
|||
/* On mouse-over, add a deeper shadow */ |
|||
.card:hover { |
|||
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); |
|||
} |
|||
|
|||
/* Add some padding inside the card container */ |
|||
.card-body { |
|||
padding: 2px 16px; |
|||
} |
|||
.is-selected{ |
|||
border: solid #bfbfe3; |
|||
} |
|||
Loading…
Reference in new issue