reply.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <style>
  2. /* 弹层样式 */
  3. .need-pop{
  4. position: fixed;
  5. top: 0;
  6. left: 0;
  7. bottom: 0;
  8. right: 0;
  9. background: rgba(0, 0, 0, 0.5);
  10. }
  11. .need-pop-con{
  12. background: #fff;
  13. width: 510px;
  14. position: absolute;
  15. left: 50%;
  16. top: 50%;
  17. transform: translate(-50%,-50%);
  18. }
  19. .need-pop-top{
  20. line-height: 30px;
  21. font-size: 20px;
  22. font-weight: bold;
  23. padding: 6px 12px;
  24. }
  25. .npt-close{
  26. font-size: 30px;
  27. cursor: pointer;
  28. line-height: 28px;
  29. }
  30. .need-pop-list{
  31. margin: 10px 0;
  32. line-height: 30px;
  33. }
  34. .need-pop-menu{
  35. width: 110px;
  36. text-align: right;
  37. margin-right: 4px;
  38. }
  39. .need-pop-menu b{
  40. color: red;
  41. font-weight: bold;
  42. }
  43. .gray-bg{
  44. background: #F0F0F0;
  45. }
  46. .need-pop-detail{
  47. width: 370px;
  48. line-height: 26px;
  49. }
  50. .need-pop-detail input,.need-pop-detail textarea{
  51. border: 1px solid #ccc;
  52. width: 100%;
  53. }
  54. .need-pop-detail input{
  55. height: 26px;
  56. }
  57. .prev-class{
  58. position: relative;
  59. }
  60. .inp-text {
  61. position: relative;
  62. text-indent: 10px;
  63. width: 100%;
  64. height: 100%;
  65. line-height: 30px;
  66. border: 1px solid #D8D8D8;
  67. cursor: pointer;
  68. }
  69. .select-con {
  70. display: none;
  71. border: 1px solid #ccc;
  72. border-top: none;
  73. position: absolute;
  74. background: #fff;
  75. z-index: 10;
  76. width: 100%;
  77. text-indent: 10px;
  78. line-height: 28px;
  79. }
  80. .select-con li {
  81. list-style: none;
  82. }
  83. .select-con li:hover{background: #2977ff;color: #fff;cursor: pointer;}
  84. .inp-text:after {
  85. content: '';
  86. border-left: 5px solid transparent;
  87. border-right: 5px solid transparent;
  88. border-top: 5px solid #676767;
  89. position: absolute;
  90. right: 10px;
  91. bottom: 12px;
  92. }
  93. .list-half{
  94. width: 49%;
  95. }
  96. .list-half .need-pop-detail{
  97. width: 120px;
  98. }
  99. .need-pop-sub{
  100. display: block;
  101. margin: 20px auto 30px;
  102. color: #fff;
  103. background: #2977ff;
  104. padding: 2px 24px;
  105. border: none;
  106. border-radius: 4px;
  107. cursor: pointer;
  108. }
  109. .gray-font{
  110. color: rgb(153, 153, 153);
  111. }
  112. .need-warn-con{
  113. font-size: 12px;
  114. padding-left: 20px;
  115. }
  116. .add-file{
  117. cursor: pointer;
  118. font-size: 14px;
  119. }
  120. .vtm{
  121. vertical-align: middle;
  122. }
  123. /* 回复样式 */
  124. .title-detail{
  125. background: #EFF5FB;
  126. padding: 20px;
  127. margin: 20px 30px;
  128. color: #000;
  129. }
  130. .title-msg{
  131. font-weight: bold;
  132. margin-bottom: 10px;
  133. }
  134. .tar{
  135. text-align: right;
  136. }
  137. .flex{
  138. display: -webkit-flex;
  139. display: -moz-flex;
  140. display: -ms-flex;
  141. display: -o-flex;
  142. display: flex;
  143. }
  144. .flex-one{
  145. -webkit-flex: 1;
  146. -moz-flex: 1;
  147. -ms-flex: 1;
  148. -o-flex: 1;
  149. flex: 1;
  150. }
  151. .flex-two{
  152. -webkit-flex: 2;
  153. -moz-flex: 2;
  154. -ms-flex: 2;
  155. -o-flex: 2;
  156. flex: 2;
  157. }
  158. .flex-three{
  159. -webkit-flex: 3;
  160. -moz-flex: 3;
  161. -ms-flex: 3;
  162. -o-flex: 3;
  163. flex: 3;
  164. }
  165. .great-num{
  166. margin-left: 10px;
  167. }
  168. .need-list{
  169. border-bottom: 1px solid #ccc;
  170. padding: 4px;
  171. line-height: 22px;
  172. min-height: 44px;
  173. }
  174. .need-list:last-child{
  175. border: none;
  176. }
  177. .need-detail{
  178. margin: 0 30px 20px;
  179. }
  180. .need-list-menu{
  181. width: 110px;
  182. align-self: center;
  183. }
  184. .need-list-main{
  185. align-self: center;
  186. }
  187. .download-file{
  188. color: #2977ff;
  189. cursor: pointer;
  190. }
  191. .great-opt-con{
  192. width: 80px;
  193. text-align: right;
  194. cursor: pointer;
  195. }
  196. .title-msg-con{
  197. position: relative;
  198. padding-right: 16px;
  199. margin-left: 8px;
  200. }
  201. .title-msg-con:after{
  202. content: '';
  203. border-left: 4px solid transparent;
  204. border-right: 4px solid transparent;
  205. border-top: 6px solid #676767;
  206. position: absolute;
  207. right: 0px;
  208. top: 8px;
  209. }
  210. .need-list-top{
  211. margin-bottom: 10px;
  212. }
  213. .great-list-name{
  214. display: inline-block;
  215. overflow: hidden;
  216. width: 36px;
  217. height: 36px;
  218. background: #2977ff;
  219. color: #fff;
  220. border-radius: 50%;
  221. font-size: 12px;
  222. text-align: center;
  223. line-height: 36px;
  224. margin: 6px 6px 0 0;
  225. }
  226. .menu-icon{
  227. width: 18px;
  228. height: auto;
  229. }
  230. .message-name{
  231. font-size: 16px;
  232. font-weight: bold;
  233. margin-right: 20px;
  234. }
  235. .message-list{
  236. margin-bottom: 12px;
  237. }
  238. .message-inp{
  239. width: 100%;
  240. padding: 10px;
  241. }
  242. .reply-btn{
  243. color: #fff;
  244. background: #2977ff;
  245. padding: 2px 24px;
  246. border: none;
  247. border-radius: 4px;
  248. cursor: pointer;
  249. margin-top: 10px;
  250. }
  251. .great-hook.hide{
  252. display: none;
  253. }
  254. .search-propose-man{
  255. background: #2977ff;
  256. color: #fff;
  257. width: 80px;
  258. height: 24px;
  259. text-align: center;
  260. border-radius: 4px;
  261. border: none;
  262. cursor: pointer;
  263. margin-right: 10px;
  264. margin-top:15px;
  265. }
  266. .message-msg{
  267. word-wrap:break-word
  268. }
  269. </style>
  270. <section class="need-detail">
  271. <section class="need-detail search-propose-man" onclick="history.back(-1);">返回列表</section>
  272. <article class="title-detail">
  273. <p class="title-msg"><?php echo $data['title']?></p>
  274. <div class="flex">
  275. <div class="flex-two gray-font">来源:<?php echo $data['origin']?></div>
  276. <div class="flex-two gray-font">类型:
  277. <?php
  278. if(isset($data['type'])){
  279. switch ($data['type']){
  280. case 0:
  281. echo '个人建议';
  282. break;
  283. case 1:
  284. echo '市场反馈';
  285. break;
  286. case 2:
  287. echo '公司决策';
  288. break;
  289. }
  290. }
  291. ?></div>
  292. <div class="flex-three gray-font">提出日期:<?php echo $data['createTime']?></div>
  293. <div class="flex-three gray-font">期待上线时间:<?php if(isset($data['releaseTime'])){echo $data['releaseTime'];}?></div>
  294. <div class="great-num gray-font tar likesNum">点赞数:<?php echo $data['likesNum']?></div>
  295. </div>
  296. </article>
  297. <section class="need-detail">
  298. <div class="flex need-list">
  299. <div class="need-list-menu gray-font">问题</div>
  300. <div class="need-list-main flex-one">
  301. <?php if(isset($data['question'])) echo $data['question'];?>
  302. </div>
  303. </div>
  304. <div class="flex need-list">
  305. <div class="need-list-menu gray-font">建议</div>
  306. <div class="need-list-main flex-one">
  307. <?php if(isset($data['target'])) echo $data['target'];?>
  308. </div>
  309. </div>
  310. <div class="flex need-list">
  311. <div class="need-list-menu gray-font">📎附件</div>
  312. <div class="need-list-main flex-one">
  313. <?php
  314. if(isset($data['urlList']) && $data['urlList']){
  315. ?>
  316. <span class="download-file"><a href="<?php echo $data['urlList'][0]?>">下载附件</a></span>
  317. <?php
  318. }
  319. ?>
  320. </div>
  321. </div>
  322. <div class="flex need-list">
  323. <div class="need-list-main flex-one">
  324. <div class="need-list-top">
  325. <img src="/images/zan.png" alt="" class="vtm menu-icon">
  326. <span class="vtm title-msg-con">点赞&nbsp;<span class="praise_num"><?php echo $data['likesNum']?></span></span>
  327. </div>
  328. <div class="great-list like">
  329. <?php
  330. if($data['likesPeople']){
  331. foreach ($data['likesPeople'] as $val){
  332. if(Yii::app()->session['coachInfo']['coach_name']==$val){
  333. echo '<span class="great-list-name js_add">'.$val.'</span>';
  334. }else{
  335. echo '<span class="great-list-name">'.$val.'</span>';
  336. }
  337. }
  338. }
  339. ?>
  340. </div>
  341. </div>
  342. <div class="great-opt-con">
  343. <div class="great-hook praise <?php if(isset($is_like) && $is_like==1){ echo 'hide';}?>">
  344. <span class="vtm">点赞</span>
  345. <img src="/images/zan.png" alt="" class="vtm">
  346. </div>
  347. <div class="great-hook cancel-praise <?php if(isset($is_like) && $is_like==0){ echo 'hide';}?>">
  348. <span class="vtm">取消点赞</span>
  349. <img src="/images/zan2.png" alt="" class="vtm">
  350. </div>
  351. </div>
  352. </div>
  353. <div class="need-list">
  354. <div class="need-list-top">
  355. <img src="/images/human.png" alt="" class="vtm menu-icon">
  356. <span class="vtm title-msg-con">已读&nbsp;<?php echo $data['readNum']?></span>
  357. </div>
  358. <div class="great-list">
  359. <?php
  360. if($data['readPeople']){
  361. foreach ($data['readPeople'] as $val){
  362. echo '<span class="great-list-name">'.$val.'</span>';
  363. }
  364. }
  365. ?>
  366. </div>
  367. </div>
  368. <div class="need-list">
  369. <div class="need-list-top">
  370. <img src="/images/dialog.png" alt="" class="vtm menu-icon">
  371. <span class="vtm">&nbsp;&nbsp;回复&nbsp;</span>
  372. </div>
  373. <?php
  374. if(isset($reply)){
  375. foreach ($reply as $item){
  376. ?>
  377. <div class="message-list">
  378. <div class="message-top">
  379. <span class="message-name"><?php echo $item['replyPeople']?></span>
  380. <span class="message-date"><?php echo $item['replyTime']?></span>
  381. </div>
  382. <div class="message-msg gray-font"><?php echo $item['content']?></div>
  383. </div>
  384. <?php
  385. }
  386. }
  387. ?>
  388. <input type="hidden" id="add_element">
  389. <textarea name="msg" id="msg" class="message-inp" placeholder=""></textarea>
  390. <input type="button" value="回复" class="reply-btn">
  391. <input type="hidden" name="id" value="<?php echo $data['id']?>" >
  392. </div>
  393. </section>
  394. <script>
  395. $('.reply-btn').click(function () {
  396. var id=$('input[name=id]').val();
  397. var msg=$('#msg').val();
  398. if(msg.length>100){
  399. layer.msg('回复内容不能超过100个字符')
  400. return false;
  401. }
  402. if(id=='' || msg==''){
  403. return false;
  404. }
  405. $.ajax({
  406. url:'<?php echo $this->createUrl('feedback/sendreply')?>',
  407. type:'POST',
  408. dataType:'json',
  409. data:{'id':id,'msg':msg},
  410. success:function(res){
  411. if(res.status==1){
  412. var html='<div class="message-list">';
  413. html+='<div class="message-top">';
  414. html+='<span class="message-name">'+res.data['username']+'</span>';
  415. html+='<span class="message-name">'+res.data['time']+'</span>';
  416. html+='</div>';
  417. html+='<div class="message-msg gray-font">'+msg+'</div>';
  418. html+='</div>';
  419. $('#add_element').before(html);
  420. $('#msg').val('');
  421. }
  422. }
  423. });
  424. });
  425. $('.praise').click(function(){
  426. var id=$('input[name=id]').val();
  427. var num=parseInt($('.praise_num').html());
  428. $.ajax({
  429. url:'<?php echo $this->createUrl('feedback/praise')?>',
  430. type:'POST',
  431. dataType:'json',
  432. data:{'id':id},
  433. success:function(res){
  434. if(res.status==1){
  435. num++;
  436. $('.praise').addClass('hide');
  437. $('.cancel-praise').removeClass('hide');
  438. $('.praise_num').html(num);
  439. $('.likesNum').html('点赞数:'+num);
  440. html='<span class="great-list-name js_add">'+res.likePeople+'</span>';
  441. $('.like').append(html);
  442. }
  443. }
  444. });
  445. });
  446. $('.cancel-praise').click(function(){
  447. var id=$('input[name=id]').val();
  448. var num=parseInt($('.praise_num').html());
  449. $.ajax({
  450. url:'<?php echo $this->createUrl('feedback/cancelpraise')?>',
  451. type:'POST',
  452. dataType:'json',
  453. data:{'id':id},
  454. success:function(res){
  455. if(res.status==1){
  456. num--;
  457. if(num<0){
  458. num=0;
  459. }
  460. $('.praise').removeClass('hide');
  461. $('.cancel-praise').addClass('hide');
  462. $('.praise_num').html(num);
  463. $('.likesNum').html('点赞数:'+num);
  464. $('.js_add').remove();
  465. }
  466. }
  467. });
  468. });
  469. $('.download-file').click(function(){
  470. var id=$('input[name=id]').val();
  471. $.ajax({
  472. url:'<?php echo $this->createUrl('feedback/download')?>',
  473. type:'POST',
  474. dataType:'json',
  475. data:{'id':id},
  476. success:function(res){
  477. if(res.status==1){
  478. }
  479. }
  480. });
  481. });
  482. </script>