ha enyém a bid akkor nem csilingel
This commit is contained in:
parent
8ef62db6fe
commit
7246d86e76
|
|
@ -46,8 +46,8 @@
|
||||||
|
|
||||||
if (publicProductBidBox)
|
if (publicProductBidBox)
|
||||||
{
|
{
|
||||||
var audio = new Audio('../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
|
//var audio = new Audio('../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
|
||||||
audio.play();
|
//audio.play();
|
||||||
refreshPublicBidBox(myObject);
|
refreshPublicBidBox(myObject);
|
||||||
}
|
}
|
||||||
if (publicInfo) {
|
if (publicInfo) {
|
||||||
|
|
@ -56,8 +56,7 @@
|
||||||
}
|
}
|
||||||
if (liveScreen)
|
if (liveScreen)
|
||||||
{
|
{
|
||||||
var audio = new Audio('../../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
|
|
||||||
audio.play();
|
|
||||||
updateOnBid(myObject);
|
updateOnBid(myObject);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Nop.Core;
|
||||||
using Nop.Core.Domain.Catalog;
|
using Nop.Core.Domain.Catalog;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Models;
|
using Nop.Plugin.Misc.AuctionPlugin.Models;
|
||||||
|
|
@ -10,7 +11,7 @@ using Nop.Web.Models.Catalog;
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Controllers;
|
namespace Nop.Plugin.Misc.AuctionPlugin.Controllers;
|
||||||
|
|
||||||
public class AuctionController(AuctionService auctionService, ILogger logger, IProductService productService, MyProductModelFactory productModelFactory)
|
public class AuctionController(AuctionService auctionService, ILogger logger, IProductService productService, MyProductModelFactory productModelFactory, IWorkContext _workContext)
|
||||||
: BasePluginController
|
: BasePluginController
|
||||||
{
|
{
|
||||||
// GET
|
// GET
|
||||||
|
|
@ -60,7 +61,8 @@ public class AuctionController(AuctionService auctionService, ILogger logger, IP
|
||||||
var auctionDto = await auctionService.GetAuctionDtoWithAuctionBids(auctionId, true, 5); //A javascript-ben az első 6-ot vágod le, melyik a valid? - J.
|
var auctionDto = await auctionService.GetAuctionDtoWithAuctionBids(auctionId, true, 5); //A javascript-ben az első 6-ot vágod le, melyik a valid? - J.
|
||||||
var activeMapping = auctionDto?.ProductToAuctionDtos.MinBy(x => x.SortIndex);
|
var activeMapping = auctionDto?.ProductToAuctionDtos.MinBy(x => x.SortIndex);
|
||||||
var isAnyItemLive = activeMapping != null;
|
var isAnyItemLive = activeMapping != null;
|
||||||
if (auctionDto == null)
|
var myUser = await _workContext.GetCurrentCustomerAsync();
|
||||||
|
if (auctionDto == null || myUser == null)
|
||||||
{
|
{
|
||||||
return new RedirectResult("/", false);
|
return new RedirectResult("/", false);
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +111,7 @@ public class AuctionController(AuctionService auctionService, ILogger logger, IP
|
||||||
model.LicitStep = nextStep;
|
model.LicitStep = nextStep;
|
||||||
model.BasePrice = basePrice;
|
model.BasePrice = basePrice;
|
||||||
model.CurrentPrice = currentPrice;
|
model.CurrentPrice = currentPrice;
|
||||||
|
model.UserCustomerId = myUser.Id;
|
||||||
|
|
||||||
|
|
||||||
return View("~/Plugins/Misc.AuctionPlugin/Views/LiveScreen.cshtml", model);
|
return View("~/Plugins/Misc.AuctionPlugin/Views/LiveScreen.cshtml", model);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Models
|
||||||
|
|
||||||
public decimal LicitStep { get; set; }
|
public decimal LicitStep { get; set; }
|
||||||
public decimal? CurrentPrice { get; set; }
|
public decimal? CurrentPrice { get; set; }
|
||||||
|
public int UserCustomerId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@
|
||||||
|
|
||||||
var liveScreenPageViewModel = @Html.Raw(Json.Serialize(Model));
|
var liveScreenPageViewModel = @Html.Raw(Json.Serialize(Model));
|
||||||
console.log("ViewModel:", liveScreenPageViewModel);
|
console.log("ViewModel:", liveScreenPageViewModel);
|
||||||
|
let myUserId = liveScreenPageViewModel.UserCustomerId;
|
||||||
// Extract and preprocess table data
|
// Extract and preprocess table data
|
||||||
var tableData = liveScreenPageViewModel.CurrentProductToAuction.AuctionBidDtos
|
var tableData = liveScreenPageViewModel.CurrentProductToAuction.AuctionBidDtos
|
||||||
.slice(0, 6) // Get the first 6 elements
|
.slice(0, 6) // Get the first 6 elements
|
||||||
|
|
@ -186,6 +186,10 @@
|
||||||
let auctionDto = data.auctionDto;
|
let auctionDto = data.auctionDto;
|
||||||
let productToAuction = auctionDto.productToAuctionDtos[0];
|
let productToAuction = auctionDto.productToAuctionDtos[0];
|
||||||
|
|
||||||
|
var liveScreenPageViewModel = @Html.Raw(Json.Serialize(Model));
|
||||||
|
console.log("ViewModel:", liveScreenPageViewModel);
|
||||||
|
let myUserId = liveScreenPageViewModel.UserCustomerId;
|
||||||
|
|
||||||
var liveScreenLicitStep = document.getElementById("liveScreenLicitStep");
|
var liveScreenLicitStep = document.getElementById("liveScreenLicitStep");
|
||||||
if(liveScreenLicitStep) {
|
if(liveScreenLicitStep) {
|
||||||
liveScreenLicitStep.textContent = data.nextStepAmount;
|
liveScreenLicitStep.textContent = data.nextStepAmount;
|
||||||
|
|
@ -194,6 +198,12 @@
|
||||||
if (liveScreenCurrentPrice) {
|
if (liveScreenCurrentPrice) {
|
||||||
liveScreenCurrentPrice.textContent= HUFFormatter.format(productToAuction.currentPrice);
|
liveScreenCurrentPrice.textContent= HUFFormatter.format(productToAuction.currentPrice);
|
||||||
}
|
}
|
||||||
|
if (myUserId != productToAuction.winnerCustomerId) {
|
||||||
|
//ding
|
||||||
|
console.log(myUserId + ", " + productToAuction.winnerCustomerId);
|
||||||
|
var audio = new Audio('../../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
|
||||||
|
audio.play();
|
||||||
|
}
|
||||||
console.log(productToAuction);
|
console.log(productToAuction);
|
||||||
var table = document.getElementById("bidHistoryTable");
|
var table = document.getElementById("bidHistoryTable");
|
||||||
var row = table.insertRow(1);
|
var row = table.insertRow(1);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,9 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="publicProductBidBox" class="p-3 @bgClass text-white">
|
<div id="publicProductBidBox" class="p-3 @bgClass text-white">
|
||||||
<strong>#@(Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault().SortIndex)</strong>
|
<div class="col-3"><strong>#@(Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault().SortIndex)</strong></div>
|
||||||
|
<div class="col-9"><a href="https://youtube.com/live/6yfnmyQE7Uw?feature=share">Youtube live</a></div>
|
||||||
|
|
||||||
<h4 id="bidBoxTitle">@title</h4>
|
<h4 id="bidBoxTitle">@title</h4>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="m-auto">
|
<div class="m-auto">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue