123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <style>
- .reset-title{padding-left: 20px; line-height: 40px;font-size: 14px;border-bottom: 1px solid #eee;}
- .paper-title{margin-right: 20px;font-weight: bold;}
- .chk-all{margin-left: 20px; padding-left:20px; cursor: pointer;background: url(/images/select_no.png) no-repeat left center;-webkit-background-size: 16px;background-size: 16px;}
- .chk-all.active{background: url(/images/select_ipt.png) no-repeat left center;-webkit-background-size: 16px;background-size: 16px;}
- .chk-num{margin-top: 10px;margin-left: 5px; width: 20px;height: 20px;line-height: 20px; text-align: center;font-style:normal; border-radius: 50%;background-color: #f40;color: #fff;}
- .class-box{padding-bottom:50px;}
- .class-box ul{padding:20px 0 0 24px;}
- .class-box li{position: relative;margin-right: 28px;margin-bottom: 20px; padding:10px 16px;width: 210px;height: 105px; border:1px solid #ccc;box-sizing: border-box;cursor: pointer;}
- .class-box li h3{margin:0; width: 180px; font-size: 16px;line-height: 24px; color: #697aff;}
- .class-box li p{margin-top: 6px;}
- .selected-img{position: absolute;top:50%;right: 10px;transform:translateY(-50%);display: none;}
- .class-box li.active,.class-box li:hover{border-color: #2977ff}
- .class-box li.active .selected-img{display: block;}
- .reset-btn{position: fixed;left: 24px;bottom:0;padding-top:10px;padding-bottom: 16px;width: 100%;background-color: #fff;}
- .reset-btn span{color: #f00;}
- .reset-btn a{margin-right: 10px; display: inline-block;color: #fff;background-color: grey;width: 100px;line-height: 30px;text-align: center; }
- .reset-btn2 a{text-decoration: none;background:#2977ff;}
- .reset-btn2 a:hover{text-decoration: none;background-color: #2977ff;}
- .reset-num{font-style:normal;}
- /*.topic-content*/
- .choose-topic h3,.filling-topic h3,.answer-topic h3{font-weight: 700;font-size: 14px;line-height: 34px;}
- .topic a{margin:0 5px; color: #4395ff}
- .topic p{display: inline;}
- .batch_topic a{margin:0 5px; color: #4395ff}
- .batch_topic p{display: inline;}
- /*.topic .score{color: #f00;}*/
- .score input,.right-answer{width: 30px;text-align: center; background: #fff;border:0;color: #50d2c2}
- .score input:focus,.right-answer:focus{border:1px solid #50d2c2;outline: none;}
- /*.right-answer{color: #f40;}*/
- .topic-answer input{width: 60px;}
- .model-score input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #009965;color:#fff;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score1 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
- .model-score2 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score2 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #009965;color: #fff;}
- .modal-btn .close3{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #fff;color: #000;border:1px solid #555;border-radius: 3px;}
- .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display:none ;background: rgba(0,0,0,.4)}
- .model-rule{width:80%;margin:15px auto;text-align: center;font-size:18px;}
- .modal1_multi .model-score1{width:80%;margin:10px auto;text-align: left}
- .modal1_multi .model-score-m{width:80%;margin:5px auto;}
- #update_msg{color:red}
- .modal1_multi .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
- </style>
- <div class="reset-title clearfix">
- <span class="fl paper-title"><?php echo isset($data[0]['name'])?$data[0]['name']:'';?></span>
- <div class="fl">
- <span class="fl">参考班级</span>
- <span class="chk-all fl">全选</span>
- <em class="fl chk-num reset-num">0</em>
- </div>
- </div>
- <div class="class-box">
- <ul class="clearfix" id="select-class">
- <?php foreach($data as $key => $value):?>
- <li class="fl" weekId="<?php echo $value['week_id'];?>">
- <div class="fl">
- <h3 class="ellipsis"><?php echo $value['class_name'];?></h3>
- <p>已生成/总数:<?php echo $value['create_count'];?>/<?php echo $value['total_count'];?></p>
- </div>
- <img src="/images/select_li.png" class="selected-img">
- </li>
- <?php endforeach;?>
- </ul>
- </div>
- <div class="reset-btn">
- <a href="javascript:;">重置</a>
- <span>您将重置<em class="reset-num">0</em>个班级
- </span>
- </div>
- <input type="hidden" class="data-reading-id" value="<?php echo $readingId; ?>"/>
- <!-- 重置提示框 -->
- <div class="modal1_multi">
- <div class="modal-shadow"></div>
- <div class="modal-content">
- <div class="modal-title clearfix">
- 提示<em class="fr close3">×</em>
- </div>
- <div class="model-rule">
- 同一场考试,只提供一次重置机会。 <br>确定需要重置吗?
- </div>
- <div class="model-score-m">
- <label>产品生成会占用服务器资源,请谨慎操作,重置后需排队等待哦!</label>
- </div>
- <div class="modal-btn">
- <a href="javascript:;" class="sumbit3">确定重置</a>
- <a href="javascript:;" class="close3 chameleon">取消</a>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- // var printType = "<?php // echo $printType;?>",
- resetCount=parseInt(<?php echo $resetCount;?>);
- // resetCount=1;
- $(".reset-btn a").click(function () {
- //判断重置次数
- if(resetCount==0){
- $('.model-rule').html('本周“<?php echo $productName?>”只提供一次重置机会。 <br>确定需要重置吗?');
- $('.sumbit3').show();
- $('.chameleon').html('取消');
- $('.model-score-m').show();
- $('.modal1_multi').show();
- }else{
- $('.model-score-m').hide();
- $('.sumbit3').hide();
- $('.chameleon').html('知道了');
- $('.model-rule').html('本周“<?php echo $productName?>”已重置,不能继续重置!<br>请联系技术支持,谢谢!');
- $('.modal1_multi').show();
- }
- // $(".layout-reset").fadeIn(400);
- });
- $('.close3').click(function(){
- $('.modal1_multi').hide();
- });
- $('.sumbit3').click(function(){
- doSubmit();
- });
- //提交重置
- function doSubmit(){
- var obj = $("#select-class>li.active");
- var classExam = [];
- $.each(obj, function(key, value) {
- classExam.push($(value).attr('weekId'));
- });
- var readingId=$('.data-reading-id').val();
- if(readingId.length==0){
- layer.msg('请刷新后再重试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- return false;
- }
- if(classExam.length > 0){
- var url = "<?php echo $this->createUrl('print/ajaxResetEnglishReading');?>";
- resetAction(classExam,readingId,url);
- }else{
- layer.msg('请选择班级!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- }
- $(".chk-all").click(function () {
- if ($(this).hasClass("active")) {
- $(this).removeClass("active");
- $(".class-box li").removeClass("active");
- $(".reset-num").html(0);
- $(".reset-btn").removeClass('reset-btn2');
- } else {
- $(this).addClass("active");
- $(".class-box li").addClass("active");
- $(".reset-num").html($(".class-box li").length);
- $(".reset-btn").addClass('reset-btn2');
- }
- });
- $("body").delegate(".class-box li", "click", function () {
- var count = 0;
- if ($(this).hasClass("active")) {
- $(this).removeClass("active");
- } else {
- $(this).addClass("active");
- }
- for (var i = 0; i < $(".class-box li").length; i++) {
- if ($(".class-box li").eq(i).hasClass("active")) {
- count++;
- }
- if(count > 0){
- $(".reset-btn").addClass('reset-btn2');
- }else{
- $(".reset-btn").removeClass('reset-btn2');
- }
- }
- if (count == $(".class-box li").length) {
- $(".chk-all").addClass("active");
- } else {
- $(".chk-all").removeClass("active");
- }
- $(".reset-num").html(count);
- });
- // toast("重置失败!请再次尝试")
- // toast("重置失败!请再次尝试",true)
- function toast(msg, flag) {
- /*flag参数为true,不能自动关闭,不传则3秒以后关闭*/
- $("body").append("<div class='toast'></div>");
- $(".toast").css({
- "position": "fixed",
- "left": "50%",
- "top": "50%",
- "transform": "translate(-50%,-50%)",
- "padding": "15px 25px",
- "max-width": "250px",
- "background": "rgba(0,0,0,.8)",
- "color": "#fff",
- "font-size": "14px",
- "border-radius": "5px",
- "display": "none",
- "z-index": "9999999"
- }).html(msg).fadeIn(400);
- if (flag)
- return;
- var tempTimer = setTimeout(function () {
- $(".toast").fadeOut(400).remove();
- clearTimeout(tempTimer)
- }, 3000)
- }
-
-
- function resetAction(classExam,readingId,url){
- $.ajax({
- url: url,
- type: "POST",
- dataType: "json",
- data: {classExam:classExam,readingId:readingId},
- success: function (data){
- if(data.status > 0){
- layer.msg('操作成功!自动返回上一层',{
- icon: 1
- }, function(){
- layer.closeAll();
- window.history.go(-1);
- });
- }else{
- layer.msg('操作失败!请再次尝试',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- })
- </script>
|