moreBrowse.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. <meta name="format-detection"content="telephone=no">
  8. <title></title>
  9. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  10. <link rel="stylesheet" href="../../css/swiper.css">
  11. <link rel="stylesheet" href="../../css/animate.css">
  12. <style media="screen">
  13. .hide{
  14. display: none;
  15. }
  16. .col{
  17. padding: 0 10px;
  18. }
  19. .col label{
  20. color: #333;
  21. font-size: 16px;
  22. padding: 15px 0 ;
  23. position: relative;
  24. padding-left: 15px;
  25. width: 100%;
  26. }
  27. .col label:before{
  28. content: '';
  29. position: absolute;
  30. top: 13px;
  31. left: 0;
  32. width: 3px;
  33. height: 26px;
  34. background: #009fe8;
  35. }
  36. .col label:after{
  37. content: '';
  38. position: absolute;
  39. bottom: 0;
  40. left: 0;
  41. width: 100%;
  42. height: 1px;
  43. background: #ECF0F1;
  44. }
  45. /*浏览记录*/
  46. .browse-items{
  47. display: -webkit-flex;
  48. display: flex;
  49. justify-content: flex-start;
  50. -webkit-justify-content: flex-start;
  51. flex-wrap: wrap;
  52. -webkit-flex-wrap: wrap;
  53. align-items: center;;
  54. }
  55. .browse-info{
  56. padding-top: 15px;
  57. }
  58. .browse-item{
  59. width: 20%;
  60. font-size: 14px;
  61. color: #333;
  62. text-align: center;
  63. margin-bottom: 10px;
  64. }
  65. .browse-item img{
  66. width: 100%;
  67. border-radius: 50%;
  68. object-fit: cover;
  69. margin: auto;
  70. margin-bottom: 5px;
  71. }
  72. .browse-item p{
  73. text-overflow: ellipsis;
  74. overflow: hidden;
  75. white-space: nowrap;
  76. min-width: 0;
  77. }
  78. .browse-item span{
  79. display: block;
  80. color: #fff;
  81. /*background: red;*/
  82. text-align: center;
  83. margin: auto;
  84. margin-bottom: 9px;
  85. border-radius: 50%;
  86. }
  87. /*浏览弹出框*/
  88. .modular{
  89. position: fixed;
  90. top: 0;
  91. left: 0;
  92. width: 100%;
  93. height: 100%;
  94. background: rgba(0,0,0, .6);
  95. z-index: 1000;
  96. }
  97. .box{
  98. -webkit-border-radius: 5px;
  99. -moz-border-radius: 5px;
  100. border-radius: 5px;
  101. background: #fff;
  102. position: absolute;
  103. top: -10%;
  104. bottom: 0;
  105. left: 0;
  106. right: 0;
  107. margin: auto;
  108. width: 270px;
  109. height: 220px;
  110. z-index: 200;
  111. padding: 20px 10px;
  112. -webkit-box-sizing: border-box;
  113. -moz-box-sizing: border-box;
  114. box-sizing: border-box;
  115. }
  116. .header-img{
  117. text-align: center;
  118. }
  119. .header-img img{
  120. width: 60px;
  121. height: 60px;
  122. -webkit-border-radius: 50%;
  123. -moz-border-radius: 50%;
  124. border-radius: 50%;
  125. margin: auto;
  126. }
  127. .header-img p{
  128. text-align: center;
  129. -webkit-border-radius: 50%;
  130. -moz-border-radius: 50%;
  131. border-radius: 50%;
  132. }
  133. .header-img{
  134. margin-bottom: 10px;
  135. }
  136. .personal-info p{
  137. padding: 5px 0;
  138. text-align: center;
  139. font-size: 14px;
  140. color: #333;
  141. }
  142. .personal-info .times{
  143. color: #727472;
  144. }
  145. </style>
  146. </head>
  147. <body>
  148. <div>
  149. <div class="col">
  150. <label>浏览记录</label>
  151. <div class="browse-info">
  152. <ul class="browse-items" id="browse_items">
  153. </ul>
  154. </div>
  155. </div>
  156. </div>
  157. <!--浏览信息弹出框-->
  158. <div class="modular hide animated" id="myModal">
  159. <div class=" box">
  160. <div class="header-img">
  161. <!--<img src="http://jiewei-php-files.oss-cn-qingdao.aliyuncs.com/avatar/avatar_15038412.png" alt="">-->
  162. </div>
  163. <div class="personal-info">
  164. <p class="name"></p>
  165. <p class="dep"></p>
  166. <p class="times"></p>
  167. </div>
  168. </div>
  169. </div>
  170. </body>
  171. </html>
  172. <script type="text/template" id="browseTl">
  173. {{~it:value}}
  174. {{?value.name != "" && value.name != null}}
  175. {{?value.img == null || value.img == ""}}
  176. <li class="browse-item" onclick="openModular('{{=value.name}}','{{=value.img}}','{{=value.department}}','{{=value.createDate}}')">
  177. <span style="width: {{=imgSize()}}px;height:{{=imgSize()}}px;line-height:{{=imgSize()}}px;background-color:#{{=Math.random().toString(16).slice(2,8)}}">{{=value.name.substr(value.name.length-1,1)}}</span>
  178. <p>{{=value.name}}</p>
  179. </li>
  180. {{??}}
  181. <li class="browse-item" onclick="openModular('{{=value.name}}','{{=value.img}}','{{=value.department}}','{{=value.createDate}}')">
  182. <img src="{{=String(value.img).substr(value.img, 4) == 'http'?value.img:urlphp+value.img}}" style="width: {{=imgSize()}}px;height:{{=imgSize()}}px" alt="">
  183. <p>{{=value.name}}</p>
  184. </li>
  185. {{?}}
  186. {{?}}
  187. {{~}}
  188. </script>
  189. <script type="text/javascript" src="../../script/api.js"></script>
  190. <script type="text/javascript" src="../../script/doT.min.js"></script>
  191. <script type="text/javascript" src="../../script/zepto.js"></script>
  192. <script src="../../script/config.js" charset="utf-8"></script>
  193. <script type="text/javascript">
  194. apiready = function () {
  195. $apis.UILoading('')
  196. browseNum(api.pageParam.id)
  197. };
  198. // 浏览人数
  199. function browseNum(id) {
  200. $http.fnReuestDataNologing(UrlRouter.getPageUserByPageId+id,'','get','',function (ret, err) {
  201. if (ret.code === '200') {
  202. $apis.html(browse_items,'#browseTl',ret.data);
  203. $apis.CloseUILoading()
  204. }
  205. })
  206. }
  207. // 浏览人员详情
  208. function openModular(name, img, dep, time) {
  209. $('.modular').show();
  210. $('.box').addClass('animated bounceInDown');
  211. setTimeout(function () {
  212. $('.box').removeClass('animated bounceInDown')
  213. }, 1000);
  214. if (img == 'null') {
  215. $('.box').find('.header-img').html(` <p style="background:#${Math.random().toString(16).slice(2,8)};width: 60px;height: 60px;line-height:60px;margin: auto">${name.substr(name.length-1,1)}</p>`)
  216. }else {
  217. var url = img.substr(img, 4)
  218. if ( url == 'http') {
  219. $('.box').find('.header-img').html(`<img src="${img}">`)
  220. }else {
  221. $('.box').find('.header-img').html(`<img src="${urlphp+img}">`)
  222. }
  223. }
  224. $('.box').find('.name').html('姓名:'+name)
  225. $('.box').find('.dep').html('部门:'+ dep)
  226. $('.box').find('.times').html('最新浏览时间:' + time)
  227. }
  228. window.onclick = function(event) {
  229. if (event.target == document.getElementById('myModal')) {
  230. $('.modular').hide();
  231. }
  232. }
  233. // 动态计算浏览人数img大小
  234. function imgSize() {
  235. var width = document.body.clientWidth;
  236. return width / 5 - 23
  237. }
  238. </script>