123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <style>
- .fl{
- float: left;
- }
- .fr{
- float: right;
- }
- .clearfix:after{
- content: '';
- display: block;
- clear: both;
- }
- .changeSubjectNav{
- position: fixed;
- width: 100%;
- box-sizing: border-box;
- top: 0;
- left: 0;
- z-index: 1000;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 10px;
- background: #ddd;
- }
- .changeSubjectNav .productSettingBtn a{
- display: block;
- width: 120px;
- height: 30px;
- background: #01B677;
- text-align: center;
- line-height: 30px;
- color: #fff;
- font-size: 16px;
- text-decoration: none;
- cursor: text;
- }
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- box-sizing: border-box;
- }
- .has-sel{
- background: #01B677;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .sel-opt{
- width: 50%;
- position: relative;
- color: #01B677;
- line-height: 30px;
- text-indent: 6px;
- cursor: pointer;
- }
- .sel-opt:after{
- content: '';
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-top: 8px solid #01B677;
- position: absolute;
- right: 12px;
- top: 12px;
- }
- // .sel-opt select{
- // width: 100%;
- // height: 30px;
- // background: #F2F2F2;
- // color: #01B677;
- // text-indent: 6px;
- // font-size: inherit;
- // border-top-right-radius: 15px;
- // border-bottom-right-radius: 15px;
- // cursor: pointer;
- // }
- // .sel-opt select option{
- // position: relative;
- // }
- .points{
- position: absolute;
- top: -2px;
- right: 0;
- width: 10px;
- height: 10px;
- background: #F01516;
- border-radius: 50%;
- }
- .sel-cons{
- border: 1px solid #01B677;
- width: 50%;
- position: absolute;
- right: 0;
- top: 30px;
- text-indent: 10px;
- display: none;
- }
- .sc-lis2{
- line-height: 30px;
- cursor: pointer;
- }
- .sc-lis2 span{
- position: relative;
- }
- .sc-lis2 .points{
- top: 2px;
- right: -16px;
- }
- .subject-change{
- margin:8px 11px 0 0;display: block
- }
- .subject-change-no{
- margin:8px 11px 0 0;display: none
- }
- </style>
- <?php
- $sub_id = isset(Yii::app()->session['session_subject_id']) ? Yii::app()->session['session_subject_id']:0;
- $duo_sub_id = isset(Yii::app()->session['session_duoxueke_subject_id']) ? Yii::app()->session['session_duoxueke_subject_id']:0;
- $testFlag = isset(Yii::app()->session['testFlag'])?Yii::app()->session['testFlag']:0;
- $printType = isset($printType)?$printType:'';
- $subject = isset($subject)?$subject:array();
- $urlInfoAll = Yii::app()->request->getPathInfo();
- $urlInfo = '';
- if($urlInfoAll){
- $urlInfoArr = explode('/',$urlInfoAll);
- if(isset($urlInfoArr[0]) && isset($urlInfoArr[1])){
- $urlInfo = $urlInfoArr[0].'/'.$urlInfoArr[1];
- }
- $urlType = '';
- foreach ($urlInfoArr as $_url_k => $_url_v) {
- if ($_url_v == 'type' && isset($urlInfoArr[$_url_k + 1])) {
- $urlType = $urlInfoArr[$_url_k + 1];
- }
- }
- if(count($urlInfoArr) > 4){
- $urlInfoArr = array_slice($urlInfoArr,0,4);
- }
- $urlInfoAll = implode('/',$urlInfoArr);
- }
- $subjectNameArr = array(
- 3 => '数学',
- 8 => '英语',
- 9 => '语文',
- 12 => '物理',
- 13 => '化学',
- 14 => '生物',
- 15 => '政治',
- 16 => '历史',
- 17 => '地理',
- 18 => '理综',
- 19 => '文综',
- 21 => '日语',
- );
- ?>
- <div class="changeSubjectNav">
- <div class="productSettingBtn"> <a href="javascript:;">产品设置</a> </div>
- <div class="tabs clearfix">
- <div class="tab-con clearfix pull-right">
- <div class="has-sel fl"><?php echo isset(Yii::app()->params["subjectId"][$sub_id])?Yii::app()->params["subjectId"][$sub_id]:'数学'?></div>
- <div class="sel-opt fl">
- 切换学科
- </div>
- <div class="sel-cons" style="z-index:6;background-color: #fff;">
- <?php foreach ($subjectNameArr as $_subId => $_subName):?>
- <div class="sc-lis2" val="<?php echo $_subId;?>"><span><?php echo $_subName;?><?php if($subject && isset($subject[$_subId]) && !empty($subject[$_subId])){?><?php }?></span></div>
- <?php endforeach;?>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".sel-opt,.sel-cons").mouseover(function () {
- $(".sel-cons").show();
- }).mouseout(function () {
- $(".sel-cons").hide();
- });
- $(".sc-lis2").click(function () {
- var sub_id = $(this).attr('val');
- var data = {
- subjectId: sub_id
- };
- $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
- if (flags) {
- location.href = "<?php echo $this->createUrl('productset/index');?>";
- } else {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- });
- </script>
|