details.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. {extend name="public/layout" /} {block name="title"}日报详情{/block} {block name="body"}
  2. <link rel="stylesheet" type="text/css" href="__STATIC__/css/csspc.css"/>
  3. <link rel="stylesheet" type="text/css" href="__STATIC__/css/redesign.css"/>
  4. <style>
  5. html,body{
  6. display: block;
  7. width: 100%;
  8. height: 100%;
  9. background-color: #fff;
  10. position: relative;
  11. }
  12. #layui-hb-body{
  13. display: block;
  14. width: 100%;
  15. height: 100%;
  16. padding: 20px 30px 58px;
  17. overflow: auto;
  18. position: relative;
  19. }
  20. .layui-hb-fj-img{
  21. margin-right: 10px;
  22. cursor: pointer;
  23. }
  24. .layui-hb-body-con{
  25. min-height: 100%;
  26. }
  27. .layui-pl-input{
  28. position: absolute;
  29. width: 100%;
  30. bottom: 0;
  31. left: 0;
  32. }
  33. /*webkit内核*/
  34. .scroll_content::-webkit-scrollbar {
  35. width:0px;
  36. height:0px;
  37. }
  38. .scroll_content::-webkit-scrollbar-button {
  39. background-color:rgba(0,0,0,0);
  40. }
  41. .scroll_content::-webkit-scrollbar-track {
  42. background-color:rgba(0,0,0,0);
  43. }
  44. .scroll_content::-webkit-scrollbar-track-piece {
  45. background-color:rgba(0,0,0,0);
  46. }
  47. /* 滚动条 */
  48. .scroll_content::-webkit-scrollbar-thumb{
  49. background-color:#aaa;
  50. border-radius: 3px;
  51. }
  52. .scroll_content::-webkit-scrollbar-corner {
  53. background-color:rgba(0,0,0,0);
  54. }
  55. .scroll_content::-webkit-scrollbar-resizer {
  56. background-color:rgba(0,0,0,0);
  57. }
  58. .scroll_content::-webkit-scrollbar {
  59. width:7px;
  60. height:8px;
  61. border-radius: 3px;
  62. }
  63. /*o内核*/
  64. .scroll_content::-o-scrollbar{
  65. -moz-appearance: none !important;
  66. background: rgba(0,255,0,0) !important;
  67. }
  68. .scroll_content::-o-scrollbar-button {
  69. background-color:rgba(0,0,0,0);
  70. }
  71. .scroll_content::-o-scrollbar-track {
  72. background-color:rgba(0,0,0,0);
  73. }
  74. .scroll_content::-o-scrollbar-track-piece {
  75. background-color:rgba(0,0,0,0);
  76. }
  77. /* 滚动条 */
  78. .scroll_content::-o-scrollbar-thumb{
  79. background-color:#aaa;
  80. border-radius: 3px;
  81. }
  82. .scroll_content::-o-scrollbar-corner {
  83. background-color:rgba(0,0,0,0);
  84. }
  85. .scroll_content::-o-scrollbar-resizer {
  86. background-color:rgba(0,0,0,0);
  87. }
  88. /*IE10,IE11,IE12*/
  89. .scroll_content{
  90. -ms-scroll-chaining: chained;
  91. -ms-overflow-style: none;
  92. -ms-content-zooming: zoom;
  93. -ms-scroll-rails: none;
  94. -ms-content-zoom-limit-min: 100%;
  95. -ms-content-zoom-limit-max: 500%;
  96. -ms-scroll-snap-type: proximity;
  97. -ms-scroll-snap-points-x: snapList(100%, 200%, 300%, 400%, 500%);
  98. -ms-overflow-style: none;
  99. overflow: auto;
  100. }
  101. .reportbox{
  102. display: block;
  103. width: 100%;
  104. position: relative;
  105. padding-left: 80px;
  106. font-size: 20px;
  107. line-height: 20px;
  108. }
  109. .leftreport{
  110. position: absolute;
  111. left: 0;
  112. top: 0;
  113. background-color: #fff;
  114. z-index: 9;
  115. }
  116. .rightreportbox{
  117. display: block;
  118. width: 100%;
  119. overflow-x: auto;
  120. overflow-y: hidden;
  121. white-space: nowrap;
  122. }
  123. .rightreportbox img{
  124. display: block;
  125. width: 20px;
  126. height: 20px;
  127. border-radius: 6px;
  128. margin-right: 4px;
  129. }
  130. .pointer{
  131. cursor: pointer;
  132. }
  133. </style>
  134. <body>
  135. <div id="layui-hb-body" class="scroll_content">
  136. <div class="layui-hb-body-con wpsr">
  137. <div class="woverflow">
  138. <div class="wleft woverflow layui-tx">
  139. <img class="width100_" src="{$data.headimgurl}"/>
  140. </div>
  141. <div class="wleft mdl15">
  142. <p class="font20 huise333">{$data.name}的日报</p>
  143. <p class="font16 huiseaaa mdt02">{$data.addtime}</p>
  144. </div>
  145. </div>
  146. <p class="layui_x mdtb15"></p>
  147. <p class="huiseaaa font16 mdtb15">{if condition="$data.type eq 'day'"}今日{elseif($data.type == 'week')/}本周{else/}本月{/if}工作:</p>
  148. <p class="huise333 font16 lh24">{$data.current_work}</p>
  149. <p class="huiseaaa font16 mdt30 mdb15">{if condition="$data.type eq 'day'"}明日{elseif($data.type == 'week')/}下周{else/}下月{/if}计划:</p>
  150. <p class="huise333 font16 lh24">{$data.next_plan}</p>
  151. <p class="huiseaaa font16 mdt30 mdb15">其他事项: </p>
  152. <p class="huise333 font16 lh24">{$data.other_matters}</p>
  153. <p class="huiseaaa font16 mdt30 mdb15">附件:</p>
  154. {notempty name="$data.enclosure_file"}
  155. <div class="bghuiseee pdtb12 woverflow">
  156. <div class="width94_ wauto woverflow">
  157. {volist name="$data.enclosure_file" id="v"}
  158. <img class="wleft layui-hb-fj-img" src="{$v}"/>
  159. {/volist}
  160. </div>
  161. </div>
  162. {/notempty}
  163. {eq name="$category" value="sent"}
  164. <div class="font20 huiseaaa mdt30 reportbox">
  165. <div class="leftreport">汇报给:</div>
  166. <div class="rightreportbox scroll_content">
  167. {volist name="$data.reporting_object" id="v"}
  168. <div class="woverflow ids">
  169. <img class="wleft" src="{$v.user.headimgurl}" alt=""/>
  170. <div class="wleft">{$v.name}</div>
  171. </div>
  172. {/volist}
  173. </div>
  174. </div>
  175. {/eq}
  176. <p class="layui_x mdtb20"></p>
  177. <div class="layui-list-pl pdb73">
  178. <ul class="layui-list-pl-ul" id="LAY_demo1">
  179. </ul>
  180. </div>
  181. </div>
  182. </div>
  183. <!-- <div class="layui-pl-input ">
  184. <div class="width90_ woverflow wauto" style="border-top: 1px solid #eee;padding: 16px 30px;">
  185. <img class="layui-xl-ico wleft" src="__STATIC__/img/xiaolan.png" />
  186. <input class="ds wleft mdl12 height100_ layui-pl-ipt" id="commentval" placeholder="请发表你的评论" type="text" id="" name=""
  187. autocomplete="off" />
  188. <p id="sendmsg" class="font18 href huiseaaa wright">发表</p>
  189. </div>
  190. </div> -->
  191. </body>
  192. {/block} {block name="js"}
  193. <script>
  194. layui.config({
  195. base: '__LAYUI__/',
  196. urlbase: '/sys'
  197. }).extend({
  198. index: 'lib/index' //主入口模块
  199. }).use(['index', 'table','flow'], function() {
  200. var $ = layui.$,
  201. form = layui.form,
  202. flow=layui.flow;
  203. var rid = "{$data.id}", parent_id='0', parent_uid="0",nowname="";
  204. $('.layui-hb-fj-img').click(function(){
  205. previewImgs($(this)[0].currentSrc)
  206. })
  207. getAjaxData();
  208. $('#sendmsg').click(function(){
  209. if(!$("#commentval").val()){
  210. alert('评论不能为空!')
  211. return false;
  212. }
  213. $.ajax({
  214. type: "POST",
  215. url: "{:url('dailyWork/send_comments')}",
  216. data: {
  217. daily_work_id: rid,
  218. comment: $("#commentval").val(),//评论内容
  219. parent_id: parent_id,//回复上级评论的id(不是回复传0)
  220. parent_uid: parent_uid,//回复上级的uid(不是回复传0)
  221. },
  222. async: true,
  223. success: function (res) {
  224. if(res.code==0){
  225. window.location.reload();
  226. }
  227. }
  228. })
  229. })
  230. function previewImgs(isrc) {
  231. var img = new Image();
  232. img.src = isrc;
  233. var height = img.height + 50; //获取图片高度
  234. var width = img.width; //获取图片宽度
  235. height= width > ($('body')[0].clientWidth - 100) ? 'auto' : height;
  236. width=width>($('body')[0].clientWidth-100)? ($('body')[0].clientWidth - 100): width;
  237. var imgHtml = "<img src='" + isrc + "' />";
  238. //弹出层
  239. layer.open({
  240. type: 1,
  241. shade: 0.8,
  242. offset: 'auto',
  243. area: [width + 'px', height + 'px'],
  244. shadeClose: true,//点击外围关闭弹窗
  245. scrollbar: false,//不现实滚动条
  246. title: "图片预览", //不显示标题
  247. content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
  248. cancel: function () {
  249. //layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', { time: 5000, icon: 6 });
  250. }
  251. });
  252. }
  253. function getAjaxData(){
  254. flow.load({
  255. elem: '#LAY_demo1',
  256. scrollElem: '#layui-hb-body',
  257. done: function (page, next) { //执行下一页的回调
  258. //模拟数据插入
  259. setTimeout(function () {
  260. var lis = [];
  261. var count = 0;
  262. $.ajax({
  263. type: "POST",
  264. url: "{:url('dailyWork/comment_list')}",
  265. data: {
  266. page: page,
  267. id: rid
  268. },
  269. async: true,
  270. success: function (rs) {
  271. if (rs.code == 0) {
  272. var str = "";
  273. for (var i in rs.data) {
  274. str += '<li data-id="' + rs.data[i].id +'" data-uid="' + rs.data[i].uid +'" data-name="' + rs.data[i].name +'" class="woverflow mdt15 pointer everycommentbox">' +
  275. '<div class="woverflow wleft layui-list-tx">' +
  276. '<img class="width100_" src="' + rs.data[i].headimgurl + '" />' +
  277. '</div>' +
  278. '<div class="wleft mdl10">' +
  279. '<p class="font16 huiseaaa">' + rs.data[i].name + (!rs.data[i].reply_name?'':'回复'+ rs.data[i].reply_name) + '</p>' +
  280. '<p class="font16 huise333 mdtb02">' + rs.data[i].comment + '</p>' +
  281. '<p class="huiseaaa font18">' + rs.data[i].addtime.split(' ')[1] + '</p>' +
  282. '</div>' +
  283. '</li>';
  284. }
  285. lis.push(str);
  286. next(lis.join(''), page < rs.page); //假设总页数为 10
  287. everycommentbox();
  288. }
  289. }
  290. });
  291. //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
  292. //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
  293. }, 500);
  294. }
  295. });
  296. }
  297. function everycommentbox(){
  298. $('.everycommentbox').click(function(){
  299. parent_id = $(this).data('id');
  300. parent_uid = $(this).data('uid');
  301. nowname = $(this).data('name');
  302. document.getElementById('commentval').placeholder='回复'+ nowname;
  303. })
  304. }
  305. });
  306. </script>
  307. {/block}