1//ãã©ã¡ã¼ã¿ã¼æå®ï¼searchæ¤ç´¢) 2function searchItem(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice) { 3 var searchAreaId = document.getElementById(id); 4 5 axios.get('/api/v1/item/search/json?' + param, { 6 params: { 7 limit: index, 8 }, 9 }).then(function (respSh) { 10 fnc_searchItem(respSh.data, searchAreaId, viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 11 }).then(function () { 12 searchAreaId.style.cssText = 'opacity:1;transition: .2s .2s ease-in'; 13 14 //ãæ°ã«å ¥ãç»é² 15 if(favorite == 1){ 16 favModuleEx.checkFavoriteItem(); 17 } 18 }).catch(function (err) { 19 console.log(err); 20 }); 21} 22 23//parsonalize ãã©ã¡ã¼ã¿ã¼æå®ï¼searchæ¤ç´¢) 24function searchItemParsonalize(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice) { 25 var searchAreaId = document.getElementById(id); 26 27 if(typeof searchUserId === 'undefined'){ 28 // parsonalize Error 29 console.log("Parsonalize Error : searchUserId undefined"); 30 }else{ 31 if(searchUserId == "" || searchUserId == null || searchUserId == undefined){ 32 searchItem(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 33 }else{ 34 var settings = { 35 "url": "https://psnalize.nissen.co.jp/search-sort", 36 "method": "POST", 37 "timeout": 0, 38 "headers": { 39 "x-api-key": "sOlQjcM4VS9vd9geHzwQx7W63i6l5EeG987z9llA", 40 "Content-Type": "application/json" 41 }, 42 "data": JSON.stringify({ 43 "search_param": "page=1&limit=" + index + "&" + param, 44 "user_id": searchUserId, 45 "sort_flg": "1" 46 }), 47 }; 48 49 $.ajax(settings).done(function (response) { 50 fnc_searchItem(response, searchAreaId, viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 51 }).then(function () { 52 searchAreaId.style.cssText = 'opacity:1;transition: .2s .2s ease-in'; 53 54 //ãæ°ã«å ¥ãç»é² 55 if(favorite == 1){ 56 favModuleEx.checkFavoriteItem(); 57 } 58 }).catch(function (err) { 59 // API parsonalize Error 60 console.log("parsonalize API Error : ", err); 61 }); 62 } 63 } 64} 65 66// function for ãã©ã¡ã¼ã¿ã¼æå®ï¼searchæ¤ç´¢) 67function fnc_searchItem(data, searchAreaId, viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice) { 68 var itemList = [], 69 itemSearch = data.itemSearchInfoXML.itemSearchInfo.itL, 70 itemSearchIndex = itemSearch.length; 71 72 if (data.itemSearchInfoXML.rcd == 200) { 73 //ã¢ã¤ãã ä»¶æ° 74 if(searchAreaId.getElementsByClassName('itemIndex')[0]){ 75 searchAreaId.getElementsByClassName('itemIndex')[0].textContent = data.itemSearchInfoXML.itemSearchInfo.endNo; 76 } 77 78 for (var i = 0; i < itemSearchIndex; i++) { 79 itemList.push(itemSearch[i]); 80 } 81 82 var listUl = document.createElement('ul'); 83 listUl.className = 'searchArea__ul'; 84 85 //颿°_å¨åº«è¡¨ 86 function stockParts() { 87 var stockP = '<p class="m-item_list_stock"><button onclick="itemModule.stockview(\'' + item.itCd + '\');" type="button" name="stock" class="m-btn-icon m-btn-icon-stock" value="å¨åº«"></button></p>'; 88 return stockP; 89 } 90 91 //颿°_ãã©ãã¨è¦ã 92 function quickviewParts() { 93 if (viewType == 'PC') { 94 var quickviewP = '<p class="m-item_list_quickview"><button onclick="itemModule.quickview(\'' + item.itCd + "','" + item.itUrl + '\');" type="button" name="quickview" class="m-btn-icon m-btn-icon-quickview" value="ãã©ãã¨è¦ã"></button></p>'; 95 } else { 96 var quickviewP = '<p class="m-item_list_quickview m-item_rank-list_quickview"><button class="m-btn-icon-quickview" type="button" name="quickview" value="ãã©ã£ã¨è¦ã" onclick="itemModule.quickview(\'' + item.itCd + "','" + item.itUrl + '\')">ãã©ã£ã¨è¦ã</button></p>'; 97 } 98 return quickviewP; 99 } 100 101 //颿°_ãªãç 102 function discountParts() { 103 if (item.dch != item.dcl) { 104 var maximum = 'æå¤§'; 105 } else { 106 var maximum = ''; 107 } 108 var itemOffP = '<p class="m-item_list_discount"><span class="item-off">' + maximum + item.dch + '%OFF</span></p>'; 109 return itemOffP; 110 } 111 112 var itemIndex = itemList.length, 113 fragment = document.createDocumentFragment(); 114 115 for (var a = 0; a < itemIndex; a++) { 116 var item = itemList[a].it, 117 listLi = document.createElement('li'), 118 listDiv = document.createElement('div'); 119 120 listLi.className = 'searchArea__list'; 121 listDiv.id = 'info-' + item.itCd; 122 listDiv.className = 'info-' + item.itCd + ' m-item_list'; 123 listDiv.setAttribute('data-bic', item.itCd); 124 listLi.appendChild(listDiv); 125 listUl.appendChild(listLi); 126 127 //ã©ã³ãã³ã° 128 if (rank) { 129 listDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_rank rank' + ('00' + (a + 1)).slice(-2) + '">' + (a + 1) + '</p>'); 130 } 131 132 //ç»å 133 if (itemImage) { 134 var imageDiv = document.createElement('div'); 135 imageDiv.className = 'm-item_list_photo'; 136 var imageDivInner = document.createElement('div'); 137 imageDivInner.className = 'm-item_list_photo_inner'; 138 139 if (viewType == 'PC') { 140 //ãæ°ã«å ¥ã 141 if (favorite) { 142 imageDivInner.insertAdjacentHTML('beforeend', '<p class="m-item_list_fav"><button data-ic="NNN' + item.itCd + '" type="button" name="stock" class="m-btn-icon m-btn-icon-favorite js-fav-off" onclick="favModuleEx.addFavoriteItem($(this).data(\'ic\'))"></button><button data-ic="NNN' + item.itCd + '" type="button" name="stock" class="m-btn-icon m-btn-icon-favorite js-fav-on" onclick="favModuleEx.disFavoriteItem($(this).data(\'ic\'))" style="display:none;"></button></p>'); 143 } 144 145 //å¨åº«è¡¨ 146 if (stock) { 147 imageDivInner.insertAdjacentHTML('beforeend', stockParts()); 148 } 149 150 //ãã©ãã¨è¦ã 151 if (quickview) { 152 imageDivInner.insertAdjacentHTML('beforeend', quickviewParts()); 153 } 154 } 155 156 var imgLink = document.createElement('a'); 157 imgLink.href = item.itUrl; 158 imgLink.className = 'm-item_list_photo_main select_item'; 159 imageDivInner.appendChild(imgLink); 160 161 //ã試ãä¾¡æ ¼ãã©ã° 162 var trialFlag = false;
163 for (var idx = 0; idx < item.dispTagList.length; idx++) { 164 item.dispTagList[idx].dispTag.id == 'DC02' ? trialFlag = true : ''; 165 } 166 167 //ãªãçç»åå 表示 168 if(trialFlag && (discountPosition || discountPosition == 'top')) { 169 imgLink.insertAdjacentHTML('beforeend', '<p class="m-item_list_trial"><span class="trial-price">ã試ãä¾¡æ ¼</span></p>'); 170 } else if (discount && (discountPosition || discountPosition == 'top')) { 171 if (item.dch >= 1) { 172 imgLink.insertAdjacentHTML('beforeend', discountParts()); 173 } 174 } 175 176 //ç»åãµã¤ãºæå® 177 if (imageSize) { 178 var imgSize = item.img.replace(/_._/, '_' + imageSize + '_'); 179 } else { 180 var imgSize = item.img; 181 } 182 imgLink.insertAdjacentHTML('beforeend', '<img src="' + imgSize + '" alt="' + item.itNm + '">'); 183 184 //売åã 185 if (soldout) { 186 if (item.sFlg) { 187 imgLink.insertAdjacentHTML('beforeend', '<span class="item-soldout"><span>売åã</span></span>'); 188 } 189 } 190 191 imageDivInner.appendChild(imgLink); 192 193 if (viewType != 'PC') { 194 //ãæ°ã«å ¥ã 195 if (favorite) { 196 imageDivInner.insertAdjacentHTML('beforeend', '<p class="m-item_list_fav"><button data-ic="NNN' + item.itCd + '" type="button" name="stock" class="m-btn-icon m-btn-icon-favorite js-fav-off" onclick="favModuleEx.addFavoriteItem($(this).data(\'ic\'))" style="position: absolute; right: 5px; bottom: 5px; z-index: 1;"></button><button data-ic="NNN' + item.itCd + '" type="button" name="stock" class="m-btn-icon m-btn-icon-favorite js-fav-on" onclick="favModuleEx.disFavoriteItem($(this).data(\'ic\'))" style="position: absolute; right: 5px; bottom: 5px; z-index: 1; display:none;"></button></p>'); 197 } 198 } 199 200 imageDiv.appendChild(imageDivInner); 201 listDiv.appendChild(imageDiv); 202 203 if (viewType != 'PC') { 204 var photoInrDiv = document.createElement('div'); 205 photoInrDiv.className = 'm-item_list_photo_inr'; 206 //ãã©ãã¨è¦ã 207 if (quickview) { 208 photoInrDiv.insertAdjacentHTML('beforeend', quickviewParts()); 209 } 210 211 //å¨åº«è¡¨ 212 if (stock) { 213 photoInrDiv.insertAdjacentHTML('beforeend', stockParts()); 214 } 215 imageDiv.appendChild(photoInrDiv); 216 } 217 } 218 219 //è²ã³ã¼ã 220 if (colorImage) { 221 var colorImgDiv = document.createElement('div'); 222 colorImgDiv.className = 'm-item_list_color'; 223 var colorImgUl = document.createElement('ul'); 224 colorImgUl.className = 'm-facet_color'; 225 var colorIndex = item.exCoList.length; 226 227 for (var b = 0; b < colorIndex; b++) { 228 colorImgUl.insertAdjacentHTML('beforeend', '<li class="color-' + item.exCoList[b].exCo.id + '"></li>'); 229 } 230 colorImgDiv.appendChild(colorImgUl); 231 listDiv.appendChild(colorImgDiv); 232 } 233 234 var textAreaDiv = document.createElement('div'); 235 textAreaDiv.className = 'm-item_list_txt'; 236 237 //ã¢ã¤ãã å 238 if (itemName) { 239 var itemUrl = item.itUrl; 240 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_item_name"><a href="' + itemUrl + '" class="select_item"><span class="item-product">' + item.itNm + '</span></a></p>'); 241 } 242 243 //ä¾¡æ ¼ 244 if (price) { 245 //ãªãç 246 if(trialFlag && (!discountPosition || discountPosition != 'top')) { 247 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_trial"><span class="trial-price">ã試ãä¾¡æ ¼</span></p>'); 248 } else if (discount && (!discountPosition || discountPosition != 'top')) { 249 if (item.dch >= 1) { 250 textAreaDiv.insertAdjacentHTML('beforeend', discountParts()); 251 } 252 } 253 254 if (item.spwl != item.spwh) { 255 var range = 'ã\xA5' + String(item.spwh).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'), 256 rangeTax = 'ã\xA5' + String(item.sph).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'), 257 rangeOnry = 'ã'; 258 } else { 259 var range = '', 260 rangeTax = '', 261 rangeOnry = ''; 262 } 263 264 //ã»ã¼ã«ã»ã¬ã¯ã¿ 265 if(trialFlag) { 266 var saleClass = ' trial_price_money'; 267 } else if (item.dch >= 1) { 268 var saleClass = ' item-sale-price'; 269 } else { 270 var saleClass = ''; 271 } 272 273 //æééå®è¡¨ç¤º 274 var trialLimitedTimeTag = ''; 275 if(trialFlag && trialLimitedTime) { 276 trialLimitedTimeTag = '<span class="trial_price_limited"><span> </span><span>æééå®</span></span>'; 277 } 278 279 //ä¾¡æ ¼å¹ 280 if (priceRange) { 281 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_price"><span class="item-price ' + saleClass + '"><span class="item-price-out-tax">' + '\xA5' + String(item.spwl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + range + '</span><span class="item-price-in-tax">(ç¨è¾¼\xA5' + String(item.spl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + rangeTax + ')</span></span>' + trialLimitedTimeTag + '</p>'); 282 } else { 283 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_price"><span class="item-price ' + saleClass + '"><span class="item-price-out-tax">Â¥<span class="item-price-min">' + String(item.spwl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span></span><span class="item-price-in-tax">(ç¨è¾¼\xA5<span class="item-price-min">' + String(item.spl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span>)</span>' + rangeOnry + '</span>' + trialLimitedTimeTag + '</p>'); 284 } 285 286 //1ç¹ããã 287 if (unitPrice) { 288 if (item.sr2 && item.sr2 != '1') { 289 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="m-item_list_unit_price"><span class="item-unit-price">
2891ç¹ããã<span class="unit-price-out-tax">\xA5' + String(Math.ceil(Number(item.spwl) / Number(item.sr2)).toFixed()).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span><span class="unit-price-in-tax">(ç¨è¾¼\xA5' + String(((Number(item.spwl) / Number(item.sr2)) * 1.1).toFixed()).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + ')ã</span></span></p>'); 290 } 291 } 292 } 293 294 //ãµã¤ãº 295 if (sizeText) { 296 if (item.dSiNmMin) { 297 if (item.dSiNmMin != item.dSiNmMax) { 298 var sizeRange = ' - ' + item.dSiNmMax; 299 } else { 300 var sizeRange = ''; 301 } 302 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="item-size">ãµã¤ãºï¼' + item.dSiNmMin + sizeRange + '</p>'); 303 } 304 } 305 306 //è²å±é 307 if (colorText) { 308 textAreaDiv.insertAdjacentHTML('beforeend', '<p class="item-color">è²ï¼' + item.dCoCnt + 'è²å±é</p>'); 309 } 310 311 //åå ¥è· 312 if (icon) { 313 if (item.raFlg) { 314 textAreaDiv.insertAdjacentHTML('beforeend', '<ul class="item_detail_icon"><li class="icon--rearrival">åå ¥è·</li></ul>'); 315 } 316 } 317 318 //ã¬ãã¥ã¼ 319 if (review) { 320 if (item.revc >= 1) { 321 if (viewType == 'PC') { 322 var reviewScoreSpan = '<span class="m-item_list_reviewscore m-item_list_reviewscore--' + (Number(item.revs) + 0.05) * 10 + '">' + Number(item.revs).toFixed(1) + '</span>'; 323 } else { 324 var reviewScoreSpan = ''; 325 } 326 textAreaDiv.insertAdjacentHTML('beforeend', '<div class="m-item_list_review"><a href="' + item.itUrl + '?qDisp=custom&temp=reviewlist">
326<span class="m-item_list_reviewstars sp-review-stars-rank-position parts-review-stars-rank' + Math.round(Math.ceil(Number(item.revs) * 10) / 5) * 5 + '"></span>' + reviewScoreSpan + '<span class="parts-review-stars-rank-num">(' + item.revc + 'ä»¶)</span></a></div>'); 327 } 328 } 329 330 // magicalLimPrice 331 if(magicalLimPrice == 1){ 332 for (var idx = 0; idx < item.dispTagList.length; idx++) { 333 if(item.dispTagList[idx].dispTag.id == 'DC03'){ 334 var magical = '<div class="m-magical_off_wrap"><div class="m-magical_off_membertxt">ã«ã¼ãä¼å¡éå®</div><div class="m-magical_off_offtxt_wrap"><span class="m-magical_off_percentage">5</span>%OFF</div></div>'; 335 textAreaDiv.insertAdjacentHTML('beforeend', magical); 336 break; 337 } 338 } 339 } 340 341 listDiv.appendChild(textAreaDiv); 342 fragment.appendChild(listUl); 343 } 344 345 searchAreaId.appendChild(fragment); 346 } else { 347 console.log('item/search(error)'); 348 console.log(resp.data.itemSearchInfoXML.rcd); 349 } 350} 351 352//åçªæå® 353function detailItem(id, param, imageSize, soldout, priceRange, query, subImgFilter, subImg_imgSize, trialLimitedTime, magicalLimPrice) { 354 var itemAreaId = document.getElementById(id); 355 detailModule.getItemList([param], { pattern: 'p0', expiry: '10' }).then(function (respIt) { 356 var item = respIt.itL[0].itD.item; 357 358 if (respIt.itL[0].itD.itSt == 200) { 359 if (itemAreaId) { 360 //ã試ãä¾¡æ ¼ãã©ã° 361 var trialFlag = false; 362 for (var idx = 0; idx < item.dispTagList.length; idx++) { 363 item.dispTagList[idx].dispTag.id == 'DC02' ? trialFlag = true : ''; 364 } 365 366 //ãªãç 367 if (itemAreaId.getElementsByClassName('m-item_list_discount')[0]) { 368 if(trialFlag) { 369 itemAreaId.getElementsByClassName('m-item_list_discount')[0].insertAdjacentHTML('beforeend', '<p class="m-item_list_trial"><span class="trial-price">ã試ãä¾¡æ ¼</span></p>'); 370 } else if (item.dch >= 1) { 371 if (item.dch != item.dcl) { 372 var maximum = 'æå¤§'; 373 } else { 374 var maximum = ''; 375 } 376 itemAreaId.getElementsByClassName('m-item_list_discount')[0].insertAdjacentHTML('beforeend', '<span class="item-off">' + maximum + item.dch + '%OFF</span>'); 377 } else { 378 $('#' + itemAreaId.id + ' .m-item_list_discount').remove(); 379 } 380 } 381 382 //ç»å 383 if (itemAreaId.getElementsByClassName('m-item_list_photo_img')[0]) { 384 //ç»åãµã¤ãºæå® 385 if (imageSize) { 386 var imgPattern = item.mainImgList[0].imgInfo.path.replace(/_._/, '_' + imageSize + '_'); 387 } else { 388 var imgPattern = item.mainImgList[0].imgInfo.path; 389 } 390 //売åã表示 391 if (soldout) { 392 if (item.sFlg) { 393 itemAreaId.getElementsByClassName('m-item_list_photo_img')[0].insertAdjacentHTML('beforeend', '<img src="' + imgPattern + '" alt="' + item.itNm + '"><span class="item-soldout"><span>売åã</span></span>'); 394 } else { 395 itemAreaId.getElementsByClassName('m-item_list_photo_img')[0].insertAdjacentHTML('beforeend', '<img src="' + imgPattern + '" alt="' + item.itNm + '">'); 396 } 397 } else { 398 itemAreaId.getElementsByClassName('m-item_list_photo_img')[0].insertAdjacentHTML('beforeend', '<img src="' + imgPattern + '" alt="' + item.itNm + '">'); 399 } 400 } 401 402 //ãµãç»å 403 if(itemAreaId.getElementsByClassName('subImg__ul')[0]){ 404 var subImgListIndex = item.subImgList.length, 405 subImg = ''; 406 407 for (var si = 0; si < subImgListIndex; si++) { 408 //ãµãç»åæå® 409 if(subImgFilter){ 410 if(item.subImgList[si].imgInfo.path.search(subImgFilter) != -1){ 411 subImg += '<li><img src="' + item.subImgList[si].imgInfo.path + '"></li>'; 412 } 413 } else { 414 subImg += '<li><img src="' + item.subImgList[si].imgInfo.path + '"></li>'; 415 } 416 } 417 418 //ãµãç»åãµã¤ãºæå® 419 if(subImg_imgSize) { 420 subImg = subImg.replace(/_l_/g, '_' + subImg_imgSize + '_') 421 } 422 itemAreaId.getElementsByClassName('subImg__ul')[0].insertAdjacentHTML('beforeend', subImg); 423 } 424 425 //è²ç»å 426 if (itemAreaId.getElementsByClassName('m-facet_color')[0]) { 427 var colorImgIndex = item.coImgList.length, 428 colorImg = ''; 429 430 for (var b = 0; b < colorImgIndex && b <= 4; b++) { 431 colorImg += '<li><img src="' + item.coImgList[b].imgInfo.path.replace(/_._/, '_s_') + '" alt="' + item.itNm + '"></li>'; 432 } 433 434 if (item.coImgList.length >= 6) { 435 colorImg += '<li class="m-item_list_color_oversize" style="margin: 8px 0;">+' + Number(item.coImgList.length - 5) + '</li>'; 436 } 437 itemAreaId.getElementsByClassName('m-facet_color')[0].insertAdjacentHTML('beforeend', colorImg); 438 } 439 440 //ã¢ã¤ãã å 441 if (itemAreaId.getElementsByClassName('m-item_list_item_name')[0]) { 442 var itemUrl = item.itCd; 443 itemAreaId.getElementsByClassName('m-item_list_item_name')[0].insertAdjacentHTML('beforeend', '<a class="select_item" href="/item/' + itemUrl
443+ '"><span class="item-product">' + item.itNm + '</span></a>'); 444 } 445 446 //ä¾¡æ ¼ 447 if (itemAreaId.getElementsByClassName('m-item_list_price')[0]) { 448 if (item.spwl != item.spwh) { 449 var range = 'ã\xA5' + String(item.spwh).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'), 450 rangeTax = 'ã\xA5' + String(item.sph).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'), 451 rangeOnry = 'ã'; 452 } else { 453 var range = '', 454 rangeTax = '', 455 rangeOnry = ''; 456 } 457 458 //ã»ã¼ã«ã»ã¬ã¯ã¿ 459 if(trialFlag) { 460 var saleClass = ' trial_price_money'; 461 } else if (item.dch >= 1) { 462 var saleClass = ' item-sale-price'; 463 } else { 464 var saleClass = ''; 465 } 466 itemAreaId.getElementsByClassName('m-item_list_price')[0].insertAdjacentHTML('beforeend', '<span class="item-price' + saleClass + '"></sapn>') 467 468 //æééå®è¡¨ç¤º 469 var trialLimitedTimeTag = ''; 470 if(trialFlag && trialLimitedTime) { 471 trialLimitedTimeTag = '<span class="trial_price_limited"><span> </span><span>æééå®</span></span>'; 472 } 473 474 //ä¾¡æ ¼å¹ è¡¨ç¤º 475 if (priceRange) { 476 itemAreaId.getElementsByClassName('item-price')[0].insertAdjacentHTML('beforeend', '<span class="item-price-out-tax">\xA5' + String(item.spwl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + range + '</span><span class="item-price-in-tax"> (ç¨è¾¼ \xA5' + String(item.spl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + rangeTax + ')</sapn>' + trialLimitedTimeTag + '</p>'); 477 } else { 478 itemAreaId.getElementsByClassName('item-price')[0].insertAdjacentHTML('beforeend', '<span class="item-price-out-tax">\xA5<span class="item-price-min">' + String(item.spwl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span></span><span class="item-price-in-tax">(ç¨è¾¼\xA5<span class="item-price-min">' + String(item.spl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span>)' + rangeOnry + '</span>' + trialLimitedTimeTag + '</p>'); 479 } 480 481 //1ç¹ããã 482 if (itemAreaId.getElementsByClassName('m-item_list_unit_price')[0]) { 483 if (item.rmk2 && item.rmk2 != '1') { 484 itemAreaId.getElementsByClassName('m-item_list_unit_price')[0].insertAdjacentHTML('beforeend', '<span class="item-unit-price">1ç¹ããã<span class="unit-price-out-tax">\xA5' + String(Math.ceil(Number(item.spwl) / Number(item.rmk2)).toFixed()).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '</span><span class="unit-price-in-tax">(ç¨è¾¼\xA5' + String(((Number(item.spwl) / Number(item.rmk2)) * 1.1).toFixed()).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + ')</span>' + rangeOnry + '</span>'); 485 } 486 } 487 } 488 489 //ãµã¤ãº 490 if (itemAreaId.getElementsByClassName('item-size')[0]) { 491 if (item.sList) { 492 if (item.sList[0].sInfo.nm != item.sList[item.sList.length - 1].sInfo.nm) { 493 var sizeRange = ' - ' + item.sList[item.sList.length - 1].sInfo.nm; 494 } else { 495 var sizeRange = ''; 496 } 497 itemAreaId.getElementsByClassName('item-size')[0].insertAdjacentHTML('beforeend', 'ãµã¤ãºï¼' + item.sList[0].sInfo.nm + sizeRange); 498 } 499 } 500 501 //ã¢ã¤ãã èª¬ææ 502 if (itemAreaId.getElementsByClassName('m-item_list_desc')[0]) { 503 itemAreaId.getElementsByClassName('m-item_list_desc')[0].insertAdjacentHTML('beforeend', item.desc); 504 } 505 506 //è²å±é 507 if (itemAreaId.getElementsByClassName('item-color')[0]) { 508 itemAreaId.getElementsByClassName('item-color')[0].insertAdjacentHTML('beforeend', 'è²ï¼' + item.coImgList.length + 'è²å±é'); 509 } 510 511 //åå ¥è· 512 if (itemAreaId.getElementsByClassName('item_detail_icon')[0]) { 513 if (item.raFlg) { 514 itemAreaId.getElementsByClassName('item_detail_icon')[0].insertAdjacentHTML('beforeend', '<li class="icon--rearrival">åå ¥è·</li>'); 515 } 516 } 517 518 // magicalLimPrice 519 if(magicalLimPrice == 1 && itemAreaId.getElementsByClassName('m-magical_off_wrap')[0]){ 520 for (var idx = 0; idx < item.dispTagList.length; idx++) { 521 if(item.dispTagList[idx].dispTag.id == 'DC03'){ 522 itemAreaId.getElementsByClassName('m-magical_off_wrap')[0].insertAdjacentHTML('beforeend', '<div class="m-magical_off_membertxt">ã«ã¼ãä¼å¡éå®</div><div class="m-magical_off_offtxt_wrap"><span class="m-magical_off_percentage">
5225</span>%OFF</div>'); 523 break; 524 } 525 } 526 } 527 } 528 } else { 529 console.log('item/detail(error) ' + respIt.itL[0].itD.item); 530 console.log(respIt.itL[0].itD.itSt); 531 $('#' + id).children().remove(); 532 } 533 534 }).then(function () { 535 itemAreaId.setAttribute('style', 'opacity: 1;transition: .2s .2s ease-in;'); 536 537 }).catch(function (err) { 538 console.log(err); 539 }); 540} 541 542var event_faans_coord_ids = []; 543 544//ã³ã¼ãã¨ãªã¢HTMLåå¾å¾ 545function coord_detail(viewType, query, coord_area_id) { 546 var array_item_data = []; 547 548 for(var k = 0;k < coord_area_id.getElementsByClassName('coordArea__list').length;k++) { 549 var fragment_coord_detail_list = document.createDocumentFragment(); 550 551 var array_coord_detail_sku = coord_area_id.getElementsByClassName('coordArea__list')[k].getAttribute('data-coord_list_sku').split(','); 552 for(var i = 0;i < array_coord_detail_sku.length;i++) { 553 if(array_item_data.indexOf(array_coord_detail_sku[i].substring(0,12)) == -1) { 554 array_item_data.push(array_coord_detail_sku[i].substring(0,12)); 555 } 556 } 557 558 var coord_detail_wrap_div = document.createElement('div'); 559 coord_detail_wrap_div.className = 'codeitemwrap'; 560 561 for (var j = 0; j < array_coord_detail_sku.length; j++) { 562 var coord_detail_div = document.createElement('div'); 563 coord_detail_div.className = 'codeitembox codeitembox--' + array_coord_detail_sku[j].substring(0,12); 564 565 if (viewType == 'PC') { 566 coord_detail_div.style.width = '90px'; 567 } else { 568 coord_detail_div.style.width = '19.2vw'; 569 } 570 571 //ã¢ã¤ãã åã¿ã°ã®ã¿ 572 if (viewType == 'PC') { 573 var coord_item_name = '<p class="m-item_list_item-product"></p>', 574 coord_item_cwb_Pb = '108px'; 575 } else { 576 var coord_item_name = '', 577 coord_item_cwb_Pb = '22.93333vw'; 578 } 579 580 //ç»å 581 var coord_item_img_div = '<a href="/item/' + array_coord_detail_sku[j].substring(0,12) + '" class="select_item"><div style="height: 0;padding-bottom: ' + coord_item_cwb_Pb + '"><img src="/img/item/' + array_coord_detail_sku[j].substring(0,5) + '/' + array_coord_detail_sku[j].substring(0,12) + '/' + array_coord_detail_sku[j].substring(0,12) + '_m_c' + array_coord_detail_sku[j].substring(12, 15) + '.jpg" alt="" style="max-width: 100%;height: auto"></div></a>'; 582 coord_detail_div.insertAdjacentHTML('beforeend', coord_item_img_div); 583 584 //ä¾¡æ ¼ã¿ã° 585 var coord_item_price = '<p class="m-item_list_price"></p>'; 586 587 //ã¹ããã¯ã¨ãªã¢ 588 var coord_item_spec_div = '<div class="m-item_list"><div class="m-item_list_txt">' + coord_item_name + coord_item_price + '</div></div>'; 589 coord_detail_div.insertAdjacentHTML('beforeend', coord_item_spec_div); 590 coord_detail_wrap_div.appendChild(coord_detail_div); 591 } 592 593 //ã¢ã³ã¼ãã£ãªã³ 594 if (array_coord_detail_sku.length >= 3) { 595 var accodion_div = document.createElement('div'); 596 597 accodion_div.className = 'accordion'; 598 coord_detail_wrap_div.appendChild(accodion_div); 599 } 600 601 fragment_coord_detail_list.appendChild(coord_detail_wrap_div); 602 603 var coord_list_id = coord_area_id.getElementsByClassName('coordArea__list')[k].classList[0], 604 coord_list = coord_area_id.getElementsByClassName(coord_list_id)[0]; 605 606 coord_list.appendChild(fragment_coord_detail_list); 607 } 608 return array_item_data; 609} 610 611//ã³ã¼ãã¨ãªã¢ã¹ããã¯æ å ± 612function item_detail_spec(id, result_array_item_data) { 613 detailModule.getItemList(result_array_item_data, { pattern: 'p2', expiry: '10' }).then(function (result_item_data) { 614 if(result_item_data.rcd == '200') { 615 for(var l = 0;l < result_item_data.itL.length;l++) { 616 if(result_item_data.itL[l].itD.itSt == '200') { 617 //ã¢ã¤ãã å 618 if (viewType == 'PC') { 619 $('#' + id + ' .codeitembox--' + result_item_data.itL[l].itD.item.itCd + ' .m-item_list_item-product').html(result_item_data.itL[l].itD.item.itNm); 620 } 621 622 //alt 623 $('#' + id + ' .codeitembox--' + result_item_data.itL[l].itD.item.itCd + ' img').attr('alt',result_item_data.itL[l].itD.item.itNm); 624 625 //ä¾¡æ ¼ 626 if (result_item_data.itL[l].itD.item.spl != result_item_data.itL[l].itD.item.sph) { 627 price_rangeOnry = 'ã'; 628 } else { 629 price_rangeOnry = ''; 630 } 631 632 //ã»ã¼ã«ã»ã¬ã¯ã¿ 633 if (result_item_data.itL[l].itD.item.dch >= 1) { 634 var sale_class = ' item-sale-price'; 635 } else { 636 var sale_class = ''; 637 } 638 $('#' + id + ' .codeitembox--' + result_item_data.itL[l].itD.item.itCd + ' .m-item_list_price').html('<span class="item-price' + sale_class + '">\xA5' + String(result_item_data.itL[l].itD.item.spl).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '(ç¨è¾¼)' + price_rangeOnry + '</span>'); 639 } else { 640 console.log('item_detail/err: ' + result_array_item_data[l]); 641 $('#' + id + ' .codeitembox--' + result_array_item_data[l]).remove(); 642 } 643 } 644 } else { 645 console.log('item_json/err: ' + result_item_data); 646 } 647 }).catch(function (err) { 648 console.log(err); 649 }); 650} 651 652// faans coord 653function faansSearch(viewType, id, param, index, favorite, detailOn, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type) { 654 // fall back for first load in viewport wait for the faans API then insert detail 655 if(NoObserver == 1){ 656 if(detailOn == 1){ 657 var count = 0; 658 var check_detail = function () { 659 if (count < 10) { 660 if($("#" + id + "").find(".codeitemwrap").length >= 1){ 661 clearInterval(setIv); 662 }else{
663 faansSearchDetail(viewType, id, query); 664 count++; 665 } 666 } else { 667 clearInterval(setIv); 668 } 669 } 670 var setIv = setInterval(check_detail, 1000); 671 } 672 }else{ 673 // call for faans API 674 getFaans(viewType, id, param, index, favorite, detailOn, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type); 675 } 676} 677 678// get faans raw data 679async function getFaansRawData(param, index) { 680 var response = await axios.get('https://connect.wear.jp/connect/v1/coordinates/search?company_id=8176' + param + "&pagesize=" + index) 681 .catch(function (err) { 682 // API faans Error 683 console.log("Fanns Raw Data API Error : ", err); 684 }); 685 return response; 686} 687 688// get faans 689var coordFavDataObject = {}; 690function getFaans(viewType, id, param, index, favorite, detailOn, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type){ 691 if(param.charAt(0) != "&"){ 692 param += "&" + param; 693 } 694 695 if(sort_type == ""){ 696 sort_type = "coordinate_updated_at"; 697 } 698 699 axios.get('https://connect.wear.jp/connect/v1/coordinates/search?company_id=8176' + param + "&pagesize=" + index + "&sort_type=" + sort_type).then(function (result) { 700 if (result) { 701 if (result["data"]["coordinates"].length > 0) { 702 var ctr = '<ul class="coordArea__ul' + ulClassName + '" style="opacity:0">'; 703 704 var ctr_items = []; 705 var observer_event_faans_coord_ids = []; 706 707 result["data"]["coordinates"].forEach(function (coordItem, coordCount) { 708 coordFavDataObject[id] = result["data"]["coordinates"]; 709 710 //ãæ°ã«å ¥ãç»é² 711 if(favorite == 1){ 712 if(NoObserver == 1) { 713 if(event_faans_coord_ids.indexOf(coordItem.id) == -1) { 714 event_faans_coord_ids.push(coordItem.id); 715 } 716 } else { 717 if(observer_event_faans_coord_ids.indexOf(coordItem.id) == -1) { 718 observer_event_faans_coord_ids.push(coordItem.id); 719 } 720 } 721 } 722 723 var ctr_sku = []; 724 var ctr_temp = []; 725 var ctr_item = ""; 726 727 coordItem.coordinate_items.forEach(function (item) { 728 if(!(item.item_detail == null)){ 729 if((item.item_detail.sku_code != null) && (ctr_sku.indexOf(item.item_detail.sku_code) == -1)){ 730 ctr_sku.push(item.item_detail.sku_code); 731 } 732 } 733 }); 734 735 ctr_sku = jQuery.grep(ctr_sku, function(n, i){ 736 return (n !== "" && n != null); 737 }); 738 739 ctr_item += '<li class="cdId_' + coordItem.id + ' coordArea__list' + liClassName + '" data-coord_list_sku="' + ctr_sku.join(",") + '">'; 740 ctr_item += '<div class="coordImg">'; 741 ctr_item += '<a href="/coordinate/detail/?coordId=' + coordItem.id + '">'; 742 743 if(imageSize == "L" || imageSize == "l"){ 744 ctr_item += '<div style="height: 0;padding-bottom: 133.43%;"><img src="'+ coordItem.image.url_500 +'" max-width="100%" height="auto"></div>'; 745 }else{ 746 ctr_item += '<div style="height: 0;padding-bottom: 133.43%;"><img src="'+ coordItem.image.url_320 +'" max-width="100%" height="auto"></div>'; 747 } 748 749 ctr_item += '</a>'; 750 751 if(favorite == 1){ 752 ctr_item += '<p class="coord_fav">'; 753 ctr_item += '<button data-cid="' + coordItem.id + '" type="button" style="display: none;" class="m-btn-icon coord-fav-off" onclick="nissenCoFavApiModule.addFavoriteCoordinate($(this), coordFavDataObject[\'' + id + '\'][' + coordCount + ']);"></button>'; 754 ctr_item += '<button data-cid="' + coordItem.id + '" type="button" style="display: none;" class="m-btn-icon coord-fav-on" onclick="nissenCoFavApiModule.delFavoriteCoordinate($(this),true);"></button>'; 755 ctr_item += '</p>'; 756 } 757 758 ctr_item += '</div>'; 759 760 if(menberImage == 1 || nickname == 1 || height == 1){ 761 ctr_item +='<a href="/coordinate/detail/?coordId=' + coordItem.id + '" class="staff_data">'; 762 if(menberImage == 1){ 763 ctr_item += '<img src="' + coordItem.member.image.url_200 + '">'; 764 } 765 if(nickname == 1){ 766 ctr_item += '<p>' + coordItem.member.nick_name + '</p>'; 767 } 768 if(height == 1){ 769 ctr_item += '<p>' + coordItem.height + 'cm</p>'; 770 } 771 ctr_item += '</a>'; 772 } 773 774 ctr_item += '</li>'; 775 776 ctr_temp.push(param.indexOf(coordItem.id)); 777 ctr_temp.push(ctr_item); 778 ctr_items.push(ctr_temp); 779 }); 780 781 ctr_items = ctr_items.sort(function(a, b){return a[0]-b[0]});
782 ctr_items.forEach(function (item) { 783 ctr += item[1]; 784 }); 785 786 ctr += '</ul>'; 787 788 $("#" + id).append(ctr); 789 790 if(NoObserver != 1 && detailOn == 1){ 791 faansSearchDetail(viewType, id, query); 792 } 793 794 if(window.nissenCoFavApiModule !== undefined && observer_event_faans_coord_ids.length > 0) { 795 nissenCoFavApiModule.checkFavoriteCoordinate(observer_event_faans_coord_ids.join(",")); 796 } 797 798 if(document.getElementById(id).getElementsByClassName('coordArea__ul')[0]) { 799 document.getElementById(id).getElementsByClassName('coordArea__ul')[0].setAttribute('style', 'opacity: 1;transition: .2s .2s ease-in;'); 800 } 801 }else{ 802 // result data coordinates are empty 803 console.log("Faans result data coordinates are empty"); 804 $("#" + id).append('<div class="coordArea__noitem"><span class="coordArea__noitem-text">ã³ã¼ãã£ãã¼ãã®æ²è¼ãçµäºãããã¾ãã</span></div>'); 805 } 806 }else{ 807 // unexpected result in Faans API 808 console.log("unexpected result in Faans API"); 809 } 810 }).catch(function (err) { 811 // API faans Error 812 console.log("Fanns API Error : ", err); 813 }); 814} 815 816function faansSearchDetail(viewType, id, query){ 817 var coord_area_id = document.getElementById(id); 818 var result_array_item_data = faans_coord_detail(viewType, query, coord_area_id); 819 item_detail_spec(id, result_array_item_data); 820 821 $('.coordArea__ul .accordion').on('click', function () { 822 $(this).siblings().addClass('menuopen'); 823 }); 824}; 825 826//FAANS ã³ã¼ãã¨ãªã¢HTMLåå¾å¾ 827function faans_coord_detail(viewType, query, coord_area_id) { 828 var array_item_data = []; 829 830 for(var k = 0;k < coord_area_id.getElementsByClassName('coordArea__list').length;k++) { 831 var fragment_coord_detail_list = document.createDocumentFragment(); 832 833 var array_coord_detail_sku = coord_area_id.getElementsByClassName('coordArea__list')[k].getAttribute('data-coord_list_sku').split(','); 834 for(var i = 0;i < array_coord_detail_sku.length;i++) { 835 if(array_item_data.indexOf(array_coord_detail_sku[i].substring(0,12)) == -1) { 836 array_item_data.push(array_coord_detail_sku[i].substring(0,12)); 837 } 838 } 839 840 var coord_detail_wrap_div = document.createElement('div'); 841 coord_detail_wrap_div.className = 'codeitemwrap'; 842 843 if(!(array_coord_detail_sku.length == 1 && array_coord_detail_sku[0] =="")){ 844 for (var j = 0; j < array_coord_detail_sku.length; j++) { 845 var coord_detail_div = document.createElement('div'); 846 coord_detail_div.className = 'codeitembox codeitembox--' + array_coord_detail_sku[j].substring(0,12); 847 848 if (viewType == 'PC') { 849 coord_detail_div.style.width = '90px'; 850 } else { 851 coord_detail_div.style.width = '19.2vw'; 852 } 853 854 //ã¢ã¤ãã åã¿ã°ã®ã¿ 855 if (viewType == 'PC') { 856 var coord_item_name = '<p class="m-item_list_item-product"></p>', 857 coord_item_cwb_Pb = '108px'; 858 } else { 859 var coord_item_name = '', 860 coord_item_cwb_Pb = '22.93333vw'; 861 } 862 863 //ç»å 864 var coord_item_img_div = '<a href="/item/' + array_coord_detail_sku[j].substring(0,12) + '" class="select_item"><div style="height: 0;padding-bottom: ' + coord_item_cwb_Pb + '"><img src="/img/item/' + array_coord_detail_sku[j].substring(0,5) + '/' + array_coord_detail_sku[j].substring(0,12) + '/' + array_coord_detail_sku[j].substring(0,12) + '_m_c' + array_coord_detail_sku[j].substring(12, 15) + '.jpg" alt="" style="max-width: 100%;height: auto"></div></a>'; 865 coord_detail_div.insertAdjacentHTML('beforeend', coord_item_img_div); 866 867 //ä¾¡æ ¼ã¿ã° 868 var coord_item_price = '<p class="m-item_list_price"></p>'; 869 870 //ã¹ããã¯ã¨ãªã¢ 871 var coord_item_spec_div = '<div class="m-item_list"><div class="m-item_list_txt">' + coord_item_name + coord_item_price + '</div></div>'; 872 coord_detail_div.insertAdjacentHTML('beforeend', coord_item_spec_div); 873 coord_detail_wrap_div.appendChild(coord_detail_div); 874 } 875 } 876 877 //ã¢ã³ã¼ãã£ãªã³ 878 if (array_coord_detail_sku.length >= 3) { 879 var accodion_div = document.createElement('div'); 880 881 accodion_div.className = 'accordion'; 882 coord_detail_wrap_div.appendChild(accodion_div); 883 } 884
885 fragment_coord_detail_list.appendChild(coord_detail_wrap_div); 886 887 var coord_list_id = coord_area_id.getElementsByClassName('coordArea__list')[k].classList[0], 888 coord_list = coord_area_id.getElementsByClassName(coord_list_id)[0]; 889 890 coord_list.appendChild(fragment_coord_detail_list); 891 } 892 return array_item_data; 893} 894 895//faans ãæ°ã«å ¥ã表示 896window.addEventListener('load', function() { 897 if(window.nissenCoFavApiModule !== undefined && event_faans_coord_ids.length > 0) { 898 var slice_value = 100; 899 var loop_index = Math.ceil(event_faans_coord_ids.length / slice_value); 900 var slice_start = 0; 901 var slice_end = 100; 902 903 for (var i = 0; i < loop_index; i++) { 904 nissenCoFavApiModule.checkFavoriteCoordinate(event_faans_coord_ids.slice(slice_start, slice_end).join(",")); 905 slice_start += slice_value; 906 slice_end += slice_value; 907 } 908 } 909}); 910 911//åã¢ã¤ãã ãã¼ãé å»¶èªã¿è¾¼ã¿ 912function itemParts(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, detailOn, query, subImg_imgSize, subImgFilter, trialLimitedTime, NoObserver, menberImage, nickname, height, ulClassName, liClassName, parsonalize, sort_type, magicalLimPrice) { 913 var flag = true, 914 element = document.getElementById(id); 915 916 if (element) { 917 if (('IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'isIntersecting' in window.IntersectionObserverEntry.prototype) || ('IntersectionObserver' in window && intersectionObserver === true)) { 918 var itemPartsObserver = new IntersectionObserver(function (entries, observer) { 919 if (flag) { 920 entries.forEach(function (entry) { 921 if (entry.isIntersecting) { 922 if(NoObserver == 1 && detailOn == 1 && id.indexOf('faans') != -1){ 923 selection(); 924 if($("#" + id + "").find(".codeitemwrap").length >= 1 || $("#" + id + "").find(".coordArea__noitem").length >= 1){ 925 flag = false; 926 } 927 }else{ 928 selection(); 929 flag = false; 930 } 931 } 932 }); 933 } 934 }); 935 itemPartsObserver.observe(element); 936 } else { 937 window.addEventListener('scroll',function () { 938 if (flag) { 939 var offsetTop = Math.floor(element.getBoundingClientRect().top), 940 position = window.innerHeight; 941 942 if (offsetTop < position) { 943 if(parsonalize == 1 && NoObserver == 1){ 944 flag = false; 945 }else if(NoObserver == 1 && detailOn == 1 && id.indexOf('faans') != -1){ 946 selection(); 947 if($("#" + id + "").find(".codeitemwrap").length >= 1 || $("#" + id + "").find(".coordArea__noitem").length >= 1){ 948 flag = false; 949 } 950 }else{ 951 selection(); 952 flag = false; 953 } 954 } 955 } 956 },{ passive: true },false); 957 } 958 959 // display faans without lazyload 960 if(parsonalize == 1 && NoObserver == 1){ 961 searchItemParsonalize(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 962 }else if (id.indexOf('faans') != -1 && NoObserver == 1) { 963 if (id.indexOf('faansDetail') != -1) { 964 getFaans(viewType, id, param, index, 1, 1, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type); 965 }else{ 966 getFaans(viewType, id, param, index, favorite, detailOn, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type); 967 } 968 } 969 } else { 970 console.log('idãè¨å®ããã¦ã¾ãã:' + id); 971 flag = false; 972 } 973 974 function selection(){ 975 if (parsonalize == 1 && NoObserver != 1) { 976 searchItemParsonalize(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 977 } else if ((param.indexOf('=') != -1 || !param) && index && id.indexOf('faans') == -1 && parsonalize != 1) { 978 searchItem(viewType, id, param, index, favorite, stock, quickview, rank, itemImage, imageSize, soldout, colorImage, itemName, price, priceRange, discount, discountPosition, unitPrice, sizeText, colorText, icon, review, query, trialLimitedTime, magicalLimPrice); 979 } else if (param.indexOf('=') == -1 && id.indexOf('faans') == -1 && parsonalize != 1) { 980 detailItem(id, param, imageSize, soldout, priceRange, query, subImgFilter, subImg_imgSize, tri
980alLimitedTime, magicalLimPrice); 981 } else if (id.indexOf('faans') != -1) { 982 if (id.indexOf('faansDetail') != -1) { 983 faansSearch(viewType, id, param, index, 1, 1, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type); 984 }else{ 985 faansSearch(viewType, id, param, index, favorite, detailOn, query, NoObserver, menberImage, nickname, height, ulClassName, liClassName, imageSize, sort_type); 986 } 987 } 988 } 989} 990 991//ã«ãã´ãªããæ¢ã 992function setCategory(ele, flag, param, num, query) { 993 function acd() { 994 if (ele.className.indexOf('menuopen') != -1) { 995 ele.classList.remove('menuopen') 996 $(ele.getAttribute('rel')).slideUp(250); 997 } else { 998 ele.classList.add('menuopen'); 999 $(ele.getAttribute('rel')).slideDown(250); 1000 } 1001 1002 $('.categoryArea .accordion').each(function () { 1003 if ($(this).attr('id') != ele.id) { 1004 if ($(this).hasClass('menuopen')) { 1005 $($(this).attr('rel')).slideUp(250); 1006 $(this).removeClass('menuopen'); 1007 } 1008 } 1009 }); 1010 } 1011 1012 if (flag && ele) {
1013 $("#" + ele.id).css('pointerEvents', 'none'); 1014 axios.get('/api/v1/item/search/json?' + param).then(function (respCategory) { 1015 if (respCategory.data.itemSearchInfoXML.rcd == 200) { 1016 var categoryList = respCategory.data.itemSearchInfoXML.itemSearchInfo.facet.itcaFcList, 1017 categoryListLength = categoryList.length, 1018 fragment = document.createDocumentFragment(); 1019 1020 for (var i = 0; i < categoryListLength; i++) { 1021 var list = document.createElement('li'); 1022 list.className = 'facet-parent'; 1023 1024 if(param.indexOf('&dl=1') != -1) { 1025 var param_opti_dlRep = param.replace('&dl=1',''); 1026 } else if (param.indexOf('dl=1') != -1) { 1027 var param_opti_dlRep = param.replace('dl=1',''); 1028 } else { 1029 var param_opti_dlRep = param; 1030 } 1031 1032 if(param_opti_dlRep.slice(0,1) == '&') { 1033 var param_opti_and = param_opti_dlRep.slice(1); 1034 } else { 1035 var param_opti_and = param_opti_dlRep; 1036 } 1037 1038 var href = '<a href="category/' + categoryList[i].f.id + '/?' + param_opti_and + '">' + categoryList[i].f.nm + '(' + categoryList[i].f.hit + ')' + '</a>' 1039 list.insertAdjacentHTML('beforeend', href) 1040 fragment.appendChild(list) 1041 } 1042 1043 document.getElementById('list_cat0' + num).appendChild(fragment); 1044 ele.setAttribute("onclick", "setCategory(this, false,'','')"); 1045 acd(); 1046 1047 setTimeout(function () { 1048 $("#" + ele.id).css('pointerEvents', 'auto'); 1049 }, 300); 1050 } else { 1051 console.log('category/search(error)'); 1052 console.log(respCategory.data.itemSearchInfoXML.rcd); 1053 } 1054 1055 }).catch(function (err) { 1056 console.log(err); 1057 }); 1058 } else { 1059 acd() 1060 } 1061} 1062 1063//nofollowå¯¾å¿ 1064function nofollow(selector) { 1065 $(selector).each(function () { 1066 var href = $(this).attr('href'); 1067 var commaCount = String(href).match(/\,/g) == null ? [] : String(href).match(/\,/g); 1068 var andCount = String(href).match(/\&/g) == null ? [] : String(href).match(/\&/g); 1069 1070 //ç¢ºèª 1071 if (String(href).indexOf('/item/') == -1 && (commaCount.length >= 2 || andCount.length >= 3)) { 1072 $(this)[0].setAttribute('rel', 'nofollow'); 1073 } 1074 }); 1075}
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.