Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop
Showing
9 changed files
with
579 additions
and
91 deletions
@@ -72,6 +72,11 @@ toast.prototype.init = function(options) { | @@ -72,6 +72,11 @@ toast.prototype.init = function(options) { | ||
72 | }); | 72 | }); |
73 | } | 73 | } |
74 | 74 | ||
75 | + __self.dom.wrap.find('.modal-dialog').css({ | ||
76 | + width: _o.width, | ||
77 | + height: _o.height | ||
78 | + }); | ||
79 | + | ||
75 | __self.dom.wrap.on('click', '[data-id]', function(event) { | 80 | __self.dom.wrap.on('click', '[data-id]', function(event) { |
76 | var $this = $(this); | 81 | var $this = $(this); |
77 | if (!$this.attr('disabled')) { | 82 | if (!$this.attr('disabled')) { |
@@ -227,6 +232,14 @@ toast._through = function() { | @@ -227,6 +232,14 @@ toast._through = function() { | ||
227 | var api = new toast(arguments[0]); | 232 | var api = new toast(arguments[0]); |
228 | return api; | 233 | return api; |
229 | }; | 234 | }; |
235 | +toast.open = function(options, callback) { | ||
236 | + return this._through({ | ||
237 | + title: options.title, | ||
238 | + addClass: options.addClass, | ||
239 | + width: options.width, | ||
240 | + content: options.content | ||
241 | + }); | ||
242 | +} | ||
230 | toast.alert = function(content, callback) { | 243 | toast.alert = function(content, callback) { |
231 | var __self = this, | 244 | var __self = this, |
232 | _o = __self.options; | 245 | _o = __self.options; |
@@ -24,8 +24,9 @@ require('../util/jquery.simplePagination'); | @@ -24,8 +24,9 @@ require('../util/jquery.simplePagination'); | ||
24 | var grid = function(options) { | 24 | var grid = function(options) { |
25 | var defaults = { | 25 | var defaults = { |
26 | hash: true, | 26 | hash: true, |
27 | - size: 10, | 27 | + //size: 10, |
28 | innerHtml: "<div class='grid'><table class='table table-striped table-bordered responsive dataTable no-footer' role='grid' aria-describedby='basicTable_info'>" + "<thead></thead><tbody></tbody></table></div>" + "<nav><ul class='pagination'></ul></nav>", | 28 | innerHtml: "<div class='grid'><table class='table table-striped table-bordered responsive dataTable no-footer' role='grid' aria-describedby='basicTable_info'>" + "<thead></thead><tbody></tbody></table></div>" + "<nav><ul class='pagination'></ul></nav>", |
29 | + nav: true, | ||
29 | tabUrl: false | 30 | tabUrl: false |
30 | } | 31 | } |
31 | this.options = $.extend({}, defaults, options); | 32 | this.options = $.extend({}, defaults, options); |
@@ -105,6 +106,7 @@ grid.prototype = { | @@ -105,6 +106,7 @@ grid.prototype = { | ||
105 | }); | 106 | }); |
106 | 107 | ||
107 | if (!p.page && !urlParam.page) p.page = 1; | 108 | if (!p.page && !urlParam.page) p.page = 1; |
109 | + if (!p.size && !urlParam.size) p.size = 10; | ||
108 | 110 | ||
109 | if (param.page !== p.page) { | 111 | if (param.page !== p.page) { |
110 | param.page = p.page; | 112 | param.page = p.page; |
@@ -112,7 +114,10 @@ grid.prototype = { | @@ -112,7 +114,10 @@ grid.prototype = { | ||
112 | param.page = urlParam.page; | 114 | param.page = urlParam.page; |
113 | } | 115 | } |
114 | 116 | ||
115 | - param.size = p.size; | 117 | + if (param.size == p.size) { |
118 | + param.size = urlParam.size; | ||
119 | + } | ||
120 | + | ||
116 | 121 | ||
117 | var urlHash = ''; | 122 | var urlHash = ''; |
118 | $.each(param, function(key, value) { | 123 | $.each(param, function(key, value) { |
@@ -123,6 +128,7 @@ grid.prototype = { | @@ -123,6 +128,7 @@ grid.prototype = { | ||
123 | if (p.hash) { | 128 | if (p.hash) { |
124 | location.hash = urlHash; | 129 | location.hash = urlHash; |
125 | } | 130 | } |
131 | + | ||
126 | return param; | 132 | return param; |
127 | }, | 133 | }, |
128 | __pagination: function(pagination) { | 134 | __pagination: function(pagination) { |
@@ -246,7 +252,7 @@ grid.prototype = { | @@ -246,7 +252,7 @@ grid.prototype = { | ||
246 | $(p.columns).each(function(i, column) { | 252 | $(p.columns).each(function(i, column) { |
247 | if (!column.hidden) { | 253 | if (!column.hidden) { |
248 | //console.log(item, column); | 254 | //console.log(item, column); |
249 | - _h += ('<td >'); | 255 | + _h += ('<td>'); |
250 | _h += (g.__bodyCell(item, column)); | 256 | _h += (g.__bodyCell(item, column)); |
251 | _h += ('</td>'); | 257 | _h += ('</td>'); |
252 | } | 258 | } |
1 | -var $=require('jquery'), | ||
2 | - util=require('./util'); | 1 | +var $ = require('jquery'), |
2 | + util = require('./util'); | ||
3 | 3 | ||
4 | 4 | ||
5 | -var tab=function(options) { | ||
6 | - var defaults={ | ||
7 | - innerHtml:'<ul class="nav nav-pills"></ul>' | 5 | +var tab = function(options) { |
6 | + var defaults = { | ||
7 | + innerHtml: '<ul class="nav nav-pills"></ul>' | ||
8 | }; | 8 | }; |
9 | - this.options=$.extend({}, defaults, options); | 9 | + this.options = $.extend({}, defaults, options); |
10 | $(options.el).html(this.options.innerHtml); | 10 | $(options.el).html(this.options.innerHtml); |
11 | - this.tab=$("ul",options.el); | ||
12 | - this.active=undefined;//undefined==void(0) | ||
13 | - return this; | 11 | + this.tab = $("ul", options.el); |
12 | + this.active = undefined; //undefined==void(0) | ||
13 | + return this; | ||
14 | } | 14 | } |
15 | -tab.prototype={ | ||
16 | - constructor:tab, | ||
17 | - init:function(data){ | ||
18 | - var g = this, p = this.options; | 15 | +tab.prototype = { |
16 | + constructor: tab, | ||
17 | + init: function(data) { | ||
18 | + var g = this, | ||
19 | + p = this.options; | ||
19 | $(this.tab).html(""); | 20 | $(this.tab).html(""); |
20 | this.render(data); | 21 | this.render(data); |
21 | this.bind(p.click); | 22 | this.bind(p.click); |
22 | return this; | 23 | return this; |
23 | }, | 24 | }, |
24 | - bind:function(callback){ | ||
25 | - var g = this, p = this.options; | ||
26 | - $(p.el).off("click","li"); | ||
27 | - $(p.el).on("click","li",function(){ | 25 | + bind: function(callback) { |
26 | + var g = this, | ||
27 | + p = this.options; | ||
28 | + $(p.el).off("click", "li"); | ||
29 | + $(p.el).on("click", "li", function() { | ||
28 | $(this).addClass('active').siblings().removeClass('active'); | 30 | $(this).addClass('active').siblings().removeClass('active'); |
29 | - g.active=$(this).find("a").attr("columnname"); | 31 | + g.active = $(this).find("a").attr("columnname"); |
30 | g.key = $(this).find("a").attr("key"); | 32 | g.key = $(this).find("a").attr("key"); |
31 | g.value = $(this).find("a").attr("value"); | 33 | g.value = $(this).find("a").attr("value"); |
32 | - callback&&callback(); | 34 | + callback && callback.call(this); |
33 | }); | 35 | }); |
34 | }, | 36 | }, |
35 | - render:function(data){ | ||
36 | - var g = this, p = this.options; | ||
37 | - | ||
38 | - var lis=[]; | ||
39 | - $(p.columns).each(function (i, column) { | ||
40 | - var li = $("<li></li>"); | ||
41 | - var a = $("<a href='javascript:void(0);'></a>"); | 37 | + render: function(data) { |
38 | + var g = this, | ||
39 | + p = this.options; | ||
42 | 40 | ||
43 | - if (column.name == 'all') { | ||
44 | - li = $('<li class="active"></li>'); | ||
45 | - }; | ||
46 | - if (column.name) a.attr({ columnname: column.name }); | ||
47 | - if (column.key) a.attr({ key: column.key}); | ||
48 | - if (column.value) a.attr({ value: column.value}); | 41 | + var lis = []; |
42 | + $(p.columns).each(function(i, column) { | ||
43 | + var li = $("<li></li>"); | ||
44 | + var a = $("<a href='javascript:void(0);'></a>"); | ||
49 | 45 | ||
50 | - var h_t = column.display || ""; | ||
51 | - a.html(h_t); | 46 | + if (column.name == 'all') { |
47 | + li = $('<li class="active"></li>'); | ||
48 | + }; | ||
49 | + if (column.name) a.attr({ | ||
50 | + columnname: column.name | ||
51 | + }); | ||
52 | + if (column.key) a.attr({ | ||
53 | + key: column.key | ||
54 | + }); | ||
55 | + if (column.value) a.attr({ | ||
56 | + value: column.value | ||
57 | + }); | ||
52 | 58 | ||
53 | - li.append(a); | ||
54 | - g.tab.append(li); | ||
55 | - }); | 59 | + var h_t = column.display || ""; |
60 | + a.html(h_t); | ||
56 | 61 | ||
57 | - g.tab.html(util.__template(g.tab.html(),data||{})); | 62 | + li.append(a); |
63 | + g.tab.append(li); | ||
64 | + }); | ||
65 | + | ||
66 | + g.tab.html(util.__template(g.tab.html(), data || {})); | ||
58 | 67 | ||
59 | }, | 68 | }, |
60 | - load:function(data){ | ||
61 | - var g = this, p = this.options; | ||
62 | - g.tab.html(util.__template(g.tab.html(),data||{})); | 69 | + load: function(data) { |
70 | + var g = this, | ||
71 | + p = this.options; | ||
72 | + g.tab.html(util.__template(g.tab.html(), data || {})); | ||
63 | } | 73 | } |
64 | } | 74 | } |
65 | 75 | ||
66 | 76 | ||
67 | -module.exports=tab; | ||
77 | +module.exports = tab; |
client/js/goods/netsale-batch.js
0 → 100644
1 | +'use strict'; | ||
2 | +var $ = require('jquery'), | ||
3 | + common = require('../common/common'); | ||
4 | + | ||
5 | +$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>'); | ||
6 | + | ||
7 | +function batchExport(el, type) { | ||
8 | + var loadModal = null; | ||
9 | + | ||
10 | + return { | ||
11 | + params: { | ||
12 | + type: type, | ||
13 | + __type: "batch-import" | ||
14 | + }, | ||
15 | + onStart: function() { | ||
16 | + loadModal = common.dialog.load(); | ||
17 | + | ||
18 | + $(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); | ||
19 | + }, | ||
20 | + onComplete: function(response) { | ||
21 | + console.log(response); | ||
22 | + if (loadModal) { | ||
23 | + loadModal.close(); | ||
24 | + } | ||
25 | + if (response.code == 200) { | ||
26 | + common.util.__tip(response.message, 'success'); | ||
27 | + } else { | ||
28 | + common.util.__tip(response.message, 'warning'); | ||
29 | + } | ||
30 | + } | ||
31 | + } | ||
32 | +} | ||
33 | + | ||
34 | +common.edit.ajaxfileupload('#sort-file', batchExport('#sort-file', 'searchSort')); | ||
35 | +common.edit.ajaxfileupload('#brand-file', batchExport('#brand-file', 'brandProperty')); |
@@ -2,18 +2,79 @@ | @@ -2,18 +2,79 @@ | ||
2 | var $ = require('jquery'), | 2 | var $ = require('jquery'), |
3 | common = require('../common/common'); | 3 | common = require('../common/common'); |
4 | 4 | ||
5 | - | ||
6 | var ENUM = { | 5 | var ENUM = { |
7 | gender: { | 6 | gender: { |
8 | 1: '男', | 7 | 1: '男', |
9 | 2: '女', | 8 | 2: '女', |
10 | 3: '通用' | 9 | 3: '通用' |
10 | + }, | ||
11 | + ageLevel: { | ||
12 | + 1: '成人', | ||
13 | + 2: '大童', | ||
14 | + 3: '小童' | ||
15 | + }, | ||
16 | + status: { | ||
17 | + '-1': '待上架', | ||
18 | + '2': '待审核', | ||
19 | + '3': '驳回', | ||
20 | + '4': '通过', | ||
21 | + '1': '已上架', | ||
22 | + '0': '已下架', | ||
23 | + '5': '再上架待审核', | ||
24 | + '6': '再上架驳回', | ||
25 | + '7': '再上架通过' | ||
26 | + }, | ||
27 | + attribute: { | ||
28 | + 1: '普通', | ||
29 | + 2: '赠品' | ||
30 | + }, | ||
31 | + tab: { | ||
32 | + '0': 0, | ||
33 | + '1': 0, | ||
34 | + '2': 0, | ||
35 | + '3': 0, | ||
36 | + 'all': 0 | ||
11 | } | 37 | } |
12 | -} | 38 | +}; |
39 | + | ||
40 | +var t = new common.tab({ | ||
41 | + el: "#basicTab", | ||
42 | + click: function() { | ||
43 | + g.options.columns[11].hidden = true; | ||
44 | + g.options.columns[8].hidden = true; | ||
45 | + if ($(this).find('a').attr('columnname') == 3) { | ||
46 | + g.options.columns[11].hidden = false; | ||
47 | + } else if ($(this).find('a').attr('columnname') == 2) { | ||
48 | + g.options.columns[8].hidden = false; | ||
49 | + }; | ||
50 | + g.init($("#gridurl").val()); | ||
51 | + }, | ||
52 | + columns: [{ | ||
53 | + name: "0", | ||
54 | + value: '-1,3', | ||
55 | + display: "上架前" | ||
56 | + }, { | ||
57 | + name: "1", | ||
58 | + value: '4,1,0,5,6', | ||
59 | + display: "上架后" | ||
60 | + }, { | ||
61 | + name: "2", | ||
62 | + value: '1', | ||
63 | + display: "搜索/标签" | ||
64 | + }, { | ||
65 | + name: "3", | ||
66 | + value: '1', | ||
67 | + display: "上架后信息缺失" | ||
68 | + }, { | ||
69 | + name: "all", | ||
70 | + value: '', | ||
71 | + display: "全部商品" | ||
72 | + }] | ||
73 | +}).init(); | ||
74 | + | ||
13 | var g = new common.grid({ | 75 | var g = new common.grid({ |
14 | el: "#basicTable", | 76 | el: "#basicTable", |
15 | parms: function() { | 77 | parms: function() { |
16 | - | ||
17 | return { | 78 | return { |
18 | productSkn: common.util.__input("productSkn"), | 79 | productSkn: common.util.__input("productSkn"), |
19 | productSkc: common.util.__input("productSkc"), | 80 | productSkc: common.util.__input("productSkc"), |
@@ -31,7 +92,8 @@ var g = new common.grid({ | @@ -31,7 +92,8 @@ var g = new common.grid({ | ||
31 | smallSortId: common.util.__input("smallSortId"), | 92 | smallSortId: common.util.__input("smallSortId"), |
32 | isOutLets: common.util.__input("isOutLets"), | 93 | isOutLets: common.util.__input("isOutLets"), |
33 | productStatus: common.util.__input("productStatus"), | 94 | productStatus: common.util.__input("productStatus"), |
34 | - isScreen: common.util.__input("isScreen") | 95 | + size: common.util.__input("size"), |
96 | + productStatusStr: t.value | ||
35 | }; | 97 | }; |
36 | }, | 98 | }, |
37 | columns: [{ | 99 | columns: [{ |
@@ -68,39 +130,228 @@ var g = new common.grid({ | @@ -68,39 +130,228 @@ var g = new common.grid({ | ||
68 | display: '年龄层/性别', | 130 | display: '年龄层/性别', |
69 | name: 'vip_discount_type', | 131 | name: 'vip_discount_type', |
70 | render: function(item) { | 132 | render: function(item) { |
71 | - return ENUM.gender[item.gender]; | 133 | + return ENUM.ageLevel[item.ageLevel] + '/' + ENUM.gender[item.gender]; |
72 | } | 134 | } |
73 | }, { | 135 | }, { |
74 | display: '商品类别', | 136 | display: '商品类别', |
75 | - name: 'vip_price' | 137 | + name: 'attribute', //商品属性(1普通、2赠品等) 商品类别 |
138 | + render: function(item) { | ||
139 | + return ENUM.attribute[item.attribute]; | ||
140 | + } | ||
141 | + }, { | ||
142 | + display: '搜索/标签', | ||
143 | + hidden: true, | ||
144 | + render: function(item) { | ||
145 | + return '关键词:' + '<br>' + | ||
146 | + '风格:' + item.style + '<br>' + | ||
147 | + '纹理:' + item.style + '<br>' + | ||
148 | + '工艺:' + item.style + '<br>'; | ||
149 | + } | ||
76 | }, { | 150 | }, { |
77 | display: '操作信息', | 151 | display: '操作信息', |
78 | render: function(item) { | 152 | render: function(item) { |
79 | var html = ''; | 153 | var html = ''; |
80 | - if (item.founder_name) { | ||
81 | - html += '<p>' + item.founder_name + '</p>'; | 154 | + if (item.founderName) { |
155 | + html += '<p>' + item.founderName + '</p>'; | ||
82 | } | 156 | } |
83 | 157 | ||
84 | - if (item.updateTime) { | ||
85 | - html += '<p>' + item.updateTime + '</p>'; | 158 | + if (item.editTime) { |
159 | + html += '<p>' + item.editTime + '</p>'; | ||
86 | } | 160 | } |
87 | return html; | 161 | return html; |
88 | } | 162 | } |
89 | }, { | 163 | }, { |
90 | display: '上架状态', | 164 | display: '上架状态', |
91 | - name: 'vip2_price' | 165 | + name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。 |
166 | + render: function(item) { | ||
167 | + var html = ''; | ||
168 | + html += ENUM.status[item.status]; | ||
169 | + if (item.shelveTime) { | ||
170 | + html += '<br>上架时间:' + item.shelveTime; | ||
171 | + } | ||
172 | + return html; | ||
173 | + } | ||
174 | + }, { | ||
175 | + display: '缺失信息', | ||
176 | + hidden: true, | ||
177 | + render: function(item) { | ||
178 | + return '缺失信息'; | ||
179 | + } | ||
92 | }, { | 180 | }, { |
93 | display: '操作', | 181 | display: '操作', |
94 | render: function(item) { | 182 | render: function(item) { |
95 | - return '<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>' + | ||
96 | - '<a href="javascript:;" class="btn btn-info btn-xs edit-btn">上架</a>' + | ||
97 | - '<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>'; | 183 | + var HtmArr = []; |
184 | + | ||
185 | + if (item.status == 1) { | ||
186 | + HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>'); | ||
187 | + HtmArr.push('<a href="javascript:;" class="btn btn-danger btn-xs shelve-btn" data-skn="' + item.productSkn + '">下架</a>'); | ||
188 | + } else if (item.status != 2 && item.status != 5) { | ||
189 | + HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>'); | ||
190 | + HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shelve-btn" data-skn="' + item.productSkn + '">上架</a>'); | ||
191 | + } | ||
192 | + HtmArr.push('<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>'); | ||
193 | + return HtmArr.join(''); | ||
98 | } | 194 | } |
99 | }] | 195 | }] |
100 | }); | 196 | }); |
101 | - | ||
102 | g.init($("#gridurl").val()); | 197 | g.init($("#gridurl").val()); |
103 | 198 | ||
199 | +//筛选 | ||
104 | $("#filter-btn").click(function() { | 200 | $("#filter-btn").click(function() { |
105 | g.reload(1); | 201 | g.reload(1); |
202 | +}); | ||
203 | + | ||
204 | +/* | ||
205 | + * 上架下架弹框 | ||
206 | + * params: title(弹框标题), html(弹框内容html) | ||
207 | + */ | ||
208 | +function shelveModal(title, html) { | ||
209 | + var selectedArr = g.selected, | ||
210 | + len = selectedArr.length, | ||
211 | + productSknList = [], | ||
212 | + shelveModal = null; | ||
213 | + | ||
214 | + if (len <= 0) { | ||
215 | + common.util.__tip('请选择要' + title + '的商品', 'warning'); | ||
216 | + return; | ||
217 | + } | ||
218 | + | ||
219 | + $.each(selectedArr, function(i, value) { | ||
220 | + productSknList.push(value['productSkn']); | ||
221 | + }); | ||
222 | + | ||
223 | + shelveModal = common.dialog.open({ | ||
224 | + title: '上架', | ||
225 | + content: html | ||
226 | + }); | ||
227 | + | ||
228 | + var e = new common.edit('.shelve-form'); | ||
229 | + e.init(); | ||
230 | + | ||
231 | + $('.shelve-form').on('click', '.btn', function() { | ||
232 | + var type = $(this).data('type'); | ||
233 | + $(this).closest('.form-group').find('input').attr('required', true) | ||
234 | + .end().siblings('.form-group').find('input').attr('required', false); | ||
235 | + | ||
236 | + e.submit('/goods/product/updateProductSknTimingInfo', function(option) { | ||
237 | + option.data.productSknList = JSON.stringify(productSknList); | ||
238 | + option.data.type = type; | ||
239 | + option.success = function(res) { | ||
240 | + if (res.data.code == 200) { | ||
241 | + e.$tip(res.data.message, function() { | ||
242 | + shelveModal.close(); | ||
243 | + }, 'growl-success'); | ||
244 | + } else { | ||
245 | + e.$tip(res.data.message); | ||
246 | + } | ||
247 | + } | ||
248 | + }); | ||
249 | + }); | ||
250 | +} | ||
251 | +//批量skn上架 | ||
252 | +$('#onshelve').on('click', function() { | ||
253 | + shelveModal('上架', $('#onshelve-template').html()); | ||
254 | +}); | ||
255 | +//批量skn下架 | ||
256 | +$('#offshelve').on('click', function() { | ||
257 | + shelveModal('下架', $('#offshelve-template').html()); | ||
258 | +}); | ||
259 | + | ||
260 | +//导出 | ||
261 | +$('#export-btn').on('click', function() { | ||
262 | + | ||
263 | +}); | ||
264 | + | ||
265 | +//单个sku,skc上下架 | ||
266 | +$('#basicTable').on('click', '.shelve-btn', function() { | ||
267 | + var that = this, | ||
268 | + skn = $(this).data('skn'), | ||
269 | + shelveModalHtml = '', | ||
270 | + shelveModal = null; | ||
271 | + | ||
272 | + var shelveModalHtml = common.util.__template($('#template').html()); | ||
273 | + | ||
274 | + $(that).addClass('disabled'); | ||
275 | + | ||
276 | + common.util.__ajax({ | ||
277 | + url: '/goods/product/getNetSaleInfo', | ||
278 | + data: { | ||
279 | + param: skn | ||
280 | + } | ||
281 | + }, function(res) { | ||
282 | + shelveModalHtml = common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct); | ||
283 | + shelveModal = common.dialog.open({ | ||
284 | + title: '上/下架', | ||
285 | + width: 900, | ||
286 | + content: shelveModalHtml | ||
287 | + }); | ||
288 | + | ||
289 | + $(that).removeClass('disabled'); | ||
290 | + | ||
291 | + var shelveTable = new common.grid({ | ||
292 | + el: "#shelve-table", | ||
293 | + columns: [{ | ||
294 | + display: 'SKC(商品信息)', | ||
295 | + render: function(item) { | ||
296 | + | ||
297 | + return 'SKC:' + item.productSkc + '<br>' + | ||
298 | + '颜色:' + item.goodsName; | ||
299 | + } | ||
300 | + }, { | ||
301 | + display: 'SKC上架操作(状态)', | ||
302 | + render: function(item) { | ||
303 | + if (item.status == 0) { | ||
304 | + return '<a class="btn btn-success" href="javascript:;">点击上架</a>'; | ||
305 | + } else { | ||
306 | + return '<a class="btn btn-danger" href="javascript:;">点击下架</a>'; | ||
307 | + } | ||
308 | + } | ||
309 | + }, { | ||
310 | + display: 'SKU', | ||
311 | + render: function(item) { | ||
312 | + //console.log(item.goodsSizeList); | ||
313 | + var html = ''; | ||
314 | + $.each(item.goodsSizeList, function(i, value) { | ||
315 | + html += value.productSku + '<br>'; | ||
316 | + }); | ||
317 | + return html; | ||
318 | + } | ||
319 | + }, { | ||
320 | + display: '尺码', | ||
321 | + render: function(item) { | ||
322 | + var html = ''; | ||
323 | + $.each(item.goodsSizeList, function(i, value) { | ||
324 | + html += value.sizeName + '<br>'; | ||
325 | + }); | ||
326 | + return html; | ||
327 | + } | ||
328 | + }, { | ||
329 | + display: '库存', | ||
330 | + render: function(item) { | ||
331 | + var html = ''; | ||
332 | + $.each(item.goodsSizeList, function(i, value) { | ||
333 | + html += value.stock + '<br>'; | ||
334 | + }); | ||
335 | + return html; | ||
336 | + } | ||
337 | + }, { | ||
338 | + display: 'SKU上架操作', | ||
339 | + render: function(item) { | ||
340 | + var html = ''; | ||
341 | + /*$.each(item.goodsSizeList, function(i, value) { | ||
342 | + html += value.sizeName + '<br>'; | ||
343 | + });*/ | ||
344 | + return html; | ||
345 | + } | ||
346 | + }, { | ||
347 | + display: 'SKU上架状态', | ||
348 | + name: 'vip_discount_type', | ||
349 | + render: function(item) { | ||
350 | + //return ENUM.ageLevel[item.ageLevel] + '/' + ENUM.gender[item.gender]; | ||
351 | + } | ||
352 | + }] | ||
353 | + }); | ||
354 | + shelveTable.init(res.data.goodsList); | ||
355 | + }, true); | ||
356 | + | ||
106 | }); | 357 | }); |
@@ -443,6 +443,7 @@ $('#sure-change').on('click', function() { | @@ -443,6 +443,7 @@ $('#sure-change').on('click', function() { | ||
443 | $('#priceTable').hide(); | 443 | $('#priceTable').hide(); |
444 | $('.success-wrap').show(); | 444 | $('.success-wrap').show(); |
445 | path = res.data; | 445 | path = res.data; |
446 | + successList.length = 0; | ||
446 | }); | 447 | }); |
447 | 448 | ||
448 | }); | 449 | }); |
@@ -109,7 +109,7 @@ exports.res = [ | @@ -109,7 +109,7 @@ exports.res = [ | ||
109 | type: 'number' | 109 | type: 'number' |
110 | }, { | 110 | }, { |
111 | name: 'isOutLets', | 111 | name: 'isOutLets', |
112 | - type: 'number' | 112 | + type: 'string' |
113 | }, { | 113 | }, { |
114 | name: 'productStatus', | 114 | name: 'productStatus', |
115 | type: 'number' | 115 | type: 'number' |
@@ -119,7 +119,48 @@ exports.res = [ | @@ -119,7 +119,48 @@ exports.res = [ | ||
119 | }, { | 119 | }, { |
120 | name: 'size', | 120 | name: 'size', |
121 | type: 'number' | 121 | type: 'number' |
122 | - }, ] | 122 | + }, { |
123 | + name: 'productStatusStr', | ||
124 | + type: 'string' | ||
125 | + }] | ||
126 | + }, { | ||
127 | + //网销信息 -> 批量skn处理 | ||
128 | + route: '/goods/product/updateProductSknTimingInfo', | ||
129 | + method: 'POST', | ||
130 | + url: '/product/updateProductSknTimingInfo', | ||
131 | + params: [{ | ||
132 | + name: 'productSknList', | ||
133 | + type: 'string' | ||
134 | + }, { | ||
135 | + name: 'type', | ||
136 | + type: 'number' | ||
137 | + }, { | ||
138 | + name: 'outSaleTime', | ||
139 | + type: 'number' | ||
140 | + }, { | ||
141 | + name: 'shelveTime', | ||
142 | + type: 'string' | ||
143 | + }, { | ||
144 | + name: 'onNewTime', | ||
145 | + type: 'string' | ||
146 | + }, { | ||
147 | + name: 'advanceBeginTime', | ||
148 | + type: 'string' | ||
149 | + }, { | ||
150 | + name: 'advanceEndTime', | ||
151 | + type: 'string' | ||
152 | + }] | ||
153 | + }, { | ||
154 | + //网销信息 -> 批量页面渲染 | ||
155 | + route: '/goods/netsale/batch', | ||
156 | + method: 'GET', | ||
157 | + view: 'pages/goods/netsale-batch', | ||
158 | + src: '/goods/netsale-batch', | ||
159 | + data: { | ||
160 | + secondTitle: '网销信息', | ||
161 | + pageTitle: '批量设置', | ||
162 | + domain: exports.domain, | ||
163 | + } | ||
123 | }, { | 164 | }, { |
124 | //网销信息 -> 编辑页页面渲染 | 165 | //网销信息 -> 编辑页页面渲染 |
125 | route: '/goods/netsale/edit/:param', | 166 | route: '/goods/netsale/edit/:param', |
@@ -135,6 +176,14 @@ exports.res = [ | @@ -135,6 +176,14 @@ exports.res = [ | ||
135 | type: 'number' | 176 | type: 'number' |
136 | }] | 177 | }] |
137 | }, { | 178 | }, { |
179 | + route: '/goods/product/getNetSaleInfo', | ||
180 | + method: 'POST', | ||
181 | + url: '/product/getNetSaleInfo', | ||
182 | + params: [{ | ||
183 | + name: 'param', | ||
184 | + type: 'number' | ||
185 | + }] | ||
186 | + }, { | ||
138 | //价格管理 -> 代销变价页面渲染 | 187 | //价格管理 -> 代销变价页面渲染 |
139 | route: '/goods/pricechange/index', | 188 | route: '/goods/pricechange/index', |
140 | method: 'GET', | 189 | method: 'GET', |
server/views/pages/goods/netsale-batch.html
0 → 100644
1 | +<div class="pageheader"> | ||
2 | + <div class="media"> | ||
3 | + <div class="pageicon pull-left"> | ||
4 | + <i class="fa fa-th-list"></i> | ||
5 | + </div> | ||
6 | + <div class="media-body"> | ||
7 | + <ul class="breadcrumb"> | ||
8 | + <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | ||
9 | + <li><a href="">商品管理</a></li> | ||
10 | + <li> | ||
11 | + {{# secondTitle}}{{.}}{{/ secondTitle}} | ||
12 | + {{^ secondTitle}}{{pageTitle}}{{/ secondTitle}} | ||
13 | + </li> | ||
14 | + </ul> | ||
15 | + | ||
16 | + <div> | ||
17 | + <div style="width: 30%;float: left;"> | ||
18 | + <h4>{{pageTitle}}</h4> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + </div> | ||
22 | + </div> | ||
23 | +</div> | ||
24 | + | ||
25 | +<div class="contentpanel"> | ||
26 | + <div class="panel panel-default" style="margin-bottom:10px;"> | ||
27 | + <div class="panel-body"> | ||
28 | + <table class="table table-bordered"> | ||
29 | + <tr> | ||
30 | + <td rowspan="2">排序</td> | ||
31 | + <td>上传EXCEL:</td> | ||
32 | + <td style="position: relative;"><input id="sort-file" name="file" data-type="searchSort" type="file" style="cursor: pointer; height: 37px; top: 8px;"></td> | ||
33 | + </tr> | ||
34 | + <tr> | ||
35 | + <td>说明:</td> | ||
36 | + <td colspan="2"> | ||
37 | + 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> | ||
38 | + 2、Excel表头为:<span style="color: #67D267;">SKN、模块ID(品牌设置:1;奥莱设置:2;搜索设置:3)、排序值</span><br> | ||
39 | + 3、第一行为表头内容,第二行开始为正式内容<br> | ||
40 | + 4、每个文件控制在2500行以内<br> | ||
41 | + 5、<a href="{{domain}}/common/searchSort.xlsx">下载样例</a> | ||
42 | + </td> | ||
43 | + </tr> | ||
44 | + <tr> | ||
45 | + <td rowspan="2">品牌款型系列</td> | ||
46 | + <td>上传EXCEL:</td> | ||
47 | + <td style="position: relative;"><input id="brand-file" name="file" data-type="brandProperty" type="file" style="cursor: pointer; height: 37px; top: 8px;"></td> | ||
48 | + </tr> | ||
49 | + <tr> | ||
50 | + <td>说明:</td> | ||
51 | + <td colspan="2"> | ||
52 | + 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> | ||
53 | + 2、Excel表头为:<span style="color: #67D267;">SKN、品牌款型系列名称、类型</span><br> | ||
54 | + 3、第一行为表头内容,第二行开始为正式内容<br> | ||
55 | + 4、每个文件控制在500行以内<br> | ||
56 | + 5、<a href="{{domain}}/common/brandModelSeries.xlsx">下载样例</a> | ||
57 | + </td> | ||
58 | + </tr> | ||
59 | + </table> | ||
60 | + </div> | ||
61 | + </div> | ||
62 | +</div> |
@@ -27,43 +27,43 @@ | @@ -27,43 +27,43 @@ | ||
27 | <div class="panel-body"> | 27 | <div class="panel-body"> |
28 | <div class="row"> | 28 | <div class="row"> |
29 | <div class="panel-col"> | 29 | <div class="panel-col"> |
30 | - <input id="productSkn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')"> | 30 | + <input id="productSkn" class="form-control panel-input" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')"> |
31 | </div> | 31 | </div> |
32 | <div class="panel-col"> | 32 | <div class="panel-col"> |
33 | - <input id="skc" class="form-control panel-input height40" type="text" placeholder="请输入SKC" onkeyup="this.value=this.value.replace(/\D/gi,'')"> | 33 | + <input id="productSkc" class="form-control panel-input" type="text" placeholder="请输入SKC" onkeyup="this.value=this.value.replace(/\D/gi,'')"> |
34 | </div> | 34 | </div> |
35 | <div class="panel-col"> | 35 | <div class="panel-col"> |
36 | - <input id="sku" class="form-control panel-input height40" type="text" placeholder="请输入SKU" onkeyup="this.value=this.value.replace(/\D/gi,'')"> | 36 | + <input id="productSku" class="form-control panel-input" type="text" placeholder="请输入SKU" onkeyup="this.value=this.value.replace(/\D/gi,'')"> |
37 | </div> | 37 | </div> |
38 | - <div class="panel-col"> | ||
39 | - <input id="productName" class="form-control panel-input height40" type="text" placeholder="商品名称"> | 38 | + <div class="panel-col2"> |
39 | + <input id="productName" class="form-control panel-input" type="text" placeholder="商品名称"> | ||
40 | </div> | 40 | </div> |
41 | <div class="panel-col2"> | 41 | <div class="panel-col2"> |
42 | - <select name="shop" id="shop" tabindex="-1" title="" class="form-control height40"> | 42 | + <select name="shopId" id="shopId" tabindex="-1" title="" class="form-control"> |
43 | <option value="-1">请选择店铺</option> | 43 | <option value="-1">请选择店铺</option> |
44 | </select> | 44 | </select> |
45 | </div> | 45 | </div> |
46 | <div class="panel-col"> | 46 | <div class="panel-col"> |
47 | - <select name="brand" id="brand" tabindex="-1" title="" class="form-control height40"> | 47 | + <select name="brandId" id="brandId" tabindex="-1" title="" class="form-control"> |
48 | <option value="-1">请选择品牌</option> | 48 | <option value="-1">请选择品牌</option> |
49 | </select> | 49 | </select> |
50 | </div> | 50 | </div> |
51 | <div class="panel-col"> | 51 | <div class="panel-col"> |
52 | - <select name="stock" id="stock" tabindex="-1" title="" class="form-control height40"> | 52 | + <select name="stock" id="stock" tabindex="-1" title="" class="form-control"> |
53 | <option value="-1">库存情况</option> | 53 | <option value="-1">库存情况</option> |
54 | <option value="1">有库存</option> | 54 | <option value="1">有库存</option> |
55 | <option value="0">无库存</option> | 55 | <option value="0">无库存</option> |
56 | </select> | 56 | </select> |
57 | </div> | 57 | </div> |
58 | <div class="panel-col"> | 58 | <div class="panel-col"> |
59 | - <select name="shoot" id="shoot" tabindex="-1" title="" class="form-control height40"> | 59 | + <select name="isScreen" id="isScreen" tabindex="-1" title="" class="form-control height40"> |
60 | <option value="-1">拍摄状态</option> | 60 | <option value="-1">拍摄状态</option> |
61 | <option value="1">已拍摄</option> | 61 | <option value="1">已拍摄</option> |
62 | <option value="0">未拍摄</option> | 62 | <option value="0">未拍摄</option> |
63 | </select> | 63 | </select> |
64 | </div> | 64 | </div> |
65 | <div class="panel-col"> | 65 | <div class="panel-col"> |
66 | - <select name="clstatus" id="clstatus" tabindex="-1" title="" class="form-control height40"> | 66 | + <select name="isMeasure" id="isMeasure" tabindex="-1" title="" class="form-control height40"> |
67 | <option value="-1">测量状态</option> | 67 | <option value="-1">测量状态</option> |
68 | <option value="1">已测量</option> | 68 | <option value="1">已测量</option> |
69 | <option value="0">未测量</option> | 69 | <option value="0">未测量</option> |
@@ -78,34 +78,34 @@ | @@ -78,34 +78,34 @@ | ||
78 | </select> | 78 | </select> |
79 | </div> | 79 | </div> |
80 | <div class="panel-col"> | 80 | <div class="panel-col"> |
81 | - <select name="cate1" id="cate1" tabindex="-1" title="" class="form-control height40"> | 81 | + <select name="maxSortId" id="maxSortId" tabindex="-1" title="" class="form-control height40"> |
82 | <option value="-1">请选择一级类目</option> | 82 | <option value="-1">请选择一级类目</option> |
83 | </select> | 83 | </select> |
84 | </div> | 84 | </div> |
85 | <div class="panel-col"> | 85 | <div class="panel-col"> |
86 | - <select name="cate2" id="cate2" tabindex="-1" title="" class="form-control height40"> | 86 | + <select name="middleSortId" id="middleSortId" tabindex="-1" title="" class="form-control height40"> |
87 | <option value="-1">请选择二级类目</option> | 87 | <option value="-1">请选择二级类目</option> |
88 | </select> | 88 | </select> |
89 | </div> | 89 | </div> |
90 | <div class="panel-col"> | 90 | <div class="panel-col"> |
91 | - <select name="cate3" id="cate3" tabindex="-1" title="" class="form-control height40"> | 91 | + <select name="smallSortId" id="smallSortId" tabindex="-1" title="" class="form-control height40"> |
92 | <option value="-1">请选择三级类目</option> | 92 | <option value="-1">请选择三级类目</option> |
93 | </select> | 93 | </select> |
94 | </div> | 94 | </div> |
95 | - <div class="panel-col"> | 95 | + <!-- <div class="panel-col"> |
96 | <select name="cate4" id="cate4" tabindex="-1" title="" class="form-control height40"> | 96 | <select name="cate4" id="cate4" tabindex="-1" title="" class="form-control height40"> |
97 | <option value="-1">请选择四级类目</option> | 97 | <option value="-1">请选择四级类目</option> |
98 | </select> | 98 | </select> |
99 | - </div> | 99 | + </div> --> |
100 | <div class="panel-col"> | 100 | <div class="panel-col"> |
101 | - <select name="aolai" id="aolai" tabindex="-1" title="" class="form-control height40"> | 101 | + <select name="isOutLets" id="isOutLets" tabindex="-1" title="" class="form-control height40"> |
102 | <option value="-1">是否奥莱</option> | 102 | <option value="-1">是否奥莱</option> |
103 | - <option value="1">奥莱</option> | ||
104 | - <option value="0">菲奥莱</option> | 103 | + <option value="Y">奥莱</option> |
104 | + <option value="N">非奥莱</option> | ||
105 | </select> | 105 | </select> |
106 | </div> | 106 | </div> |
107 | <div class="panel-col"> | 107 | <div class="panel-col"> |
108 | - <select name="status" id="status" tabindex="-1" title="" class="form-control height40"> | 108 | + <select name="productStatus" id="productStatus" tabindex="-1" title="" class="form-control height40"> |
109 | <option value="-1">状态</option> | 109 | <option value="-1">状态</option> |
110 | <option value="1">待上架</option> | 110 | <option value="1">待上架</option> |
111 | <option value="0">待审核</option> | 111 | <option value="0">待审核</option> |
@@ -120,14 +120,14 @@ | @@ -120,14 +120,14 @@ | ||
120 | </div> | 120 | </div> |
121 | 121 | ||
122 | <div class="panel-col"> | 122 | <div class="panel-col"> |
123 | - <select name="jit" id="jit" tabindex="-1" title="" class="form-control height40"> | 123 | + <select name="isJit" id="isJit" tabindex="-1" title="" class="form-control"> |
124 | <option value="-1">是否JIT商品</option> | 124 | <option value="-1">是否JIT商品</option> |
125 | <option value="Y">是</option> | 125 | <option value="Y">是</option> |
126 | <option value="N">否</option> | 126 | <option value="N">否</option> |
127 | </select> | 127 | </select> |
128 | </div> | 128 | </div> |
129 | <div class="panel-col"> | 129 | <div class="panel-col"> |
130 | - <select name="size" id="size" tabindex="-1" title="" class="form-control height40"> | 130 | + <select name="size" id="size" tabindex="-1" title="" class="form-control"> |
131 | <option value="10">单页显示条数</option> | 131 | <option value="10">单页显示条数</option> |
132 | <option value="10">10条</option> | 132 | <option value="10">10条</option> |
133 | <option value="20">20条</option> | 133 | <option value="20">20条</option> |
@@ -136,23 +136,84 @@ | @@ -136,23 +136,84 @@ | ||
136 | <option value="100">100条</option> | 136 | <option value="100">100条</option> |
137 | </select> | 137 | </select> |
138 | </div> | 138 | </div> |
139 | - <div class="panel-col height40"> | 139 | + <div class="panel-col"> |
140 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | 140 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> |
141 | - <a id="all-btn" href="javascript:;" class="btn btn-info">全部</a> | 141 | + <a id="all-btn" href="" class="btn btn-info">全部</a> |
142 | </div> | 142 | </div> |
143 | </div> | 143 | </div> |
144 | 144 | ||
145 | <div class="row" style="margin: 0 0 0 -5px;"> | 145 | <div class="row" style="margin: 0 0 0 -5px;"> |
146 | - <a id="" href="javascript:;" class="btn btn-default">上架</a> | ||
147 | - <a id="" href="javascript:;" class="btn btn-default">下架</a> | ||
148 | - <a id="" href="javascript:;" class="btn btn-default">导出</a> | ||
149 | - <a id="import-btn" href="javascript:;" class="btn btn-info">批量(排序、款型系列)</a> | 146 | + <a id="onshelve" href="javascript:;" class="btn btn-default">上架</a> |
147 | + <a id="offshelve" href="javascript:;" class="btn btn-default">下架</a> | ||
148 | + <a id="export-btn" href="javascript:;" class="btn btn-default">导出</a> | ||
149 | + <a id="import-btn" href="/goods/netsale/batch" class="btn btn-info">批量(排序、款型系列)</a> | ||
150 | </div> | 150 | </div> |
151 | </div> | 151 | </div> |
152 | + | ||
152 | </div> | 153 | </div> |
153 | <div class="panel"> | 154 | <div class="panel"> |
154 | - <div class="dataTables_wrapper no-footer" id="basicTable"></div> | 155 | + <div class="panel-body nopadding"> |
156 | + <div class="dataTab_wrapper" id="basicTab"></div> | ||
157 | + <div class="dataTables_wrapper no-footer" id="basicTable"></div> | ||
158 | + </div> | ||
155 | </div> | 159 | </div> |
160 | + | ||
156 | </div> | 161 | </div> |
157 | 162 | ||
158 | -<input type="hidden" id="gridurl" value="{{gridurl}}"> | ||
163 | +<input type="hidden" id="gridurl" value="{{gridurl}}"> | ||
164 | + | ||
165 | +<script type="text/template" id="onshelve-template"> | ||
166 | + <form class="shelve-form form-horizontal form-bordered"> | ||
167 | + <div class="panel panel-default"> | ||
168 | + <div class="panel-body nopadding"> | ||
169 | + <div class="form-group"> | ||
170 | + <a class="btn btn-info" data-type="2" href="javascript:;">上架上新</a> | ||
171 | + <a class="btn btn-info" data-type="1" href="javascript:;">上架不上新</a> | ||
172 | + </div> | ||
173 | + <div class="form-group"> | ||
174 | + <div class="col-sm-3 height40">预计上架时间:</div> | ||
175 | + <div class="col-sm-6"><input id="shelveTime" class="form-control" jsaction="time" type="text" placeholder="预上架时间" readonly></div> | ||
176 | + <div class="col-sm-1"><a class="btn btn-info" data-type="3" href="javascript:;">确定</a></div> | ||
177 | + </div> | ||
178 | + <div class="form-group"> | ||
179 | + <div class="col-sm-3 height40">预计上架上新时间:</div> | ||
180 | + <div class="col-sm-6"><input id="onNewTime" class="form-control" jsaction="time" type="text" placeholder="预计上架上新时间" readonly></div> | ||
181 | + <div class="col-sm-1"><a class="btn btn-info" data-type="4" href="javascript:;">确定</a></div> | ||
182 | + </div> | ||
183 | + <div class="form-group"> | ||
184 | + <div class="col-sm-2 height40">预售时间:</div> | ||
185 | + <div class="col-sm-4"><input id="advanceBeginTime" class="form-control" jsaction="time:end:advanceEndTime" type="text" placeholder="预售开始时间" readonly></div> | ||
186 | + <div class="col-sm-4"><input id="advanceEndTime" class="form-control" jsaction="time:start:advanceBeginTime" type="text" placeholder="预售结束时间" readonly></div> | ||
187 | + <div class="col-sm-1"><a class="btn btn-info" data-type="5" href="javascript:;">确定</a></div> | ||
188 | + </div> | ||
189 | + </div> | ||
190 | + </div> | ||
191 | + </form> | ||
192 | +</script> | ||
193 | + | ||
194 | +<script type="text/template" id="offshelve-template"> | ||
195 | + <form class="shelve-form form-horizontal form-bordered"> | ||
196 | + <div class="panel panel-default"> | ||
197 | + <div class="panel-body nopadding"> | ||
198 | + <div class="form-group"> | ||
199 | + <a class="btn btn-info" data-type="7" href="javascript:;">立即下架</a> | ||
200 | + </div> | ||
201 | + <div class="form-group"> | ||
202 | + <div class="col-sm-3 height40">预计下架时间:</div> | ||
203 | + <div class="col-sm-4">售罄<input id="outSaleTime" class="form-control" type="text" style="display:inline-block;width:60px;" value="0">天下架</div> | ||
204 | + <div class="col-sm-1"><a class="btn btn-info" data-type="6" href="javascript:;">确定</a></div> | ||
205 | + </div> | ||
206 | + | ||
207 | + </div> | ||
208 | + </div> | ||
209 | + </form> | ||
210 | +</script> | ||
211 | + | ||
212 | + | ||
213 | + | ||
214 | +<script type="text/template" id="template"> | ||
215 | + <p>SKN:{productSkn} 品牌:{brandName}</p> | ||
216 | + <p>商品名称:{productName}</p> | ||
217 | + <div id="shelve-table" class="dataTables_wrapper no-footer"></div> | ||
218 | + | ||
219 | +</script> |
-
Please register or login to post a comment