
Full Cover Camera Lens Protection For IPhone 15 Plus 12 14 16 Pro Max 13Mini Tempered Glass Metal Lens Protector Film Back Cover
'; skuObjList.map(function(item,index){ myhtml+=''+item.title+''; item.skulist.map(function(item2,index2){ item2 = item2.replace(""", "@"); myhtml+=''+item2+''; }); myhtml+=''; }); myhtml+=''; $('#popSkuCon').length>0&&$('.showSweetAlert #popSkuCon').remove(); $('.showSweetAlert .pop2Smt .popContent').prepend(myhtml); } //选择sku的全选按钮事件 $('body').on('click','#popSkuCon label',function(e){ var tarObj=$(e.target); if (tarObj.is('input')) { if (tarObj.parent().parent().is('p')) { if (tarObj.parent().hasClass('all')) { //全选 var childInput=tarObj.closest('div').siblings().find('input'); tarObj.is(':checked')?childInput.prop('checked','checked'):childInput.removeAttr('checked'); } else { //子类型全选 var childInput=tarObj.closest('div').find('ul input'); tarObj.is(':checked')?childInput.prop('checked','checked'):childInput.removeAttr('checked'); } } if (!tarObj.is(':checked')) { tarObj.closest('#popSkuCon').children("div").eq(0).find("input").removeAttr("checked"); if (tarObj.parent().parent().is("li")) { tarObj.closest('ul').siblings("p").find("input").removeAttr("checked"); } } } }); //选择区域定价国家的全选按钮事件 $('body').on('click','#popCountry label',function(e){ var tarObj=$(e.target); if (tarObj.is('input')) { if (tarObj.parent().hasClass('all')) { //全选 var childInput=tarObj.closest('div').find('ul').find('input'); tarObj.is(':checked')?childInput.prop('checked','checked'):childInput.removeAttr('checked'); } if (!tarObj.is(':checked')) { tarObj.closest('div').children("p").find("input").removeAttr("checked"); } } }); function getSelectSkus(){ // 获取弾层中所有选择的SKU var selectSkulist=[]; if ($('.showSweetAlert #popSkuCon > div').eq(0).find("input").is(':checked')) { return selectSkulist; } $('.showSweetAlert #popSkuCon > div').map(function(index,item){ if(index>0){ var skulist=[];//速卖通原始名称,用于填充定价 var skuNameList=[];//重命名后的名称,用于保持产品 $(item).find('li').map(function(index2,item2){ if($(item2).find('input').is(':checked')){ var itemValue = $(item2).find('input').val(); skulist.push(itemValue.replace("@", """)); skuNameList.push($(item2).text()); } }); selectSkulist.push({ title:$(item).find('p label').text(), skulist:skulist, skuNameList:skuNameList }); } }); return selectSkulist; } $('body').on('click','#btnpop2cancel,#pop2cancelSmt',function(){ $('.showSweetAlert .pop2con,.showSweetAlert .pop2freeNotice,.showSweetAlert .pop2Smt,.showSweetAlert .colorNotice,.showSweetAlert .pop2overlay').hide(); }); $('body').on('click','#btnpop2ok',function(e){ hideHint(); if($(e.target).attr('data-type')!='error'){ // 如果成功,就关闭顶级弾层 $('.showSweetAlert').hide(); $('.sweet-overlay').hide(); var currentUrl = location.href; if (currentUrl.indexOf("mangoerp.com") > -1) { $('body').attr('class','no-skin modal-open'); } else { $('body').attr('class','aside-expanded-true pace-done'); } } }); function showHint(type, msg) { if (type == "error") $('.showSweetAlert .pop2Hint .sa-error').show(); else $('.showSweetAlert .pop2Hint .sa-success').show(); $('.showSweetAlert .pop2Hint p').html(msg); $('.showSweetAlert .pop2Hint,.showSweetAlert .pop2overlay').show(); if (type == "sync") { type = "error"; //为了同步模板下拉框成功后,不关闭计算器弹框 } $('.showSweetAlert .pop2Hint #btnpop2ok').attr('data-type',type); } function hideHint() { $('.showSweetAlert .pop2Hint .sa-error').hide(); $('.showSweetAlert .pop2Hint .sa-success').hide(); $('.showSweetAlert .pop2Hint,.showSweetAlert .pop2overlay').hide(); $('.showSweetAlert .pop2con,.showSweetAlert .pop2Smt,.showSweetAlert .pop2overlay').hide(); } //下拉框切换运费模板事件 $('body').on('change', '#selectRegionPercentTemplate', function () { var templateId = $(this).children('option:selected').val(); if (templateId == "") { for (var i = 2; i < tableRowSize; i++) { percentSheet.setRowData(i, ["","","","","","","","","","","","","","","","",""]); } return; } var param={ method:'ajax', params: { url: domain + '/seller/getTeamplateById?templateId=' + templateId, xhrFields: {withCredentials: true} } }; chrome.runtime.sendMessage(param,function(t){ ($('.showSweetAlert #percentSheet')[0]).jexcel = null; $('.showSweetAlert #percentSheet').html(""); percentSheet = jexcel($('.showSweetAlert #percentSheet')[0], regionOptions(regionDataPercen)); if (!t.message && t.result) { //初始化海外仓下拉框 initOverseasCountries(t.result, percentSheet); logisticsDiscount = t.result.logisticsDiscount; var template = JSON.parse(t.result.data); template.type = t.result.templateType; template.shippingCountry = "CN"; template.volumeSize = t.result.volumeSize; templateData = template; initOptions(template); jisuan(template.fee ? template.fee : "0"); $($('.showSweetAlert #nav span')[0]).click(); //当有体积时,显示体积table if (templateData.volumeSize) { var threeSide = templateData.volumeSize.split("x"); $(".showSweetAlert #txtLength").val(threeSide[0]); $(".showSweetAlert #txtWidth").val(threeSide[1]); $(".showSweetAlert #txtHeight").val(threeSide[2]); $(".showSweetAlert #divVolumeSize").css("display", "flex"); } else { $(".showSweetAlert #divVolumeSize").hide(); } //只有有包邮国家时才需要初始化两个table if (template.fee) { $('.showSweetAlert #nav').show(); initDataTable(template); } else { $('.showSweetAlert #nav').hide(); } hotCountries = sortCountrys(template.countrys); for (var j = 0; j < (tableRowSize - 2); j++) { var rowData = createLogistis(j + 3,"percent", "CN"); percentSheet.setRowData(j + 2, rowData); } //执行无忧集运判断逻辑 consolidationFunction(); //区域零售价红色自动纠正 autoCorrectLowestPrice(); //计算折扣上限 resetDiscountLimit(); //不符合网规时标黄 changeValueYellow(); } else { swal("", t.message, "error"); } }); }); //product_save button 定价计算器上的产品管理保存按钮 window.isGetRetailOK = false;//标记零售价是否获取完成 window.isGetRegionOK = false;//标记区域定价是否获取完成 function saveProduct() { $("#saveProductBtn").prop("disabled", true); var currentUrls = location.search ? location.search.substr(1) : ""; if (currentUrls) { $('.sweetAlert').removeClass('zndjpop').removeClass('qydjlre').removeClass('qydjlrl').removeClass('diy100'); var baseSkuDatas = $("input[name='baseSkuDatas']"); if (baseSkuDatas.length == 0) { $("#saveProductBtn").prop("disabled", false); swal({ title: "", text: "只有点击定价计算器里的填充定价按钮后才能使用此功能,请先点击定价计算器里的填充定价按钮!", type: "error", customClass: "sweetAlertNormal", allowOutsideClick: true }); return; } var productId = ""; var queryParams = currentUrls.split('&'); for (var idi = 0; idi < queryParams.length; idi++) { var arr = queryParams[idi].split("="); if (arr[0] == "productId" || arr[0] == "switchId" || arr[0] == "draftId") { productId = arr[1]; break; } } var title = $("#struct-content #base-card #struct-title #title").val(); var uploader = $("#struct-content #base-card #struct-mainImage .info-content .image-upload-wrap .image-uploader"); var imgUrl = ""; if (uploader.length > 0) { var imgs = $(uploader[0]).find(".sell-o-image-item-preview img"); if (imgs.length > 0) { for (var ii = 0; ii < imgs.length; ii++) { var src = $(imgs[ii]).attr("src"); if (src.indexOf("http") == 0 && src.indexOf("XXXX") == -1) { imgUrl = src; break; } } } } var skuPrices = []; var skuNamesSet = []; //零售价 // 每次填充价格前,一定要把滚动条回到顶部 var prictmainobj = $("table.sell-sku-inner-table.sell-sku-body-table").eq(0); var scrollobj=prictmainobj.closest('.ver-scroll-wrap'); scrollobj.animate({ scrollTop: "0" }, 0,function(){ setTimeout(function(){ getRetailPrice(skuPrices, skuNamesSet); },200) }); // 区域定价 // 每次填充价格前,一定要把滚动条回到顶部 // 记住:这里滑动到顶部,只在最开始执行一次 var regionPrices = {}; var skutableobj = $("table.sell-sku-inner-table.sell-sku-body-table").eq(1); if (skutableobj.find('tr').length > 0) { var regionTimer = setInterval(function () { if (window.isGetRetailOK) { clearInterval(regionTimer); var regionscrollobj = skutableobj.closest('.ver-scroll-wrap'); regionscrollobj.animate({ scrollTop: "0" }, 0,function(){ setTimeout(function(){ getRegionPrice(regionPrices) },200) }); } }, 100); } else { window.isGetRegionOK = true; } var timer = setInterval(function () { if (window.isGetRetailOK && window.isGetRegionOK) { clearInterval(timer); window.isGetRetailOK = false; window.isGetRegionOK = false; if (JSON.stringify(regionPrices) != "{}") { for (var skuI = 0; skuI < skuPrices.length; skuI++) { if (regionPrices[skuPrices[skuI]["skuName"]]){ skuPrices[skuI]["regionPrices"] = regionPrices[skuPrices[skuI]["skuName"]]; } } } var product = {"aeId":productId, "title":title, "imgUrl":imgUrl, "skus":skuPrices}; //补充成本、重量、运费模板等信息 for (var m = 0; m < baseSkuDatas.length; m++) { var baseData = JSON.parse($(baseSkuDatas[m]).val()); var selectSkus = baseData.selectSkus; var weightStr = Number(baseData.weight).toFixed(0); if (selectSkus && selectSkus.length > 0) { for (var j = 0; j < skuPrices.length; j++) { var skuNameList = skuPrices[j]["skuNameList"]; if (skuNameList.length == selectSkus.length) { var tempFlag = true; for (var n = 0; n < selectSkus.length; n++) { var tempSkus = selectSkus[n]["skuNameList"]; var skuName = skuNameList[n]; if (tempSkus && tempSkus.length > 0 && tempSkus.indexOf(skuName) == -1) { tempFlag = false; break; } } if (tempFlag) { skuPrices[j]["cost"] = baseData.cost; skuPrices[j]["weight"] = weightStr; } } else { skuPrices[j]["cost"] = baseData.cost; skuPrices[j]["weight"] = weightStr; } } } else { for (var o = 0; o < skuPrices.length; o++) { skuPrices[o]["cost"] = baseData.cost; skuPrices[o]["weight"] = weightStr; } } if (baseData.templateName) { product.templateName = baseData.templateName; } if (baseData.serviceRate) { product.serviceRate = baseData.serviceRate; } if (baseData.wreckRate) { product.wreckRate = baseData.wreckRate; } if (baseData.discountRate) { product.discountRate = baseData.discountRate; } } var param={ method:'ajax', params: { url: domain + '/seller/product/saveProduct', data: JSON.stringify(product), type: "POST", contentType: "application/json", xhrFields: {withCredentials: true} } }; chrome.runtime.sendMessage(param, function(response) { $('.showSweetAlert').removeClass("aezsmain"); if (response.status == "FAIL" || response.message) { swal({ title: "", text: response.message, type: "error", customClass: "sweetAlertNormal", allowOutsideClick: true }, function () { $("div[data-custom-class='sweetAlertNormal']").remove(); }); } else { swal({ title: "", text: "保存成功", type: "success", customClass: "sweetAlertNormal", allowOutsideClick: true }, function () { $("div[data-custom-class='sweetAlertNormal']").remove(); }); } $("#saveProductBtn").prop("disabled", false); }); } }, 100); } else { $("#saveProductBtn").prop("disabled", false); } } function saveProductDxm() { $("#saveProductBtn").prop("disabled", true); // $('.sweetAlert').removeClass('zndjpop').removeClass('qydjlre').removeClass('qydjlrl').removeClass('diy100'); var baseSkuDatas = $("input[name='baseSkuDatas']"); if (baseSkuDatas.length == 0) { $("#saveProductBtn").prop("disabled", false); swal({ title: "", text: "只有点击定价计算器里的填充定价按钮后才能使用此功能,请先点击定价计算器里的填充定价按钮!", type: "error", customClass: "sweetAlertNormal", allowOutsideClick: true }); return; } var productId = "temp" + new Date().getTime(); var title = $("#subject").val(); var imgEle = $("#img_show").find("img").first(); var imgUrl = ""; if (imgEle.length > 0) { imgUrl = imgEle.attr("src"); } var purchaseUrl = $("#sourceUrl11").val(); var skuPrices = []; //全球零售价 if ($("#skuVariantList tr[trcid]").length > 0) { $("#skuVariantList tr[trcid]").each(function () { var skuPrice = {}; skuPrice.originalPrice = $(this).find("input").first().val(); skuPrice.sku = $(this).find("input").last().val();//商品编码 var skuNames = []; $(this).find("td[data-names='property']").each(function (index, elem) { var property = $(elem).html(); if (property.indexOf("(") > -1 && property.indexOf(")") > -1) { skuNames.push(property.match(/(.+)/g)[0].replace(/(|)/g, "")); } else { skuNames.push(property); } }); skuPrice.skuName = skuNames.join("-"); skuPrice.skuNameList = skuNames.slice(); skuPrices.push(skuPrice); }); } else if ($("#retail #skuPrice:visible").length > 0) { var skuPrice = {}; skuPrice.originalPrice = $("#retail #skuPrice:visible").val(); skuPrice.sku = ""; skuPrice.skuName = ""; skuPrice.skuNameList = []; skuPrices.push(skuPrice); } // 区域定价 // 每次填充价格前,一定要把滚动条回到顶部 // 记住:这里滑动到顶部,只在最开始执行一次 var regionPrices = {}; var skuTrs = $("#setNationalProductPrice table tbody tr"); if (skuTrs.length > 0) { skuTrs.each(function () { var countriesTds = $(this).find("td[data-coun]"); if (countriesTds.length > 0) { var skuNames = []; $(this).find("td[cid]").each(function (index, elem) { var property = $(elem).html(); if (property.indexOf("(") > -1 && property.indexOf(")") > -1) { skuNames.push(property.match(/(.+)/g)[0].replace(/(|)/g, "")); } else { skuNames.push(property); } }); var nationalPrice = {}; countriesTds.each(function (index, elem) { var country =$(elem).attr("data-coun").toLowerCase(); nationalPrice[country == "id" ? "idd" : country] = $(elem).find("input").val(); }); regionPrices[skuNames.join("-")] = nationalPrice; } }); } if (JSON.stringify(regionPrices) != "{}") { for (var skuI = 0; skuI < skuPrices.length; skuI++) { if (regionPrices[skuPrices[skuI]["skuName"]]){ skuPrices[skuI]["regionPrices"] = regionPrices[skuPrices[skuI]["skuName"]]; } } } var product = {"aeId":productId, "title":title, "imgUrl":imgUrl, "skus":skuPrices,"purchaseUrl":purchaseUrl}; //补充成本、重量、运费模板等信息 for (var m = 0; m < baseSkuDatas.length; m++) { var baseData = JSON.parse($(baseSkuDatas[m]).val()); var selectSkus = baseData.selectSkus; var weightStr = Number(baseData.weight).toFixed(0); if (selectSkus && selectSkus.length > 0) { for (var j = 0; j < skuPrices.length; j++) { var skuNameList = skuPrices[j]["skuNameList"]; if (skuNameList.length == selectSkus.length) { var tempFlag = true; for (var n = 0; n < selectSkus.length; n++) { var tempSkus = selectSkus[n]["skuNameList"]; var skuName = skuNameList[n]; if (tempSkus && tempSkus.length > 0 && tempSkus.indexOf(skuName) == -1) { tempFlag = false; break; } } if (tempFlag) { skuPrices[j]["cost"] = baseData.cost; skuPrices[j]["weight"] = weightStr; } } else { skuPrices[j]["cost"] = baseData.cost; skuPrices[j]["weight"] = weightStr; } } } else { for (var o = 0; o < skuPrices.length; o++) { skuPrices[o]["cost"] = baseData.cost; skuPrices[o]["weight"] = weightStr; } } if (baseData.templateName) { product.templateName = baseData.templateName; } if (baseData.serviceRate) { product.serviceRate = baseData.serviceRate; } if (baseData.wreckRate) { product.wreckRate = baseData.wreckRate; } if (baseData.discountRate) { product.discountRate = baseData.discountRate; } } var param={ method:'ajax', params: { url: domain + '/seller/product/saveProduct', data: JSON.stringify(product), type: "POST", contentType: "application/json", xhrFields: {withCredentials: true} } }; chrome.runtime.sendMessage(param, function(response) { $('.showSweetAlert').removeClass("aezsmain"); if (response.status == "FAIL" || response.message) { swal({ title: "", text: response.message, type: "error", customClass: "sweetAlertNormal", allowOutsideClick: true }, function () { $("div[data-custom-class='sweetAlertNormal']").remove(); }); } else { swal({ title: "", text: "保存成功", type: "success", customClass: "sweetAlertNormal", allowOutsideClick: true }, function () { $("div[data-custom-class='sweetAlertNormal']").remove(); }); } $("#saveProductBtn").prop("disabled", false); }); } // function getCustomedColorMap() { // var colorMap = {}; // var colorDiv = $("#struct-saleProp>div>div").eq(0); // var label = colorDiv.children("div").eq(0).text(); // // var colorDiv = $("#struct-saleProp").children("div").eq(0); // // var label = colorDiv.children("div").eq(0).text(); // if (label == "颜色") { // var items = colorDiv.children("div").eq(1).find(".info-content").find(".item"); // for (var i = 0; i < items.length; i++) { // var colorSpans = $(items[i]).find(".posting-feild-color-item").children("span"); // var value = colorSpans.eq(0).find("em").text(); // var key = colorSpans.eq(1).find("input").val(); // if (key && key != "" && value && value != "") { // colorMap[key] = value; // } // } // } // return colorMap; // } function getRetailPrice(skuPrices, skuNamesSet) { var prictmainobj = $("table.sell-sku-inner-table.sell-sku-body-table").eq(0); var trs = prictmainobj.find("tr"); if (trs.length > 0) { var skuNames = []; for (var j = 0; j < trs.length; j++) { var tds = $(trs[j]).find("td"); var tdSpCount = $(trs[j]).find("td.col-skuPrice").index();//当前行shu属性数量。默认零售价前面的单元格均为属性 var skuPrice = {}; for (var k = 0; k < tds.length; k++) { if (k < tdSpCount) { if (j === 0) { if($(tds[k]).find("p").length>0) skuNames.push($(tds[k]).find("p").text()); else skuNames.push($(tds[k]).find(".ae-sku-cell-text-content").text()); } else { if($(tds[k]).find("p").length>0) skuNames.splice(skuNames.length - tdSpCount + k, 1, $(tds[k]).find("p").text()); else skuNames.splice(skuNames.length - tdSpCount + k, 1, $(tds[k]).find(".ae-sku-cell-text-content").text()); } } else { if (k === (tdSpCount)) { skuPrice.originalPrice = $(tds[k]).find("input").val(); } else if ($(tds[k]).find("input[name='skuOuterId']").length != 0) { skuPrice.sku = $(tds[k]).find("input[name='skuOuterId']").val(); } } } if (skuNamesSet.indexOf(skuNames.join("-")) == -1) { skuPrice.skuName = skuNames.join("-"); skuPrice.skuNameList = skuNames.slice(); skuPrices.push(skuPrice); skuNamesSet.push(skuPrice.skuName); } } } // 滚动到下一屏 var scrollobj = prictmainobj.closest('.ver-scroll-wrap'); if (scrollobj.scrollTop() + scrollobj.height() >= scrollobj[0].scrollHeight) { window.isGetRetailOK = true; return; } scrollobj.animate({ scrollTop: "+="+190 }, 0,function(){ setTimeout(function(){ getRetailPrice(skuPrices, skuNamesSet); },200); }); } function getRegionPrice(regionPrices) { var tables = $("table.sell-sku-inner-table.sell-sku-body-table").eq(1); var trs = tables.find("tr"); if (trs.length > 0) { var skuNames = []; var inputSize = $(trs[0]).find(".sell-sku-cell-money").length; for (var j = 0; j < trs.length; j++) { var tds = $(trs[j]).find("td"); var nationalPrice = {}; for (var k = 0; k < tds.length; k++) { if ($(tds[k]).hasClass("sell-sku-cell-money")) { var priceInput = $(tds[k]).find("input"); if (priceInput.length != 0) { var tdClass = $(tds[k]).attr("class").match(/col-price-\w{2}/); if (tdClass != null && tdClass.length > 0) { var country = tdClass[0].replace("col-price-","").toLowerCase(); nationalPrice[country == "id" ? "idd" : country] = priceInput.val(); } } } else { if (j == 0) { if($(tds[k]).find("p").length>0) skuNames.push($(tds[k]).find("p").text()); else skuNames.push($(tds[k]).find(".ae-sku-cell-text-content").text()); } else { if($(tds[k]).find("p").length>0) skuNames.splice(skuNames.length - (tds.length - inputSize) + k, 1, $(tds[k]).find("p").text()); else skuNames.splice(skuNames.length - (tds.length - inputSize) + k, 1, $(tds[k]).find(".ae-sku-cell-text-content").text()); } } } var skuName = skuNames.join("-"); regionPrices[skuName] = nationalPrice; } } // 滚动到下一屏 var scrollobj = tables.closest('.ver-scroll-wrap'); if (scrollobj.scrollTop() + scrollobj.height() >= scrollobj[0].scrollHeight) { window.isGetRegionOK = true; return; } scrollobj.animate({ scrollTop: "+="+190 }, 0,function(){ setTimeout(function(){ getRegionPrice(regionPrices); },200); }); } //红色和黄色代表什么意思? $("body").on("click", ".colorTip", function () { $('.showSweetAlert .colorNotice,.showSweetAlert .pop2overlay').show(); }); function convertPrice(exchangeRate, price) { if (exchangeRate <= 1=""> -1) { var shopId = $(this).children('option:selected').val(); if (shopId != "") { syncTemplates('?dxmId=' + shopId); } } else if (location.href.indexOf("mangoerp.com/erp") > -1) { var shopId = $(this).children('option:selected').attr("data-shopid"); if (shopId != "" && shopId != undefined) { syncTemplates('?wdtId=' + shopId); } } }); //------------------------旺店通监听店铺切换模块---------------------- $('body').on('click', '#shopCn .el-radio__label', function () { var shopId = $(this).parent().attr("data-shopcn"); if (shopId != "" && shopId != undefined) { syncTemplates('?wdtId=' + shopId); } }); //------------------------通途需授权模块---------------------- //监控通途发布产品页面店铺下拉框变更事件,刷新模板下拉框 $(function() { storeChange(); }); function storeChange(){ var currentVal=getStoreId(); setInterval(function() { var nowVal=getStoreId(); if(nowVal != currentVal && nowVal !== "") { syncTemplates('?ttId=' + nowVal); currentVal=nowVal; } },1000); } function getStoreId(){ return $("#baseInfoDiv .bg-title:contains('基本信息')").next().find('.left label:contains("Aliexpress店铺")') .siblings('span.textbox.combo').find('input[type=hidden].textbox-value').val(); } //------------------------通途需授权模块-------------------end //计算器页面同步按钮事件 $("body").on("click", ".syncTemplates", function () { if (chrome.runtime.getManifest().version < "1.1.4") { showHint("error", "此功能需要更新插件到1.1.4及以上版本才能使用。升级教程:https://www.yuque.com/helps/aeoptools/tquc69"); return; } var currentUrl = location.hostname; if (currentUrl.indexOf("mabangerp.com") > -1) { var value = $('input[name="shopId"]:checked').val(); if (value != "") { syncTemplates('?mbId=' + value); } } else if (currentUrl.indexOf("dianxiaomi.com") > -1) { var shopId = $('#shopId').children('option:selected').val(); if (shopId != "") { syncTemplates('?dxmId=' + shopId); } } else if (currentUrl.indexOf("tongtool.com") > -1) { $("#rootEle tr:first .pdtb5").each(function (i) { if ($(this).text().indexOf("Aliexpress店铺") > -1) { var shopId = $(this).find(".textbox-value").val(); if (shopId !== "") { syncTemplates('?ttId=' + shopId); } return false; } }); } else if (currentUrl.indexOf("qizhishangke.com") > -1) { var value = $("#shopCn").attr("data-cn"); if (value != "") { syncTemplates('?wdtId=' + value); } } else if (currentUrl.indexOf("mangoerp.com") > -1) { var shopId = $('#shopId').children('option:selected').attr("data-shopid"); if (shopId != "" && shopId != undefined) { syncTemplates('?wdtId=' + shopId); } } else if (currentUrl.indexOf("wxwerp.com") > -1 && currentUrl.indexOf("www.wxwerp.com") === -1 || window.hasOwnProperty('wxwIndDomain') && wxwIndDomain.indexOf(currentUrl) > -1) {//旺销王v3版本 var shopId = $('#v3-aliexpress-shop').attr("cnid"); if (shopId != "" && shopId != undefined) { syncTemplates('?wdtId=' + shopId); } } else if (currentUrl.indexOf("damaijiaerp.com") > -1) { var shopId = $('#shopId').val(); if (shopId != "" && shopId != undefined) { syncTemplates('?wdtId=' + shopId); } } else { syncTemplates(''); } }) //有两个填充地方,另一个在price_menu.html function syncTemplates(params) { var param={ method:'ajax', params: { url: domain + '/seller/querySampleTemplates' + params, xhrFields: {withCredentials: true} } }; chrome.runtime.sendMessage(param,function(t){ if (!t.message && t.result) { if (t.result["NORMAL"] && t.result["NORMAL"].length > 0) { $("#selectNormalTemplate").empty(); $("#selectNormalTemplate").append("请选择运费模板"); for (var i = 0; i < t.result["NORMAL"].length; i++) { var template = t.result["NORMAL"][i]; $("#selectNormalTemplate").append("" + template.templateName + ""); } //至少弹过一次计算器框时 $('.showSweetAlert #selectNormalTemplate').empty(); $('.showSweetAlert #selectNormalTemplate').append("请选择运费模板"); for (var i = 0; i < t.result["NORMAL"].length; i++) { var template = t.result["NORMAL"][i]; $('.showSweetAlert #selectNormalTemplate').append("" + template.templateName + ""); } $('.showSweetAlert #selectNormalTemplate').trigger("chosen:updated"); $('.showSweetAlert #selectNormalTemplate').chosen(); } else { $("#selectNormalTemplate").empty(); $("#selectNormalTemplate").append("请选择运费模板"); //至少弹过一次计算器框时 $('.showSweetAlert #selectNormalTemplate').empty(); $('.showSweetAlert #selectNormalTemplate').append("请选择运费模板"); $('.showSweetAlert #selectNormalTemplate').trigger("chosen:updated"); $('.showSweetAlert #selectNormalTemplate').chosen(); } if (t.result["REGION"] && t.result["REGION"].length > 0) { $("#selectRegionAmountTemplate").empty(); $("#selectRegionPercentTemplate").empty(); $("#selectRegionAmountTemplate").append("请选择运费模板"); $("#selectRegionPercentTemplate").append("请选择运费模板"); for (var j = 0; j < t.result["REGION"].length; j++) { var template = t.result["REGION"][j]; $("#selectRegionAmountTemplate").append("" + template.templateName + ""); $("#selectRegionPercentTemplate").append("" + template.templateName + ""); } //至少弹过一次计算器框时 $('.showSweetAlert #selectRegionAmountTemplate').empty(); $(".showSweetAlert #selectRegionPercentTemplate").empty(); $(".showSweetAlert #selectRegionAmountTemplate").append("请选择运费模板"); $(".showSweetAlert #selectRegionPercentTemplate").append("请选择运费模板"); for (var j = 0; j < t.result["REGION"].length; j++) { var template = t.result["REGION"][j]; $(".showSweetAlert #selectRegionAmountTemplate").append("" + template.templateName + ""); $(".showSweetAlert #selectRegionPercentTemplate").append("" + template.templateName + ""); } $(".showSweetAlert #selectRegionAmountTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionAmountTemplate").chosen(); $(".showSweetAlert #selectRegionPercentTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionPercentTemplate").chosen(); } else { $("#selectRegionAmountTemplate").empty(); $("#selectRegionPercentTemplate").empty(); $("#selectRegionAmountTemplate").append("请选择运费模板"); $("#selectRegionPercentTemplate").append("请选择运费模板"); //至少弹过一次计算器框时 $('.showSweetAlert #selectRegionAmountTemplate').empty(); $(".showSweetAlert #selectRegionPercentTemplate").empty(); $(".showSweetAlert #selectRegionAmountTemplate").append("请选择运费模板"); $(".showSweetAlert #selectRegionPercentTemplate").append("请选择运费模板"); $(".showSweetAlert #selectRegionAmountTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionAmountTemplate").chosen(); $(".showSweetAlert #selectRegionPercentTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionPercentTemplate").chosen(); } $(".syncTemplates").show(); $(".authorizeBtn").hide(); $(".buyStore").hide(); //主动点击同步时才需要提示 if (params == '') { showHint("sync", "同步成功"); } } else if (t.message) { $("#selectNormalTemplate").empty(); $("#selectNormalTemplate").append("" + t.message + ""); //至少弹过一次计算器框时 $('.showSweetAlert #selectNormalTemplate').empty(); $('.showSweetAlert #selectNormalTemplate').append("" + t.message + ""); $('.showSweetAlert #selectNormalTemplate').trigger("chosen:updated"); $('.showSweetAlert #selectNormalTemplate').chosen(); $("#selectRegionAmountTemplate").empty(); $("#selectRegionPercentTemplate").empty(); $("#selectRegionAmountTemplate").append("" + t.message + ""); $("#selectRegionPercentTemplate").append("" + t.message + ""); //至少弹过一次计算器框时 $('.showSweetAlert #selectRegionAmountTemplate').empty(); $(".showSweetAlert #selectRegionPercentTemplate").empty(); $(".showSweetAlert #selectRegionAmountTemplate").append("" + t.message + ""); $(".showSweetAlert #selectRegionPercentTemplate").append("" + t.message + ""); $(".showSweetAlert #selectRegionAmountTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionAmountTemplate").chosen(); $(".showSweetAlert #selectRegionPercentTemplate").trigger("chosen:updated"); $(".showSweetAlert #selectRegionPercentTemplate").chosen(); if (t.message.indexOf("授权") > -1) { $(".syncTemplates").hide(); $(".buyStore").hide(); if (params.indexOf("dxmId") > -1) { $(".authorizeBtn").attr("href", "https://www.dianxiaomi.com/sys/index.htm?go=m407"); } else if (params.indexOf("mbId") > -1) { $(".authorizeBtn").attr("href", "https://www.mabangerp.com/index.php?mod=shop.list"); } else { $(".authorizeBtn").attr("href", "https://listing.tongtool.com/listing/account/index.htm"); } $(".authorizeBtn").show(); } else { //账号已过期 $(".syncTemplates").hide(); $(".authorizeBtn").hide(); $(".buyStore").show(); } } else { console.log(t.message); } }); } //------------------------定制100g计算器模块start---------------------- //定制100g计算器菜单事件,弹出对话框 $("body").on("click", "#btnDiy100", function () { if($(".diy100").length){ $(".diy100").show(); $('.sweet-overlay').show(); $('body').attr('class','aside-expanded-true pace-done stop-scrolling'); }else{ $('.sweetAlert').removeClass('zndjpop').removeClass('qydjlre').removeClass('qydjlrl').removeClass('diy100'); $('.aeplgcon ul li.nav').removeClass('now'); $('#btnDiy100').parent().addClass('now'); swal({ title: "定制计算器", showConfirmButton: false, text: $('#region_diy_div').html(), html: true, customClass: "sweetAlert aezsmain diy100", allowOutsideClick: false }); if ($(".showSweetAlert select[name='selectTemplate']").chosen) { $(".showSweetAlert select[name='selectTemplate']").chosen(); } if ($(".showSweetAlert .locationCountry #locationSelect").chosen) { $(".showSweetAlert .locationCountry #locationSelect").chosen(); } } }); //选择模板下拉框后的事件 $('body').on('change', '#selectDiyTemplate', function () { var templateId = $(this).children('option:selected').val(); diySheet.setValue("G2", "", true); for (var i = 3; i < tableRowSizeDiy; i++) { diySheet.setRowData(i, ["","","","","","","","","","",""]); } if (templateId == "") { return; } var param={ method:'ajax', params: { url: domain + '/seller/getTeamplateById?templateId=' + templateId, xhrFields: {withCredentials: true} } }; chrome.runtime.sendMessage(param,function(t){ ($('.showSweetAlert #diySheet')[0]).jexcel = null; $('.showSweetAlert #diySheet').html(""); diySheet = jexcel($('.showSweetAlert #diySheet')[0], diyOptions()); if (!t.message && t.result) { var template = JSON.parse(t.result.data); //合并所有发货地的热门国家,用来勾选区域定价的国家 getPriceHotCountry(t.result); //初始化海外仓下拉框 var html = "中国"; if (t.result.overseasData) { var overseas = JSON.parse(t.result.overseasData); for (var key in overseas) { html += "" + overseas[key]["cnName"] + ""; } } $(".showSweetAlert .locationCountry #locationSelect").html(html); $(".showSweetAlert .locationCountry #locationSelect").trigger("chosen:updated"); $(".showSweetAlert .locationCountry #locationSelect").off("change").on('change', function (e, params) { if (params.selected == "CN") { template.shippingCountry = "CN"; template.type = t.result.templateType; template.volumeSize = t.result.volumeSize; templateData = template; } else { var tempOverseasAll = JSON.parse(t.result.overseasData); var temp = tempOverseasAll[params.selected]; temp.type = t.result.templateType; temp.shippingCountry = params.selected; templateData = temp; } if(templateData){ initDiyData(templateData, templateData.shippingCountry); } }); logisticsDiscount = t.result.logisticsDiscount; template.type = t.result.templateType; template.shippingCountry = "CN"; templateData = template; initDiyData(template, "CN"); } else { swal("", t.message, "error"); } }); }); function initDiyData(template, shippingCountry) { var exchangeRate = template.exchangeRate; var serviceRate = localStorage.getItem("serviceRate"); var wreckRate = localStorage.getItem("wreckRate"); if (exchangeRate == undefined || exchangeRate == "") { exchangeRate = localStorage.getItem("exchangeRate"); exchangeRate = exchangeRate ? exchangeRate : 6.6; } if (serviceRate == undefined || serviceRate == "" || serviceRate == "undefined") { serviceRate = 5; } if (wreckRate == undefined || wreckRate == "" || wreckRate == "undefined") { wreckRate = 2; } diySheet.setValue("A2", exchangeRate, true); diySheet.setValue("B2", serviceRate, true); diySheet.setValue("C2", 0, true); diySheet.setValue("D2", template.goodsWeight, true); diySheet.setValue("F2", wreckRate, true); diySheet.setValue("G2", template.fee, true); diySheet.setValue("H2", '=ROUNDUP(C2/A2+G2+E2*(B2+F2)/100, 2)', true); diySheet.setValue("I2", '=ROUNDUP(J2/A2/E2*100,2)', true); diySheet.setValue("J2", '=ROUNDUP((E2-H2)*A2,2)', true); diySheet.setValue("K2", '=E2', true); for (var i = 3; i < tableRowSizeDiy; i++) { diySheet.setRowData(i, ["","","","","","","","","","",""]); } if (template.type != "NORMAL" && template.type != "NORMAL_100") { hotCountries = sortCountrys(template.countrys); for (var j = 0; j < hotCountries.length; j++) { var row = j + 4; var countryLogis = []; var countryLogistic = hotCountries[j]; countryLogis.push(countryLogistic.countryName); //A countryLogis.push(countryLogistic.country); //B countryLogis.push(countryLogistic.logisName); //C countryLogis.push(countryLogistic.firstWeight); //D countryLogis.push(countryLogistic.firstWeightFee); //E if (countryLogistic.overWeight == undefined || countryLogistic.overWeight == "") { countryLogis.push(1); //F countryLogis.push((countryLogistic.overWeightFee/1000).toFixed(4));//G } else { countryLogis.push(countryLogistic.overWeight); //F countryLogis.push(countryLogistic.overWeightFee); //G } countryLogis.push(countryLogistic.registrationFee); //H countryLogis.push("=ROUNDUP(E" + row + "+H" + row + "+ROUNDUP((D2-D" + row + ">0 ? D2-D" + row + ":0)/F" + row + ",0)*G" + row + ",2)");//I countryLogis.push("=ROUNDUP(I" + row + "/A2-G2>0.01 ? I" + row + "/A2-G2:0,2)"); countryLogis.push(""); diySheet.setRowData(j + 3, countryLogis); } } } // 填充报价使用 function assemblePricesForDiy() { var prices = {}; prices.templateName = $(".showSweetAlert [name='selectTemplate']").children('option:selected').html(); prices.global = diySheet.getValue("K2"); prices.serviceRate = diySheet.getValue("B2"); prices.cost = diySheet.getValue("C2"); prices.weight = diySheet.getValue("D2"); prices.discountRate = 0; prices.wreckRate = diySheet.getValue("F2"); prices.globalSwitch = true; for (var i = 4; i < (tableRowSizeDiy + 1); i++) { var country = diySheet.getValue("B" + i); if (country) { prices["price-" + country] = diySheet.getValue("J" + i); } } return prices; } // 当修改重量后重新计算包邮费用 function recomputeFreeFee(el, records) { var skip = true; for (var ri = 0; ri < records.length; ri++) { if (records[ri].row == 1 && records[ri].col == 3) { skip = false; break; } } if (skip) return; var weight = diySheet.getValue("D2"); var exchangeRate = diySheet.getValue("A2"); if (templateData.otherCountrys && templateData.otherCountrys.length > 0) { for (var i = 0; i < templateData.otherCountrys.length; i++) { var otherCountry = templateData.otherCountrys[i]; if (otherCountry.countryName == templateData.feeFreeCountry) { var fee; var firstWeight = otherCountry.firstWeight; var firstWeightFee = otherCountry.firstWeightFee; var registrationFee = otherCountry.registrationFee; var overWeight = otherCountry.overWeight; var overWeightFee = otherCountry.overWeightFee; if (overWeight == undefined || overWeight == "") { var size = maltose.complexEval((weight - firstWeight > 0 ? weight - firstWeight : 0),0); fee = maltose.complexEval((firstWeightFee + registrationFee + size * overWeightFee / 1000) / exchangeRate, 2); } else { var size = Math.ceil(maltose.complexEval((weight - firstWeight > 0 ? weight - firstWeight : 0) + '/' + overWeight,2), 0); fee = maltose.complexEval((firstWeightFee + registrationFee + size * overWeightFee) / exchangeRate, 2); } diySheet.setValue("G2", fee, true); return; } } } } //------------------------定制100g计算器模块end------------------------.aeplgcon { position: fixed; top: 35%; right: 5px; background: #000000ad; color: #fff; z-index: 9999999; width: 190px; } .aeplgcon p { padding: 10px 0; margin: 0; line-height: normal; text-align: center; font-size: 16px; background: #FF5959; } .aeplgcon ul { text-align: left; padding-left: 0; margin-left: 0; margin-bottom: 0; overflow: hidden; } .aeplgcon ul li.nav { padding: 0 15px; border-top: 1px solid #595959; } .aeplgcon ul li.nav:hover { background: #00000059; } .aeplgcon ul li a { color: #fff; padding: 10px 0; display: block; font-size: 13px; } .aeplgcon ul li.nav.now:before { content: "·"; position: absolute; color: #fff700; left: 5px; text-align: center; line-height: 36px; font-size: 40px; } .aeplgcon i { font-style: inherit; font-size: 13px; color: #ffc100; line-height: 34px; display: block; } .aeplgcon em:hover { background: #d25353; } .aeplgcon em { font-style: normal; width: 22px; height: 20px; display: inline-block; text-align: center; position: absolute; top: 0; left: 0px; color: #fff; cursor: pointer; font-size: 15px; } .aeplgcon em.showPOP { left: -68px; background: #FF5959; width: 62px; padding: 1px; font-size: 14px; text-align: center; border-radius: 3px; } .sweetAlert.aezsmain { margin-top: -372px; left: 17%; right: 3%; top: 51%; overflow: auto; height: 90%; z-index: 9999999999; width: auto; } .sweetAlertNormal { width: 450px; left: 50%; height: auto; top: 50%; } .aezsmain .chosen-container-single { z-index: 100000; } .aezsmain .chosen-container-single .chosen-single { padding-top: 5px; } .aezsmain .chosen-container-single .chosen-drop .chosen-results { text-align: left; font-weight: normal; } .aezsmain .chosen-container-single .chosen-search input[type="text"] { box-sizing: border-box; display: block; height: 30px; } .jexcel > thead > tr > td { z-index: 1; position: relative; }AE助手-定价计算器智能定价计算器区域定价计算器(利润额)区域定价计算器(利润率)(请务必与运费模板配合使用) x.aezsmain .table > thead > tr > th, .aezsmain .table > tbody > tr > th, .aezsmain .table > tfoot > tr > th, .aezsmain .table > thead > tr > td, .aezsmain .table > tbody > tr > td, .aezsmain .table > tfoot > tr > td { text-align: center; } .aezsmain .table > thead > tr > th { background: #92cddc; color: #000; font-size: 14px; vertical-align: middle; } .aezsmain .table > thead > tr > th small { font-weight: normal; } .aezsmain #tableFeeDetail > tbody > tr > td { background: #f3f3f3; font: 400 15px Arial; padding-top: 10px; padding-bottom: 10px; } .aezsmain .tableDJ { margin-bottom: 10px; } .aezsmain #tableInputInfo.table > tbody > tr > td,.aezsmain #tableVolumeSize.table > tbody > tr > td { padding: 0; } .aezsmain #tableInputInfo input,.aezsmain #tableVolumeSize input { width: 100px; height: 38px; border: none; margin: 0; display: inline-block; text-align: center; font: 400 15px Arial; } .aezsmain .allfreecountrys .ibox-title { background: #F5F5F6; } .aezsmain .allfreecountrys .ibox-content { padding: 0; } .aezsmain .allfreecountrys .ibox-content table { width: 100%; margin: 0 !important; font-size: 12px; font-weight: normal; margin-top: -1px !important; } .popContent { height: 250px; overflow-y: scroll; font-weight: 600; color: #575757; padding-left: 20px; padding-right: 20px; z-index: 99999999999; text-align: center; line-height: 22px; } #popCountry { margin-top: 20px; text-align: left; } #popSkuCon > div { text-align: left; } #popSkuCon > div p { font-weight: bolder; margin: 0; } #popSkuCon > div ul,#popCountry ul { padding-left: 9px; } #popSkuCon > div ul li,#popCountry ul li { display: inline-block; margin-left: 9px; cursor: pointer; } #popSkuCon input,#popCountry input { width: auto; height: auto; display: inline-block; cursor: pointer; vertical-align: top; margin-right: 1px; } #popCountry input[type="checkbox"] { -webkit-appearance: checkbox !important; }.aezsmain .jexcel { width: 100%; } .aezsmain .jexcel td { vertical-align: middle; } .aezsmain .pricingBtn { color: white; display: none; background-color: rgb(26, 179, 148); } .aezsmain .pricingBtn:hover { color: white; background-color: rgb(0, 169, 141); } .aezsmain.sweet-alert a.btnClose{ position: absolute; top: 45px; right: 3px; height: 30px; width: 30px; padding: 0; margin: 0; line-height: 30px; background-color: #fff; border-radius: 50%; font-size: 17px; margin-left: 183px; margin-top: -94px; color: #999; } .aezsmain.sweet-alert a.btnClose:hover{ background-color: #7b7b7b; color: #fff; } .aezsmain .nav { width: 235px; border: 1px solid #ccc; } .aezsmain .nav span { display: block; width: 114px; border-left: 1px solid #ccc; text-align: center; line-height: 32px; font-size: 13px; color: #666; float: left; cursor: pointer; } .aezsmain .nav span.active { background: #1ab394; color: #fff; } .aezsmain .nav span:first-child { border: 0; } .jexcel_container .jexcel_pagination {display: none;}.aezsmain .pop2con,.aezsmain .pop2Smt,.aezsmain .pop2freeNotice,.aezsmain .colorNotice { width: 600px; position: fixed; left: 46%; top: 40%; z-index: 999999; font-size: 14px; margin-left: -200px; margin-top: -68px; background: #fff; border-radius: 5px; padding: 15px 10px; text-align: left; } .sell-o-select-options .options-content{max-height:20000px !important;}/新增/ .aezsmain .pop2Hint { width: 450px; position: fixed; left: 48%; top: 40%; z-index: 999999; font-size: 14px; margin-left: -200px; margin-top: -68px; background: #fff; border-radius: 5px; padding: 15px 10px; text-align: left; box-shadow: 5px 5px 7px 3px rgb(204, 204, 204);/新增/ } .aezsmain .pop2con .pop2title,.aezsmain .pop2Smt .pop2title,.aezsmain .pop2freeNotice .pop2title,.aezsmain .colorNotice .pop2title { font-size: 25px; font-weight: 600; color: #575757; text-align: center; padding-top: 10px; padding-bottom: 15px; } .aezsmain .pop2con input{ display: inline-block; width: 470px; height: 30px; font-size: 14px; } .aezsmain .pop2con .btncon,.aezsmain .pop2Smt .btncon,.aezsmain .pop2freeNotice .btncon,.aezsmain .colorNotice .btncon{ text-align: right; } .aezsmain .pop2freeNotice .btncon a { background-color: #1AB394; border-color: #1AB394; color: white; } .aezsmain .pop2con .btncon a,.aezsmain .pop2Smt .btncon a,.aezsmain .pop2Hint .btncon a { margin-right: 5px; background-color: #1AB394; border-color: #1AB394; color: white; width: 60px; font-size: 14px; } .aezsmain #btnpop2cancel,.aezsmain #pop2cancelSmt { color: rgb(103,106,108); background-color:white; border-color: rgb(231,234,236); } .aezsmain #btnpop2cancel:hover,.aezsmain #pop2cancelSmt:hover { border-color: rgb(210,210,210); } .aezsmain .pop2Hint .btncon a:active { border-color: #1AB394; background-color: #1AB394; } .aezsmain .pop2overlay{ background-color: rgba(0, 0, 0, 0.4); position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 100001; } .aezsmain .pop2Hint p{ color: #797979; font-size: 15px; text-align: center; font-weight: 300; position: relative; float: none; margin-bottom: 18px; padding: 0; line-height: normal; }

