Commit a1b12a75 by 孙龙

up

parent 3bc106b4
......@@ -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;
......
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