123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- {extend name="public/layout" /} {block name="title"}日报详情{/block} {block name="body"}
- <link rel="stylesheet" type="text/css" href="__STATIC__/css/csspc.css"/>
- <link rel="stylesheet" type="text/css" href="__STATIC__/css/redesign.css"/>
- <style>
- html,body{
- display: block;
- width: 100%;
- height: 100%;
- background-color: #fff;
- position: relative;
- }
- #layui-hb-body{
- display: block;
- width: 100%;
- height: 100%;
- padding: 20px 30px 58px;
- overflow: auto;
- position: relative;
- }
- .layui-hb-fj-img{
- margin-right: 10px;
- cursor: pointer;
- }
- .layui-hb-body-con{
- min-height: 100%;
- }
- .layui-pl-input{
- position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
-
- }
- /*webkit内核*/
- .scroll_content::-webkit-scrollbar {
- width:0px;
- height:0px;
- }
- .scroll_content::-webkit-scrollbar-button {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-webkit-scrollbar-track {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-webkit-scrollbar-track-piece {
- background-color:rgba(0,0,0,0);
- }
- /* 滚动条 */
- .scroll_content::-webkit-scrollbar-thumb{
- background-color:#aaa;
- border-radius: 3px;
- }
- .scroll_content::-webkit-scrollbar-corner {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-webkit-scrollbar-resizer {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-webkit-scrollbar {
- width:7px;
- height:8px;
- border-radius: 3px;
- }
- /*o内核*/
- .scroll_content::-o-scrollbar{
- -moz-appearance: none !important;
- background: rgba(0,255,0,0) !important;
- }
- .scroll_content::-o-scrollbar-button {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-o-scrollbar-track {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-o-scrollbar-track-piece {
- background-color:rgba(0,0,0,0);
- }
- /* 滚动条 */
- .scroll_content::-o-scrollbar-thumb{
- background-color:#aaa;
- border-radius: 3px;
- }
- .scroll_content::-o-scrollbar-corner {
- background-color:rgba(0,0,0,0);
- }
- .scroll_content::-o-scrollbar-resizer {
- background-color:rgba(0,0,0,0);
- }
- /*IE10,IE11,IE12*/
- .scroll_content{
- -ms-scroll-chaining: chained;
- -ms-overflow-style: none;
- -ms-content-zooming: zoom;
- -ms-scroll-rails: none;
- -ms-content-zoom-limit-min: 100%;
- -ms-content-zoom-limit-max: 500%;
- -ms-scroll-snap-type: proximity;
- -ms-scroll-snap-points-x: snapList(100%, 200%, 300%, 400%, 500%);
- -ms-overflow-style: none;
- overflow: auto;
- }
- .reportbox{
- display: block;
- width: 100%;
- position: relative;
- padding-left: 80px;
- font-size: 20px;
- line-height: 20px;
- }
- .leftreport{
- position: absolute;
- left: 0;
- top: 0;
- background-color: #fff;
- z-index: 9;
- }
- .rightreportbox{
- display: block;
- width: 100%;
- overflow-x: auto;
- overflow-y: hidden;
- white-space: nowrap;
- }
- .rightreportbox img{
- display: block;
- width: 20px;
- height: 20px;
- border-radius: 6px;
- margin-right: 4px;
- }
- .pointer{
- cursor: pointer;
- }
- </style>
- <body>
- <div id="layui-hb-body" class="scroll_content">
- <div class="layui-hb-body-con wpsr">
- <div class="woverflow">
- <div class="wleft woverflow layui-tx">
- <img class="width100_" src="{$data.headimgurl}"/>
- </div>
- <div class="wleft mdl15">
- <p class="font20 huise333">{$data.name}的日报</p>
- <p class="font16 huiseaaa mdt02">{$data.addtime}</p>
- </div>
- </div>
- <p class="layui_x mdtb15"></p>
- <p class="huiseaaa font16 mdtb15">{if condition="$data.type eq 'day'"}今日{elseif($data.type == 'week')/}本周{else/}本月{/if}工作:</p>
- <p class="huise333 font16 lh24">{$data.current_work}</p>
- <p class="huiseaaa font16 mdt30 mdb15">{if condition="$data.type eq 'day'"}明日{elseif($data.type == 'week')/}下周{else/}下月{/if}计划:</p>
- <p class="huise333 font16 lh24">{$data.next_plan}</p>
- <p class="huiseaaa font16 mdt30 mdb15">其他事项: </p>
- <p class="huise333 font16 lh24">{$data.other_matters}</p>
- <p class="huiseaaa font16 mdt30 mdb15">附件:</p>
- {notempty name="$data.enclosure_file"}
- <div class="bghuiseee pdtb12 woverflow">
- <div class="width94_ wauto woverflow">
- {volist name="$data.enclosure_file" id="v"}
- <img class="wleft layui-hb-fj-img" src="{$v}"/>
- {/volist}
- </div>
- </div>
- {/notempty}
- {eq name="$category" value="sent"}
- <div class="font20 huiseaaa mdt30 reportbox">
- <div class="leftreport">汇报给:</div>
- <div class="rightreportbox scroll_content">
- {volist name="$data.reporting_object" id="v"}
- <div class="woverflow ids">
- <img class="wleft" src="{$v.user.headimgurl}" alt=""/>
- <div class="wleft">{$v.name}</div>
- </div>
- {/volist}
- </div>
- </div>
- {/eq}
- <p class="layui_x mdtb20"></p>
- <div class="layui-list-pl pdb73">
- <ul class="layui-list-pl-ul" id="LAY_demo1">
-
-
- </ul>
- </div>
-
- </div>
-
- </div>
- <!-- <div class="layui-pl-input ">
- <div class="width90_ woverflow wauto" style="border-top: 1px solid #eee;padding: 16px 30px;">
- <img class="layui-xl-ico wleft" src="__STATIC__/img/xiaolan.png" />
- <input class="ds wleft mdl12 height100_ layui-pl-ipt" id="commentval" placeholder="请发表你的评论" type="text" id="" name=""
- autocomplete="off" />
- <p id="sendmsg" class="font18 href huiseaaa wright">发表</p>
- </div>
-
- </div> -->
- </body>
- {/block} {block name="js"}
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'table','flow'], function() {
- var $ = layui.$,
- form = layui.form,
- flow=layui.flow;
- var rid = "{$data.id}", parent_id='0', parent_uid="0",nowname="";
- $('.layui-hb-fj-img').click(function(){
- previewImgs($(this)[0].currentSrc)
- })
- getAjaxData();
- $('#sendmsg').click(function(){
- if(!$("#commentval").val()){
- alert('评论不能为空!')
- return false;
- }
- $.ajax({
- type: "POST",
- url: "{:url('dailyWork/send_comments')}",
- data: {
- daily_work_id: rid,
- comment: $("#commentval").val(),//评论内容
- parent_id: parent_id,//回复上级评论的id(不是回复传0)
- parent_uid: parent_uid,//回复上级的uid(不是回复传0)
- },
- async: true,
- success: function (res) {
- if(res.code==0){
- window.location.reload();
- }
- }
- })
- })
- function previewImgs(isrc) {
- var img = new Image();
- img.src = isrc;
- var height = img.height + 50; //获取图片高度
- var width = img.width; //获取图片宽度
- height= width > ($('body')[0].clientWidth - 100) ? 'auto' : height;
- width=width>($('body')[0].clientWidth-100)? ($('body')[0].clientWidth - 100): width;
- var imgHtml = "<img src='" + isrc + "' />";
- //弹出层
- layer.open({
- type: 1,
- shade: 0.8,
- offset: 'auto',
- area: [width + 'px', height + 'px'],
- shadeClose: true,//点击外围关闭弹窗
- scrollbar: false,//不现实滚动条
- title: "图片预览", //不显示标题
- content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
- cancel: function () {
- //layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', { time: 5000, icon: 6 });
- }
- });
- }
- function getAjaxData(){
- flow.load({
- elem: '#LAY_demo1',
- scrollElem: '#layui-hb-body',
- done: function (page, next) { //执行下一页的回调
- //模拟数据插入
- setTimeout(function () {
- var lis = [];
- var count = 0;
- $.ajax({
- type: "POST",
- url: "{:url('dailyWork/comment_list')}",
- data: {
- page: page,
- id: rid
- },
- async: true,
- success: function (rs) {
- if (rs.code == 0) {
- var str = "";
- for (var i in rs.data) {
- 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">' +
- '<div class="woverflow wleft layui-list-tx">' +
- '<img class="width100_" src="' + rs.data[i].headimgurl + '" />' +
- '</div>' +
- '<div class="wleft mdl10">' +
- '<p class="font16 huiseaaa">' + rs.data[i].name + (!rs.data[i].reply_name?'':'回复'+ rs.data[i].reply_name) + '</p>' +
- '<p class="font16 huise333 mdtb02">' + rs.data[i].comment + '</p>' +
- '<p class="huiseaaa font18">' + rs.data[i].addtime.split(' ')[1] + '</p>' +
- '</div>' +
- '</li>';
- }
- lis.push(str);
- next(lis.join(''), page < rs.page); //假设总页数为 10
- everycommentbox();
- }
- }
- });
- //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
- //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
- }, 500);
- }
- });
- }
- function everycommentbox(){
- $('.everycommentbox').click(function(){
- parent_id = $(this).data('id');
- parent_uid = $(this).data('uid');
- nowname = $(this).data('name');
- document.getElementById('commentval').placeholder='回复'+ nowname;
- })
- }
- });
-
- </script>
- {/block}
|