Commit be64338c authored by liuyanfang's avatar liuyanfang

修复bug

parent 5593231e
...@@ -85,7 +85,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) { ...@@ -85,7 +85,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
// 从bg页面转发给厂家页面的content.js // 从bg页面转发给厂家页面的content.js
chrome.tabs.query({ chrome.tabs.query({
url: bookingAppUrls url: `https://${message.value.platform}.fahuoyi.com/order/index*` //淘宝:app 拼多多:pdd5
}, function (tabs) { }, function (tabs) {
tabs && tabs.forEach(tab => { tabs && tabs.forEach(tab => {
// chrome.tabs.sendMessage(tab.id!, message) // chrome.tabs.sendMessage(tab.id!, message)
......
...@@ -32,6 +32,12 @@ async function booking(wayCompanyId: string, orderNo: string) { ...@@ -32,6 +32,12 @@ async function booking(wayCompanyId: string, orderNo: string) {
domEle.btnPrint.click(); domEle.btnPrint.click();
await delayDate(500);
if(document.querySelector(".bootbox-message")?.innerText==' 所选订单中部分订单地址不可达,是否继续打印?'){
document.querySelector(".bootbox-accept").click();
}
result = await waitDialog(); result = await waitDialog();
if (result.status > 0) { if (result.status > 0) {
...@@ -91,6 +97,11 @@ async function booking(wayCompanyId: string, orderNo: string) { ...@@ -91,6 +97,11 @@ async function booking(wayCompanyId: string, orderNo: string) {
domEle.btnDeliver.click() domEle.btnDeliver.click()
} }
return result; return result;
}else{
//取消打印
await delayDate(1000);
document.querySelector("#printWaybillDialog > div > div > div.modal-footer > button.btn.btn-default").click();
return result;
} }
...@@ -160,6 +171,11 @@ async function waitPrintResult() { ...@@ -160,6 +171,11 @@ async function waitPrintResult() {
result.msg = "" result.msg = ""
return result; return result;
} }
if(document.querySelector(".bootbox-message")?.innerText==' 获取电子面单失败,从9月1日起淘宝平台开启付费解密虚拟号方案(查看详情),因此不支持非菜鸟电子面单打印,请尽量使用菜鸟电子面单打印,如需付费解密虚拟号打印非菜鸟电子面单请联系发货易客服咨询'){
result.msg="获取电子面单失败";
document.querySelector(".bootbox-accept").click();
return result;
}
} }
return result; return result;
} }
......
...@@ -5,8 +5,8 @@ let domEle = { ...@@ -5,8 +5,8 @@ let domEle = {
divNav:document.getElementsByClassName("nav-link") as HTMLCollection, divNav:document.getElementsByClassName("nav-link") as HTMLCollection,
inputOrderId: "#originalIds", 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)", 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", checkBoxSelectAll: "div.bottom-operation-bar > span input.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", btnPrint: ".ec-print-waybill-button",
modalTips:"ant-modal-confirm-title", modalTips:"ant-modal-confirm-title",
btnTipsConfirm:"ant-btn ant-btn-primary", btnTipsConfirm:"ant-btn ant-btn-primary",
spanWaybillTemplate: ():any=>document.getElementsByClassName("ant-modal-body")[0].getElementsByClassName("ant-select-selector")[0] , 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