QRcode0.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  9. <link rel="stylesheet" href="../../css/apiToast.css">
  10. <link rel="stylesheet" href="../../css/projeck.css">
  11. <style>
  12. html,body{
  13. background: #fff;
  14. }
  15. .api_layout{
  16. width: 100%;
  17. position: relative;
  18. }
  19. .List_QRcode{
  20. width: 100%;
  21. -webkit-box-sizing: border-box;
  22. -moz-box-sizing: border-box;
  23. box-sizing: border-box;
  24. }
  25. .List_QRcode li{
  26. -webkit-box-sizing: border-box;
  27. box-sizing: border-box;
  28. position: relative;
  29. border-bottom: 1px solid #ecf0f1;
  30. }
  31. .btn{
  32. width: 80px;
  33. height: 32px;
  34. line-height: 32px;
  35. font-size: 12px;
  36. background: #fff;
  37. color: #41c1fc;
  38. -webkit-border-radius: 50px;
  39. -moz-border-radius: 50px;
  40. border-radius: 50px;
  41. }
  42. .texts{
  43. font-size: 16px;
  44. color: #fff;
  45. line-height: 18px;
  46. width: 100%;
  47. line-height: 1.5;
  48. }
  49. .bg_start{
  50. display: inline-block;
  51. width: 20px;
  52. height: 20px;
  53. background: url("../../image/star.png");
  54. background-size: cover;
  55. position: relative;
  56. top: 4px;
  57. }
  58. .bord{
  59. border: 1px solid #41c1fc;
  60. }
  61. .List_QRcode li {
  62. padding:10px 0;
  63. }
  64. .List_QRcode li .btn{
  65. position: absolute;
  66. top: 15px;
  67. right: 10px;
  68. }
  69. .List_QRcode li .list_title{
  70. font-size: 16px;
  71. color: #97a3b4;
  72. height: 23px;
  73. line-height: 23px;
  74. margin-bottom: 10px;
  75. }
  76. .List_QRcode li .texts01{
  77. color: #1d1e2c;
  78. }
  79. .List_QRcode li .list_title .start1{
  80. width:0;
  81. }
  82. /*巡检记录列表样式*/
  83. .record_list li{
  84. padding: 12px 15px;
  85. position: relative;
  86. }
  87. .record_list li:after{
  88. content: '';
  89. width: 100%;
  90. display: block;
  91. position: absolute;
  92. bottom: 0;
  93. left: 0;
  94. height: 1px;
  95. background: #e6e7e8;
  96. }
  97. .record_header{
  98. width: 52px;
  99. height: 52px;
  100. -webkit-border-radius: 50%;
  101. -moz-border-radius: 50%;
  102. border-radius: 50%;
  103. margin-right: 7px;
  104. border: 1px solid #ECF0F1;
  105. }
  106. .personal_info{
  107. display: flex;
  108. justify-content: flex-start;
  109. flex-wrap: nowrap;
  110. display: -webkit-flex;
  111. -webkit-justify-content: flex-start;
  112. -webkit-flex-wrap: nowrap;
  113. align-items: center;
  114. position: relative;
  115. }
  116. .personal_info span{
  117. display: block;
  118. font-size: 15px;
  119. color: #000;
  120. }
  121. .personal_info span:first-child{
  122. font-weight: bold;
  123. }
  124. .personal_info span:last-child{
  125. color: #69707f;
  126. }
  127. .more_recode{
  128. width: 32px;
  129. height: 23px;
  130. -webkit-box-sizing: border-box;
  131. -moz-box-sizing: border-box;
  132. box-sizing: border-box;
  133. display: block;
  134. background: url("../../image/moreRecord.png") no-repeat;
  135. background-size: cover;
  136. position: absolute;
  137. top: 0;
  138. right: 8px;
  139. }
  140. .text_content{
  141. margin-top: 15px;
  142. color: #000;
  143. font-size: 15px;
  144. }
  145. .rows{
  146. display: flex;
  147. /*justify-content: space-around;*/
  148. flex-wrap: wrap;
  149. align-items: flex-start;
  150. margin-top: 10px;
  151. }
  152. .column{
  153. /*width: 100%;*/
  154. margin-bottom: 10px;
  155. }
  156. .column img{
  157. width: 100%;
  158. height: 100%;
  159. object-fit: cover;
  160. -webkit-border-radius: 10px;
  161. -moz-border-radius: 10px;
  162. border-radius: 10px;
  163. margin: auto;
  164. border: 1px solid #f2f2f2;
  165. }
  166. .date_record{
  167. color: #999;
  168. font-size: 15px;
  169. }
  170. .Unread{
  171. width: 40px;
  172. height: 32px;
  173. display: block;
  174. position: absolute;
  175. top: 0;
  176. right: 0;
  177. background: url("../../image/unread.png") no-repeat;
  178. background-size: cover;
  179. }
  180. .nread{
  181. width: 40px;
  182. height: 32px;
  183. display: block;
  184. position: absolute;
  185. top: 0;
  186. right: 0;
  187. background: url("../../image/nread.png") no-repeat;
  188. background-size: cover;
  189. }
  190. .footers{
  191. display: flex;
  192. display: -webkit-flex;
  193. justify-content: space-between;
  194. -webkit-justify-content: space-between;
  195. white-space: nowrap;
  196. align-items: center;
  197. -webkit-align-items: center;
  198. padding: 10px 0;
  199. }
  200. .thumbs{
  201. width: 15px;
  202. height: 15px;
  203. background: url("../../icon/momentHeart.png") no-repeat;
  204. -webkit-background-size: contain;
  205. background-size: contain;
  206. background-position: center;
  207. }
  208. .comment{
  209. width: 15px;
  210. height: 15px;
  211. background: url("../../icon/momentComment.png") no-repeat;
  212. -webkit-background-size: contain;
  213. background-size: contain;
  214. background-position: center;
  215. }
  216. .thumbsAndcomment{
  217. display: flex;
  218. display: -webkit-flex;
  219. justify-content:flex-start;
  220. -webkit-justify-content: flex-start;
  221. white-space: nowrap;
  222. align-items: center;
  223. -webkit-align-items: center;
  224. }
  225. .thumbsAndcomment span{
  226. position: relative;
  227. top: 0;
  228. margin-left: 5px;
  229. color: #3a4553;
  230. font-size: 12px;
  231. }
  232. .thumbs_num{
  233. background: #f3f3f3;
  234. padding: 5px 0;
  235. display: none;
  236. padding-right: 5px;
  237. position: relative;
  238. }
  239. .thumbs_num:after{
  240. content: '';
  241. display: block;
  242. position: absolute;
  243. bottom: 0;
  244. left: 0;
  245. height: 1px;
  246. width: 100%;
  247. background: rgba(226,226,228,.4);
  248. }
  249. .thumbs_num p{
  250. color: #6d6f96;
  251. font-size: 13px;
  252. }
  253. .thumbs-s{
  254. margin-right: 50px;
  255. }
  256. .taox{
  257. width: 15px;
  258. height: 15px;
  259. background: url("../../icon/taox.png") no-repeat;
  260. -webkit-background-size: contain;
  261. background-size: contain;
  262. background-position: center;
  263. margin: 0 5px;
  264. }
  265. .comment_content p{
  266. background: #f3f3f3;
  267. }
  268. .comment_c{
  269. font-size: 13px;
  270. padding: 5px;
  271. }
  272. .title{
  273. color: #6d6f96;
  274. }
  275. </style>
  276. </head>
  277. <body>
  278. <div class="api_layout">
  279. <div class="List_QRcodes">
  280. <ul class="List_QRcode" id="List_QRcode"></ul>
  281. </div>
  282. </div>
  283. <div class="noText hide">
  284. <img src="../../image/noText.png" alt="">
  285. </div>
  286. </body>
  287. </html>
  288. <script type="text/template" id="template">
  289. {{~it:value}}
  290. {{?value.msgType == 'CODE'}}
  291. <li style="padding:15px;" onclick="QRcodeDetaile('{{=value.pageId}},{{=value.id}},{{=value.departmentId}}','{{=value.pageName}}')">
  292. <p class="time list_title">
  293. <i class="bg_start"></i>
  294. <span>{{=value.createDate}}</span>
  295. </p>
  296. <p class="texts texts01">{{=value.dataContent}}</p>
  297. </li>
  298. {{??}}
  299. <li style="padding:10px 15px;">
  300. <div onclick="RecordDetaile('{{=value.recordId}}')">
  301. <div class="personal_info">
  302. <img src="{{=urlphp}}storage/avatar/avatar_{{=value.createId}}.png" onerror=javascript:this.src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/icon/default-avatar.png" class="record_header">
  303. <p>
  304. <span>{{=value.createName}}</span>
  305. <span>{{=value.uesrOrganizationName}}</span>
  306. </p>
  307. </div>
  308. <p class="text_content">{{=value.dataContent}}</p>
  309. <div class="row{{=value.id}} rows">
  310. {{if (value.dataImages != "") { }}
  311. {{ for (var j=0;j<value.dataImages.length;j++) { }}
  312. {{if(j<=8) { }}
  313. <div class="column">
  314. <img src="{{=value.dataImages[j]}}" alt="">
  315. </div>
  316. {{ } }}
  317. {{ } }}
  318. {{ } }}
  319. </div>
  320. <i class=" {{=value.readFlag == true?'nread' : 'Unread'}}"></i>
  321. </div>
  322. <div class="footers">
  323. <span class="date_record">{{=value.createDate}}</span>
  324. <div class="thumbsAndcomment">
  325. <div class="flex-start thumbs-s" id="thumbsid{{=value.id}}" onclick="dianzan(this,'{{=value.id}}')" flat="{{=value.staffflag}}">
  326. <i class="thumbs" style="background:url({{=value.staffflag==true?'../../icon/momentHeart_like.png':'../../icon/momentHeart.png'}}) no-repeat;background-size: contain;background-position: center;"></i>
  327. <span class="zan">赞</span>
  328. </div>
  329. <div class="flex-start" onclick="comment(this,'{{=value.id}}')">
  330. <i class="comment"></i>
  331. <span>评论</span>
  332. </div>
  333. </div>
  334. </div>
  335. <div class="thumbs_num" style="display:{{=value.staffLIkes.length == 0?'none':'block'}}">
  336. <div class="flex-start">
  337. <i class="taox"></i>
  338. <p class="names">
  339. {{? value.staffLIkes.length > 0}}
  340. {{ for(var d = 0;d<value.staffLIkes.length;d++) { }}
  341. {{? d === 0}}
  342. <span class="{{=value.staffLIkes[d].staffNum == uuid?'true':''}}">{{=value.staffLIkes[d].name}}</span>
  343. {{??}}
  344. <span class="{{=value.staffLIkes[d].staffNum == uuid?'true':''}}">,{{=value.staffLIkes[d].name}}</span>
  345. {{?}}
  346. {{ } }}
  347. {{?}}
  348. </p>
  349. </div>
  350. </div>
  351. <div class="comment_content">
  352. {{? value.staffCommentVos.length > 0}}
  353. {{ for(var s = 0;s<value.staffCommentVos.length;s++) { }}
  354. <p class="comment_c" onclick=deleteComment(this,'{{=value.staffCommentVos[s].id}}','{{=value.staffCommentVos[s].staffNum}}')>
  355. <span class="title">{{=value.staffCommentVos[s].name}}:</span>
  356. {{=value.staffCommentVos[s].content}}
  357. </p>
  358. {{ } }}
  359. {{?}}
  360. </div>
  361. </li>
  362. {{?}}
  363. {{~}}
  364. </script>
  365. <script type="text/javascript" src="../../script/api.js"></script>
  366. <script type="text/javascript" src="../../script/doT.min.js"></script>
  367. <script src="../../script/zepto.js" charset="utf-8"></script>
  368. <script src="../../script/config.js" charset="utf-8"></script>
  369. <script type="text/javascript">
  370. var depIDs = '',uuid='';
  371. var isLoadding = false;
  372. var skip = 1,name = "";
  373. apiready = function () {
  374. depIDs = api.pageParam.depID;
  375. var info = $api.getStorage('data'),
  376. user = JSON.parse(info).data.user;
  377. uuid = JSON.parse(info).data.user.staff_num;
  378. name = JSON.parse(info).data.user.name;
  379. QRcodeListFun(uuid,depIDs,true);
  380. resetWidth();
  381. api.addEventListener({
  382. name : 'scrolltobottom',
  383. extra : {
  384. threshold : 0 //设置距离底部多少距离时触发,默认值为0,数字类型
  385. }
  386. }, function(ret, err) {
  387. if (!isLoadding) {
  388. isLoadding = true;
  389. QRcodeListFun(uuid,depIDs,true);
  390. }
  391. })
  392. }
  393. function QRcodeListFun(uuid,depID,isLoadMore){
  394. var filter = {
  395. "departmentId" :depID,
  396. 'userId':uuid,
  397. "pageNumber" : skip,
  398. "pageSize" : 10
  399. };
  400. $http.requestShowProgress(UrlRouter.getPageAndRecordDynamic,'get',filter)
  401. .then(ret=>{
  402. if (ret.data.length == 0 && skip == 1) {
  403. $api.removeCls($api.dom('.noText'), 'hide');
  404. return false;
  405. }else {
  406. $api.addCls($api.dom('.noText'), 'hide');
  407. }
  408. if (ret.data.length > 0) {
  409. skip += 1;
  410. $apis.append(List_QRcode,'#template',ret.data);
  411. for (var i = 0; i < ret.data.length; i++) {
  412. flexImage(ret.data[i].id)
  413. }
  414. } else {
  415. isLoadding = true;
  416. api.toast({
  417. msg: '没有更多数据',
  418. duration: 2000,
  419. location: 'bottom'
  420. });
  421. }
  422. })
  423. .catch(err=>{
  424. api.toast({
  425. msg: '加载超时,请检查网络',
  426. duration: 2000,
  427. location: 'bottom'
  428. });
  429. })
  430. }
  431. function resetWidth() {
  432. var items = document.getElementsByClassName("texts");
  433. for (var i = 0; i < items.length; i++) {
  434. items[i].style.width = (api.frameWidth - 130) + "px";
  435. }
  436. }
  437. function QRcodeDetaile(pageid,title) {
  438. var pageidA = pageid.split(',');
  439. $event.openWin('browseQrcode_win','../browseQrcode/browseQrcode_win',{pageId:pageidA[0],id:pageidA[1],departmentId:pageidA[2],title:title},'');
  440. // $event.openWin('QrcodeDetaile','QrcodeDetaile',{pageId:pageidA[0],id:pageidA[1],departmentId:pageidA[2],flag:true},'');
  441. }
  442. // 巡检记录
  443. // 记录详情
  444. function RecordDetaile(recordId) {
  445. $event.openTabLayout('recodeDetails','../browseQrcode/recodeDetails','记录详情',{recordParentId:recordId});
  446. }
  447. function flexImage(j) {
  448. var length = document.querySelectorAll('.row'+j+' .column').length,
  449. column = document.querySelectorAll('.row'+j+' .column');
  450. imgs = document.querySelectorAll('.row'+j+' .column img');
  451. if (length == 1) {
  452. column[0].style.width = api.winWidth-30 + 'px';
  453. column[0].style.height = (api.winWidth-30) +'px'
  454. }else if (length == 2) {
  455. for (var i = 0; i < column.length; i++) {
  456. column[i].style.width = (api.winWidth-30) / 2 +'px'
  457. column[i].style.height = (api.winWidth-30-20) / 2 +'px'
  458. column[i].getElementsByTagName('img')[0].style.width= (api.winWidth-50) / 2 +'px'
  459. }
  460. }else {
  461. for (var i = 0; i < column.length; i++) {
  462. column[i].style.width = (api.winWidth-30) / 3 +'px'
  463. column[i].style.height = (api.winWidth-30-20) / 3 +'px'
  464. column[i].getElementsByTagName('img')[0].style.width=(api.winWidth-50) / 3 +'px'
  465. }
  466. }
  467. };
  468. // 点赞
  469. function dianzan(el,id,type) {
  470. var gray ='../../icon/momentHeart.png',red = '../../icon/momentHeart_like.png';
  471. var thumbs_num = $(el).parent().parent().parent().find('.thumbs_num');
  472. var str = "";
  473. if ($(el).attr('flat') === "false"){
  474. $(el).attr('flat','true');
  475. $(el).find('.thumbs').css("backgroundImage",'url('+red+')');
  476. if (thumbs_num.find('p').html().replace(/\s+/g,"") === ""){
  477. thumbsPost(id,type)
  478. str =`<span class="true">${name}</span>`;
  479. $(thumbs_num).css('display','block');
  480. $(thumbs_num.find('p')).append(str)
  481. }else {
  482. thumbsPost(id,type)
  483. $(thumbs_num).css('display','block');
  484. str =`<span class="true">,${name}</span>`;
  485. $(thumbs_num.find('p')).append(str);
  486. }
  487. } else {
  488. thumbsPost(id,type)
  489. var thumbs_numTrue = $(el).parent().parent().parent().find('.thumbs_num').find('p').find('.true');
  490. var index = $(el).parent().parent().parent().find('.thumbs_num p>span').length;
  491. index === 1?$(thumbs_num).css('display','none'):"";
  492. $(el).attr('flat','false');
  493. $(el).find('.thumbs').css("backgroundImage",'url('+gray+')');
  494. $(thumbs_numTrue).remove();
  495. }
  496. }
  497. // 评论
  498. function comment(el,id,type) {
  499. var inputField = api.require('inputField');
  500. inputField.open({
  501. bgColor: '#f5f5f5',
  502. lineColor: '#ccc',
  503. fileBgColor: '#fff',
  504. borderColor: '#ccc',
  505. autoFocus:true,
  506. placeholder:'评论',
  507. sendBtn:{
  508. bg: '#86c3f7', //字符串类型;发送按钮常态背景色
  509. inputBg:'#009fe8', //(可选项)字符串类型;当输入文字发时送按钮的背景色;默认:bg的色值
  510. bgHighlight: '#009fe8', //字符串类型;发送按钮点击时的高亮背景色
  511. title: '发送', //字符串类型;发送按钮的标题
  512. titleSize: 14, //数字类型;发送按钮的标题字体大小
  513. titleColor: '#fff', //字符串类型;发送按钮标题文字颜色
  514. corner: 5, //数字类型;发送按钮圆角大小
  515. sendW:60, //数字类型;发送按钮的宽
  516. sendH:30, //数字类型;发送按钮的高
  517. marginRight:10,
  518. },
  519. placeholderStyles:{
  520. color: '#ccc', //字符串类型;占位文字颜色,支持rgb、rgba、#;默认:#696969
  521. size: 14, //数字类型;占位文字大小;默认:13
  522. marginL: 10
  523. },
  524. fixedOn: api.frameName
  525. }, function(ret, err) {
  526. if (ret) {
  527. commentFun(el,id,type,ret.msg)
  528. inputField.close();
  529. }
  530. });
  531. addEventWindow();// 监听关闭input
  532. }
  533. // 监听点击空白处关闭input
  534. function addEventWindow() {
  535. var inputField = api.require('inputField');
  536. inputField.setInputFieldListener(function(ret, err) {
  537. if (ret) {
  538. if (ret.chatViewH === 0) {
  539. var inputField = api.require('inputField');
  540. inputField.close();
  541. }
  542. }
  543. });
  544. }
  545. // 删除评论
  546. function deleteComment(el,ids,jobNum) {
  547. if (jobNum != uuid) return false;
  548. api.actionSheet({
  549. cancelTitle: '取消',
  550. destructiveTitle: '删除',
  551. }, function(ret, err) {
  552. if (ret.buttonIndex === 1) {
  553. $http.requestData(UrlRouter.delComment,'post',{id:ids})
  554. .then(ret=>{
  555. if (ret.code === 0) {
  556. $(el).remove();
  557. }
  558. }).catch(err=>{})
  559. }
  560. });
  561. }
  562. // 点赞接口
  563. function thumbsPost(ids,types) {
  564. var data ={
  565. id:ids,
  566. type:'record'
  567. }
  568. $http.requestData(UrlRouter.thumbs,'post',data)
  569. .then(ret=>{
  570. if (ret.code === 401) {
  571. api.alert({
  572. title: '提示',
  573. msg: '登录过期,重新登录',
  574. });
  575. }
  576. }).catch(err=>{})
  577. }
  578. // 评论接口
  579. function commentFun(el,ids,type,msg) {
  580. var data = {
  581. id:ids,
  582. type:'record',
  583. content:msg
  584. }
  585. $http.requestData(UrlRouter.comment,'post',data)
  586. .then(ret=>{
  587. if (ret.code === 0) {
  588. var comment = $(el).parent().parent().parent().find('.comment_content')
  589. var html = `<p class="comment_c" onclick=deleteComment(this,${ret.data.id},${ret.data.staff_num})>
  590. <span class="title">${name}:</span>
  591. ${ret.data.content}
  592. </p>`;
  593. $(comment).append(html);
  594. }
  595. }).catch(err=>{})
  596. }
  597. </script>