Authored by 姜敏

品类显示展开bug

@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 </script> 45 </script>
46 46
47 <script type="text/template" id="tableTemp2"> 47 <script type="text/template" id="tableTemp2">
48 - <span class="folder"></span> 48 + <span class="folder" data-name="[[isRefundExchange]]"></span>
49 <span style="width: 5%">[[id]]</span> 49 <span style="width: 5%">[[id]]</span>
50 <span style="width: 20%">[[sortName]]</span> 50 <span style="width: 20%">[[sortName]]</span>
51 <span>[[sortLevel]]级分类</span> 51 <span>[[sortLevel]]级分类</span>
@@ -58,14 +58,11 @@ @@ -58,14 +58,11 @@
58 [[/if]] 58 [[/if]]
59 </span> 59 </span>
60 <span class="operate" data-id="[[id]]" data-name="[[sortName]]"> 60 <span class="operate" data-id="[[id]]" data-name="[[sortName]]">
61 - [[if isok]]  
62 - [[else]]  
63 - [[if isRefundExchange=="1"]]  
64 - <a class="btn btn-danger btn-sm close-category " style="width:50px" href="javascript:;"></a>  
65 - [[/if]]  
66 - [[if isRefundExchange=="0"]]  
67 - <a class="btn btn-warning btn-sm open-category " style="width:50px" href="javascript:;"></a>  
68 - [[/if]] 61 + [[if isRefundExchange=="1"]]
  62 + <a class="btn btn-danger btn-sm close-category " style="width:50px" href="javascript:;"></a>
  63 + [[/if]]
  64 + [[if isRefundExchange=="0"]]
  65 + <a class="btn btn-warning btn-sm open-category " style="width:50px" href="javascript:;"></a>
69 [[/if]] 66 [[/if]]
70 </span> 67 </span>
71 </script> 68 </script>
@@ -42,10 +42,8 @@ var Bll = { @@ -42,10 +42,8 @@ var Bll = {
42 } 42 }
43 }; 43 };
44 /** 44 /**
45 - * 获取数据 45 + * 列表
46 */ 46 */
47 -  
48 -  
49 var g = new common.grid({ 47 var g = new common.grid({
50 el: "#basicTable", 48 el: "#basicTable",
51 columns: [ 49 columns: [
@@ -65,22 +63,13 @@ var g = new common.grid({ @@ -65,22 +63,13 @@ var g = new common.grid({
65 function init(item) { 63 function init(item) {
66 if (top) { 64 if (top) {
67 html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix'>"; 65 html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix'>";
68 - if (item.isRefundExchange == 0) {  
69 - isRefundExchange = 0;  
70 - }  
71 top = false; 66 top = false;
72 } else { 67 } else {
73 html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix level_" + item.sortLevel + "' style='display: none'>"; 68 html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix level_" + item.sortLevel + "' style='display: none'>";
74 - if (item.isRefundExchange == 0) {  
75 - isRefundExchange = 0;  
76 - }  
77 } 69 }
78 html += common.util.__template2($('#tableTemp2').html(), item); 70 html += common.util.__template2($('#tableTemp2').html(), item);
79 - if (item.subList) { 71 + if (item.subList.length>0) {//如果有子集
80 for (var i = 0; i < item.subList.length; i++) { 72 for (var i = 0; i < item.subList.length; i++) {
81 - if (isRefundExchange == 0) {  
82 - item.subList[i].isok = true;  
83 - }  
84 init(item.subList[i]); 73 init(item.subList[i]);
85 } 74 }
86 } 75 }
@@ -97,6 +86,11 @@ g.init(Bll.dataList); @@ -97,6 +86,11 @@ g.init(Bll.dataList);
97 $(document).on('click', '.folder', function () { 86 $(document).on('click', '.folder', function () {
98 var $wrap = $(this).parent(); 87 var $wrap = $(this).parent();
99 if (!$(this).hasClass('open')) { 88 if (!$(this).hasClass('open')) {
  89 + var isfont = $(this).data('name');
  90 + if(isfont==0){
  91 + $wrap.find('.level-wrap .operate a').hide();
  92 + }
  93 +
100 if ($wrap.find('> .level-wrap').size() > 0) { 94 if ($wrap.find('> .level-wrap').size() > 0) {
101 var position = $(this).css("background-position"); 95 var position = $(this).css("background-position");
102 var a = position.substring(0, position.indexOf("px")); 96 var a = position.substring(0, position.indexOf("px"));