selfHelp.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. <style>
  2. /**
  3. *
  4. * @authors Your Name (you@example.org)
  5. * @date 2018-09-12 10:32:37
  6. * @version $Id$
  7. */
  8. .information-inquiry{
  9. width: 800px;
  10. margin: 0 auto;
  11. border: 1px solid #f1f1f1;
  12. /*box-shadow:4px 4px 10px #7c7c7c;*/
  13. }
  14. .information-inquiry .title{
  15. padding: 0 16px;
  16. height: 50px;
  17. line-height: 50px;
  18. background-color: #1BBF7B;
  19. }
  20. .information-inquiry .title .title-text{
  21. font-size: 18px;
  22. color: #fff;
  23. font-weight: 650;
  24. }
  25. .information-inquiry .title .title-tag{
  26. display: inline-block;
  27. margin-right: 20px;
  28. margin-top: 10px;
  29. padding: 6px 12px;
  30. height: 30px;
  31. line-height: 16px;
  32. color: #fff;
  33. border: 1px solid #F8F8FA;
  34. border-radius: 4px;
  35. background-color: #1BBF7B;
  36. cursor: pointer;
  37. }
  38. .btn-closes{
  39. display: inline-block;
  40. margin-top: 10px;
  41. line-height: 30px;
  42. cursor: pointer;
  43. }
  44. .dialog-box{
  45. width: 544px;
  46. border-right: 1px solid #ccc;
  47. }
  48. .information-inquiry .content-box .chat-box{
  49. padding: 0 18px 18px 18px;
  50. height: 380px;
  51. border-bottom: 1px solid #ccc;
  52. overflow: auto;
  53. }
  54. .information-inquiry .content-box .head-portrait{
  55. display: inline-block;
  56. width: 34px;
  57. height: 34px;
  58. }
  59. .chat-msg-left .head-portrait{
  60. margin-right: 18px;
  61. }
  62. .chat-msg-right .head-portrait{
  63. margin-left: 18px;
  64. }
  65. .head-portrait img{
  66. width: 34px;
  67. height: 34px;
  68. border-radius: 50%;
  69. }
  70. .information-inquiry .content-box .chat-msg{
  71. margin-top: 24px;
  72. }
  73. .chat-msg-text{
  74. display: inline-block;
  75. padding: 0 10px;
  76. line-height: 34px;
  77. border: 1px solid #cccccc;
  78. border-radius: 4px;
  79. background-color: #fbfbfb;
  80. }
  81. .hot-problem{
  82. display: inline-block;
  83. margin-top: 12px;
  84. line-height: 30px;
  85. border: 1px solid #cccccc;
  86. border-radius: 4px;
  87. background-color: #fbfbfb;
  88. }
  89. .hot-problem .hot-problem-title{
  90. padding: 0 10px;
  91. color: #000;
  92. border-bottom: 1px solid #ccc;
  93. font-weight: 650;
  94. }
  95. .hot-problem .hot-problem-list{
  96. padding: 0 10px;
  97. }
  98. .hot-problem .hot-problem-list a{
  99. display: block;
  100. color: #0066ff;
  101. cursor: pointer;
  102. }
  103. .hot-problem .hot-problem-list a:before{
  104. content: "";
  105. display: inline-block;
  106. width: 8px;
  107. height:8px;
  108. border-radius: 4px;
  109. background-color: #ccc;
  110. margin-right: 4px;
  111. }
  112. .reply{
  113. display: inline-block;
  114. max-width: 433px;
  115. min-width: 280px;
  116. border: 1px solid #cccccc;
  117. border-radius: 4px;
  118. background-color: #fbfbfb;
  119. }
  120. .reply-text{
  121. padding: 8px;
  122. border-bottom: 1px solid #ccc;
  123. }
  124. .reply-confirm{
  125. padding: 6px;
  126. }
  127. .reply-confirm span{
  128. display: inline-block;
  129. width: 49%;
  130. height: 38px;
  131. line-height: 38px;
  132. text-align: center;
  133. cursor: pointer;
  134. }
  135. .reply-confirm img{
  136. vertical-align: middle;
  137. margin-right: 10px;
  138. }
  139. .reply-btn{
  140. border-right: 1px solid #ccc;
  141. }
  142. .reply-confirm .reply-btn-dissatisfied-show, .reply-confirm .reply-btn-show{
  143. display: none;
  144. color: #14ae68;
  145. }
  146. .diss{
  147. display: none;
  148. padding: 0 14px 12px 12px;
  149. }
  150. .diss input{
  151. padding: 0 4px;
  152. width: 98%;
  153. height: 36px;
  154. outline:none;
  155. }
  156. .input-box{
  157. padding-bottom: 18px;
  158. }
  159. .input-box textarea{
  160. margin: 10px;
  161. border: none;
  162. outline:none;
  163. resize:none;
  164. }
  165. .btn-send-msg{
  166. margin-right: 44px;
  167. width: 70px;
  168. height: 32px;
  169. line-height: 32px;
  170. color: #fff;
  171. background-color: #00af65;
  172. border-radius: 4px;
  173. text-align: center;
  174. cursor: pointer;
  175. }
  176. .right-box{
  177. width: 254px;
  178. }
  179. .msg{
  180. height: 230px;
  181. overflow: auto;
  182. border-bottom: 1px solid #ccc;
  183. }
  184. .msg .msg-title{
  185. padding:0 10px;
  186. height: 34px;
  187. line-height: 34px;
  188. background-color: #e4e4e4;
  189. }
  190. .msg .msg-title img,.faqs-title img{
  191. vertical-align: middle;
  192. margin-right: 8px;
  193. }
  194. .msg-time{
  195. font-weight: 650;
  196. }
  197. .msg-text{
  198. padding: 6px;
  199. }
  200. .msg-text p{
  201. margin-bottom: 12px;
  202. }
  203. .faqs-title{
  204. padding:0 10px;
  205. height: 34px;
  206. line-height: 34px;
  207. background-color: #e4e4e4;
  208. font-weight: 650;
  209. border-bottom: 1px solid #ccc;
  210. }
  211. .faqs-list{
  212. height: 290px;
  213. overflow: auto;
  214. }
  215. .faqs-list li{
  216. padding:0 10px;
  217. border-bottom: 1px solid #ccc;
  218. }
  219. .faqs-list li>p{
  220. width: 234px;
  221. height: 38px;
  222. line-height: 38px;
  223. color: #666;
  224. font-weight: 600;
  225. margin-bottom: 0;
  226. overflow: hidden;
  227. text-overflow:ellipsis;
  228. white-space: nowrap;
  229. }
  230. .faqs-reply{
  231. display: none;
  232. font-size: 13px;
  233. color: #666;
  234. }
  235. .classified-service{
  236. width: 1200px;
  237. height: 698px;
  238. margin: 0 auto;
  239. border: 1px solid #ccc;
  240. background: #fff;
  241. position: absolute;
  242. left: 20%;
  243. top: 2%;
  244. }
  245. .classified-service-menu{
  246. width: 238px;
  247. }
  248. .classified-service-menu-title{
  249. height: 52px;
  250. line-height: 52px;
  251. font-size: 18px;
  252. font-weight: 650;
  253. color: #333;
  254. background-color: #f2f2f2;
  255. text-indent: 8px;
  256. }
  257. .classified-service-menu-box{
  258. margin-top: 24px;
  259. padding: 0 20px;
  260. }
  261. .classified-service-menu-box>ul>li{
  262. padding-left: 17px;
  263. cursor: pointer;
  264. }
  265. .classified-service-menu-box .isfather{
  266. padding-left: 0;
  267. }
  268. .classified-service-menu-box .isfather:before {
  269. content:url(/images/icon-selected_down.png);
  270. margin-right: 8px;
  271. display: inline-block;
  272. width: 9px;
  273. height:9px;
  274. }
  275. .classified-service-menu-box .child-menu{
  276. display: none;
  277. padding-left: 30px;
  278. }
  279. .classified-service-content{
  280. width: 960px;
  281. height: 100%;
  282. border-left: 1px solid #ccc;
  283. }
  284. .btn-close{
  285. display: inline-block;
  286. margin-top: 10px;
  287. margin-right: 10px;
  288. padding: 12px 16px;
  289. /*height: 16px;*/
  290. line-height: 16px;
  291. border-radius: 4px;
  292. background-color: #f2f2f2;;
  293. cursor: pointer;
  294. }
  295. .problem-box{
  296. margin-top: 52px;
  297. padding: 0 10px;
  298. }
  299. .problem-box .problem-title{
  300. color: #333;
  301. font-weight: 650;
  302. }
  303. .problem-box tr{
  304. line-height: 50px;
  305. border-bottom: 1px solid #ccc;
  306. }
  307. .problem-box tr td:nth-child(1){
  308. width: 640px;
  309. text-indent: 36px;
  310. }
  311. .problem-box tr td:nth-child(2){
  312. width: 200px;
  313. text-align: center;
  314. }
  315. .problem-box tr td:nth-child(3){
  316. width: 100px;
  317. }
  318. .problem-box .btn-look{
  319. display: inline-block;
  320. width: 30px;
  321. height: 18px;
  322. line-height: 18px;
  323. text-align: center;
  324. border: 1px solid #000;
  325. background-color: #f2f2f2;
  326. cursor: pointer;
  327. }
  328. .look-box{
  329. display: none;
  330. /*width: 760px;*/
  331. /*height: 720px;*/
  332. background: #fff;
  333. /*border:1px solid #ccc;*/
  334. /*overflow: hidden;*/
  335. }
  336. .look-box .look-title{
  337. padding-left: 10px;
  338. height: 60px;
  339. line-height: 60px;
  340. border-bottom: 1px solid #ccc;
  341. /*background-color: #f2f2f2;*/
  342. }
  343. .look-box .btn-close{
  344. display: inline-block;
  345. width: 40px;
  346. height: 26px;
  347. line-height: 26px;
  348. text-align: center;
  349. border: 1px solid #000;
  350. background-color: #f2f2f2;
  351. }
  352. .look-box-con{
  353. padding: 16px;
  354. }
  355. .look-box-con-problem{
  356. line-height: 40px;
  357. }
  358. .look-box-con-problem img{
  359. vertical-align: middle;
  360. }
  361. .look-box-con-problem .btn-edit{
  362. display: inline-block;
  363. margin-top: 10px;
  364. width: 112px;
  365. height: 30px;
  366. line-height: 30px;
  367. text-align: center;
  368. border: 1px solid #000;
  369. background-color: #f2f2f2;
  370. cursor: pointer;
  371. }
  372. .look-box-con-answer{
  373. width: 720px;
  374. margin-top: 30px;
  375. border: 1px solid #ccc;
  376. /*overflow: auto;*/
  377. }
  378. .look-box-con-answer textarea{
  379. margin: 10px;
  380. border: none;
  381. outline:none;
  382. resize:none;
  383. }
  384. .helper{
  385. padding:8px;
  386. position: absolute;
  387. left: 0;
  388. /*bottom: 40px;*/
  389. cursor: pointer;
  390. background:rgba(255,255,255,1);
  391. border-radius:3px;
  392. border:1px solid #eee;
  393. }
  394. .helper img{width:32px;}
  395. .chat-msg-box{
  396. word-wrap:break-word;
  397. overflow: hidden;
  398. }
  399. .chat-msg-box img{
  400. max-width: 410px;
  401. }
  402. .relation-problem-list{
  403. padding: 0 10px;
  404. color: #000;
  405. border-bottom: 1px solid #ccc;
  406. font-weight: 600;
  407. }
  408. .relation-problem-list a{
  409. display: block;
  410. color: #0066ff;
  411. font-weight:normal;
  412. line-height:28px;
  413. cursor: pointer;
  414. }
  415. .relation-problem-list a:before{
  416. content: "";
  417. display: inline-block;
  418. width: 8px;
  419. height:8px;
  420. border-radius: 4px;
  421. background-color: #ccc;
  422. margin-right: 4px;
  423. }
  424. .faqs-problem{
  425. cursor: pointer;
  426. }
  427. </style>
  428. <!--自助查询-->
  429. <div class="classified-service clearfix">
  430. <div class="classified-service-menu fl">
  431. <div class="classified-service-menu-title">分类目录</div>
  432. <div class="classified-service-menu-box">
  433. <ul id="ismenu">
  434. <li class="isfather">试卷管理
  435. <ul class="child-menu">
  436. <li>打印试卷</li>
  437. <li>下载钻石纠错本</li>
  438. <li>下载个性化学习宝</li>
  439. <li>导出报告</li>
  440. </ul>
  441. </li>
  442. <li class="isfather">教学管理
  443. <ul class="child-menu">
  444. <li>打印试卷</li>
  445. <li>下载钻石纠错本</li>
  446. <li>下载个性化学习宝</li>
  447. <li>导出报告</li>
  448. </ul>
  449. </li>
  450. <li>安装于登录</li>
  451. <li>扫描上传</li>
  452. </ul>
  453. </div>
  454. </div>
  455. <div class="classified-service-content fr">
  456. <!-- <span class="btn-close fr">关闭</span>-->
  457. <div class="problem-box">
  458. <table>
  459. <tr class="problem-title">
  460. <td>问题</td>
  461. <td>创建时间</td>
  462. <td>操作</td>
  463. </tr>
  464. </table>
  465. </div>
  466. </div>
  467. </div>
  468. <div class="look-box">
  469. <div class="look-box-con">
  470. <div class="look-box-con-problem">
  471. <div class="question">第三方试卷如何切换模版</div>
  472. <div class="type">所属分类:试卷管理>第三方试卷>第三方试卷如何切换模版</div>
  473. <div class="alike">关联问题:第三方试卷有哪几个模版</div>
  474. <input type="hidden" name="help_answer_id" value="0">
  475. <div>
  476. <img src="/images/icon-answer.png">
  477. <span>答案</span>
  478. <span class="btn-edit fr">帮助编辑</span>
  479. </div>
  480. </div>
  481. <div class="look-box-con-answer">
  482. <!--<textarea id="look-answer_val" rows="26" cols="86" readonly="readonly"></textarea>-->
  483. <script id="container" name="content" type="text/plain"></script>
  484. </div>
  485. </div>
  486. </div>
  487. <!--自助结束-->
  488. <script type="text/javascript" src="/js/ueditor1_4_3_3-utf8-php/ueditor.config.js"></script>
  489. <script type="text/javascript" src="/js/ueditor1_4_3_3-utf8-php/ueditor.all.js"></script>
  490. <script>
  491. var nowTypeId=0;
  492. var nowPage=1;
  493. var ue = UE.getEditor('container',{
  494. toolbars: [
  495. [ 'bold','justifyleft', 'justifyright', 'justifycenter', 'justifyjustify']
  496. ],
  497. wordCount:false,
  498. //关闭elementPath
  499. elementPathEnabled:false,
  500. initialFrameHeight:450,
  501. scaleEnabled:true
  502. });
  503. init();
  504. //自主查询
  505. function init() {
  506. index=layer.msg('加载中,请稍候',{time: 0});
  507. $.ajax({
  508. url:'<?php echo $this->createUrl('help/list') ?>',
  509. method:'POST',
  510. dataType:'json',
  511. success:function(res){
  512. if(res.status==1){
  513. var tree=res.data.tree;
  514. var treeHtml='';
  515. for(var i=0;i<tree.length;i++){
  516. if(tree[i]['children']!='undefined' && tree[i]['children'].length>0){
  517. treeHtml+='<li class="isfather">'+tree[i]['ptName'];
  518. treeHtml+='<ul class="child-menu">';
  519. for(var j=0;j<tree[i]['children'].length;j++){
  520. if(tree[i]['children'][j]['children']!=undefined){
  521. treeHtml+='<li class="show_list" id="'+tree[i]['children'][j]['ptId']+'">'+tree[i]['children'][j]['ptName'];
  522. treeHtml+='<ul class="child-menu">';
  523. secondTree=tree[i]['children'][j]['children'];
  524. for(var k=0;k<secondTree.length;k++){
  525. treeHtml+='<li class="show_list" id="'+secondTree[k]['ptId']+'">'+secondTree[k]['ptName']+'</li>';
  526. }
  527. treeHtml+='</ul></li>';
  528. }else{
  529. treeHtml+='<li class="show_list" id="'+tree[i]['children'][j]['ptId']+'">'+tree[i]['children'][j]['ptName']+'</li>';
  530. }
  531. }
  532. treeHtml+='</ul></li>';
  533. }else{
  534. treeHtml+='<li class="show_list" id="'+tree[i]['ptId']+'">'+tree[i]['ptName']+'</li>';
  535. }
  536. }
  537. $('#ismenu').html(treeHtml);
  538. var listHtml='<tr class="problem-title"><td>问题</td><td>创建时间</td><td>操作</td></tr>';
  539. var listData=res.data.list;
  540. if(listData['total']>0){
  541. for(var i=0;i<listData['list'].length;i++){
  542. listHtml+='<tr>';
  543. listHtml+='<td>'+listData['list'][i]['hpName']+'</td>';
  544. listHtml+='<td>'+listData['list'][i]['createTime']+'</td>';
  545. listHtml+='<td><span rel="'+listData['list'][i]['hpId']+'" class="btn-look">查看</span></td>';
  546. listHtml+='</tr>';
  547. }
  548. listHtml+='<tr><td colspan="3">';
  549. if(listData['pageNum']>1){
  550. listHtml+='<a href="#" typeId="'+nowTypeId+'" rel="'+listData['pageNum']+'" class="prevPage">上一页</a>';
  551. }
  552. if(listData['pageNum']<listData['pages']){
  553. listHtml+='<a href="#" typeId="'+nowTypeId+'" rel="'+listData['pageNum']+'" class="nextPage">下一页</a>';
  554. }
  555. listHtml+='</td></tr>';
  556. }
  557. $('.problem-box table').html(listHtml);
  558. layer.closeAll();
  559. // $('.information-inquiry').hide();
  560. // $('.classified-service').show();
  561. }
  562. }
  563. });
  564. }
  565. $("#ismenu")
  566. .on("click",'li',function(e){
  567. // $(this).find('.child-menu').show(500);
  568. e.stopPropagation();
  569. $(this).children('.child-menu').slideToggle("slow");
  570. })
  571. .on('click','.show_list',function(){
  572. showList(nowPage,$(this).attr('id'))
  573. });
  574. var noRepeatSubmit=0;
  575. $('.btn-edit').click(function(){
  576. if($(this).hasClass('saveAnswer') && noRepeatSubmit==0){
  577. noRepeatSubmit=1;
  578. var obj=$(this);
  579. var name=$('.question').html();
  580. var hpId=$('input[name=help_answer_id]').val();
  581. var suggest= ue.getPlainTxt();
  582. $.ajax({
  583. url:'<?php echo $this->createUrl('help/add') ?>',
  584. method:'POST',
  585. dataType:'json',
  586. data:{'name':name,'id':hpId,'suggest':suggest},
  587. success:function(res){
  588. if(res.status==1){
  589. layer.msg('提交成功');
  590. obj.html('帮助编辑');
  591. $('#look-answer_val').attr('readonly',true);
  592. $('.btn-edit').removeClass('saveAnswer');
  593. }
  594. }
  595. });
  596. }else{
  597. ue.setEnabled();
  598. $(this).addClass('saveAnswer');
  599. $(this).html('保存编辑');
  600. noRepeatSubmit=0;
  601. }
  602. });
  603. $('.problem-box')
  604. .on('click','.btn-look',function(){
  605. id=$(this).attr('rel');
  606. console.log(ue);
  607. $('.look-box-con').find('.alike').html('');
  608. $('.look-box-con').find('.question').html('');
  609. $('.look-box-con').find('.type').html('');
  610. $.ajax({
  611. url:'<?php echo $this->createUrl('help/view') ?>',
  612. method:'POST',
  613. dataType:'json',
  614. data:{'id':id},
  615. success:function(res){
  616. if(res.status==1){
  617. $('.look-box-con').find('.question').html(res.data.hpName);
  618. var relProblem='';
  619. if(res.data.relProblem.length>0){
  620. for(var i=0;i<res.data.relProblem.length;i++){
  621. relProblem=relProblem+(i+1)+'、'+res.data.relProblem[i]['hpName']+'; '
  622. }
  623. }
  624. if(relProblem!=''){
  625. $('.look-box-con').find('.alike').html('关联问题:'+relProblem);
  626. }
  627. $('.look-box-con').find('.type').html('所属分类:'+res.data.typeName);
  628. $('input[name=help_answer_id]').val(id);
  629. setTimeout(function(){ ue.setContent(res.data.hpAnswer);ue.setDisabled(); }, 100); //奇怪的赋值方法
  630. layer.open({
  631. type: 1,
  632. area: ['760px', '790px'],
  633. shadeClose: false, //点击遮罩关闭
  634. content: $(".look-box"),
  635. cancel: function(index, layero){
  636. //console.log(guanbi)
  637. $('.btn-edit').html('帮助编辑');
  638. $('#look-answer_val').attr('readonly',true);
  639. $('.btn-edit').removeClass('saveAnswer');
  640. }
  641. });
  642. }
  643. }
  644. });
  645. })
  646. .on('click','.nextPage',function(){
  647. var pageNum=parseInt($(this).attr('rel'))+1;
  648. var typeId=$(this).attr('typeId');
  649. nowPage=pageNum;
  650. showList(pageNum,typeId);
  651. })
  652. .on('click','.prevPage',function(){
  653. var pageNum=parseInt($(this).attr('rel'))-1;
  654. var typeId=$(this).attr('typeId');
  655. nowPage=pageNum;
  656. showList(pageNum,typeId);
  657. });
  658. function showList(pageNum,typeId){
  659. console.log(typeId);
  660. $.ajax({
  661. url:'<?php echo $this->createUrl('help/question') ?>',
  662. method:'POST',
  663. dataType:'json',
  664. data:{'pnum':pageNum,'typeId':typeId},
  665. success:function (res) {
  666. if(res.status==1){
  667. var listHtml='<tr class="problem-title"><td>问题</td><td>创建时间</td><td>操作</td></tr>';
  668. var listData=res.data;
  669. if(listData['total']>0){
  670. for(var i=0;i<listData['list'].length;i++){
  671. listHtml+='<tr>';
  672. listHtml+='<td>'+listData['list'][i]['hpName']+'</td>';
  673. listHtml+='<td>'+listData['list'][i]['createTime']+'</td>';
  674. listHtml+='<td><span rel="'+listData['list'][i]['hpId']+'" class="btn-look">查看</span></td>';
  675. listHtml+='</tr>';
  676. }
  677. listHtml+='<tr><td colspan="3">';
  678. if(listData['pageNum']>1){
  679. listHtml+='<a href="#" typeId="'+nowTypeId+'" rel="'+listData['pageNum']+'" class="prevPage">上一页</a>';
  680. }
  681. if(listData['pageNum']<listData['pages']){
  682. listHtml+='<a href="#" typeId="'+nowTypeId+'" rel="'+listData['pageNum']+'" class="nextPage">下一页</a>';
  683. }
  684. listHtml+='</td></tr>';
  685. }
  686. $('.problem-box table').html(listHtml);
  687. }
  688. }
  689. });
  690. }
  691. </script>