lvcheng.blade.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. @extends('mobile.module.layouts.content')
  2. @push('meta')
  3. @endpush
  4. @push('css')
  5. <link href="{{ theme_asset('mobile/css/news.css') }}" rel="stylesheet">
  6. <style>
  7. .line-container {
  8. color: #606c76;
  9. font-family: "Helvetica Neue For Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  10. box-sizing: border-box;
  11. position: relative;
  12. list-style: none;
  13. margin: 0.16rem;
  14. padding-left: 1.92rem;
  15. }
  16. .line-container::after {
  17. position: absolute;
  18. content: "";
  19. left: 1.7rem;
  20. top: 0;
  21. width: 1px;
  22. height: 100%;
  23. background-color: #e4e1fe;
  24. }
  25. .line-container .line-item {
  26. padding: 0.32rem;
  27. position: relative;
  28. }
  29. .line-container .item-circle {
  30. box-sizing: border-box;
  31. position: absolute;
  32. margin-left: -7px;
  33. width: 16px;
  34. height: 16px;
  35. border-radius: 10px;
  36. background: white;
  37. border: 2px solid #8b80f9;
  38. }
  39. .line-container .item-circle.purple {
  40. border: 2px solid #8b80f9;
  41. }
  42. .line-container .item-circle.orange {
  43. border: 2px solid #ed9153;
  44. }
  45. .line-container .item-circle.yellow {
  46. border: 2px solid #fbd157;
  47. }
  48. .line-container .item-star {
  49. box-sizing: border-box;
  50. position: absolute;
  51. margin-left: -11px;
  52. width: 24px;
  53. height: 24px;
  54. margin-top: -4px;
  55. }
  56. .line-container .item-star path {
  57. stroke: #8b80f9;
  58. stroke-width: 4px;
  59. fill: white;
  60. }
  61. .line-container .item-star.purple path {
  62. stroke: #8b80f9;
  63. }
  64. .line-container .item-star.orange path {
  65. stroke: #ed9153;
  66. }
  67. .line-container .item-star.yellow path {
  68. stroke: #fbd157;
  69. }
  70. .line-container .item-tag {
  71. position: absolute;
  72. left: -1.92rem;
  73. width: 65px;
  74. text-align: center;
  75. color: #949fa8;
  76. font-size: 11.6666666667px;
  77. }
  78. .line-container .item-content {
  79. white-space: pre-line;
  80. }
  81. .line-container .item-content.star {
  82. font-weight: bold;
  83. font-size: 15.4px;
  84. }
  85. .line-container .item-symbol {
  86. box-sizing: border-box;
  87. position: absolute;
  88. left: -0.24rem;
  89. z-index: 1;
  90. background: white;
  91. }
  92. .Timeline-title{
  93. height: 40px;
  94. font-size: 14px;
  95. }
  96. .Timeline-fieldInfo{
  97. margin-left: 12px;
  98. padding-bottom: 15px
  99. }
  100. .Timeline-field{
  101. font-size: 14px;
  102. color: #333;
  103. line-height: 22px;
  104. overflow-wrap: break-word;
  105. white-space: pre-line;
  106. word-break: break-word
  107. }
  108. .Timeline-fieldLast {
  109. font-size: 14px;
  110. color: #999;
  111. line-height: 22px;
  112. margin-top: 8px
  113. }
  114. </style>
  115. @endpush
  116. @push('js')
  117. <script src="{{ theme_asset('mobile/js/dropload.min.js') }}"></script>
  118. @endpush
  119. @section('content')
  120. <div id="app">
  121. <div class="drop_content">
  122. <light-timeline :items='items'></light-timeline>
  123. </div>
  124. </div>
  125. @endsection
  126. @section('script')
  127. <script>
  128. var data = eval('{!! $data !!}'),timeline_data = new Array(),post = {};
  129. post.startTime = '{{ $startTime }}';
  130. post.endTime = '{{ $endTime }}';
  131. post.next_page = '{{ $next_page }}';
  132. post.page = '{{ $params['page'] }}';
  133. for(var i = 0;i < data.length; i++){
  134. var item = {};
  135. var time_str = new Date(data[i].createTime).toLocaleString(),time_arr = time_str.split(' ');
  136. item.tag = time_arr[0] + "\r\n" + time_arr[1];
  137. item.type = 'circle';
  138. item.htmlMode = true;
  139. var field_info = '';
  140. for(var j = 0;j < data[i].eventFieldInfo.length;j++){
  141. var field_item = data[i].eventFieldInfo[j];
  142. field_item.value = typeof(field_item.value) == 'undefined' ? '--' : field_item.value
  143. switch(field_item.desc){
  144. case '时长':
  145. field_info += '<div class="Timeline-field">'+ field_item.desc +':<span><span> ' + formatSeconds(field_item.value) +' </span></span></div>'
  146. break;
  147. default:
  148. field_info += '<div class="Timeline-field">'+ field_item.desc +':<span><span> ' + field_item.value +' </span></span></div>'
  149. break;
  150. }
  151. }
  152. item.content = '<div style="color:#ed9153;" class="Timeline-title">'+data[i].description+'</div><div class="Timeline-fieldInfo Timeline-tracker"> ' + field_info + ' </div><div class="Timeline-fieldLast"> ' + data[i].operatorName + '</div>';
  153. timeline_data[i] = item;
  154. }
  155. function formatSeconds(value) {
  156. var theTime = parseInt(value);// 秒
  157. var middle= 0;// 分
  158. var hour= 0;// 小时
  159. if(theTime > 60) {undefined
  160. middle= parseInt(theTime/60);
  161. theTime = parseInt(theTime%60);
  162. if(middle> 60) {undefined
  163. hour= parseInt(middle/60);
  164. middle= parseInt(middle%60);
  165. }
  166. }
  167. var result = ""+parseInt(theTime)+"秒";
  168. if(middle > 0) {undefined
  169. result = ""+parseInt(middle)+"分"+result;
  170. }
  171. if(hour> 0) {undefined
  172. result = ""+parseInt(hour)+"小时"+result;
  173. }
  174. return result;
  175. }
  176. </script>
  177. <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
  178. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  179. <script type="module">
  180. Vue.component('light-timeline', {
  181. name: 'light-timeline',
  182. props: {
  183. items: {
  184. type: Array
  185. }
  186. },
  187. data() {
  188. return {
  189. presetReg: /purple|orange|yellow/
  190. }
  191. },
  192. methods: {
  193. getColorClass(color) {
  194. return this.presetReg.test(color) ? color : ''
  195. },
  196. getStyle(item) {
  197. const color = item.color
  198. if (!this.presetReg.test(color)) {
  199. return this.makeCircleColor(color)
  200. }
  201. return {}
  202. },
  203. makeCircleColor(color) {
  204. return { border: `2px solid ${color}` }
  205. }
  206. },
  207. template:'<ul class="line-container"><li class="line-item"v-for="item in items"><div class="item-tag"><slot name="tag":item="item">@{{item.tag}}</slot></div><div class="item-symbol"><slot name="symbol":item="item"><div class="item-circle":class="getColorClass(item.color)":style="getStyle(item)"></div></slot></div><slot name="content":item="item"><div class="item-content"v-if="!item.htmlMode":class="item.type">@{{item.content}}</div><div class="item-content html-mode"v-else="v-else":class="item.type"v-html="item.content"></div></slot></li></ul>'
  208. });
  209. new Vue({
  210. el: "#app",
  211. data () {
  212. return {
  213. post: post,
  214. items: timeline_data
  215. }
  216. },
  217. methods: {
  218. Scrollbottom() {
  219. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  220. let clientHeight = document.documentElement.clientHeight;
  221. let scrollHeight = document.documentElement.scrollHeight;
  222. if (scrollTop + clientHeight >= scrollHeight) {
  223. axios.post('/mobile/talent/lvcheng',post).then(response => (console.log(response))).catch(
  224. function (error) {
  225. console.log(error);
  226. });
  227. }
  228. },
  229. },
  230. created(){
  231. //window.addEventListener('scroll', this.Scrollbottom);
  232. },
  233. });
  234. </script>
  235. @endsection