12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .printerbox{
- border:1px solid #ccc;
- margin: 0 auto;
- background-color: #fff;
- padding: 10px;
- }
- .printerbox img{
- width: 100%;
- }
- .printerbox p{
- padding-top: 10px;
- }
- </style>
- <div id="printer" class="text-center">
- {foreach $list as $key => $value}
- <div class="col-xs-6 printerbox">
- <img src="{:url('Qrcode/qrcode')}?code={$value['qCode']}" alt="二维码">
- <p class="text-center">{$value['title']}</p>
- </div>
- {/foreach}
- </div>
- <div class="text-center">
- <br>
- <a href="javascript:;" class="btn btn-sm btn-primary" onclick="print()"><i class="glyphicon glyphicon-print"> 打印</i></a>
- </div>
- <script src="/static/jquery-1.11.3.min.js"></script>
- <script src="/static/browser.js"></script>
- <script src="/static/jquery.jqprint-0.3.js"></script>
- <script>
- function print(){
- $("#printer").jqprint();
- }
- </script>
- <script>
- var index = layer.load(1, {
- shade: [0.1,'#fff'] //0.1透明度的白色背景
- });
- document.onreadystatechange = function() //当页面加载状态改变的时候执行function
- {
- if(document.readyState == "complete") { //当页面加载状态为完全结束时进入
- layer.closeAll();
- window.print();
- }
- }
- </script>
- {/block}
|