Commit 1e853cf6 by 孙龙

up

parent ffec89cd
......@@ -104,6 +104,27 @@ class WebController extends Controller
}
/*
* 标签预览
*/
public function showTemplate($request,$info){
$info['title'] = '预览';
$id = $request->input("t_id",0);
$count = TemplateListModel::where("id",intval($id))->where("create_userid",$request->user->userId)->count("id");
if($count <= 0){
return back()->with('showTemplateerror', '没找到属于您的模板信息');
}
$templateInfo = TemplateListModel::where("id",intval($id))->select("id","template_name","status")->first();
if($templateInfo->status <= 0){
return back()->with('showTemplateerror', '该模板已经被主人禁用了');
}
// dump($templateInfo->template_extend);
$html = $templateInfo->template_extend;
$info["html"] = $html->html;
return view('web', $info);
}
/*
* 打印标签
*/
public function prints($request,$info){
......@@ -128,6 +149,9 @@ class WebController extends Controller
$templateRelation = TmplRelationsModel::where("create_userid",$request->user->userId)->whereIn("id",$tmpl_relationid_arr)
->get();
if(!$templateRelation){
die("没有要打印的数据");
}
$html = [];
foreach($templateRelation as $item){
$createHtml = (new \App\Services\LabelService)->getLabelHtml($item->id);
......
@if (session('showTemplateerror'))
<div class="alert alert-success">
{{ session('showTemplateerror') }}
</div>
@endif
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
......@@ -49,7 +54,7 @@
<script type="text/html" id="action">
<!-- <a class="btn btn-xs btn-outline btn-info" lay-event="offline">离线使用</a> -->
<a class="btn btn-xs btn-outline btn-success" lay-event="show">预览</a>
<a class="btn btn-xs btn-outline btn-success" href="/web/showTemplate?t_id=@{{ d.id }}" target="_blank" lay-event="show">预览</a>
<a class="btn btn-xs btn-outline btn-success" href="/web/design?t_id=@{{ d.id }}" target="_blank">编辑</a>
@{{# if (d.status == -1) { }}
<a class="btn btn-xs btn-outline layui-btn-primary" lay-event="enable">启用</a>
......
{!! $html !!}
\ No newline at end of file
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