PageSourceSearch

https://www.lallibreria-uv.es/js/ListaDeseos.js?v=001.350

js lallibreria-uv.es collected 2026-10-03 17:51:52 UTC 15,086 bytes, 439 lines download raw bytes

1function getListaDeseos() {
2
3	var contadorUnidades = 0;
4
5	var totalizadorPrecioBruto = 0.0;
6
7	var totalizadorPeso = 0;
8
9	var totalPrecioBrutoSinIVA = 0.0;
10
11	var totalImporteConIVA = 0.0;
12
13	$("#dvContainerWishList").empty();
14
15	var Local_Host = "";
16
17	if (window.location.href.indexOf("ediweb") > 0) {
18		Local_Host = "/ediweb";
19	}
20
21	$.ajax({
22		type: "POST",
23		url: "./CestaGlobal.aspx/bindGridListaDeseos",
24		contentType: "application/json; charset=utf-8",
25		dataType: "json",
26		success: function (result) {
27
28			if (result.d.length > 0) {
29				//getCabeceraListPedido();
30
31				for (var i = 0; i < result.d.length; i++) {
32
33					var PVPSinDTO = parseFloat(result.d[i].PVPSinDTO.replace(",", "."));
34
35					var PVP = parseFloat(result.d[i].PVP.replace(",", "."));
36
37					contadorUnidades += 1;
38
39					totalizadorPeso += parseFloat(result.d[i].Peso.replace(",", ".")) * parseFloat(result.d[i].Cantidad);
40
41					var porcDTOArticulo = result.d[i].perDTO.replace(",", ".") / 100;
42
43					var TotalPVPArticulo = (result.d[i].PVP.replace(",", ".") * result.d[i].Cantidad);
44
45					var TotalPrecioConDescuentoArticulo = (result.d[i].PVP.replace(",", ".") * result.d[i].Cantidad) * porcDTOArticulo;
46
47					var TotalImporteArticulo = TotalPVPArticulo - TotalPrecioConDescuentoArticulo;
48
49					totalizadorPrecioBruto += TotalImporteArticulo;
50
51					totalImporteConIVA = Math.round(parseFloat(result.d[i].Precio.replace(",", ".")) * parseInt(result.d[i].Cantidad) * 100) / 100;
52
53					totalImporteConIVA = number_format(totalImporteConIVA, 2);
54
55					if (porcDTOArticulo == 0) {
56						PVPSinDTO = "";
57					} else {
58
59						PVPSinDTO = number_format(PVPSinDTO, 2) + "&nbsp;&euro;";
60					}
61
62					var iconoEBook = 'style="display:none"'
63
64					if (result.d[i].ClasificacionArticulo == "5") {
65
66						iconoEBook = 'style="display:block"'
67					}
68
69					var literalPendiente = "Pendiente servir: "
70
71					if (result.d[i].QPendiente == "No") {
72						result.d[i].QPendiente = "";
73
74						literalPendiente = "";
75					}
76
77					var SinStockNoDisponible = result.d[i].SinStockNoDisponible;
78					var HTMLcesta = "";
79
80					if (SinStockNoDisponible == true)
81					{
82						if (JSON.parse(document.getElementById("hddBloqueoCesta").value.toLowerCase())) {
83
84							HTMLcesta = '&nbsp;</div>';
85						}
86						else if (result.d[i].Estado.toString().toLowerCase().indexOf("enstock") > 0) {
87
88							HTMLcesta = '<a onclick="AddCesta(event,this);" id="imgCarrito" class="btnAddToCart" style="width:100%" href="#">' +
89								'<i class="inline-icon material-icons white md-18">shopping_cart</i>&nbsp;' + getIdioma("btnAdd") +
90								'</a>' +
91								'</div>'
92						}
93						else {
94
95							HTMLcesta = '<span class="NoDisponible"  title="No disponible  (Normal / Disponible)">&nbsp;&nbsp;Stock: No&nbsp;&nbsp;</span></div>';
96						}
97					}
98					else
99					{
100						if (JSON.parse(document.getElementById("hddBloqueoCesta").value.toLowerCase())) {
101
102							HTMLcesta = '&nbsp;</div>';
103						}
104						else {
105
106							HTMLcesta = '<a onclick="AddCesta(event,this);" id="imgCarrito" class="btnAddToCart" style="width:100%" href="#">' +
107								'<i class="inline-icon material-icons white md-18">shopping_cart</i>&nbsp;' + getIdioma("btnAdd") +
108								'</a>' +
109								'</div>'
110						}
111					}
112
113					
114					
115
116
117					$("#dvContainerWishList").append(
118									   "<div class='dvListDeseos'>" +
119									   "<div>" +
120									   "<div class='dvListPedido1'>" +
121									   '<input id="Hidden1" type="hidden" value="' + result.d[i].CodFamilia + '"/>' +
122									   '<input id="Hidden2" type="hidden" value="' + result.d[i].CodArticulo + '"/>' +
123									   '<input id="Hidden3" type="hidden" value="' + result.d[i].Peso + '"/>' +
124									   '<input id="Hidden4" type="hidden" value="' + result.d[i].Precio + '"/>' +
125									   '<input id="Hidden5" type="hidden" value="' + result.d[i].DTO + '"/>' +
126									   '<input id="Hidden6" type="hidden" value="' + result.d[i].PVP + '"/>' +
127									   '<input id="Hidden7" type="hidden" value="' + result.d[i].perDTO + '"/>' +
128									   '<a href="' + LimpiaNombre(result.d[i].Titulo) + "-isbn-" + result.d[i].ISBN + "-codigo-" + result.d[i].CodFamilia + "," + result.d[i].CodArticulo + '">' +
129									   '<img src="' + result.d[i].Imagen + '" class="imgArticuloCesta" />' +
130									   '</a>' +
131									   '<div id="dvIsEbookCarrusel"' + iconoEBook + '" runat="server">eBook</div>' +
132									   "</div>" +
133
134									   "<div class='dvListPedido2'>" +
135									   '<label class="lblListPedido"><strong>' + result.d[i].Titulo + '</strong></label><br/>' +
136									   '<label class="lblListPedido">' + result.d[i].Autor + '</label><br/>' +
137									  // '<label class="lblListPedido">&nbsp;&nbsp;' + result.d[i].Isbn + '</label><br/>' +
138									  // '<label class="lblListPedido">&nbsp;&nbsp;Ref:&nbsp;' + result.d[i].CI + '</label><br/>' +
139									   //'<label class="lblListPedido">&nbsp;&nbsp;' + literalPendiente + '</label>' +
140									   //'<label class="lblListPedido">&nbsp;&nbsp;' + result.d[i].QPendiente + '</label><br/>' +
141										"</div>" +
142
143										"</div>" +
144
145
146										/*
147										"<div class='dvListPedido3'>" +
148										'<label class="lblListPedido3">' + result.d[i].PVP + '</label>&nbsp;&euro;' +
149										'<label style="display:none;margin-top:40px;font-size:14px" class="lblListPedido">&nbsp;&nbsp;' + result.d[i].IVA + '</label>' +
150										"</div>" +
151										*/
152
153										"<div class='dvListPedido4'>" +
154										"<div class='displayinline'>" +
155										//'<button type="button" class="buttonsCart" onclick="UpdateArticuloCestaWeb(event,this,2);" >' +
156										//'<i class="inline-icon material-icons">
156remove_circle</i>' +
157										//'</button>' +
158										"</div>" +
159										"<div class='displayinline'>" +
160										//'<input id="txbQuantity" autocomplete="off"  onkeyup="UpdateArticuloCestaWeb(event,this,3);" type="text" value="' + result.d[i].Cantidad + '">' +
161										"</div>" +
162										"<div class='displayinline'>" +
163										//'<button type="button" class="buttonsCart" onclick="UpdateArticuloCestaWeb(event,this,1);">' +
164										//'<i class="inline-icon material-icons">add_circle</i>' +
165										//'</button>' +
166										
167										HTMLcesta +
168
169										//'<label style="margin-top:7px" class="lblListPedido">' + result.d[i].Estado + '</label>' +
170										//"<div style='display:none'>" +
171										//'<label id="lblQuantity" class="lblListPedido" style="display:inherit;line-height:25px;border:1px solid #CCC;width:40px;height:25px;text-align:center;background-color:#FFF">' + result.d[i].Cantidad + '</label>' +
172									   // '</div>' +
173										"</div>" +
174
175										/*
176										"<div class='dvListPedido5'>" +
177										'&nbsp;&nbsp;' +
178										'<label class="lblListPedido5">' + result.d[i].DTO + '</label>' +
179										"</div>" +
180										*/
181
182										"<div class='dvListPedido7'>" +
183										'<div id="dvAddListaDeseoCart" class="displayinline textaligncenter">' +
184										//'<a onclick="AddListaDeseos(event,this);" id="LinkButton1" title="Añadir a lista de deseos" href="#">' +
185										//'<i id="iconCorazon" class="inline-icon material-icons iconoDeseosPre md-24">favorite_border</i>' +
186										//'</a>' +
187										'</div>' +
188										"<div id='dvDeleteArticuloCart' class='displayinline textaligncenter'>" +
189										'<button type="button" id="btnEliminarArticuloListaDeseos" onclick="DeleteArticuloListaDeseos(event,this);" >' +
190										'<i class="inline-icon material-icons md-24 orange600">delete_forever</i>' +
191										'</button>' +
192										'</div>' +
193										"</div>" +
194
195										"<div class='dvListPedido6'>" +
196										'<label class="lblListPedido6_1">' + PVPSinDTO + '</label>' +
197										'<label class="lblListPedido6_2">' + number_format(PVP, 2) + '&nbsp;&euro;</label>' +
198										"</div>" +
199
200										"</div>"
201										 );
202
203
204					document.getElementById("displayUnitsWishList").textContent = contadorUnidades;
205
206				}
207				setdisplayunitswishlist();
208
209			}
210			else {
211
212				if (document.getElementById("hddIsAuthenticated").value == "True") {
213
214					$("#dvContainerWishList").append(
215										   "<div class='dvListPedidoEmpty'>" +
216										   '<i id="iconWishListEmpty" class="material-icons">sentiment_dissatisfied</i>' +
217										   '</div>');
218				}
219				else
220				{
221					$("#dvContainerWishList").append(
222										   "<div class='dvListPedidoInitSession'>" +
223										   '<p><i id="iconWishListEmpty" class="material-icons md-48">account_box</i></p>' +
224						                   '<p><span>' + getIdioma("lbl00113") + '</p>' +
225						'<p><a onclick="mostrarFlotanteLogin(event);" href="#">' + getIdioma("lbl00114") +'</a></span></p>' +
226										   '</div>');
227
228				}
229
230				document.getElementById("displayUnitsWishList").textContent = "0";
231
232			}
233
234		},
235		error: function (jqXHR, textStatus, errorThrown) {
236			// alert("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
237			// Handle errors here
238			console.log("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
239		}
240	});
241
242
243
244}
245
246
247
248function AddListaDeseos(event, thediv) {
249
250	cerrarCestaLight();
251
252	event.stopPropagation(); // Stop stuff happening
253	event.preventDefault(); // Totally stop stuff happening
254
255	var codFamilia = "";
256	var codArticulo = "";
257
258	if (thediv.parentElement.parentElement.parentElement.className == "dvListPedidoCestaGlobal"
259		|| thediv.parentElement.parentElement.parentElement.className == "dvListPedido") {
260
261		codFamilia = thediv.parentElement.parentElement.parentElement.childNodes[0].childNodes[0].childNodes[0].value;
262		codArticulo = thediv.parentElement.parentElement.parentElement.childNodes[0].childNodes[0].childNodes[1].value;
263	}
264	else {
265
266		codFamilia = thediv.parentElement.parentElement.parentElement.parentElement.childNodes[1].value;
267		codArticulo = thediv.parentElement.parentElement.parentElement.parentElement.childNodes[3].value;
268
269		if (codFamilia == undefined) {
270			codFamilia = thediv.parentElement.parentElement.parentElement.childNodes[1].value;
271
272			codArticulo = thediv.parentElement.parentElement.parentElement.childNodes[3].value;
273		}
274		
275	}
276
277	if (document.getElementById("hddIsAuthenticated").value == "True") {
278
279		var Local_Host = "";
280
281		if (window.location.href.indexOf("ediweb") > 0) {
282			Local_Host = "/ediweb";
283		}
284
285		$.ajax({
286
287			type: 'POST',
288			url: "./Default.aspx/addListaArticulosDeseos",
289			data: "{codFamilia:" + JSON.stringify(codFamilia) + "," + "codArticulo:" + JSON.stringify(codArticulo) + "}",
290			contentType: "application/json; charset=utf-8",
291			dataType: "json",
292			success: function (result) {
293
294				if (result.d == "1") {
295
296					//document.getElementById("iconCorazon").textContent = 'favorite';
297
298					AbrirWishListLight(event);
299
300				}
301			},
302			error: function (jqXHR, textStatus, errorThrown) {
303				alert("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
304				// Handle errors here
305				console.log("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
306			},
307			complete: function (event, ui) {
308				//alert("AJAX Complete");
309				setdisplayunitswishlist();
310
311			}
312		});
313
314	}
315	else {
316
317		AbrirWishListLight(event);
318
319
320	}
321
322}
323
324
325
326function DeleteArticuloListaDeseos(event, thediv) {
327
328	event.stopPropagation(); // Stop stuff happening
329	event.preventDefault(); // Totally stop stuff happening
330
331	var codFamilia = thediv.parentElement.parentElement.parentNode.childNodes[0].childNodes[0].childNodes[0].value;
332
333	var codArticulo = thediv.parentElement.parentElement.parentNode.childNodes[0].childNodes[0].childNodes[1].value;
334
335	if (window.location.href.indexOf("ediweb") > 0) {
336		Local_Host = "/ediweb";
337	}
338
339	$.ajax({
340
341		type: 'POST',
342		url: "./Default.aspx/DeleteArticuloListaDeseos",
343		data: "{codFamilia:" + JSON.stringify(codFamilia) + "," + "codArticulo:" + JSON.stringify(codArticulo) + "}",
344		contentType: "application/json; charset=utf-8",
345		dataType: "json",
346		success: function (result) {
347
348			if (result.d == "1") {
349
350				thediv.parentElement.parentElement.parentElement.parentElement.removeChild(thediv.parentElement.parentElement.parentElement);
351
352				getListaDeseos();
353			}
354		},
355		error: function (jqXHR, textStatus, errorThrown) {
356			alert("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
357			// Handle errors here
358			console.log("textStatus: " + textStatus + "\n" + "jqXHR: " + jqXHR + "\n" + "errorThrown: " + errorThrown);
359		},
360		complete: function (event, ui) {
361			//alert("AJAX Complete");
362			if (document.getElementById("displayUnitsWishList").textContent == 1) {
363
364				document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
365				document.getElementById("iconCorazon").setAttribute("data-icon", "favorite_border");
366
367			}
368			else {
369				document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
370				document.getElementById("iconCorazon").setAttribute("data-icon", "favorite");
371
372			}
373		}
374	});
375
376}
377
378function setdisplayunitswishlist() {
379
380	if (window.location.host.indexOf("distriforma") > 0) {
381		if (document.getElementById("displayUnitsWishList").textContent == 0) {
382
383			document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
384			document.getElementById("iconCorazon").setAttribute("data-icon", "favorite_border");
385
386		}
387		else {
388			document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
389			document.getElementById("iconCorazon").setAttribute("data-icon", "favorite");
390
391		}
392
393		if (document.getElementById("dvContainerListCestaGlobal") != null) {
394			if (document.getElementById("displayUnitsWishList").textContent == 0) {
395
396				document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
397				document.getElementById("iconCorazon").setAttribute("data-icon", "favorite_border");
398
399			}
400			else {
401
402				document.getElementById("iconCorazon").setAttribute("class", "inline-icon material-icons iconoDeseosPreAuth");
403				document.getElementById("iconCorazon").setAttribute("data-icon", "favorite");
404
405			}
406		}
407	}
408
409}
410
411
412
413function AbrirWishListLight(event) {
414
415	event.stopPropagation(); // Stop stuff happening
416	event.preventDefault(); // Totally stop stuff happening
417
418
419	getListaDeseos();
420
421	var modalAjax = document.getElementById("modalWishListLight");
422
423	modalAjax.style.display = "block";
424
425	unloadScrollBars();
426
427}
428
429
430function cerrarWishListLight() {
431
432	var modalAjax = document.getElementById("modalWishListLight");
433
434	modalAjax.style.display = "none";
435
436	reloadScrollBars();
437
438}
439

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.