en_waikan.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>外刊宝</title>
  8. <meta name="description" content="">
  9. <meta name="keywords" content="">
  10. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo;?>/css/english_reading/reset.css">
  11. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo;?>/css/english_reading/base.css">
  12. <link rel="stylesheet" href="<?php echo Yii::app()->request->hostInfo;?>/css/english_reading/en_reading.css">
  13. <style>
  14. /* .pdf-B5 {
  15. background: url(<?php // echo Yii::app()->request->hostInfo.'/images/en_reading/bg-watermark.png';?>);
  16. background-repeat: repeat-y;
  17. background-size: 100%;
  18. }*/
  19. .paper-number {
  20. background: url(<?php echo Yii::app()->request->hostInfo.'/images/en_reading/bg-paper-number.png';?>) no-repeat;
  21. background-size: 8.4mm;
  22. }
  23. .topic .topic-number .bg-wrap {
  24. display: inline-block;
  25. width: 22.2mm;
  26. height: 6.8mm;
  27. padding-left: 2.6mm;
  28. line-height: 5.8mm;
  29. background: url(<?php echo Yii::app()->request->hostInfo.'/images/en_reading/bg-topic-number.png';?>) no-repeat;
  30. background-size: 22.2mm 6.8mm;
  31. font-size:18pt;
  32. }
  33. .pdf-B5 .module-bgc {
  34. background: url(<?php echo Yii::app()->request->hostInfo.'/images/en_reading/gong-xing.png';?> ) no-repeat;
  35. background-size: 100% 100%;
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <!-- 内容开始 -->
  41. <?php
  42. $options_arr = array("A.","B.","C.","D.","E.","F.","G.","H.","I.","J");
  43. ?>
  44. <div class="pdf-B5">
  45. <div class="pdf-content">
  46. <?php if(isset($topic_ids) && $topic_ids):?>
  47. <?php $n = 0;?>
  48. <?php foreach($topic_ids as $topic_id):?>
  49. <?php
  50. if(isset($topic_detail) && isset($topic_detail[$topic_id]) && $topic_detail[$topic_id]){
  51. $v=$topic_detail[$topic_id];
  52. }else{
  53. continue;
  54. }
  55. ?>
  56. <section class="topic">
  57. <h2 class="topic-number">
  58. <span class="bg-wrap"><?php echo chr(65+$n);?></span>
  59. </h2>
  60. <div class="topic-msg">
  61. <span>主题语境:<?php echo isset($v['ztyj'])?$v['ztyj']:'';?></span>
  62. <span>体裁:<?php echo isset($v['tc'])?$v['tc']:'';?></span>
  63. <span>语篇等级:<em class="highlight-a"><?php echo isset($v['ypdj'])?$v['ypdj']:'';?></em></span>
  64. <span><?php echo substr($topic_id,4);?></span>
  65. </div>
  66. <div class="topic-main">
  67. <?php echo isset($v['title'])?$v['title']:'';?>
  68. </div>
  69. <?php if(isset($v['slave']) && $v['slave'] && !in_array($v['type_id'],$type_config['seven_selected_five'])):?>
  70. <?php foreach($v['slave'] as $slave_key=>$slave_value):?>
  71. <div class="min-topic-block">
  72. <div class="min-topic">
  73. <?php if(in_array($v['type_id'],array(430,41))):?>
  74. <div class="min-topic-block">
  75. <ul class="sort-list">
  76. <li>
  77. <i><?php echo ($slave_key+1);?>.</i>
  78. <?php if(isset($slave_value['options']) && $slave_value['options']):?>
  79. <ul class="option-list">
  80. <?php foreach($slave_value['options'] as $op_k=>$op_v):?>
  81. <li><?php echo $options_arr[$op_k];?><?php echo $op_v;?></li>
  82. <?php endforeach;?>
  83. </ul>
  84. <?php endif;?>
  85. </li>
  86. </ul>
  87. </div>
  88. <?php else:?>
  89. <!-- 题干 -->
  90. <?php if($slave_value['title']):?>
  91. <div class="min-topic-content"><?php echo ($slave_key+1).'.'.$slave_value['title']?></div>
  92. <?php else:?>
  93. <div class="min-topic-number"><?php echo ($slave_key+1).'.'.$slave_value['title']?></div>
  94. <?php endif;?>
  95. <!-- 选项 -->
  96. <ul class="option clearfix col-1">
  97. <?php if(isset($slave_value['options']) && $slave_value['options']):?>
  98. <?php foreach($slave_value['options'] as $op_k=>$op_v):?>
  99. <li><b class="option-a"><?php echo $options_arr[$op_k];?></b><?php echo $op_v;?></li>
  100. <?php endforeach;?>
  101. <?php endif;?>
  102. </ul>
  103. <?php endif;?>
  104. </div>
  105. </div>
  106. <?php endforeach;?>
  107. <?php endif;?>
  108. <div class="topic-module-answer">
  109. <div class="answer-wrap">
  110. <span class="answer-title">【答案】</span>
  111. <?php if(isset($v['answer']) && $v['answer']):?>
  112. <p class="answer-block">
  113. <?php if(count($v['answer'])==1){ ?>
  114. <?php echo implode('',$v['answer']);?>
  115. <?php }elseif(count($v['answer'])<15){ ?>
  116. <?php echo '1~'.count($v['answer']);?> <?php echo implode('',$v['answer']);?>
  117. <?php }elseif(count($v['answer']) == 15){ ?>
  118. <?php
  119. $all_answer = implode('',$v['answer']);
  120. echo '1~5';echo substr($all_answer,0,5);
  121. echo ' 6~10';echo substr($all_answer,5,5);
  122. echo ' 11~15';echo substr($all_answer,10,5);
  123. ?>
  124. <?php }else{?>
  125. <?php
  126. $all_answer = implode('',$v['answer']);
  127. echo '1~5';echo substr($all_answer,0,5);
  128. echo ' 6~10';echo substr($all_answer,5,5);
  129. echo ' 11~15';echo substr($all_answer,10,5);
  130. echo ' 15~'.count($v['answer']);echo substr($all_answer,15,5);
  131. ?>
  132. <?php } ?>
  133. </p>
  134. <?php endif;?>
  135. </div>
  136. <div class="analysis-wrap">
  137. <p class="analysis-title">【解析】</P>
  138. <div class="analysis"><?php echo isset($v['parse_content'])?$v['parse_content']:'';?></div>
  139. </div>
  140. <?php if(isset($v['chjl']) && $v['chjl']):?>
  141. <div class="module-bgc">
  142. <i>词汇积累</i>
  143. </div>
  144. <div class="question-type-mod-content">
  145. <div class="word-mean-item">
  146. <?php echo $v['chjl'];?>
  147. </div>
  148. </div>
  149. <?php endif;?>
  150. <?php if(isset($v['jzpx']) && $v['jzpx']):?>
  151. <div class="module-bgc">
  152. <i>句子剖析</i>
  153. </div>
  154. <div class="syntactic-analysis">
  155. <div class="syntactic-analysis-item">
  156. <?php echo $v['jzpx'];?>
  157. </div>
  158. </div>
  159. <?php endif;?>
  160. <?php if(isset($v['gjctz']) && $v['gjctz']):?>
  161. <div class="module-bgc">
  162. <i>关键词拓展</i>
  163. </div>
  164. <div class="syntactic-analysis">
  165. <div class="syntactic-analysis-item">
  166. <?php echo $v['gjctz'];?>
  167. </div>
  168. </div>
  169. <?php endif;?>
  170. <?php if(isset($v['cnjjx']) && $v['cnjjx']):?>
  171. <div class="module-bgc">
  172. <i>长难句解析</i>
  173. </div>
  174. <div class="syntactic-analysis">
  175. <div class="syntactic-analysis-item">
  176. <?php echo $v['cnjjx'];?>
  177. </div>
  178. </div>
  179. <?php endif;?>
  180. </div>
  181. </section>
  182. <?php $n++;?>
  183. <?php endforeach;?>
  184. <?php endif;?>
  185. </div>
  186. </div>
  187. <script>
  188. window.onload = function () {
  189. var optionUl = document.getElementsByClassName('option');
  190. console.log(optionUl);
  191. for (var i = 0; i < optionUl.length; i++) {
  192. arrayFunction(optionUl[i])
  193. }
  194. function arrayFunction(option) {
  195. for( var j = 0;j<option.children.length;j++){
  196. var sumWidth = 0
  197. sumWidth += option.children[j].offsetWidth
  198. }
  199. if (sumWidth > 111) {
  200. for (var k = 0; k < option.children.length; k++) {
  201. option.children[k].style.display = 'block'
  202. }
  203. } else {
  204. for (var m = 0; m < option.children.length; m++) {
  205. option.children[m].style.display = 'inline-block'
  206. option.children[m].style.float = 'left'
  207. if(option.children[m].offsetWidth>103){
  208. option.children[m].style.width = '44mm'
  209. }else{
  210. option.children[m].style.width = '30mm'
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </script>
  217. </body>
  218. </html>