Commit e168472b authored by liuyanfang's avatar liuyanfang

修复授权店铺名称错误

parent e0c011c4
{ {
"name": "菜芽-自动约单", "name": "菜芽-自动约单",
"version": "1.0.8", "version": "1.0.10",
"description": "辅助手机壳厂家打印发货易的快递单", "description": "辅助手机壳厂家打印发货易的快递单",
"manifest_version": 2, "manifest_version": 2,
......
...@@ -26,7 +26,6 @@ let domEle = { ...@@ -26,7 +26,6 @@ let domEle = {
async function booking(wayCompanyId: string, orderNo: string,fhy_type:Number) { async function booking(wayCompanyId: string, orderNo: string,fhy_type:Number) {
let checkOptionObj = platformObj let checkOptionObj = platformObj
chrome.storage.local.get({ checkOptionObj: platformObj }, function (res) { chrome.storage.local.get({ checkOptionObj: platformObj }, function (res) {
console.log('新版V2',res.checkOptionObj);
checkOptionObj = res.checkOptionObj checkOptionObj = res.checkOptionObj
}) })
let result = { let result = {
...@@ -92,9 +91,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:Number) { ...@@ -92,9 +91,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:Number) {
let rowObject = { let rowObject = {
info: rowInfo, info: rowInfo,
msg: rowResult, msg: rowResult,
orderNo, orderNo:'',
success: 1, success: 1,
} }
if(rowIter===0){
rowObject.orderNo = orderNo
}
rowResultList.push(rowResult) rowResultList.push(rowResult)
if (rowResult.indexOf("打印失败") > -1) { if (rowResult.indexOf("打印失败") > -1) {
printReslut.fail++; printReslut.fail++;
...@@ -158,6 +160,7 @@ async function waitreauthDialog() { ...@@ -158,6 +160,7 @@ async function waitreauthDialog() {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
await delayDate(1000); await delayDate(1000);
if (domEle.reauthDialog&&domEle.reauthDialog.style.display==='block') { if (domEle.reauthDialog&&domEle.reauthDialog.style.display==='block') {
await delayDate(1000)
result.msg=`获取${domEle.shopName.innerText}店铺授权失败` result.msg=`获取${domEle.shopName.innerText}店铺授权失败`
domEle.reauthDialogClose.click() domEle.reauthDialogClose.click()
return result return result
...@@ -219,6 +222,7 @@ async function waitPrintResult() { ...@@ -219,6 +222,7 @@ async function waitPrintResult() {
for (let i = 0; i < 30; i++) { for (let i = 0; i < 30; i++) {
await delayDate(1000); await delayDate(1000);
if (domEle.reauthDialog&&domEle.reauthDialog.style.display==='block') { if (domEle.reauthDialog&&domEle.reauthDialog.style.display==='block') {
await delayDate(1000)
console.log('店铺授权',domEle.shopName.innerText); console.log('店铺授权',domEle.shopName.innerText);
result.status = 5; result.status = 5;
result.msg=`获取${domEle.shopName.innerText}店铺授权失败`; result.msg=`获取${domEle.shopName.innerText}店铺授权失败`;
......
...@@ -29,7 +29,6 @@ let domEle = { ...@@ -29,7 +29,6 @@ let domEle = {
async function booking(waybillTemplateTitle: string, orderNo: string,shopId:string,fhy_type:number) { async function booking(waybillTemplateTitle: string, orderNo: string,shopId:string,fhy_type:number) {
let checkOptionObj = platformObj let checkOptionObj = platformObj
chrome.storage.local.get({ checkOptionObj: platformObj }, function (res) { chrome.storage.local.get({ checkOptionObj: platformObj }, function (res) {
console.log('新版V2',res.checkOptionObj);
checkOptionObj = res.checkOptionObj checkOptionObj = res.checkOptionObj
}) })
let result = { let result = {
...@@ -94,11 +93,12 @@ async function booking(waybillTemplateTitle: string, orderNo: string,shopId:stri ...@@ -94,11 +93,12 @@ async function booking(waybillTemplateTitle: string, orderNo: string,shopId:stri
simulateMouseClick(domEle.spanWaybillTemplate()); simulateMouseClick(domEle.spanWaybillTemplate());
let waybillTemplateList= domEle.divWaybillTemplateList(); let waybillTemplateList= domEle.divWaybillTemplateList();
console.log(111111111,waybillTemplateList);
for (let i = 0; i < waybillTemplateList.childNodes.length; i++) { for (let i = 0; i < waybillTemplateList.childNodes.length; i++) {
console.log(2222,waybillTemplateList.childNodes);
let divItem = waybillTemplateList.childNodes[i] as any; let divItem = waybillTemplateList.childNodes[i] as any;
if (divItem.innerText.includes(waybillTemplateTitle) ) { if (divItem.innerText.includes(waybillTemplateTitle) ) {
console.log(333333,waybillTemplateTitle);
simulateMouseClick(divItem); simulateMouseClick(divItem);
simulateMouseClick(domEle.radioGetNewWaybill()); simulateMouseClick(domEle.radioGetNewWaybill());
...@@ -132,9 +132,12 @@ async function booking(waybillTemplateTitle: string, orderNo: string,shopId:stri ...@@ -132,9 +132,12 @@ async function booking(waybillTemplateTitle: string, orderNo: string,shopId:stri
let rowObject = { let rowObject = {
info: rowInfo, info: rowInfo,
msg: rowResult, msg: rowResult,
orderNo, orderNo:'',
success: 1, success: 1,
} }
if(rowIter===0){
rowObject.orderNo = orderNo
}
rowResultList.push(rowResultHTML) rowResultList.push(rowResultHTML)
if (domEle.tableResult().rows[rowIter].cells[2].innerHTML.indexOf('class="text-error"') > -1) { if (domEle.tableResult().rows[rowIter].cells[2].innerHTML.indexOf('class="text-error"') > -1) {
printReslut.fail++; printReslut.fail++;
...@@ -203,6 +206,7 @@ async function waitreauthDialog() { ...@@ -203,6 +206,7 @@ async function waitreauthDialog() {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
await delayDate(1000); await delayDate(1000);
if (domEle.reauthDialog()&&domEle.reauthDialog().style.display) { if (domEle.reauthDialog()&&domEle.reauthDialog().style.display) {
await delayDate(1000);
result.msg=`获取${domEle.shopName().innerText}店铺授权失败`; result.msg=`获取${domEle.shopName().innerText}店铺授权失败`;
return result; return result;
}else { }else {
...@@ -271,6 +275,7 @@ async function waitPrintResult() { ...@@ -271,6 +275,7 @@ async function waitPrintResult() {
return result; return result;
} }
if (domEle.reauthDialog()&&domEle.reauthDialog().style.display) { if (domEle.reauthDialog()&&domEle.reauthDialog().style.display) {
await delayDate(1000);
result.status = 5 result.status = 5
result.msg=`获取${domEle.shopName().innerText}店铺授权失败` result.msg=`获取${domEle.shopName().innerText}店铺授权失败`
return result return result
...@@ -303,7 +308,6 @@ function changeReactInputValue(inputDom:any,newText:string){ ...@@ -303,7 +308,6 @@ function changeReactInputValue(inputDom:any,newText:string){
const mouseClickEvents = ['mousedown', 'click', 'mouseup']; const mouseClickEvents = ['mousedown', 'click', 'mouseup'];
function simulateMouseClick(element:any){ function simulateMouseClick(element:any){
console.log('element',element);
if(!element) return if(!element) return
mouseClickEvents.forEach(mouseEventType => mouseClickEvents.forEach(mouseEventType =>
element.dispatchEvent( element.dispatchEvent(
......
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