Commit 5bdb543c authored by liuyanfang's avatar liuyanfang

修复bug

parent 21119c43
......@@ -85,7 +85,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
// 从bg页面转发给厂家页面的content.js
chrome.tabs.query({
url: bookingAppUrls
url: `https://${message.value.platform}.fahuoyi.com/order/index*` //淘宝:app 拼多多:pdd5
}, function (tabs) {
tabs && tabs.forEach(tab => {
// chrome.tabs.sendMessage(tab.id!, message)
......
......@@ -40,6 +40,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
domEle.btnPrint.click();
await delayDate(500);
if(document.querySelector(".bootbox-message")?.innerText==' 所选订单中部分订单地址不可达,是否继续打印?'){
document.querySelector(".bootbox-accept").click();
}
result = await waitDialog();
if (result.status > 0) {
......@@ -105,6 +111,11 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
}
}
return result;
}else{
//取消打印
await delayDate(1000);
document.querySelector("#printWaybillDialog > div > div > div.modal-footer > button.btn.btn-default").click();
return result;
}
......@@ -174,6 +185,11 @@ async function waitPrintResult() {
result.msg = ""
return result;
}
if(document.querySelector(".bootbox-message")?.innerText==' 获取电子面单失败,从9月1日起淘宝平台开启付费解密虚拟号方案(查看详情),因此不支持非菜鸟电子面单打印,请尽量使用菜鸟电子面单打印,如需付费解密虚拟号打印非菜鸟电子面单请联系发货易客服咨询'){
result.msg="获取电子面单失败";
document.querySelector(".bootbox-accept").click();
return result;
}
}
return result;
}
......
......@@ -7,8 +7,8 @@ let domEle = {
divNav:document.getElementsByClassName("nav-link") as HTMLCollection,
inputOrderId: "#originalIds",
btnSearch: "#root > section > main > div > div > div > div.order-main > div.order-table-container > div.order-search-pane > div > div > div:nth-child(2) > button:nth-child(2)",
checkBoxSelectAll: "#root > section > main > div > div > div > div.order-main > div:nth-child(3) > div:nth-child(2) > div.bottom-operation-bar > span:nth-child(1) > label > span.ant-checkbox > input",
btnPrint: "#root > section > main > div > div > div > div.order-main > div:nth-child(3) > div:nth-child(2) > div.bottom-operation-bar > button.ant-btn.ant-btn-primary.ec-print-waybill-button.mr10",
checkBoxSelectAll: "div.bottom-operation-bar > span input.ant-checkbox-input",
btnPrint: ".ec-print-waybill-button",
modalTips:"ant-modal-confirm-title",
btnTipsConfirm:"ant-btn ant-btn-primary",
spanWaybillTemplate: ():any=>document.getElementsByClassName("ant-modal-body")[0].getElementsByClassName("ant-select-selector")[0] ,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment