"; }else if (value.from_vipon_editor){ html += "
Vipon Editor" }else if(value.is_from_admin==1){ html += "
Vipon Editor"; }else{ html +="
"+value.from_nickname; } html += "
\n" + "
replied to
\n" ; if('1696596'==value.to_uid){ html += "
"; }else if (value.to_vipon_editor){ html += "
Vipon Editor" }else if (value.is_to_admin==1){ html += "
Vipon Editor"; }else{ html += "
"+value.to_nickname; } html +="
\n" + "
\n" + "
" + "
"+value.create_time+"
\n" + "
\n" + "
\n" + "
"+value.content+"
\n" + "
\n" + "
\n" ; let imgArray = JSON.parse(value.content_img); if(imgArray[0]&&imgArray.length>0){ for(let i=0;i
\n" ; } } html += "
\n" + "
- \n" + " \n" + "
- \n" + " \n" + " \n" + " reply\n" + " \n" + " \n" ; if(value.thumb_type==0){ html+="
- \n" + " \n" + " \n" + " "+value.like_num+"\n" + " \n" + " \n" + "
- \n" + " \n" + " \n" + " "+value.down_num+"\n" + " \n" + " \n" ; }else if(value.thumb_type==1){ html+="
- \n" + " \n" + " \n" + " "+value.like_num+"\n" + " \n" + " \n" + "
- \n" + " \n" + " \n" + " "+value.down_num+"\n" + " \n" + " \n" ; }else if(value.thumb_type==2){ html+="
- \n" + " \n" + " \n" + " "+value.like_num+"\n" + " \n" + " \n" + "
- \n" + " \n" + " \n" + " "+value.down_num+"\n" + " \n" + " \n" ; } html+="
\n" + "
\n" + "
\n" + "
\n" + "
\n" + " \n" + "
\n" + "
\n" + "
\n" + " \n" + " \n" + " \n" + "
\n" + " 78%\n" + " uploading\n" + "
\n" + " \n" + "
\n" + "
\n" + "
\n" + "
\n" + " \n" + "
\n" + "
\n" + "
\n" + "
\n" + "
\n" + "
\n" + "
" return html; } $("#lowerProduct .btn-info").on('click',function () { if($('#lowerProduct .list input:checked').length<1){ $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html('Report reason can not be empty!'); titleModel(true); return; } let datas={ id:"10445622", report_group:$('#lowerProduct .list input:checked').next().html() }; if($('#lowerProduct .list input:checked').next().html()=="Other"){ if($.trim($('#lowerProduct textarea').val())==''){ $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html('Report reason can not be empty!'); titleModel(true); return; } datas.report_reason=$('#lowerProduct textarea').val(); } $(".lower-product").css('display','none'); $("#lowerProduct").modal("hide"); $.ajax({ url:"/product/shelves", type:"post", data:datas, success(data){ }, error(err){ } }) }) //管理员修改商品信息提交↓↓↓ var adminUpdateUrl="/product/admin-update-info-new"; //修改商品原价 $("#updateOriginPrice .btn-info").on('click',function () { $("#updateOriginPrice").modal("hide"); if($('#new-OriginPrice').val()<=0){ alert('请填写正确的数据'); return; } $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", type: 1, data: { price: $('#new-OriginPrice').val() } }, success(data){ if(data.code===1) { window.location.reload(true); }else { alert(data.msg); } }, error(){ alert(data.msg); } }) }) //修改商品折后价 $("#updateDiscountPrice .btn-info").on('click',function () { $("#updateDiscountPrice").modal("hide"); if($('#new-DiscountPrice').val()<=0){ alert('请填写正确的数据'); return; } $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", type: 2, data: { final_price: $('#new-DiscountPrice').val() } }, success(data){ if(data.code===1) { window.location.reload(true); }else{ alert(data.msg); } }, error(){ alert(data.msg); } }) }) //修改code折扣力度(vipon站外折扣力度) $("#updateDiscountPercent .btn-info").on('click',function () { $("#updateDiscountPercent").modal("hide"); $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", user_id: '360646', type: 3, data: { discount_type:$('#choices').val(), discount:$('#amz_discountval').val() } }, success(data){ if (data.code===1) { window.location.reload(true); }else { alert(data.msg); } }, error(){ alert(data.msg); } }) }) //修改商品叠加亚马逊站内折扣力度 $("#updateDiscountPercentFusion .btn-info").on('click',function () { $("#updateDiscountPercentFusion").modal("hide"); $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", user_id: '360646', type: 4, data: { amz_discount_type:$('#choices_new').val(), amz_discount:$('#amz_discountval_new').val() } }, success(data){ if (data.code===1) { window.location.reload(true); }else { alert(data.msg); } }, error(){ alert(data.msg); } }) }) //修改商品发货方式和运费 $("#updateDelivery .btn-info").on('click',function () { $("#updateDelivery").modal("hide"); if(($('#new-delivery').val()=='FBA'&&$('#new-shipping').val()>0)|| ($('#new-shipping').val()<0)){ alert('请填写正确的数据'); return; } $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", type: 5, data: { fba: $('#new-delivery').val(), shipping: $('#new-shipping').val(), } }, success(data){ if (data.code===1) { window.location.reload(true); }else { alert(data.msg); } }, error(){ alert(data.msg); } }) }) //修改商品变体信息 $("#updateVariants .btn-info").on('click',function () { $("#updateVariants").modal("hide"); let checkvariantsList=[]; $('#variantsList-id').each(function () { checkvariantsList=$(this).val() }) $.ajax({ url:adminUpdateUrl, type:"post", data:{ id:"10445622", type: 6, data: { variation_type: $('#new-variants').val(), variation_list:checkvariantsList } }, success(data){ if (data.code===1) { window.location.reload(true); }else { alert(data.msg); } }, error(){ alert(data.msg); } }) }) //管理员修改商品信息提交↑↑↑ $('.affiliate button').on('click',function (e) { e.preventDefault(); $('.affiliate').hide() }) $('.report-sumbit').on('click',function () { console.log(1); if (to_verify_email()) { if($('.collapse-body input:checked').length<1){ $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html('Report reason can not be empty!'); titleModel(true); return; } let data = { product_id:"10445622", report_group:$('.collapse-body input:checked').next().html() } if($('.collapse-body input:checked').next().html()=="Other"){ if($.trim($('.collapse-body textarea').val())==''){ $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html('Report reason can not be empty!'); titleModel(true); return; } data.report_reason=$('.collapse-body textarea').val(); } let reportimage = [] upload_img.imglist.forEach((x)=>{ reportimage.push(x.url) }) console.log(reportimage); data.report_image = reportimage $(this).attr('disabled','disabled'); let This=this; $.ajax({ url: "/report/handle", method: 'POST', cache: false, dataType:"json", data:data, success:function (data) { $(This).removeAttr('disabled'); $('#reportDropDown').collapse('hide'); $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html(data.msg); titleModel(true); if(data.code==0||data.code==200){ $('[href="#reportDropDown"]').removeAttr('data-toggle') .on('click',function (e) { e.preventDefault(); $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html('You have already reported'); titleModel(true); }) } } }) } }) $('.shop .btn').on('click', function () { console.log(2); if (to_verify_email()) { let url = ''; if ($.trim($(this).html()) == 'Follow') { url = "https://www.myvipon.com/shopper/my/fans-add"; } else { $('#followed').modal('show'); return; } $(this).attr('disabled', 'disabled'); let This = this; $.ajax({ url: url, type: 'post', dataType: "json", data: {user_id: 360646}, success: function (data) { $(This).removeAttr('disabled'); if (data.code == 200) { if ($.trim($(This).html()) == 'Follow') { $(This).html('Following').addClass('followed') } else { $(This).html('Follow').removeClass('followed') } } $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html(data.message); titleModel(true); }, error: function () { $(This).removeAttr('disabled'); } }) } }) $('#followed .modal-body div > button:last-child').on('click',function () { let url = "https://www.myvipon.com/shopper/my/fans-del"; $(this).attr('disabled', 'disabled'); let This = this; $.ajax({ url: url, type: 'post', dataType: "json", data: {user_id: 360646}, success: function (data) { $(This).removeAttr('disabled'); $('#followed').modal('hide') if (data.code == 200) { $('.shop .btn').html('Follow').removeClass('followed'); } $('#favoritesTitle .thumb-title').css('display','block'); $('#favoritesTitle .thumb-title').html(data.message); titleModel(true); }, error: function () { $(This).removeAttr('disabled'); } }) }) $('.list-img li').on('click',function () { if($(this).find('video').length==0){ $('.left-show-img video').hide(); $('.left-show-img video ').attr('src',''); $('.left-show-img>img').show(); $('.left-show-img>img').attr('src',$(this).find('img').attr('src')); }else{ $('.left-show-img>img').hide(); $('.left-show-img video').show(); $('.left-show-img video ').attr('src',$(this).find('source').attr('src')); } }) $('.product-video video').on('error',function () { $(this).next().css('display','flex'); }) $('.own-description span').on('click',function () { if($(this).parent().hasClass('hide-own-description')){ $(this).parent().removeClass('hide-own-description'); }else{ $(this).parent().addClass('hide-own-description'); } }) var items =[]; var observer = new IntersectionObserver(entries => { entries.forEach((item, index) => { if (item.intersectionRatio > 0.8) { let getpro_id ={ product_id: item.target.getAttribute('data-id'), module: item.target.getAttribute('data-module'), search: $("#header .head-search .search-input input").val(), amz_cat_id: item.target.getAttribute('data-amz_cat_id') } items.push(getpro_id); } }); // observer.disconnect() // 统计到就不在需要继续观察了 }, { threshold: [0.8] // 只要展现面积达到 100% 的元素 }); $(window).scroll(function(){ let newArr = Array.from(document.querySelectorAll(".box-contain")); newArr.forEach(item => observer.observe(item)); }); setInterval(()=>{ if (items.length != 0) { $.ajax({ url:goodsurl, type:'post', dataType:'json', headers: { 'Content-Type':"application/json;charset=UTF-8" }, data:JSON.stringify({ "product_map" : items, "reviewer_id": 0, "ip": "141.147.67.156" }), success:function (data) { items = [] }, error:function (err) {} }); } },3000)