123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <style>
- .helper{
- display: none;
- }
- </style>
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css"/>
- <div class="main-content-inner" style="height: 500px;width: 94%;">
- <div class="layout-gap">
- <span style="float: left">
- <div id="clearCopied" class="anc-finish-btn i_fl select_file" style="height: 32px;line-height: 32px;margin-top: 5px;">清空全部已复制</div>
- <span style="height: 32px;line-height: 32px;margin-top: 5px; margin-left:5px;color: red;">下载链接有效期为24小时</span>
- </span>
- <span style="float: right">
- <div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
- <div class="row" style="padding-top:10px;">
- <div style="font-size: 16px">
- <div class="dataTables_paginate paging_simple_numbers"
- style="vertical-align:sub;">
- <ul id="yw0" class="yiiPager">
- <li>
- <?php echo $page;?>/<?php echo $pages['totalPage'];?>
- </li>
- <?php
- if ($page > 1) {
- echo '<li class="previous"><a href="' . $this->createUrl('downloadtask/index') . '?page=' . ($page - 1) . '">上一页</a></li>';
- }
- if ($page < $pages['totalPage']) {
- echo '<li class="next"><a href="' . $this->createUrl('downloadtask/index') . '?page=' . ($page + 1) . '">下一页</a></li>';
- }
- ?>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </span>
- </div>
- <section>
- <div class="x_content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <div class="dataTables_length margin-zy">
- <table id="datatable" class="table table-striped table-bordered"
- style="margin-left: 30px;">
- <thead>
- <tr>
- <th>名称</th>
- <th>班级</th>
- <th>打包人数</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(empty($dataList)):?>
- <tr><td colspan="5" style="text-align: center;vertical-align: center;font-size: 20px">暂无数据</td></tr>
- <?php endif;?>
- <?php foreach ($dataList as $loop): ?>
- <tr>
- <td><?php echo $loop['product_name'] ?></td>
- <td><?php echo $loop['class_name'] ?></td>
- <td><?php echo $loop['student_count'] ?></td>
- <td style="color:
- <?php
- switch ($loop['pack_status']) {
- case 0:
- echo 'red';
- break;
- case 1:
- echo 'orange';
- break;
- case 2:
- echo 'black';
- break;
- case 3:
- echo 'green';
- break;
- }
- ?>
- ;"><?php echo $loop['status'] ?></td>
- <td id="copyUrl">
- <?php if ($loop['pack_status'] == 1 || $loop['pack_status'] == 3): ?>
- <span style="padding:5px;color:white;background: #2977ff;cursor: pointer"
- data-url="<?php echo $loop['pack_url']; ?>"
- data-id="<?php echo $loop['id']; ?>"
- >复制下载链接</span>
- <?php endif; ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
- </section>
- </div>
- <script src="/js/jquery-2.2.2.min.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- $('#clearCopied').click(function () {
- layer.msg("确定清除已复制的下载任务吗?", {
- time: 0,
- btn: ['确定', '取消'],
- offset: ['300px', '350px'],
- yes: function (index) {
- layer.close(index);
- $.ajax({
- type: 'GET',
- url: "<?php echo $this->createUrl("downloadtask/clear");?>",
- success: function (data) {
- layer.alert('清空成功!', {
- icon: 1,
- offset: ['300px', '350px'],
- yes: function () {
- location.reload();
- }
- });
- }
- });
- }
- })
- });
- $('#copyUrl span').click(function () {
- var taskId = $(this).attr('data-id');
- var url = $(this).attr('data-url');
- Copy(url);
- $.ajax({
- type: 'GET',
- url: "<?php echo $this->createUrl("downloadtask/ajaxCopy");?>",
- data: {"id": taskId},
- success: function (data) {
- layer.alert('复制成功!', {
- icon: 1,
- offset: ['300px', '350px'],
- yes: function () {
- location.reload();
- }
- });
- }
- })
- });
- // 复制微信号函数
- function Copy(str) {
- var save = function (e) {
- e.clipboardData.setData('text/plain', str);
- e.preventDefault();
- };
- document.addEventListener('copy', save);
- document.execCommand('copy');
- document.removeEventListener('copy', save);
- console.log('复制成功');
- }
- </script>
|