foodCard.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!--#include file="/inc/header.html"-->
  2. <!--粮食专卡模块-->
  3. <script type="text/javascript">
  4. window.renderHeader=function(e){
  5. var template="{{#childenList}}<li class=\"bif-nav-item\" style=\" width: auto\" data-fun=\"{{moduleUrl}}\" data-href=\"/pages/{{moduleUrl}}.html\">{{moduleName}}</li>{{/childenList}}";
  6. var views = Mustache.render(template, e);
  7. $("#bif-nav-ul").html(views);
  8. $(".tree-breadcrumb #nav-item-a").html($("#bif-nav-ul li:first-child").html());
  9. $("#bif-nav-ul li:first-child").addClass("active");
  10. };
  11. $(function(){
  12. var modules=JSON.parse(window.sessionStorage.getItem("modules"));
  13. if(window.treemap){
  14. renderHeader(window.treemap[16]);//粮食专卡ID16
  15. }else if(modules){
  16. renderHeader(modules.treemap[16]);
  17. }
  18. })
  19. </script>
  20. <div class="con-wrap">
  21. <div class="tree-breadcrumb">
  22. <span><a class="nav-prov">首页</a></span>&gt;
  23. <span class="nav-prov">山东分公司</span>
  24. <span><a class="nav-city" href="javascript:;"></a></span>
  25. <span><a class="nav-grain" href="javascript:;"></a></span>
  26. <span class="nav-house"></span>
  27. </div>
  28. <div id="con-map" style="margin-top: 0px;position: relative;">
  29. <div class="bif-con">
  30. </div>
  31. </div>
  32. </div>
  33. <!--#include file="/inc/footer.html"-->
  34. <style>
  35. .bif-nav-item {
  36. width: 97px;
  37. text-align: center;
  38. }
  39. .author-nav-sidebar {
  40. box-sizing: border-box;
  41. padding-top: 227px;
  42. float: left;
  43. height: 554px;
  44. line-height: 25px;
  45. width: 25px;
  46. cursor: pointer;
  47. text-align: center;
  48. /*writing-mode: vertical-rl;*/
  49. /*writing-mode:tb-rl;*/
  50. /*-webkit-transform:rotate(90deg);
  51. -moz-transform:rotate(90deg);
  52. -o-transform: rotate(90deg);*/
  53. /*white-space:nowrap;*/
  54. /*text-indent: 7px;*/
  55. margin-top: 10px;
  56. color: #fff;
  57. background-color: #ccc;
  58. }
  59. </style>
  60. <script>
  61. /*获取到链接首页的url*/
  62. $(function(){
  63. $.ajax({
  64. type: "post",
  65. dataType: 'json',
  66. url: config.baseUrl + "/sys/jump",
  67. success: function(e) {
  68. $('.nav-prov').attr('href','/'+e.defaultHome);
  69. },
  70. error: function(e) {
  71. console.log(e);
  72. }
  73. });
  74. });
  75. $(function() {
  76. base.getTree();
  77. base.listAllTypeRemote();
  78. $(document).on('click','[data-fun]',function( e ) {
  79. // console.log(e);
  80. //获取当前激活状态的函数名称
  81. var activeFunc = $('.bif-nav .active').data('fun'),
  82. //获取当前点击目标的函数名
  83. fun = $(this).data('fun');
  84. //比较其是否为同一目标,防止重复点击
  85. if (activeFunc === fun) {
  86. return false;
  87. }
  88. $(this).addClass('active').siblings().removeClass('active');
  89. if(typeof funs[fun] == 'function') {
  90. funs[fun]($(this),e);
  91. //删除多余的dom结构
  92. $('.panel,.window-shadow, .window-mask').remove();
  93. } else {
  94. console.info('not found function '+fun);
  95. }
  96. });
  97. // var showCount = 0,
  98. // hideCount = 0;
  99. //隐藏
  100. $('.author-nav-sidebar').on('click',function(e){
  101. e.preventDefault();
  102. var wid = $('.bif-con').css('width');
  103. // var li = $('.tabs-selected').index();
  104. if( wid !== '1172px' ) {
  105. $(this).text('显示菜单');
  106. $('.author-nav').hide();
  107. $('.bif-con').css('width','1172px');
  108. // if( showCount == 0 ) {
  109. // showCount++;
  110. $.parser.parse('.bif-con');
  111. //再次加载当前页面
  112. $('[data-fun].active').removeClass('active').trigger('click');
  113. } else {
  114. $(this).text('隐藏菜单');
  115. $('.author-nav').show();
  116. $('.bif-con').css('width','970px');
  117. // if( hideCount == 0 ) {
  118. // hideCount++;
  119. $.parser.parse('.bif-con');
  120. //再次加载当前页面
  121. $('[data-fun].active').removeClass('active').trigger('click');
  122. // }
  123. }
  124. })
  125. });
  126. </script>
  127. </body>
  128. </html>