index.blade.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. @extends('layouts.base')
  2. @section('title','商城更新')
  3. @section('content')
  4. <style>
  5. .add-snav li {
  6. height:47px;
  7. }
  8. .version {
  9. color : #aa1111;
  10. }
  11. </style>
  12. <div class="right-titpos">
  13. <ul class="add-snav">
  14. <li class="active">当前版本 : <span class="version">{{$version}}</span></li>
  15. <li style="width: 10px"> </li>
  16. @if(!$list)
  17. <li class="active"> ( 您已是最新版本! )</li>
  18. @else
  19. <li class="active"><div class="btn btn-primary btn-xs updateVersion">更新版本</div></li>
  20. @endif
  21. </ul>
  22. </div>
  23. <ul class="timeline">
  24. @foreach($list as $item)
  25. <!-- timeline time label -->
  26. <li class="time-label">
  27. <span class="bg-red">
  28. {{date('Y-m-d',$item['created_at'])}}
  29. </span>
  30. </li>
  31. <!-- /.timeline-label -->
  32. <!-- timeline item -->
  33. <li>
  34. <!-- timeline icon -->
  35. <i class="fa fa-clock-o bg-gray"></i>
  36. <div class="timeline-item">
  37. <span class="time"><i class="fa fa-clock-o"></i> {{date('H:i',$item['created_at'])}}</span>
  38. <h3 class="timeline-header">版本:{{$item['version']}}</h3>
  39. <div class="timeline-body">
  40. <div class="form-group">{!! $item['description'] !!}</div>
  41. </div>
  42. </div>
  43. </li>
  44. <!-- END timeline item -->
  45. @endforeach
  46. </ul>
  47. <script>
  48. $(".updateVersion").click(function () {
  49. var $btn = $(this);
  50. console.log($btn);
  51. $btn.button('loading');
  52. $.ajax({
  53. url: '{!! yzWebUrl('update.start-download') !!}',
  54. type: 'POST',
  55. dataType: 'json'
  56. })
  57. .done(function (json) {
  58. console.log("Downloading finished");
  59. console.log(json);
  60. $btn.button('reset');
  61. })
  62. .fail(function (message) {
  63. console.log('update.start-download:', message)
  64. });
  65. });
  66. </script>
  67. @endsection