Commit 7e990092 by 孙龙

Revert "up"

This reverts commit a1b12a75
parent 81b23655
...@@ -115,6 +115,7 @@ class LabelService { ...@@ -115,6 +115,7 @@ class LabelService {
$html = $_html; $html = $_html;
} }
$dom = HtmlDomParser::str_get_html( $html ); $dom = HtmlDomParser::str_get_html( $html );
//处理文本 //处理文本
...@@ -135,26 +136,21 @@ class LabelService { ...@@ -135,26 +136,21 @@ class LabelService {
//处理一维码 //处理一维码
$yiweimaits = $dom->find("div[name='yiweimait']"); $yiweimaits = $dom->find("div[name='yiweimait']");
foreach($yiweimaits as $k=>$yiweimait){ foreach($yiweimaits as $k=>$yiweimait){
try{
$a = $yiweimait->style; $a = $yiweimait->style;
$b = 'data:image/png;base64,' . DNS1D::getBarcodePNG($yiweimait->datatypes, "C128"); $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; $c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a);
}catch(\Exception $e){ $yiweimait->style = $c;
throw new \Exception(sprintf("生成一维码失败:%s,一维码内容:%s",$e->getMessage(),$yiweimait->datatypes));
}
} }
//处理二维码 //处理二维码
$erweimas = $dom->find("div[name='erweimait']"); $erweimas = $dom->find("div[name='erweimait']");
foreach($erweimas as $k=>$erweima){ foreach($erweimas as $k=>$erweima){
try{ $a =$erweima->style;
$a =$erweima->style; $b = 'data:image/png;base64,' . DNS2D::getBarcodePNG($erweima->datatypes, "QRCODE");
$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);
$c = preg_replace('/background: url\((.*?)\) 0% 0% \/ 100% 100%/'," background: url({$b}) 0% 0% / 100% 100% ",$a); $erweima->style = $c;
$erweima->style = $c;
}catch(\Exception $e){
throw new \Exception(sprintf("生成二维码失败:%s",$e->getMessage()));
}
} }
return $dom; return $dom;
......
This diff could not be displayed because it is too large.
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 sign in to comment