From d876f59d9d434c2bea4de67a7f90f5ec35baebc1 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 1 Dec 2024 13:23:28 +0100 Subject: [PATCH] =?UTF-8?q?livescreen=20online/offline,=20livescreen=20f?= =?UTF-8?q?=C5=91k=C3=A9p,=20el=C5=91z=C5=91=20k=C3=B6vetkez=C5=91=20nincs?= =?UTF-8?q?=20k=C3=A9p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/AuctionPublicViewComponent.cs | 4 +- .../Views/LiveScreen.cshtml | 49 ++++++++++++++----- .../Views/PublicProductBidBox.cshtml | 28 ++++++++--- 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs b/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs index bf26cbc..d17e53b 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs +++ b/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs @@ -166,7 +166,7 @@ public class AuctionPublicViewComponent : NopViewComponent var nextDetails = await _myProductModelFactory.PrepareProductDetailsModelAsync(nextProduct); nextUrl = Url.RouteUrl(new { nextDetails.SeName }, _webHelper.GetCurrentRequestProtocol()).ToLowerInvariant(); nextImageUrl = nextDetails.DefaultPictureModel.FullSizeImageUrl; - nextProductName = nextDetails.SeName; + nextProductName = nextDetails.Name; } } else @@ -184,7 +184,7 @@ public class AuctionPublicViewComponent : NopViewComponent var lastDetails = await _myProductModelFactory.PrepareProductDetailsModelAsync(lastProduct); lastUrl = Url.RouteUrl(new { lastDetails.SeName }, _webHelper.GetCurrentRequestProtocol()).ToLowerInvariant(); lastImageUrl = lastDetails.DefaultPictureModel.FullSizeImageUrl; - lastProductName = lastDetails.SeName; + lastProductName = lastDetails.Name; } } else diff --git a/Nop.Plugin.Misc.AuctionPlugin/Views/LiveScreen.cshtml b/Nop.Plugin.Misc.AuctionPlugin/Views/LiveScreen.cshtml index c935ce0..303194d 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Views/LiveScreen.cshtml +++ b/Nop.Plugin.Misc.AuctionPlugin/Views/LiveScreen.cshtml @@ -106,19 +106,30 @@
- +
- -
+
+ } else { -
- -
+
+ + +

@Model.AuctionDto.AuctionName

-
+
+ +
+
+
+ +
+
+
+ +
} @@ -163,6 +174,8 @@ }); function addRowToTable(tableRow) { + var thPageViewModel = @Html.Raw(Json.Serialize(Model)); + let myUserId = thPageViewModel.UserCustomerId; var table = document.getElementById("bidHistoryTable"); var row = table.insertRow(); @@ -172,8 +185,14 @@ var cell2 = row.insertCell(); cell2.textContent = HUFFormatter.format(tableRow.BidPrice); - var cell3 = row.insertCell(); - cell3.textContent = "###"; + if (myUserId != thPageViewModel.CurrentProductToAuction.winnerCustomerId) { + var cell3 = row.insertCell(); + cell3.textContent = "Online"; + } + else { + var cell3 = row.insertCell(); + cell3.textContent = "Offline"; + } } @@ -213,9 +232,15 @@ var cell2 = row.insertCell(); cell2.textContent = HUFFormatter.format(productToAuction.currentPrice); - - var cell3 = row.insertCell(); - cell3.textContent = "###"; + if (myUserId != productToAuction.winnerCustomerId) { + var cell3 = row.insertCell(); + cell3.textContent = "Online"; + } + else { + var cell3 = row.insertCell(); + cell3.textContent = "Offline"; + } + } diff --git a/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml b/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml index 6b04dc3..4deeb73 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml +++ b/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml @@ -35,10 +35,11 @@
-
- ... + @*
+ ...
-
+
*@ +
@(string.IsNullOrEmpty(Model.LastProductUrl) ? @T("Plugins.Misc.AuctionPlugin.StartOfList") : @T("Plugins.Misc.AuctionPlugin.BackToLast"))

@(string.IsNullOrEmpty(Model.LastProductName) ? "---" : Model.LastProductName)

@@ -51,10 +52,11 @@
-
+ @*
...
-
+
*@ +
@(string.IsNullOrEmpty(Model.NextProductUrl) ? @T("Plugins.Misc.AuctionPlugin.EndOfList") : @T("Plugins.Misc.AuctionPlugin.ComingUp"))

@(string.IsNullOrEmpty(Model.NextProductName) ? "---" : Model.NextProductName)

@@ -445,6 +447,8 @@ function handleAuctionUpdate(data) { var widgetPriceElement = document.getElementById("price-value-" + bidBoxPageViewModel.ProductId); + var bidButtonElement = document.getElementById("signalRBidButton"); + var licitStepElement = document.getElementById("licitStepText"); var bidBoxTitle = document.getElementById("bidBoxTitle"); var productAuctionMappingId = data.auctionDto.productToAuctionDtos[0].id; let isMyBid = false; @@ -464,7 +468,19 @@ console.log("THIS IS FOR US! SORRY FOR SHOUTING"); switch (itemStatus) { case AuctionStatus.None: - bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.AuctionNotStarted"))"; + location.reload(); + // bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.AuctionNotStarted"))"; + + // bidBoxPageViewModel.NextBidPrice = Number(data.nextBidPrice); + + // if(bidBoxPageViewModel.WorkingCurrency.CurrencyCode == "EUR") { + // widgetPriceElement.textContent = EURFormatter.format(data.currentPrice * bidBoxPageViewModel.WorkingCurrency.Rate); // Update the price + // licitStepElement.textContent = EURFormatter.format(data.nextStepAmount * bidBoxPageViewModel.WorkingCurrency.Rate); + // } + // else { + // widgetPriceElement.textContent = HUFFormatter.format(data.currentPrice); // Update the price + // licitStepElement.textContent = HUFFormatter.format(data.nextStepAmount); + // } break; case AuctionStatus.Active: