Commit 8c305c70 by 孙龙

up

parent c0f21ec3
...@@ -11,6 +11,7 @@ use App\Model\TemplateListModel; ...@@ -11,6 +11,7 @@ use App\Model\TemplateListModel;
use App\Model\NodesModel; use App\Model\NodesModel;
use DNS1D; use DNS1D;
use DNS2D; use DNS2D;
use Sunra\PhpSimple\HtmlDomParser;
class WebController extends Controller class WebController extends Controller
{ {
...@@ -121,11 +122,54 @@ class WebController extends Controller ...@@ -121,11 +122,54 @@ class WebController extends Controller
foreach($matches[1] as $k=>$field){ foreach($matches[1] as $k=>$field){
$arr[$k] = $info["ichunt2020"][$field]; $arr[$k] = $info["ichunt2020"][$field];
} }
$html = str_replace($matches[0],$arr,$tmpRelation->tmpRelation->html); if(!empty($matches)){
$html = str_replace($matches[0],$arr,$tmpRelation->tmpRelation->html);
}else{
$html = $tmpRelation->tmpRelation->html;
}
$dom = HtmlDomParser::str_get_html( $html );
$textareas = $dom->find('textarea');
foreach($textareas as $k=>$textarea){
$textarea->innertext = $textarea->datatypes;
}
$yiweimaits = $dom->find("div[name='yiweimait']");
foreach($yiweimaits as $k=>$yiweimait){
// dump($yiweimait->imagesurl);
// dump($yiweimait->style);
// dump($yiweimait->datatypes);
// dump(DNS1D::getBarcodePNG($yiweimait->datatypes, "C128"));
$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;
}
$erweimas = $dom->find("div[name='erweimait']");
foreach($erweimas as $k=>$erweima){
// dump($erweima->datatypes);
$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);
// dump($c);
$erweima->style = $c;
}
//exit;
// dump($dom);
// exit;
// \View::make('admin.messages', $info["ichunt2020"]); // \View::make('admin.messages', $info["ichunt2020"]);
// dump($html);exit; // dump($html);exit;
$info["html"] = $html; $info["html"] = $dom;
return view('web', $info); return view('web', $info);
} }
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
"hprose/hprose": "^2.0", "hprose/hprose": "^2.0",
"php-amqplib/php-amqplib": "2.7", "php-amqplib/php-amqplib": "2.7",
"jenssegers/mongodb": "3.2.*", "jenssegers/mongodb": "3.2.*",
"milon/barcode": "5.1" "milon/barcode": "5.1",
"sunra/php-simple-html-dom-parser": "1.5.2"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
......

508 Bytes | W: | H:

134 Bytes | W: | H:

public4445645656.png
public4445645656.png
public4445645656.png
public4445645656.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<script type="text/html" id="action"> <script type="text/html" id="action">
<a class="btn btn-xs btn-outline btn-info" href="/web/showPage?tmpl_relation_id=@{{ d.id }}" target="_blank" lay-event="offline">预览</a> <a class="btn btn-xs btn-outline btn-info" href="/web/showPage?tmpl_relation_id=@{{ d.id }}" target="_blank" lay-event="offline">预览</a>
<a class="btn btn-xs btn-outline btn-success" href="/web/editLabel?t_id=@{{ d.id }}" target="_blank">下载</a> <a class="btn btn-xs btn-outline btn-success" href="/web/showPage?tmpl_relation_id=@{{ d.id }}" target="_blank" target="_blank">下载</a>
{{--@{{# if (d.status == -1) { }}--}} {{--@{{# if (d.status == -1) { }}--}}
{{--<a class="btn btn-xs btn-outline layui-btn-primary" lay-event="enable">启用</a>--}} {{--<a class="btn btn-xs btn-outline layui-btn-primary" lay-event="enable">启用</a>--}}
{{--@{{# }else{ }}--}} {{--@{{# }else{ }}--}}
......
This diff could not be displayed because it is too large.
...@@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir); ...@@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
return array( return array(
'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'), 'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'),
'Sunra\\PhpSimple\\HtmlDomParser' => array($vendorDir . '/sunra/php-simple-html-dom-parser/Src'),
'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'), 'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'),
'Mockery' => array($vendorDir . '/mockery/mockery/library'), 'Mockery' => array($vendorDir . '/mockery/mockery/library'),
'Milon\\Barcode' => array($vendorDir . '/milon/barcode/src'), 'Milon\\Barcode' => array($vendorDir . '/milon/barcode/src'),
......
This diff could not be displayed because it is too large.
...@@ -3512,6 +3512,62 @@ ...@@ -3512,6 +3512,62 @@
"homepage": "https://github.com/sebastianbergmann/version" "homepage": "https://github.com/sebastianbergmann/version"
}, },
{ {
"name": "sunra/php-simple-html-dom-parser",
"version": "v1.5.2",
"version_normalized": "1.5.2.0",
"source": {
"type": "git",
"url": "https://github.com/sunra/php-simple-html-dom-parser.git",
"reference": "75b9b1cb64502d8f8c04dc11b5906b969af247c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sunra/php-simple-html-dom-parser/zipball/75b9b1cb64502d8f8c04dc11b5906b969af247c6",
"reference": "75b9b1cb64502d8f8c04dc11b5906b969af247c6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.2"
},
"time": "2016-11-22T22:57:47+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Sunra\\PhpSimple\\HtmlDomParser": "Src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sunra",
"email": "sunra@yandex.ru",
"homepage": "https://github.com/sunra"
},
{
"name": "S.C. Chen",
"homepage": "http://sourceforge.net/projects/simplehtmldom/"
}
],
"description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.",
"homepage": "https://github.com/sunra/php-simple-html-dom-parser",
"keywords": [
"dom",
"html",
"parser"
]
},
{
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v5.4.12", "version": "v5.4.12",
"version_normalized": "5.4.12.0", "version_normalized": "5.4.12.0",
......
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