help.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  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. display:none;
  242. position: absolute;
  243. left: 20%;
  244. top: 2%;
  245. }
  246. .classified-service-menu{
  247. width: 238px;
  248. }
  249. .classified-service-menu-title{
  250. height: 52px;
  251. line-height: 52px;
  252. font-size: 18px;
  253. font-weight: 650;
  254. color: #333;
  255. background-color: #f2f2f2;
  256. text-indent: 8px;
  257. }
  258. .classified-service-menu-box{
  259. margin-top: 24px;
  260. padding: 0 20px;
  261. }
  262. .classified-service-menu-box>ul>li{
  263. padding-left: 17px;
  264. cursor: pointer;
  265. }
  266. .classified-service-menu-box .isfather{
  267. padding-left: 0;
  268. }
  269. .classified-service-menu-box .isfather:before {
  270. content:url(/images/icon-selected_down.png);
  271. margin-right: 8px;
  272. display: inline-block;
  273. width: 9px;
  274. height:9px;
  275. }
  276. .classified-service-menu-box .child-menu{
  277. display: none;
  278. padding-left: 30px;
  279. }
  280. .classified-service-content{
  281. width: 960px;
  282. height: 100%;
  283. border-left: 1px solid #ccc;
  284. }
  285. .btn-close{
  286. display: inline-block;
  287. margin-top: 10px;
  288. margin-right: 10px;
  289. padding: 12px 16px;
  290. /*height: 16px;*/
  291. line-height: 16px;
  292. border-radius: 4px;
  293. background-color: #f2f2f2;;
  294. cursor: pointer;
  295. }
  296. .problem-box{
  297. margin-top: 52px;
  298. padding: 0 10px;
  299. }
  300. .problem-box .problem-title{
  301. color: #333;
  302. font-weight: 650;
  303. }
  304. .problem-box tr{
  305. line-height: 50px;
  306. border-bottom: 1px solid #ccc;
  307. }
  308. .problem-box tr td:nth-child(1){
  309. width: 640px;
  310. text-indent: 36px;
  311. }
  312. .problem-box tr td:nth-child(2){
  313. width: 200px;
  314. text-align: center;
  315. }
  316. .problem-box tr td:nth-child(3){
  317. width: 100px;
  318. }
  319. .problem-box .btn-look{
  320. display: inline-block;
  321. width: 30px;
  322. height: 18px;
  323. line-height: 18px;
  324. text-align: center;
  325. border: 1px solid #000;
  326. background-color: #f2f2f2;
  327. cursor: pointer;
  328. }
  329. .look-box{
  330. display: none;
  331. /*width: 760px;*/
  332. /*height: 720px;*/
  333. background: #fff;
  334. /*border:1px solid #ccc;*/
  335. /*overflow: hidden;*/
  336. }
  337. .look-box .look-title{
  338. padding-left: 10px;
  339. height: 60px;
  340. line-height: 60px;
  341. border-bottom: 1px solid #ccc;
  342. /*background-color: #f2f2f2;*/
  343. }
  344. .look-box .btn-close{
  345. display: inline-block;
  346. width: 40px;
  347. height: 26px;
  348. line-height: 26px;
  349. text-align: center;
  350. border: 1px solid #000;
  351. background-color: #f2f2f2;
  352. }
  353. .look-box-con{
  354. padding: 16px;
  355. }
  356. .look-box-con-problem{
  357. line-height: 40px;
  358. }
  359. .look-box-con-problem img{
  360. vertical-align: middle;
  361. }
  362. .look-box-con-problem .btn-edit{
  363. display: inline-block;
  364. margin-top: 10px;
  365. width: 112px;
  366. height: 30px;
  367. line-height: 30px;
  368. text-align: center;
  369. border: 1px solid #000;
  370. background-color: #f2f2f2;
  371. cursor: pointer;
  372. }
  373. .look-box-con-answer{
  374. width: 720px;
  375. margin-top: 30px;
  376. border: 1px solid #ccc;
  377. /*overflow: auto;*/
  378. }
  379. .look-box-con-answer textarea{
  380. margin: 10px;
  381. border: none;
  382. outline:none;
  383. resize:none;
  384. }
  385. .helper{
  386. padding:8px;
  387. position: absolute;
  388. left: 0;
  389. /*bottom: 40px;*/
  390. cursor: pointer;
  391. background:rgba(255,255,255,1);
  392. border-radius:3px;
  393. border:1px solid #eee;
  394. }
  395. .helper img{width:32px;}
  396. .chat-msg-box{
  397. word-wrap:break-word;
  398. overflow: hidden;
  399. }
  400. .chat-msg-box img{
  401. max-width: 410px;
  402. }
  403. .relation-problem-list{
  404. padding: 0 10px;
  405. color: #000;
  406. border-bottom: 1px solid #ccc;
  407. font-weight: 600;
  408. }
  409. .relation-problem-list a{
  410. display: block;
  411. color: #0066ff;
  412. font-weight:normal;
  413. line-height:28px;
  414. cursor: pointer;
  415. }
  416. .relation-problem-list a:before{
  417. content: "";
  418. display: inline-block;
  419. width: 8px;
  420. height:8px;
  421. border-radius: 4px;
  422. background-color: #ccc;
  423. margin-right: 4px;
  424. }
  425. .faqs-problem{
  426. cursor: pointer;
  427. }
  428. </style>
  429. <div class="information-inquiry">
  430. <!-- <div class="title clearfix">
  431. <span class="title-text fl">帮助中心</span>
  432. <span class="btn-closes fr"><img src="/images/icon-del.png"></span>
  433. <span class="title-tag fr">自助查询</span>
  434. </div>-->
  435. <div class="content-box clearfix">
  436. <div class="dialog-box fl">
  437. <div class="chat-box">
  438. <div class="scollBox">
  439. <!-- 单条信息开始 -->
  440. <div class="chat-msg clearfix">
  441. <div class="chat-msg-left fl">
  442. <span class="head-portrait fl"><img src="/images/left_head.png"></span>
  443. <span class="chat-msg-box fl">
  444. <p class="chat-msg-text">有什么问题需要我帮您解决吗?</p>
  445. <div>
  446. <div class="hot-problem">
  447. <div class="hot-problem-title">【热门问题】</div>
  448. <div class="hot-problem-list">
  449. <a href="#">扫描上传</a>
  450. <a href="#">选择题答案设置错误</a>
  451. <a href="#">试题顺序需要调整</a>
  452. <a href="#">下载word,学管端直接崩溃</a>
  453. <a href="#">下载钻石纠错本</a>
  454. </div>
  455. </div>
  456. </div>
  457. </span>
  458. </div>
  459. </div>
  460. <!-- 单条信息结束 -->
  461. <!--精准信息-->
  462. <!---->
  463. </div>
  464. </div>
  465. <div class="input-box clearfix">
  466. <textarea id="user_val" rows="5" cols="50" ></textarea>
  467. <div>
  468. <span class="btn-send-msg fr">发送</span>
  469. </div>
  470. </div>
  471. </div>
  472. <div class="right-box fr">
  473. <div class="msg">
  474. <div class="msg-title clearfix">
  475. <span class="fl"><img src="/images/icon-clock.png">通知</span>
  476. <span class="msg-time fr"></span>
  477. </div>
  478. <div class="msg-text">
  479. </div>
  480. </div>
  481. <div class="faqs">
  482. <div class="faqs-title"><img src="/images/icon-question.png">常见问题</div>
  483. <div class="faqs-list">
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. </div>
  489. <script>
  490. var defaultAnswer='不知道';
  491. init();
  492. function init(){
  493. index=layer.msg('加载中,请稍候',{time: 0});
  494. $.ajax({
  495. url:'<?php echo $this->createUrl('help/index') ?>',
  496. method:'POST',
  497. dataType:'json',
  498. success:function(res){
  499. if(res.status==1){
  500. if(res.data.Notice.status==1){
  501. $('.information-inquiry .msg-time').html(res.data.Notice.data.appointTime);
  502. $('.information-inquiry .msg-text').html(res.data.Notice.data.hnContext);
  503. }
  504. if(res.data.Notice.status==1){
  505. $('.information-inquiry .msg-time').html(res.data.Notice.data.appointTime);
  506. }
  507. if(res.data.HelpHello.status==1){
  508. $('.information-inquiry .chat-msg-text').eq(0).html(res.data.HelpHello.data.hhWelcome);
  509. defaultAnswer=res.data.HelpHello.data.hhSorry;
  510. }
  511. var fhtml='<ul>';
  512. if(res.data.Familiar.status==1 && res.data.Familiar.data.length>0){
  513. var Familiar=res.data.Familiar.data;
  514. for(var i=0;i<Familiar.length;i++){
  515. fhtml+='<li><p title="'+Familiar[i].hpName+'" class="faqs-problem">'+Familiar[i].hpName+'</p><div class="faqs-reply" >'+Familiar[i].hpAnswer+'</div></li>';
  516. }
  517. }
  518. fhtml+='</ul>';
  519. $('.information-inquiry .faqs-list').html(fhtml);
  520. //热门问题
  521. var hotHtml='';
  522. if(res.data.Hot.status==1 && res.data.Hot.data.length>0){
  523. var Hot=res.data.Hot.data;
  524. for(var i=0;i<Hot.length;i++){
  525. hotHtml+='<a id="'+Hot[i]['hpId']+'">'+Hot[i]['hpName']+'</a>';
  526. }
  527. }
  528. $('.information-inquiry .hot-problem-list').eq(0).html(hotHtml);
  529. //$('.information-inquiry').show();
  530. // $('.helper').hide();
  531. }
  532. // layer.open({
  533. // title: false,
  534. // closeBtn: 0,
  535. // type: 1,
  536. // offset: '20px',
  537. // area: ['802px', '620px'],
  538. // content: $(".information-inquiry")
  539. // });
  540. // // $('.information-inquiry').show();
  541. // $('.helper').hide();
  542. layer.close(index);
  543. }
  544. });
  545. }
  546. $(".reply-btn-dissatisfied").on("click", function() {
  547. $(this).css("display","none");
  548. $(this).parent('.reply-confirm').find('.reply-btn-dissatisfied-show').css("display","inline-block");
  549. $(this).parent().parent('.reply').find('.diss').css("display","block");
  550. });
  551. $('.faqs-list').on("click",".faqs-problem", function() {
  552. $(this).parent('li').find('.faqs-reply').slideToggle("slow");
  553. });
  554. // $('.information-inquiry .btn-closes').click(function(){
  555. // // $('.information-inquiry').hide();
  556. // //关闭帮助中心按钮
  557. // layer.closeAll();
  558. // // $('.helper').show();
  559. // });
  560. // $('.classified-service .btn-close').click(function(){
  561. // $('.classified-service').hide();
  562. // $('.helper').show();
  563. // });
  564. $('.btn-send-msg').click(function(){
  565. if($('#user_val').val()==''){
  566. return false;
  567. }
  568. var keyword=$('#user_val').val();
  569. var html='<div class="chat-msg clearfix">';
  570. html+='<div class="chat-msg-right fr">';
  571. html+='<span class="head-portrait fr"><img src="/images/right_head.png"></span>';
  572. html+='<span class="chat-msg-box fr">';
  573. html+='<p class="chat-msg-text">'+keyword+'</p>';
  574. html+='</span></div></div>';
  575. $('.scollBox').append(html);
  576. $(".chat-box").animate({"scrollTop":$(".scollBox").height()},900);
  577. $('#user_val').val('');
  578. search(keyword);
  579. });
  580. $('.chat-box')
  581. .on('click','.reply-btn-dissatisfied',function(){
  582. $(this).css("display","none");
  583. $(this).parent('.reply-confirm').find('.reply-btn-dissatisfied-show').css("display","inline-block");
  584. $(this).parent().parent('.reply').find('.diss').css("display","block");
  585. $(this).parent('.reply-confirm').find('.reply-btn').removeClass('reply-btn');
  586. var name=$(this).closest('.reply-confirm').attr('rel');
  587. var id=$(this).closest('.reply-confirm').attr('id');
  588. $.ajax({
  589. url:'<?php echo $this->createUrl('help/use')?>',
  590. method:'POST',
  591. dataType:'json',
  592. data:{'name':name,'id':id,'type':2},
  593. success:function(res){
  594. if(res.status==1){
  595. layer.msg('提交成功,感谢您的参与');
  596. }
  597. }
  598. });
  599. })
  600. .on('click','.relation-problem-list a',function(){
  601. var id=$(this).attr('id');
  602. viewQuestion(id,2,1);
  603. return false;
  604. })
  605. .on('click','.hot-problem-list a',function(){
  606. var id=$(this).attr('id');
  607. if($(this).hasClass('need_count')){
  608. viewQuestion(id,1,1);
  609. }else{
  610. viewQuestion(id,1,0);
  611. }
  612. return false;
  613. })
  614. .on('click','.reply-btn',function(){
  615. $(this).css("display","none");
  616. $(this).parent('.reply-confirm').find('.reply-btn-show').css("display","inline-block");
  617. $(this).parent('.reply-confirm').find('.reply-btn-dissatisfied').removeClass('reply-btn-dissatisfied');
  618. var name=$(this).closest('.reply-confirm').attr('rel');
  619. var id=$(this).closest('.reply-confirm').attr('id');
  620. $.ajax({
  621. url:'<?php echo $this->createUrl('help/use')?>',
  622. method:'POST',
  623. dataType:'json',
  624. data:{'name':name,'id':id,'type':1},
  625. success:function(res){
  626. if(res.status==1){
  627. layer.msg('提交成功,感谢您的参与');
  628. }
  629. }
  630. });
  631. })
  632. .on('change','.diss-text',function(){
  633. var name=$(this).closest('.chat-msg-box').find('.reply-confirm').attr('rel');
  634. var id=$(this).closest('.chat-msg-box').find('.reply-confirm').attr('id');
  635. var suggest=$.trim($(this).val());
  636. if(suggest==''){
  637. return false;
  638. }
  639. $.ajax({
  640. url:'<?php echo $this->createUrl('help/add')?>',
  641. method:'POST',
  642. dataType:'json',
  643. data:{'name':name,'id':id,'source':2,'suggest':suggest},
  644. success:function(res){
  645. if(res.status==1){
  646. layer.msg('提交成功,感谢您的参与');
  647. }
  648. }
  649. });
  650. });
  651. function search(keyword){
  652. keyword=$.trim(keyword);
  653. if(keyword==''){
  654. return false;
  655. }
  656. $.ajax({
  657. url:'<?php echo $this->createUrl('help/search')?>',
  658. method:'POST',
  659. dataType:'json',
  660. data:{'keyword':keyword},
  661. success:function (res) {
  662. if(res.status==1){
  663. answer=res.data;
  664. if(answer.length>1 || (answer.length==1 && answer[0]['hpName']!=keyword)){
  665. var answerHtml='<div class="chat-msg clearfix">';
  666. answerHtml+='<div class="chat-msg-left fl">';
  667. answerHtml+='<span class="head-portrait fl"><img src="/images/left_head.png"></span>';
  668. answerHtml+='<span class="chat-msg-box fl">';
  669. answerHtml+='<p class="chat-msg-text">您是想问?</p>';
  670. answerHtml+='<div>';
  671. answerHtml+='<div class="hot-problem">';
  672. answerHtml+='<div class="hot-problem-list">';
  673. for(var i=0;i<answer.length;i++){
  674. answerHtml+='<a href="#" class="need_count" id="'+answer[i]['hpId']+'">'+answer[i]['hpName']+'</a>';
  675. }
  676. answerHtml+='</div></div></div></span></div></div>';
  677. }else if(answer.length==1){
  678. var answerHtml='<div class="chat-msg clearfix">';
  679. answerHtml+='<div class="chat-msg-left fl">';
  680. answerHtml+='<span class="head-portrait fl"><img src="/images/left_head.png"></span>';
  681. answerHtml+='<span class="chat-msg-box fl">';
  682. answerHtml+='<div class="reply">';
  683. answerHtml+='<div class="reply-text">'+answer[0]['hpAnswer']+'</div>';
  684. answerHtml+='<div class="reply-confirm" rel="'+answer[0]['hpName']+'" id="'+answer[0]['hpId']+'">';
  685. answerHtml+='<span class="reply-btn"><img src="/images/icon-satisfied.png">有用</span>';
  686. answerHtml+='<span class="reply-btn-show"><img src="/images/icon-satisfied-show.png">有用</span>';
  687. answerHtml+='<span class="reply-btn-dissatisfied"><img src="/images/icon-dissatisfied.png">没用</span>';
  688. answerHtml+='<span class="reply-btn-dissatisfied-show"><img src="/images/icon-dissatisfied-show.png">没用</span>';
  689. answerHtml+='</div>';
  690. if(answer[0]['relProblem']!=undefined && answer[0]['relProblem'].length>0){
  691. answerHtml+='<div class="relation-problem-list">';
  692. for(var i=0;i<answer[0]['relProblem'].length;i++){
  693. answerHtml+='<a href="#" id="'+answer[0]['relProblem'][i]['hpId']+'">'+answer[0]['relProblem'][i]['hpName']+'</a>';
  694. }
  695. answerHtml+='</div>';
  696. }
  697. answerHtml+='<div class="diss">';
  698. answerHtml+='<input class="diss-text" type="text" placeholder="感谢你的评价,请填写具体原因供我们改进">';
  699. answerHtml+='</div>';
  700. answerHtml+='</div>';
  701. answerHtml+='</span>';
  702. answerHtml+='</div>';
  703. answerHtml+='</div>';
  704. }else{
  705. var answerHtml='<div class="chat-msg clearfix">';
  706. answerHtml+='<div class="chat-msg-left fl">';
  707. answerHtml+='<span class="head-portrait fl"><img src="/images/left_head.png"></span>';
  708. answerHtml+='<span class="chat-msg-box fl">';
  709. answerHtml+='<p class="chat-msg-text">'+defaultAnswer+'</p>';
  710. answerHtml+='<div>';
  711. answerHtml+='</div></span></div></div>';
  712. NoAnswer(keyword);
  713. }
  714. }
  715. $('.scollBox').append(answerHtml);
  716. $(".chat-box").animate({"scrollTop":$(".scollBox").height()},900);
  717. }
  718. });
  719. }
  720. function NoAnswer(key){
  721. $.ajax({
  722. url:'<?php echo $this->createUrl('help/noanswer')?>',
  723. method:'POST',
  724. dataType:'json',
  725. data:{'name':key},
  726. success:function(res){
  727. }
  728. });
  729. }
  730. //查看标准答案
  731. function viewQuestion(id,isAnswer,needcount){
  732. $.ajax({
  733. url:'<?php echo $this->createUrl('help/view') ?>',
  734. method:'POST',
  735. dataType:'json',
  736. data:{'id':id,'isAnswer':isAnswer,'needcount':needcount},
  737. success:function(res){
  738. if(res.status==1){
  739. var answerHtml='<div class="chat-msg clearfix">';
  740. answerHtml+='<div class="chat-msg-left fl">';
  741. answerHtml+='<span class="head-portrait fl"><img src="/images/left_head.png"></span>';
  742. answerHtml+='<span class="chat-msg-box fl">';
  743. answerHtml+='<div class="reply">';
  744. answerHtml+='<div class="reply-text">'+res.data['hpAnswer']+'</div>';
  745. if(res.data['relProblem'].length>0){
  746. answerHtml+='<div class="relation-problem-list">';
  747. for(var i=0;i<res.data['relProblem'].length;i++){
  748. answerHtml+='<a href="#" id="'+res.data['relProblem'][i]['hpId']+'">'+res.data['relProblem'][i]['hpName']+'</a>';
  749. }
  750. answerHtml+='</div>';
  751. }
  752. answerHtml+='<div class="reply-confirm" rel="'+res.data['hpName']+'" id="'+res.data['hpId']+'">';
  753. answerHtml+='<span class="reply-btn"><img src="/images/icon-satisfied.png">有用</span>';
  754. answerHtml+='<span class="reply-btn-show"><img src="/images/icon-satisfied-show.png">有用</span>';
  755. answerHtml+='<span class="reply-btn-dissatisfied"><img src="/images/icon-dissatisfied.png">没用</span>';
  756. answerHtml+='<span class="reply-btn-dissatisfied-show"><img src="/images/icon-dissatisfied-show.png">没用</span>';
  757. answerHtml+='</div>';
  758. answerHtml+='<div class="diss">';
  759. answerHtml+='<input class="diss-text" type="text" placeholder="感谢你的评价,请填写具体原因供我们改进">';
  760. answerHtml+='</div>';
  761. answerHtml+='</div>';
  762. answerHtml+='</span>';
  763. answerHtml+='</div>';
  764. answerHtml+='</div>';
  765. $('.scollBox').append(answerHtml);
  766. $(".chat-box").animate({"scrollTop":$(".scollBox").height()},900);
  767. }
  768. }
  769. });
  770. }
  771. </script>