| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>考生考场座位贴</title>
- <style>
- .room{
- width: 100%;
- border:1px solid #cecece;
- }
- .room.selected{
- border:1px solid #f20e01;
- }
- .print h2{
- text-align: center;
- }
- .print .list .item{
- width: 200px;
- text-align: center;
- line-height: 40px;
- font-weight: bold;
- font-size: 20px;
- float: left;
- }
- .print .list .item .avatar{
- width: 180px;
- height: 253px;
- }
- </style>
- </head>
- <body>
- @foreach($data as $k=>$v)
- <div class="room clearfix">
- <div class="print">
- <div class="list">
- @foreach($v as $key => $val)
- <div class="item">
- <div class="avatar">
- <img src="{{$val['avatar']}}" width="170" />
- </div>
- <div class="seat">
- 座位号:{{$val['seat']}}
- </div>
- <div class="realname">
- 姓名:{{$val['realname']}}
- </div>
- <div class="number">
- 准考证:{{$val['number']}}
- </div>
- </div>
- @endforeach
- </div>
- </div>
- </div>
- <div class="print" style="margin: 10px 0;text-align: center">
- <button class="print_page btn btn-sm btn-info" style="width: 200px;height: 60px;font-size: 30px;line-height: 40px">打印此页</button>
- </div>
- @endforeach
- <div id="print_body" ></div>
- <script type="text/javascript" src="{{ theme_asset('app/js/hiprint/polyfill.min.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/hiprint/hiprint.bundle.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/hiprint/plugins/JsBarcode.all.min.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/hiprint/plugins/qrcode.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('app/js/jQuery.print.js') }}"></script>
- <script>
- $(".print_page").on('mouseover',function(){
- var dom = $(this).parent().prev();
- $(dom).addClass('selected')
- });
- $(".print_page").on('mouseout',function(){
- var dom = $(this).parent().prev();
- $(dom).removeClass('selected')
- });
- $(".print_page").on('click',function(){
- var dom = $(this).parent().prev();
- console.log(dom)
- $(dom).print()
- });
- // hiprint.init();
- // <!-- 创建打印模板对象-->
- // var hiprintTemplate = new hiprint.PrintTemplate();
- // <!-- 模板对象添加打印面板 paperHeader:页眉线 paperFooter:页尾线-->
- // var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 });
- // <!-- 文本 打印面板添加文本元素-->
- // panel.addPrintText({ options: { width: 140, height: 15, top: 20, left: 20, title: 'hiprint插件手动添加text', textAlign: 'center' } });
- // <!-- 条形码 打印面板添加条形码元素-->
- // panel.addPrintText({ options: { width: 140, height: 35, top: 40, left: 20, title: '123456', textType: 'barcode' } });
- // <!-- 二维码 打印面板添加二维码元素-->
- // panel.addPrintText({ options: { width: 35, height: 35, top: 40, left: 165, title: '二维码', textType: 'qrcode' } });
- // <!-- 长文本 打印面板添加长文本元素-->
- // panel.addPrintLongText({ options: { width: 180, height: 35, top: 90, left: 20, title: '长文本:' } });
- // <!-- 表格 打印面板添加表格元素 content为字符串 -->
- // panel.addPrintTable({ options: { width: 252, height: 35, top: 130, left: 20, content: $('#testTable').html() } });
- // <!-- html 打印面板添加自定义html content为字符串或$('..') -->
- // panel.addPrintHtml({ options: { width: 140, height: 35, top: 180, left: 20, content:'' } });
- // <!-- 竖线 -->
- // panel.addPrintVline({ options: { height: 35, top: 230, left: 20 } });
- // <!-- 横线 -->
- // panel.addPrintHline({ options: { width: 140, top: 245, left: 120 } });
- // <!-- 矩形 -->
- // panel.addPrintRect({ options: { width: 35, height: 35, top: 230, left: 60 } });
- // <!-- 打印设计 -->
- // hiprintTemplate.design('#print_body');
- </script>
- </body>
- </html>
|