Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ruitu-fahuoyi-exension
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖健文
ruitu-fahuoyi-exension
Commits
21119c43
Commit
21119c43
authored
Nov 14, 2022
by
liuyanfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加打印失败的订单返回
parent
c1a04b5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
bookingApp.ts
src/content/bookingApp.ts
+4
-1
bookingV2.ts
src/content/bookingV2.ts
+2
-0
index.ts
src/content/index.ts
+12
-2
No files found.
src/content/bookingApp.ts
View file @
21119c43
...
...
@@ -27,10 +27,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
let
result
=
{
status
:
0
,
msg
:
""
,
data
:
[]
,
data
:
[]
}
let
printError
:
any
=
orderNo
result
=
await
waitOrder
();
if
(
result
.
status
>
0
)
{
result
.
data
=
printError
return
result
;
}
...
...
@@ -41,6 +43,7 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
result
=
await
waitDialog
();
if
(
result
.
status
>
0
)
{
result
.
data
=
printError
return
result
;
}
for
(
let
i
=
0
;
i
<
domEle
.
selectWaybillTemplate
.
options
.
length
;
i
++
)
{
...
...
src/content/bookingV2.ts
View file @
21119c43
...
...
@@ -262,6 +262,8 @@ 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
(
new
MouseEvent
(
mouseEventType
,
{
...
...
src/content/index.ts
View file @
21119c43
...
...
@@ -194,8 +194,18 @@ const printWayBillByNew = function ({ orderNo, wayCompanyId, platform }: Pick<Pa
// web页面通信
window
.
addEventListener
(
"message"
,
function
(
message
:
any
){
console
.
log
(
111111
,
message
);
chrome
.
storage
.
local
.
get
({
AutoTime
:
null
,
proAutoTime
:
null
},
function
(
res
)
{
if
(
res
.
AutoTime
){
chrome
.
runtime
.
sendMessage
(
message
.
data
,(
ret
)
=>
{
window
.
postMessage
({
AutoTime
:
res
.
AutoTime
})
})
}
if
(
res
.
proAutoTime
){
chrome
.
runtime
.
sendMessage
(
message
.
data
,(
ret
)
=>
{
window
.
postMessage
({
proAutoTime
:
res
.
proAutoTime
})
})
}
})
if
(
message
.
data
.
action
==
ACTION
.
BookingApp
){
chrome
.
runtime
.
sendMessage
(
message
.
data
,(
ret
)
=>
{
window
.
postMessage
({
isResult
:
1
,...
ret
},
"*"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment