Authored by weiqingting

Merge branch 'release/release' into release/pre

@@ -45,7 +45,7 @@ tab.prototype = { @@ -45,7 +45,7 @@ tab.prototype = {
45 g.active = $(this).find("a").attr("columnname"); 45 g.active = $(this).find("a").attr("columnname");
46 g.key = $(this).find("a").attr("key"); 46 g.key = $(this).find("a").attr("key");
47 g.value = $(this).find("a").attr("value"); 47 g.value = $(this).find("a").attr("value");
48 - 48 + g.__index__ = $(this).index();
49 this._init = p._init; 49 this._init = p._init;
50 callback && callback.call(this); 50 callback && callback.call(this);
51 }); 51 });
@@ -87,14 +87,22 @@ tab.prototype = { @@ -87,14 +87,22 @@ tab.prototype = {
87 87
88 li.append(a); 88 li.append(a);
89 g.tab.append(li); 89 g.tab.append(li);
  90 +
90 }); 91 });
  92 +
  93 + g.__tab = g.tab.html();
91 g.tab.html(util.__template(g.tab.html(), data || {})); 94 g.tab.html(util.__template(g.tab.html(), data || {}));
92 95
93 }, 96 },
94 load: function(data) { 97 load: function(data) {
95 var g = this, 98 var g = this,
96 p = this.options; 99 p = this.options;
97 - g.tab.html(util.__template(g.tab.html(), data || {})); 100 + g.tab.html(util.__template(g.__tab, data || {}));
  101 +
  102 + if (g.__index__ != undefined) {
  103 + $('li',p.el).removeClass('active');
  104 + $('li',p.el).eq(g.__index__).addClass('active');
  105 + }
98 } 106 }
99 } 107 }
100 108
@@ -23,8 +23,9 @@ var ENUM = { @@ -23,8 +23,9 @@ var ENUM = {
23 "2": 300, 23 "2": 300,
24 "all": 400 24 "all": 400
25 } 25 }
26 -} 26 +};
27 27
  28 +var currentTab;
