Browse Source

Updated myOrders add review and product details

pull/205/head
Galip Tolga Erdem 3 years ago
parent
commit
8b04d5fb53
  1. 8
      apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml
  2. 55
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml

8
apps/public-web/src/EShopOnAbp.PublicWeb/Components/UserOrders/Default.cshtml

@ -72,14 +72,14 @@
</abp-column> </abp-column>
<abp-column offset="_3" size="_2"> <abp-column offset="_3" size="_2">
<abp-row class="pb-3"> <abp-row class="pb-3">
<abp-button class="btn btn-light shadow" disabled="true" abp-tooltip-right="Not available yet"> <a class="btn btn-light" disabled="true" abp-tooltip-right="Not available yet">
@L["UserOrders:ReturnProducts"] @L["UserOrders:ReturnProducts"]
</abp-button> </a>
</abp-row> </abp-row>
<abp-row> <abp-row>
<abp-button class="btn btn-light shadow" disabled="true" abp-tooltip-right="Not available yet"> <a class="btn btn-outline-light shadow" href="/products/@item.ProductId.ToString()" abp-tooltip-right="Add review">
@L["UserOrders:AddReview"] @L["UserOrders:AddReview"]
</abp-button> </a>
</abp-row> </abp-row>
</abp-column> </abp-column>
</abp-row> </abp-row>

55
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml

@ -19,42 +19,53 @@
@model EShopOnAbp.PublicWeb.Pages.ProductDetailModel @model EShopOnAbp.PublicWeb.Pages.ProductDetailModel
@section styles{ @section styles{
<abp-style src="/Pages/index.css" /> <abp-style src="/Pages/index.css"/>
} }
@section scripts { @section scripts {
<abp-script src="/client-proxies/basket-proxy.js" /> <abp-script src="/client-proxies/basket-proxy.js"/>
<abp-script src="/Pages/index.js" /> <abp-script src="/Pages/index.js"/>
<abp-script src="/Pages/productDetail.js" /> <abp-script src="/Pages/productDetail.js"/>
} }
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-6 col-md-6 col-sm-6 "> <div class="col-lg-6 col-md-6 col-sm-6 ">
<div class="product-list"> <div class="product-container">
@{ @{
var product = Model.Product; var product = Model.Product;
var productPrice = product.Price.ToString("C", new CultureInfo("en-US")); var productPrice = product.Price.ToString("C", new CultureInfo("en-US"));
string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.RemoteServices.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.RemoteServices.Default.BaseUrl}product-images/@product.ImageName"; string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.RemoteServices.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.RemoteServices.Default.BaseUrl}product-images/@product.ImageName";
string buyText = L["Index:AddToBasket"]; string buyText = L["Index:AddToBasket"];
<div class="product-list-item" data-product-id="@product.Id.ToString()" style="cursor:auto"> <div class="product-list-item" data-product-id="@product.Id.ToString()">
<div class="col"> <a href="/products/@product.Id.ToString()">
<div class="product-info-box"> <div class="product-title">
<h6>@product.Name</h6> <span>
<em class="d-block text-muted">@product.Code - @L["StockCount"]: @product.StockCount</em> <h6>@product.Name</h6>
<span class="d-block text-muted">@product.Code</span>
</span>
</div>
<div class="product-image">
<img src="@productImage" loading="lazy"/>
</div>
<div class="product-count">
<span class="d-block">@L["StockCount"]: @product.StockCount</span>
</div>
</a>
<div class="product-item-bottom">
<div class="item-added">
<div class="fa fa-check" style="color: yellowgreen; padding-right: 1em;"></div>
<span style="display: flex">Added to cart</span>
</div> </div>
</div>
<img src="@productImage" />
<div class="row mt-5 ">
@if (product.StockCount > 0) @if (product.StockCount > 0)
{ {
<abp-button class="add-basket-button" button-type="Warning" text="@buyText" data-product-id="@product.Id.ToString()"></abp-button> <abp-button class="add-basket-button" button-type="Warning" text="@buyText" data-product-id="@product.Id.ToString()"></abp-button>
} }
else else
{ {
<abp-button disabled="true" class="add-basket-button" button-type="Warning" text="@L["Index:OutOfStock"]" /> <abp-button disabled="true" class="add-basket-button" button-type="Warning" text="@L["Index:OutOfStock"]"/>
} }
<div class="info-section col" style="text-align: center"> <div class="info-section col">
<span class="product-price">@productPrice</span> <span class="product-price">@productPrice</span>
</div> </div>
</div> </div>
@ -66,13 +77,13 @@
<abp-column size-md="_6"> <abp-column size-md="_6">
@if (GlobalFeatureManager.Instance.IsEnabled<RatingsFeature>() && Model.IsPurschased) @if (GlobalFeatureManager.Instance.IsEnabled<RatingsFeature>() && Model.IsPurschased)
{ {
@await Component.InvokeAsync(typeof(RatingViewComponent), new {entityType = "quote", entityId = @product.Id.ToString()}) @await Component.InvokeAsync(typeof(RatingViewComponent), new { entityType = "quote", entityId = @product.Id.ToString() })
} }
</abp-column> </abp-column>
<abp-column size-md="_12"> <abp-column size-md="_12">
@if (GlobalFeatureManager.Instance.IsEnabled<CommentsFeature>()) @if (GlobalFeatureManager.Instance.IsEnabled<CommentsFeature>())
{ {
@await Component.InvokeAsync(typeof(CommentingViewComponent), new {entityType = "quote", entityId = @product.Id.ToString()}) @await Component.InvokeAsync(typeof(CommentingViewComponent), new { entityType = "quote", entityId = @product.Id.ToString() })
} }
</abp-column> </abp-column>
</abp-row> </abp-row>

Loading…
Cancel
Save