Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a1b12a75
authored
May 25, 2020
by
孙龙
1
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
3bc106b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
app/Services/LabelService.php
storage/offline_print/1000.txt
app/Services/LabelService.php
View file @
a1b12a75
...
...
@@ -115,7 +115,6 @@ class LabelService {
$html
=
$_html
;
}
$dom
=
HtmlDomParser
::
str_get_html
(
$html
);
//处理文本
...
...
@@ -136,21 +135,26 @@ class LabelService {
//处理一维码
$yiweimaits
=
$dom
->
find
(
"div[name='yiweimait']"
);
foreach
(
$yiweimaits
as
$k
=>
$yiweimait
){
$a
=
$yiweimait
->
style
;
$b
=
'data:image/png;base64,'
.
DNS1D
::
getBarcodePNG
(
$yiweimait
->
datatypes
,
"C128"
);
$c
=
preg_replace
(
'/background: url\((.*?)\) 0% 0% \/ 100% 100%/'
,
" background: url(
{
$b
}
) 0% 0% / 100% 100% "
,
$a
);
$yiweimait
->
style
=
$c
;
try
{
$a
=
$yiweimait
->
style
;
$b
=
'data:image/png;base64,'
.
DNS1D
::
getBarcodePNG
(
$yiweimait
->
datatypes
,
"C128"
);
$c
=
preg_replace
(
'/background: url\((.*?)\) 0% 0% \/ 100% 100%/'
,
" background: url(
{
$b
}
) 0% 0% / 100% 100% "
,
$a
);
$yiweimait
->
style
=
$c
;
}
catch
(
\Exception
$e
){
throw
new
\Exception
(
sprintf
(
"生成一维码失败:%s,一维码内容:%s"
,
$e
->
getMessage
(),
$yiweimait
->
datatypes
));
}
}
//处理二维码
$erweimas
=
$dom
->
find
(
"div[name='erweimait']"
);
foreach
(
$erweimas
as
$k
=>
$erweima
){
$a
=
$erweima
->
style
;
$b
=
'data:image/png;base64,'
.
DNS2D
::
getBarcodePNG
(
$erweima
->
datatypes
,
"QRCODE"
);
$c
=
preg_replace
(
'/background: url\((.*?)\) 0% 0% \/ 100% 100%/'
,
" background: url(
{
$b
}
) 0% 0% / 100% 100% "
,
$a
);
$erweima
->
style
=
$c
;
try
{
$a
=
$erweima
->
style
;
$b
=
'data:image/png;base64,'
.
DNS2D
::
getBarcodePNG
(
$erweima
->
datatypes
,
"QRCODE"
);
$c
=
preg_replace
(
'/background: url\((.*?)\) 0% 0% \/ 100% 100%/'
,
" background: url(
{
$b
}
) 0% 0% / 100% 100% "
,
$a
);
$erweima
->
style
=
$c
;
}
catch
(
\Exception
$e
){
throw
new
\Exception
(
sprintf
(
"生成二维码失败:%s"
,
$e
->
getMessage
()));
}
}
return
$dom
;
...
...
storage/offline_print/1000.txt
View file @
a1b12a75
This diff could not be displayed because it is too large.
孙龙
@sunlong_v5
mentioned in commit
7e990092
Dec 23, 2020
mentioned in commit
7e990092
mentioned in commit 7e99009262fbdbea3a65b5d52b174fc47da74fc5
Toggle commit list
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