GlobalTechMart
Review

You May Also Like

Leather+Silicone Strap for Samsung Watch 7/6/5/4 40 44mm 4/6 Classic 42 43 46 47mm Leather Grain Band for Galaxy Watch 5pro 45mm

Glass Lens Protector Film for Samsung Galaxy S26 Ultra S26 Plus S26 Camera Full-Coverage Protection Tempered Glass

Stylus No-Latency Touch Screen Pen

GLOWLITE 360 ° Purification Ultrasonic Cleaning Machine High Frequency One-button Ultrasonic Glasses Cleaner Ultrasonic Cleaning Device Portable Vibration Wash Cleaner For Ring Glasses Makeup Brush

szhaiyu | For Magsafe Magnetic ShockProof Protective Phone Case For iPhone 17 Pro Max 16 15 14 13 12 Silicone Plain Back Cover

imobile | Drop Protection Full Coverage Case for Oppo Find X2 Pro

Casing For Honor X6d Honorx6d Leather Phone Case Camera Protection Shockpoof Cases Back Cover

WiWU iShield Ultra Case for iPhone 17 Pro max 360 ° Rotation Stand for iPhone 17 Pro Air Magnetic Wireless Charge

1pcs 2pcs 3pcs 2-IN-1 USB-C Cable Foldable SmartPhone Holder 240W Fast Charging Data Cable Phone Charge Bracket PD Cable

Hagibis USB C to USB C Cable USB Type C Charger Cord 240W PD3.1 Fast Charging Short for iPhone 15/16/17 Pro Laptops Tablet Car

Leather Funda For Xiaomi Poco X7 Pro 5G Case Magnetic Car Phone Cover For PocoX7Pro Poko Little X 7 Pro X7Pro 5G Shockproo Coque


