Commit e168472b authored by liuyanfang's avatar liuyanfang

修复授权店铺名称错误

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