Browse Source

updated user address provider

pull/50/head
Galip Tolga Erdem 5 years ago
parent
commit
7a79fddd12
  1. 28
      apps/public-web/src/EShopOnAbp.PublicWeb/Basket/UserAddressProvider.cs
  2. 7
      apps/public-web/src/EShopOnAbp.PublicWeb/Components/Payment/Default.cshtml

28
apps/public-web/src/EShopOnAbp.PublicWeb/Basket/UserAddressProvider.cs

@ -12,15 +12,22 @@ public class UserAddressProvider : ITransientDependency
new()
{
Id = 1,
Name = EShopOnAbpPaymentConsts.DemoAddressTypes.Home,
Description = "Cecilia Chapman Senior 711-2880 Nulla St. Mankato Mississippi 96522/USA",
Type = EShopOnAbpPaymentConsts.DemoAddressTypes.Home,
Street = "Cecilia Chapman Senior 711-2880 Nulla St.",
City = "Mankato Mississippi",
Country = "USA",
ZipCode = "96522",
IsDefault = true
},
new()
{
Id = 2,
Name = EShopOnAbpPaymentConsts.DemoAddressTypes.Work,
Description = "Yeşilköy Serbest Bölge Mah. E-Blok Sokak E1 Blok No:2, Bakırköy/İstanbul"
Type = EShopOnAbpPaymentConsts.DemoAddressTypes.Work,
Street = "Yeşilköy Serbest Bölge Mah. E-Blok Sk. Bakırköy",
City = "İstanbul",
Country = "Turkey",
ZipCode = "34149",
Description = "Near Ataturk Airport"
}
};
}
@ -29,7 +36,16 @@ public class UserAddressProvider : ITransientDependency
public class AddressDto
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public bool IsDefault { get; set; } = false;
public string Description { get; set; }
public string Street { get; set; }
public string City { get; set; }
public string Country { get; set; }
public string ZipCode { get; set; }
public override string ToString()
{
return $"{Street} {ZipCode} {City}/{Country}";
}
}

7
apps/public-web/src/EShopOnAbp.PublicWeb/Components/Payment/Default.cshtml

@ -24,10 +24,11 @@
var address = Model.Address[(i * defaultColumnSize) + j];
string isSelected = address.IsDefault ? "is-selected" : string.Empty;
<div class="card @isSelected" data-address-id="@address.Id">
<div class="card-header"><h4>@address.Type</h4></div>
<div class="card-body">
<h4 class="card-title">@address.Name</h4>
<p class="card-text">@address.Description</p>
<p class="card-text">@address.ToString()</p>
</div>
<div class="card-footer">@address.Description</div>
</div>
}
</abp-column>
@ -40,7 +41,7 @@
<h3>Select Payment Method</h3>
<abp-row>
<abp-column size-lg="_3" size-md="_4" size-sm="_6">
<abp-card>
<abp-card class="is-selected" data-payment-id="1">
<img class="" src="https://upload.wikimedia.org/wikipedia/commons/b/b5/PayPal.svg" alt="paypal logo">
</abp-card>
</abp-column>

Loading…
Cancel
Save