28 29
29 /*下拉选择*/ 30 /*下拉选择*/
30 common.dropDown({ 31 common.dropDown({
@@ -44,29 +45,8 @@ var t = new common.tab({ @@ -44,29 +45,8 @@ var t = new common.tab({
44 el: "#basicTab", 45 el: "#basicTab",
45 click: function() { 46 click: function() {
46 var columnname = $(this).find('a').attr('columnname'); 47 var columnname = $(this).find('a').attr('columnname');
47 - if (columnname == 'all') {  
48 - g.options.columns[1].hidden = false;  
49 - g.options.columns[2].hidden = true;  
50 - g.options.columns[3].hidden = true;  
51 - g.options.columns[4].hidden = true;  
52 - g.options.columns[5].hidden = false;  
53 - g.options.columns[6].hidden = true;  
54 -  
55 - } else if(columnname == 1) {  
56 - g.options.columns[1].hidden = true;  
57 - g.options.columns[2].hidden = false;  
58 - g.options.columns[3].hidden = false;  
59 - g.options.columns[4].hidden = true;  
60 - g.options.columns[5].hidden = true;  
61 - g.options.columns[6].hidden = false;  
62 - } else {  
63 - g.options.columns[1].hidden = true;  
64 - g.options.columns[2].hidden = false;  
65 - g.options.columns[3].hidden = false;  
66 - g.options.columns[4].hidden = false;  
67 - g.options.columns[5].hidden = true;  
68 - g.options.columns[6].hidden = true;  
69 - } 48 + currentTab = ENUM.tab[columnname];
  49 + layoutGridCloum(columnname);
70 g.init('/payDelivery/queryTotalBrandPayDelivery'); 50 g.init('/payDelivery/queryTotalBrandPayDelivery');
71 }, 51 },
72 columns: [{ 52 columns: [{
@@ -90,7 +70,7 @@ var g = new common.grid({ @@ -90,7 +70,7 @@ var g = new common.grid({
90 return { 70 return {
91 brandId: common.util.__input("brandId"), 71 brandId: common.util.__input("brandId"),
92 isPayDelivery: common.util.__input("isPayDelivery"), 72 isPayDelivery: common.util.__input("isPayDelivery"),
93 - checkStatus: ENUM.tab[t.active] //(t.active && t.active!='all') ? t.active : 400 73 + checkStatus: (currentTab && currentTab != 'all') ? currentTab : 400//ENUM.tab[t.active] //(t.active && t.active!='all') ? t.active : 400
94 }; 74 };
95 }, 75 },
96 columns: [{ 76 columns: [{
@@ -157,6 +137,32 @@ var g = new common.grid({ @@ -157,6 +137,32 @@ var g = new common.grid({
157 }); 137 });
158 g.init('/payDelivery/queryTotalBrandPayDelivery'); 138 g.init('/payDelivery/queryTotalBrandPayDelivery');
159 139
  140 +function layoutGridCloum(tabname) {
  141 + if (tabname == 'all') {
  142 + g.options.columns[1].hidden = false;
  143 + g.options.columns[2].hidden = true;
  144 + g.options.columns[3].hidden = true;
  145 + g.options.columns[4].hidden = true;
  146 + g.options.columns[5].hidden = false;
  147 + g.options.columns[6].hidden = true;
  148 +
  149 + } else if(tabname == 1) {
  150 + g.options.columns[1].hidden = true;
  151 + g.options.columns[2].hidden = false;
  152 + g.options.columns[3].hidden = false;
  153 + g.options.columns[4].hidden = true;
  154 + g.options.columns[5].hidden = true;
  155 + g.options.columns[6].hidden = false;
  156 + } else {
  157 + g.options.columns[1].hidden = true;
  158 + g.options.columns[2].hidden = false;
  159 + g.options.columns[3].hidden = false;
  160 + g.options.columns[4].hidden = false;
  161 + g.options.columns[5].hidden = true;
  162 + g.options.columns[6].hidden = true;
  163 + }
  164 +}
  165 +
160 // tab初始化 166 // tab初始化
161 var loadTab = function() { 167 var loadTab = function() {
162 t.active = undefined; 168 t.active = undefined;
@@ -171,16 +177,30 @@ var loadTab = function() { @@ -171,16 +177,30 @@ var loadTab = function() {
171 }, 800); 177 }, 800);
172 }; 178 };
173 179
  180 +var reloadTab = function() {
  181 + t.active = undefined;
  182 + setTimeout(function() {
  183 + common.util.__ajax({
  184 + url: "/payDelivery/queryCountBrandPayDelivery",
  185 + data: g.options.parms()
  186 + }, function(res) {
  187 + var __dt = $.extend({}, ENUM.tips, res.data);
  188 + t.load(__dt);
  189 + }, true);
  190 + }, 800);
  191 +};
  192 +
174 loadTab(); 193 loadTab();
175 // 筛选 194 // 筛选
176 $(document).on('click', "#filter-btn", function() { 195 $(document).on('click', "#filter-btn", function() {
177 - loadTab();  
178 - g.options.columns[1].hidden = false;  
179 - g.options.columns[2].hidden = true;  
180 - g.options.columns[3].hidden = true;  
181 - g.options.columns[4].hidden = true;  
182 - g.options.columns[5].hidden = false;  
183 - g.options.columns[6].hidden = true; 196 + reloadTab();
  197 + //g.options.columns[1].hidden = false;
  198 + //g.options.columns[2].hidden = true;
  199 + //g.options.columns[3].hidden = true;
  200 + //g.options.columns[4].hidden = true;
  201 + //g.options.columns[5].hidden = false;
  202 + //g.options.columns[6].hidden = true;
  203 + layoutGridCloum(currentTab);
184 g.reload(); 204 g.reload();
185 }); 205 });
186 206
@@ -18,7 +18,7 @@ var ENUM = { @@ -18,7 +18,7 @@ var ENUM = {
18 } 18 }
19 }; 19 };
20 20
21 -var currentSelItem; 21 +var currentSelItem, currentTab;
22 22
23 /*下拉选择*/ 23 /*下拉选择*/
24 common.dropDown({ 24 common.dropDown({
@@ -40,28 +40,8 @@ var t = new common.tab({ @@ -40,28 +40,8 @@ var t = new common.tab({
40 el: "#basicTab", 40 el: "#basicTab",
41 click: function () { 41 click: function () {
42 var columnname = $(this).find('a').attr('columnname'); 42 var columnname = $(this).find('a').attr('columnname');
43 - if (columnname == 'all') {  
44 - g.options.columns[2].hidden = false;  
45 - g.options.columns[3].hidden = true;  
46 - g.options.columns[4].hidden = true;  
47 - g.options.columns[5].hidden = true;  
48 - g.options.columns[6].hidden = false;  
49 - g.options.columns[7].hidden = true;  
50 - } else if (columnname == 100) {  
51 - g.options.columns[2].hidden = true;  
52 - g.options.columns[3].hidden = false;  
53 - g.options.columns[4].hidden = false;  
54 - g.options.columns[5].hidden = true;  
55 - g.options.columns[6].hidden = true;  
56 - g.options.columns[7].hidden = false;  
57 - } else {  
58 - g.options.columns[2].hidden = true;  
59 - g.options.columns[3].hidden = false;  
60 - g.options.columns[4].hidden = false;  
61 - g.options.columns[5].hidden = false;  
62 - g.options.columns[6].hidden = true;  
63 - g.options.columns[7].hidden = true;  
64 - } 43 + currentTab = columnname;
  44 + layoutGridCloum(columnname);
65 g.init('/payDelivery/queryPayDeliveryList'); 45 g.init('/payDelivery/queryPayDeliveryList');
66 }, 46 },
67 columns: [{ 47 columns: [{
@@ -86,7 +66,7 @@ var g = new common.grid({ @@ -86,7 +66,7 @@ var g = new common.grid({
86 brandId: common.util.__input("brandId"), 66 brandId: common.util.__input("brandId"),
87 isPayDelivery: common.util.__input("isPayDelivery"), 67 isPayDelivery: common.util.__input("isPayDelivery"),
88 productSkn: common.util.__input("productSkn"), 68 productSkn: common.util.__input("productSkn"),
89 - status: (t.active && t.active != 'all') ? t.active : 400 69 + status: (currentTab && currentTab != 'all') ? currentTab : 400
90 }; 70 };
91 }, 71 },
92 columns: [{ 72 columns: [{
@@ -158,6 +138,31 @@ var g = new common.grid({ @@ -158,6 +138,31 @@ var g = new common.grid({
158 }); 138 });
159 g.init('/payDelivery/queryPayDeliveryList'); 139 g.init('/payDelivery/queryPayDeliveryList');
160 140
  141 +function layoutGridCloum(tabname) {
  142 + if (tabname == 'all') {
  143 + g.options.columns[2].hidden = false;
  144 + g.options.columns[3].hidden = true;
  145 + g.options.columns[4].hidden = true;
  146 + g.options.columns[5].hidden = true;
  147 + g.options.columns[6].hidden = false;
  148 + g.options.columns[7].hidden = true;
  149 + } else if (tabname == 100) {
  150 + g.options.columns[2].hidden = true;
  151 + g.options.columns[3].hidden = false;
  152 + g.options.columns[4].hidden = false;
  153 + g.options.columns[5].hidden = true;
  154 + g.options.columns[6].hidden = true;
  155 + g.options.columns[7].hidden = false;
  156 + } else {
  157 + g.options.columns[2].hidden = true;
  158 + g.options.columns[3].hidden = false;
  159 + g.options.columns[4].hidden = false;
  160 + g.options.columns[5].hidden = false;
  161 + g.options.columns[6].hidden = true;
  162 + g.options.columns[7].hidden = true;
  163 + }
  164 +}
  165 +
161 // tab初始化 166 // tab初始化
162 var loadTab = function () { 167 var loadTab = function () {
163 t.active = undefined; 168 t.active = undefined;
@@ -172,17 +177,33 @@ var loadTab = function () { @@ -172,17 +177,33 @@ var loadTab = function () {
172 }, 800); 177 }, 800);
173 }; 178 };
174 179
  180 +var reloadTab = function () {
  181 + t.active = undefined;
  182 + setTimeout(function () {
  183 + common.util.__ajax({
  184 + url: "/payDelivery/queryCountProductPayDelivery",
  185 + data: g.options.parms()
  186 + }, function (res) {
  187 + var __dt = $.extend({}, ENUM.tips, res.data);
  188 + t.load(__dt);
  189 + }, true);
  190 + }, 800);
  191 +};
  192 +
175 loadTab(); 193 loadTab();
176 // 筛选 194 // 筛选
177 $(document).on('click', "#filter-btn", function () { 195 $(document).on('click', "#filter-btn", function () {
178 - loadTab();  
179 - g.options.columns[2].hidden = false;  
180 - g.options.columns[3].hidden = true;  
181 - g.options.columns[4].hidden = true;  
182 - g.options.columns[5].hidden = true;  
183 - g.options.columns[6].hidden = false;  
184 - g.options.columns[7].hidden = true; 196 + //loadTab();
  197 + reloadTab();
  198 + //g.options.columns[2].hidden = false;
  199 + //g.options.columns[3].hidden = true;
  200 + //g.options.columns[4].hidden = true;
  201 + //g.options.columns[5].hidden = true;
  202 + //g.options.columns[6].hidden = false;
  203 + //g.options.columns[7].hidden = true;
  204 + layoutGridCloum(currentTab);
185 g.reload(); 205 g.reload();
  206 + //g.init('/payDelivery/queryPayDeliveryList');
186 }); 207 });
187 208
188 $(document).on('click', ".edit-class-btn", function () { 209 $(document).on('click', ".edit-class-btn", function () {
@@ -243,16 +243,7 @@ var Button = [ @@ -243,16 +243,7 @@ var Button = [
243 "title": "" 243 "title": ""
244 }, 244 },
245 "is_show_name": "N", 245 "is_show_name": "N",
246 - "list": [],  
247 - "image":{  
248 - "src": "",  
249 - "alt": "",  
250 - "url":{  
251 - "action":"",  
252 - "url":""  
253 - }  
254 - }  
255 - 246 + "list": []
256 } 247 }
257 }, 248 },
258 { 249 {
@@ -69,34 +69,7 @@ @@ -69,34 +69,7 @@
69 <input type="hidden" id="is_show_name_brand" value="[[contentData.data.is_show_name]]" for="radio"/> 69 <input type="hidden" id="is_show_name_brand" value="[[contentData.data.is_show_name]]" for="radio"/>
70 </div> 70 </div>
71 </div> 71 </div>
72 - <div class="form-group">  
73 - <table class="table table-hover table-bordered responsive dataTable no-footer">  
74 - <tbody>  
75 - <tr>  
76 - <td>  
77 - <input type="file" name="file" value="[[contentData.data.image.src]]" class="observe" data-field="image.src"/>  
78 - </td>  
79 - <td>  
80 - <div class="form-group ">  
81 - <select name="goTo" class="form-control observe" value="[[contentData.data.image.url.action]]" data-field="image.url.action">  
82 - [[layout action_template]]  
83 - </select>  
84 - </div>  
85 - <div class="form-group ">  
86 - <input value="[[contentData.data.image.url.url]]" class="form-control observe"  
87 - data-field="image.url.url" placeholder="图片链接"/>  
88 72
89 - <p style="color:#999;margin-top: 5px;">链接中不能有英文单引号</p>  
90 - </div>  
91 - <div class="form-group ">  
92 - <input value="[[contentData.data.image.alt]]" class="form-control observe"  
93 - data-field="image.alt" placeholder="图片描述"/>  
94 - </div>  
95 - </td>  
96 - </tr>  
97 - </tbody>  
98 - </table>  
99 - </div>  
100 73
101 [[/if]] 74 [[/if]]
102 [[if contentData.template_name=='customBrands']] 75 [[if contentData.template_name=='customBrands']]