Здоровые зубы - залог иммунитета. Обзор электрической зубной щетки Oral B
Всем привет!
Галерея
addFrame("3203");
if (!window.prodList) window.prodList = [];
let productsList = ["400094269","20076011"] console.log(productsList) for(let itemId of productsList){ window.prodList.push(itemId); }
var vItems = new Vue({ el: '#pGoods3203', data: { itemsIds: ["400094269","20076011"], items: [], itemsCost: [], procData: 0 }, methods:{ calcPrice(id){ return this.calcPriceNum(id).toLocaleString('ru'); }, calcPriceNum(id){ for(let i in this.itemsCost){ if (this.itemsCost[i].productId == id){ return (this.itemsCost[i].price.salePrice || ""); } } return ""; }, procowox(item, itemNum){ let cost = 0; if ('price' in this.itemsCost) cost = this.calcPriceNum(item.productId) return JSON.stringify({ 'event': 'OWOX', 'eventCategory': 'Interactions', 'eventAction': 'click', 'eventLabel': 'blockProductClick', 'eventContent': 'Tovari is materiala', 'eventPosition': itemNum, 'eventParameter': 'site', 'eventProductId': item.productId, // id товара на сайте //'eventProductCategoryId': 'cat2_cis_0000000298', // id категории товара на сайте 'userAuth': (typeof(userAuth) !== 'undefined')?userAuth:false, 'userAuthType': (typeof(userAuthType) !== 'undefined')?userAuthType:false,
'ecommerce': { 'click': { 'actionField': { 'list': 'Tovari is materiala' }, 'products': [{ 'id': item.productId, // id товара на сайте 'name': item.name, // Название товара //'category': item.name, // Название категории товара //'dimension101': '123456', // id категории продукта 'brand': item.brandName, // Бренд товара 'position': '1', 'price': cost, // Цена товара 'metric13': cost, // Цена товара фактическая 'metric14': cost, // Цена товара базовая 'variant': 'site', 'dimension60': 'Article' // Тип страницы }] } } }) } }, watch:{ procData: function(options){ if (this.procData == 2){ setTimeout(()=>{
$('#aGoods3203').addClass('article-goods__slider article-goods__slider--inside').html(this.$refs.goods.innerHTML)
$('#aGoods3203').slick({ dots: !1, infinite: !1, slidesToShow: 4, responsive: [{ breakpoint: 1036, settings: { slidesToShow: 4 } }, { breakpoint: 768, settings: { slidesToShow: 2, arrows: !1 } }] });
}, 150) } } }, mounted () { let itemsReady = setInterval(()=>{ if (window.prodItems.length > window.prodList.length*0.8 && window.prodCost.length > window.prodList.length*0.8){ clearInterval(itemsReady);
for(let i in window.prodItems){ if (this.itemsIds.indexOf( window.prodItems[i].productId ) > -1){ this.items.push(window.prodItems[i]); } } for(let i in window.prodCost){ if (this.itemsIds.indexOf( window.prodCost[i].productId ) > -1){ this.itemsCost.push(window.prodCost[i]); } } this.procData = 2; }
}, 100) /*document.getElementById('mvframe3203').onload = () => { var paramsArr = { "productIds":this.itemsIds, "mediaTypes":["images"], "status":true, "categories":true, "brand":true, "propertyTypes":["KEY"] }; $.ajax({ url: '/bff/product-details/list/', dataType: "json", method: 'POST', data: paramsArr, success: (r)=>{ this.items = r.body.products; window.prodItems = this.items; this.procData++; } });
$.ajax({ url: '/bff/products/prices/', dataType: "json", method: 'GET', data: {productIds: this.itemsIds.join(',')}, success: (r)=>{ this.itemsCost = r.body.materialPrices; window.prodCost = this.itemsCost; this.procData++; } }); }*/ } })







Комментарии
Авторизуйтесь, чтобы иметь возможность писать комментарии:
Войти