Showing
5 changed files
with
257 additions
and
434 deletions
@@ -93,34 +93,34 @@ edit.prototype={ | @@ -93,34 +93,34 @@ edit.prototype={ | ||
93 | }); | 93 | }); |
94 | 94 | ||
95 | /*时间插件初始化*/ | 95 | /*时间插件初始化*/ |
96 | - var fdatepicker={}; | ||
97 | - $("input[jsaction]",that.el) | ||
98 | - .add("input[jsaction]",that.el) | ||
99 | - .each(function(){ | ||
100 | - var $this=$(this); | ||
101 | - var name=$this.attr("id"), | ||
102 | - arr=String.prototype.split.call($this.attr("jsaction"),':'); | ||
103 | - var obj=$("#"+name).fdatepicker({ | ||
104 | - format: arr[0]=="date"?'yyyy-mm-dd':'yyyy-mm-dd hh:ii:ss', | ||
105 | - pickTime: arr[0]=="date"?false:true | ||
106 | - }).data("datepicker"); | 96 | + var fdatepicker = {}; |
97 | + $("input[jsaction]", that.el) | ||
98 | + .add("input[jsaction]", that.el) | ||
99 | + .each(function() { | ||
100 | + var $this = $(this); | ||
101 | + var name = $this.attr("id"), | ||
102 | + arr = String.prototype.split.call($this.attr("jsaction"), ':'); | ||
103 | + var obj = $("#" + name).fdatepicker({ | ||
104 | + format: arr[0] == "date" ? 'yyyy-mm-dd' : 'yyyy-mm-dd hh:ii:ss', | ||
105 | + pickTime: arr[0] == "date" ? false : true | ||
106 | + }).data("datepicker"); | ||
107 | 107 | ||
108 | - fdatepicker[name]={ | ||
109 | - obj:obj, | ||
110 | - action:arr[1]?(arr[1]==="end"?"setEndDate":"setStartDate"):false, | ||
111 | - target:arr[2]?"#"+arr[2]:false | ||
112 | - }; | ||
113 | - }); | ||
114 | - for(var key in fdatepicker){ | ||
115 | - var obj=fdatepicker[key].obj; | ||
116 | - var action=fdatepicker[key].action; | ||
117 | - var target=fdatepicker[key].target; | ||
118 | - if(action){ | ||
119 | - (function(obj,action,target){ | ||
120 | - $("#"+key).click(function(){ | ||
121 | - obj[action]($(target).val().replace(/\s.*/,'')); | 108 | + fdatepicker[name] = { |
109 | + obj: obj, | ||
110 | + action: arr[1] ? (arr[1] === "end" ? "setEndDate" : "setStartDate") : false, | ||
111 | + target: arr[2] ? "#" + arr[2] : false | ||
112 | + }; | ||
113 | + }); | ||
114 | + for (var key in fdatepicker) { | ||
115 | + var obj = fdatepicker[key].obj; | ||
116 | + var action = fdatepicker[key].action; | ||
117 | + var target = fdatepicker[key].target; | ||
118 | + if (action) { | ||
119 | + (function(obj, action, target) { | ||
120 | + $("#" + key).click(function() { | ||
121 | + obj[action]($(target).val().replace(/\s.*/, '')); | ||
122 | }); | 122 | }); |
123 | - })(obj,action,target); | 123 | + })(obj, action, target); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 |
@@ -161,8 +161,6 @@ common.edit.ajaxfileupload("#upload-input", { | @@ -161,8 +161,6 @@ common.edit.ajaxfileupload("#upload-input", { | ||
161 | 161 | ||
162 | if (response.data.succesList && response.data.succesList.length > 0) { | 162 | if (response.data.succesList && response.data.succesList.length > 0) { |
163 | common.util.__tip(response.message, 'success'); | 163 | common.util.__tip(response.message, 'success'); |
164 | - } else { | ||
165 | - common.util.__tip('没有成功导入的数据', 'warning'); | ||
166 | } | 164 | } |
167 | } else { | 165 | } else { |
168 | common.util.__tip(response.message, 'warning'); | 166 | common.util.__tip(response.message, 'warning'); |
@@ -8,6 +8,7 @@ var $ = require('jquery'), | @@ -8,6 +8,7 @@ var $ = require('jquery'), | ||
8 | common = require('../common/common'); | 8 | common = require('../common/common'); |
9 | 9 | ||
10 | require('../common/bootstrap-wysihtml5'); | 10 | require('../common/bootstrap-wysihtml5'); |
11 | +require('../util/datepicker'); | ||
11 | 12 | ||
12 | var ENMA = { | 13 | var ENMA = { |
13 | attachType: { | 14 | attachType: { |
@@ -28,6 +29,8 @@ if ($("#saleTime").data("time")) { | @@ -28,6 +29,8 @@ if ($("#saleTime").data("time")) { | ||
28 | $("#saleTime").val(date); | 29 | $("#saleTime").val(date); |
29 | } | 30 | } |
30 | 31 | ||
32 | + | ||
33 | + | ||
31 | //测试数据 | 34 | //测试数据 |
32 | var g = new common.grid({ | 35 | var g = new common.grid({ |
33 | el: "#baseTable", | 36 | el: "#baseTable", |
@@ -108,22 +111,29 @@ e.on("validate", function() { | @@ -108,22 +111,29 @@ e.on("validate", function() { | ||
108 | return "请上传默认封面"; | 111 | return "请上传默认封面"; |
109 | } | 112 | } |
110 | }); | 113 | }); |
111 | -e.on("validate",function(){ | ||
112 | - var limitProductType=$("#limitProductType").val(); | ||
113 | - var activityId=$.trim($("#activityId").val()); | ||
114 | - if(limitProductType==2&&activityId==""){ | 114 | +e.on("validate", function() { |
115 | + var limitProductType = $("#limitProductType").val(); | ||
116 | + var activityId = $.trim($("#activityId").val()); | ||
117 | + if (limitProductType == 2 && activityId == "") { | ||
115 | return "请填写排队限购ID"; | 118 | return "请填写排队限购ID"; |
116 | } | 119 | } |
117 | }) | 120 | }) |
118 | 121 | ||
119 | e.init(); | 122 | e.init(); |
120 | 123 | ||
124 | +console.log($('#saleTime').val().slice(0, -3)); | ||
121 | //添加修改 | 125 | //添加修改 |
122 | $('.limit-add-btn').click(function(option) { | 126 | $('.limit-add-btn').click(function(option) { |
123 | e.submit($('#limit-add-form').attr('action'), function(option) { | 127 | e.submit($('#limit-add-form').attr('action'), function(option) { |
128 | + var saleTime = new Date(option.data.saleTime.replace(/-/g, '/')); | ||
124 | //option.debug=true; | 129 | //option.debug=true; |
125 | option.data.attachmentContent = JSON.stringify(g.__rows); | 130 | option.data.attachmentContent = JSON.stringify(g.__rows); |
126 | - option.data.saleTime = new Date(option.data.saleTime.replace('-', ',')).getTime() / 1000; | 131 | + |
132 | + /*if ($('input[name="dayFlag"]:checked').val() == 0) { | ||
133 | + saleTime = new Date(option.data.saleTime.slice(0, -3).replace(/-/g, '/')); | ||
134 | + }*/ | ||
135 | + option.data.saleTime = saleTime.getTime() / 1000; | ||
136 | + console.log(option.data); | ||
127 | option.success = function(res) { | 137 | option.success = function(res) { |
128 | res = res.data; | 138 | res = res.data; |
129 | if (res.code == "200") { | 139 | if (res.code == "200") { |
@@ -145,30 +155,31 @@ $('.limit-add-btn').click(function(option) { | @@ -145,30 +155,31 @@ $('.limit-add-btn').click(function(option) { | ||
145 | // var $editor = $('#editor'), //文字,图片,视频容器 | 155 | // var $editor = $('#editor'), //文字,图片,视频容器 |
146 | // type = $('#limit-add-form').attr('type'); | 156 | // type = $('#limit-add-form').attr('type'); |
147 | 157 | ||
148 | -var Bll={ | ||
149 | - imgVideo:function(title,item,index){ | ||
150 | - if(item.attachType==2||item.__attachType==2){item.extend="mp4"}; | ||
151 | - common.dialog.confirm(title,common.util.__template($("#picDialogTemp").html(),item),function(){ | ||
152 | - var _html=$.trim($("#imgVideoText").val()); | ||
153 | - | ||
154 | - if(_html){ | ||
155 | - if(item.attachType){ | ||
156 | - //修改 | ||
157 | - g.__rows[index].attachUrl=_html; | ||
158 | - } | ||
159 | - else{ | ||
160 | - //添加 | ||
161 | - g.__rows.push({ | ||
162 | - "attachType": item.__attachType, | ||
163 | - "attachUrl": _html, | ||
164 | - "isDefault": 0, | ||
165 | - "attachName":$("#attachName").val() | ||
166 | - }); | ||
167 | - } | ||
168 | - | ||
169 | - g.reload(); | ||
170 | - e1.init(); | ||
171 | - } | 158 | +var Bll = { |
159 | + imgVideo: function(title, item, index) { | ||
160 | + if (item.attachType == 2 || item.__attachType == 2) { | ||
161 | + item.extend = "mp4" | ||
162 | + }; | ||
163 | + common.dialog.confirm(title, common.util.__template($("#picDialogTemp").html(), item), function() { | ||
164 | + var _html = $.trim($("#imgVideoText").val()); | ||
165 | + | ||
166 | + if (_html) { | ||
167 | + if (item.attachType) { | ||
168 | + //修改 | ||
169 | + g.__rows[index].attachUrl = _html; | ||
170 | + } else { | ||
171 | + //添加 | ||
172 | + g.__rows.push({ | ||
173 | + "attachType": item.__attachType, | ||
174 | + "attachUrl": _html, | ||
175 | + "isDefault": 0, | ||
176 | + "attachName": $("#attachName").val() | ||
177 | + }); | ||
178 | + } | ||
179 | + | ||
180 | + g.reload(); | ||
181 | + e1.init(); | ||
182 | + } | ||
172 | }); | 183 | }); |
173 | var a = new common.edit("#upload-wrapper"); | 184 | var a = new common.edit("#upload-wrapper"); |
174 | a.on("callback", function(obj) { | 185 | a.on("callback", function(obj) { |
@@ -233,165 +244,4 @@ $('body').on('click', ".delete", function() { | @@ -233,165 +244,4 @@ $('body').on('click', ".delete", function() { | ||
233 | $('body').on('click', ".edit", function() { | 244 | $('body').on('click', ".edit", function() { |
234 | var item = g.rows[$(this).data("index")]; | 245 | var item = g.rows[$(this).data("index")]; |
235 | Bll[item.attachType == 3 ? "wenZi" : "imgVideo"]("修改" + ENMA.attachType[item.attachType], item, $(this).data("index")); | 246 | Bll[item.attachType == 3 ? "wenZi" : "imgVideo"]("修改" + ENMA.attachType[item.attachType], item, $(this).data("index")); |
236 | -}); | ||
237 | - | ||
238 | - | ||
239 | -// //添加图片 | ||
240 | -// $('body').on('click', '#picDialog', function() { | ||
241 | - | ||
242 | -// common.dialog.confirm("添加图片",common.util.__template($("#picDialogTemp").html(),{name:"图片", fileId: "imgUpload"}),function(){ | ||
243 | - | ||
244 | -// var imgStr = '<img src="' + $('#imgUpload').attr('value') + '">'; | ||
245 | -// var $oImg = $('<div class="quota-content quota-img" data-type="1">' + imgStr + '<a href="javascript:;" class="editor-delete btn btn-default">删除</a></div>'); | ||
246 | - | ||
247 | -// $oImg.appendTo($editor); | ||
248 | -// }); | ||
249 | -// var a = new common.edit("#upload-wrapper"); | ||
250 | -// a.init(); | ||
251 | - | ||
252 | -// return false; | ||
253 | -// }); | ||
254 | - | ||
255 | -// //添加视频 | ||
256 | -// $('body').on('click', '#videoDialog', function() { | ||
257 | -// common.dialog.confirm("添加视频",common.util.__template($("#picDialogTemp").html(),{name:"视频"}),function(){ | ||
258 | - | ||
259 | -// /*var imgStr = '<img src="http://img11.static.yhbimg.com/goodsimg/2015/07/07/08/01315b5bbfd72bc5b59fa2fda6c28b9ae6.jpg">'; | ||
260 | -// var $oVideo = $('<div class="quota-imf"><img src="' + imgStr + '" alt="" /></div>'); | ||
261 | - | ||
262 | -// $('.quota-video').html(imgStr);*/ | ||
263 | -// }); | ||
264 | -// var a = new common.edit("#upload-wrapper"); | ||
265 | -// a.init(); | ||
266 | -// return false; | ||
267 | - | ||
268 | -// }); | ||
269 | - | ||
270 | - | ||
271 | -// // 表单验证 | ||
272 | -// var limitAddForm = new common.edit("#limit-add-form"); | ||
273 | -// limitAddForm.init(); | ||
274 | - | ||
275 | -// limitAddForm.on("validate", function(){ | ||
276 | -// var param = { | ||
277 | -// batchNo: $('#batchNo').val() | ||
278 | -// } | ||
279 | -// if (type == 'update') { | ||
280 | -// param.id = $('#batchNo').data('id'); | ||
281 | -// } | ||
282 | -// /*common.util.__ajax2({ | ||
283 | - | ||
284 | -// });*/ | ||
285 | - | ||
286 | - | ||
287 | -// }); | ||
288 | - | ||
289 | -// //表单提交 | ||
290 | -// $('.limit-add-btn').click(function () { | ||
291 | -// var $this = $(this); | ||
292 | -// var param = { | ||
293 | -// batchNo: $('#batchNo').val() | ||
294 | -// } | ||
295 | -// if (type == 'update') { | ||
296 | -// param.id = $('#batchNo').data('id'); | ||
297 | -// } | ||
298 | - | ||
299 | -// common.util.__ajax2({ | ||
300 | -// url:'/limit/checkBatch', | ||
301 | -// data: param | ||
302 | -// }, function(res) { | ||
303 | -// if (res.code == 200) { | ||
304 | -// limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) { | ||
305 | -// option.beforeSend = function () { | ||
306 | -// $this.attr('disabled', 'disabled'); | ||
307 | -// var param = { | ||
308 | -// batchNo: $('#batchNo').val() | ||
309 | -// } | ||
310 | -// if (type == 'update') { | ||
311 | -// param.id = $('#batchNo').data('id'); | ||
312 | -// } | ||
313 | - | ||
314 | -// }; | ||
315 | - | ||
316 | -// option.success=function(res){ | ||
317 | -// if (res.data.code == 200) { | ||
318 | -// //成功返回列表页 | ||
319 | -// limitAddForm.$tip('提交成功',function(){ | ||
320 | -// //window.location.href = '/limit/product/index'; | ||
321 | -// }, 'growl-success'); | ||
322 | -// $this.removeAttr('disabled'); | ||
323 | -// } else { | ||
324 | -// limitAddForm.$tip(res.data.message); | ||
325 | -// $this.removeAttr('disabled'); | ||
326 | -// } | ||
327 | -// return false; | ||
328 | -// }; | ||
329 | - | ||
330 | -// option.error=function(res){ | ||
331 | -// limitAddForm.$tip(res.message); | ||
332 | -// $this.removeAttr('disabled'); | ||
333 | -// }; | ||
334 | - | ||
335 | -// //文字,图片,视频上传数据 | ||
336 | -// option.data.attachmentContent = []; | ||
337 | -// option.data.attachmentContent.push({ | ||
338 | -// attachUrl:option.data.coverImg, | ||
339 | -// isDefault: 1, | ||
340 | -// attachType: 1, | ||
341 | -// orderBy: 0 | ||
342 | -// }); | ||
343 | -// if ($('.quota-content').size() > 0) { | ||
344 | -// $('.quota-content').each(function(i) { | ||
345 | -// var editType = $(this).data('type'), | ||
346 | -// content = '', | ||
347 | -// obj = { | ||
348 | -// attachType: editType, //上传内容类型,1:图片, 2:视频,3:文字 | ||
349 | -// isDefault: 0, //是否封面图 | ||
350 | -// orderBy: i //排序 | ||
351 | -// }; | ||
352 | - | ||
353 | -// if (editType == 3) { | ||
354 | -// content = $(this).find('span').text(); | ||
355 | -// obj.intro = content; //文字key为intro | ||
356 | -// } else if (editType == 1) { | ||
357 | -// content = $(this).find('img').attr('src'); | ||
358 | -// obj.attachUrl = content; //图片key为attachUrl | ||
359 | -// } | ||
360 | -// option.data.attachmentContent.push(obj) | ||
361 | -// }); | ||
362 | -// } | ||
363 | - | ||
364 | -// //因为只能传字符串,转换为字符串 | ||
365 | -// option.data.attachmentContent = JSON.stringify(option.data.attachmentContent); | ||
366 | - | ||
367 | -// //时间上传为时间戳 | ||
368 | -// option.data.saleTime = new Date(option.data.saleTime.replace('-',',')).getTime() / 1000; | ||
369 | -// console.log(option.data); | ||
370 | - | ||
371 | -// }); | ||
372 | -// } | ||
373 | -// }); | ||
374 | - | ||
375 | - | ||
376 | -// }); | ||
377 | - | ||
378 | -// //编辑页,时间戳转换 | ||
379 | -// $('#saleTime').val(function() { | ||
380 | -// if ($(this).data('time')) { | ||
381 | -// var date = new Date($(this).data('time') * 1000); | ||
382 | -// return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); | ||
383 | -// } | ||
384 | -// }); | ||
385 | - | ||
386 | -// //富文本删除事件 | ||
387 | -// $('#limit-add-form').on('click', '.editor-delete', function() { | ||
388 | -// $(this).parents('.quota-content').remove(); | ||
389 | -// }); | ||
390 | - | ||
391 | -// $('input[name="hotFlag"]').on('click', function() { | ||
392 | -// if ($(this).val() == 0) { | ||
393 | -// $('#orderBy').attr('disabled', true); | ||
394 | -// } else { | ||
395 | -// $('#orderBy').removeAttr('disabled'); | ||
396 | -// } | ||
397 | -// }); | ||
247 | +}); |
@@ -2,213 +2,188 @@ exports.domain = require('../config/common.js').domain; | @@ -2,213 +2,188 @@ exports.domain = require('../config/common.js').domain; | ||
2 | //exports.domain = 'http://172.16.6.240:8088/platform'; | 2 | //exports.domain = 'http://172.16.6.240:8088/platform'; |
3 | 3 | ||
4 | //路由配置 | 4 | //路由配置 |
5 | -exports.res = [ | ||
6 | - { | ||
7 | - //【限购商品】页面渲染 | ||
8 | - route: '/limit/product/index', | ||
9 | - method: 'GET', | ||
10 | - view: 'pages/limit/index', | ||
11 | - src: '/product/limit' | ||
12 | - }, { | ||
13 | - // 【限购商品】ajax分页 | ||
14 | - route: '/limit/product/page', | ||
15 | - method: 'POST', | ||
16 | - url: '/limitProduct/getLimitProductList', | ||
17 | - params: [ | ||
18 | - { | ||
19 | - name: 'hotFlag', | ||
20 | - type: 'Number' | ||
21 | - },{ | ||
22 | - name: 'saleFlag', | ||
23 | - type: 'Number' | ||
24 | - },{ | ||
25 | - name: 'showFlag', | ||
26 | - type: 'Number' | ||
27 | - },{ | ||
28 | - name: 'productName', | ||
29 | - type: 'String' | ||
30 | - },{ | ||
31 | - name: 'productSkn', | ||
32 | - type: 'String' | ||
33 | - },{ | ||
34 | - name: 'page', | ||
35 | - type: 'Number' | ||
36 | - },{ | ||
37 | - name: 'size', | ||
38 | - type: 'Number' | ||
39 | - } | ||
40 | - | ||
41 | - ] | ||
42 | - },{ | ||
43 | - // 【限购商品】添加页面渲染 | ||
44 | - route: '/limit/product/add', | ||
45 | - method: 'GET', | ||
46 | - view: 'pages/limit/add', | ||
47 | - src: '/product/limit-add', | ||
48 | - data: { | ||
49 | - data: {}, | ||
50 | - action: '/limit/product/add' | 5 | +exports.res = [{ |
6 | + //【限购商品】页面渲染 | ||
7 | + route: '/limit/product/index', | ||
8 | + method: 'GET', | ||
9 | + view: 'pages/limit/index', | ||
10 | + src: '/product/limit' | ||
11 | +}, { | ||
12 | + // 【限购商品】ajax分页 | ||
13 | + route: '/limit/product/page', | ||
14 | + method: 'POST', | ||
15 | + url: '/limitProduct/getLimitProductList', | ||
16 | + params: [{ | ||
17 | + name: 'hotFlag', | ||
18 | + type: 'Number' | ||
19 | + }, { | ||
20 | + name: 'saleFlag', | ||
21 | + type: 'Number' | ||
22 | + }, { | ||
23 | + name: 'showFlag', | ||
24 | + type: 'Number' | ||
25 | + }, { | ||
26 | + name: 'productName', | ||
27 | + type: 'String' | ||
28 | + }, { | ||
29 | + name: 'productSkn', | ||
30 | + type: 'String' | ||
31 | + }, { | ||
32 | + name: 'page', | ||
33 | + type: 'Number' | ||
34 | + }, { | ||
35 | + name: 'size', | ||
36 | + type: 'Number' | ||
51 | } | 37 | } |
52 | - },{ | ||
53 | - // 【限购商品】ajax添加 | ||
54 | - route: '/limit/product/add', | ||
55 | - method: 'POST', | ||
56 | - url: '/limitProduct/addLimitProduct', | ||
57 | - params: [ | ||
58 | - { | ||
59 | - name: 'productName', | ||
60 | - type: 'String' | ||
61 | - }, | ||
62 | - { | ||
63 | - name: 'attachmentContent', | ||
64 | - type: 'String' | ||
65 | - }, | ||
66 | - { | ||
67 | - name: 'batchNo', | ||
68 | - type: 'Number' | ||
69 | - },{ | ||
70 | - name: 'saleTime', | ||
71 | - type: 'String' | ||
72 | - },{ | ||
73 | - name: 'hotFlag', | ||
74 | - type: 'Number' | ||
75 | - },{ | ||
76 | - name:'orderBy', | ||
77 | - type: 'Number' | ||
78 | - },{ | ||
79 | - name: 'notSaleOrderBy', | ||
80 | - type: 'Number' | ||
81 | - },{ | ||
82 | - name:'limitProductType', | ||
83 | - type:'Number' | ||
84 | - }, | ||
85 | - { | ||
86 | - name:'activityId', | ||
87 | - type:'Number' | ||
88 | - } | ||
89 | - ] | ||
90 | - | ||
91 | - }, { | ||
92 | - route: '/limit/edit/:id', | ||
93 | - method: 'GET', | ||
94 | - view: 'pages/limit/add', | ||
95 | - url: '/limitProduct/getLimitProduct', | ||
96 | - data:{ | ||
97 | - action:"/limit/update", | ||
98 | - type:"update" | ||
99 | - }, | ||
100 | - src:'/product/limit-add', | ||
101 | - params:[ | ||
102 | - {name:"id",type:"String"} | ||
103 | - ] | ||
104 | - }, { | ||
105 | - route: '/limit/update', | ||
106 | - method: 'POST', | ||
107 | - url: '/limitProduct/updateLimitProduct', | ||
108 | - params: [ | ||
109 | - { | ||
110 | - name: 'id', | ||
111 | - type: 'Number' | ||
112 | - }, | ||
113 | - { | ||
114 | - name: 'productName', | ||
115 | - type: 'String' | ||
116 | - }, | ||
117 | - { | ||
118 | - name: 'attachmentContent', | ||
119 | - type: 'String' | ||
120 | - }, | ||
121 | - { | ||
122 | - name: 'batchNo', | ||
123 | - type: 'Number' | ||
124 | - },{ | ||
125 | - name: 'saleTime', | ||
126 | - type: 'String' | ||
127 | - },{ | ||
128 | - name: 'hotFlag', | ||
129 | - type: 'Number' | ||
130 | - },{ | ||
131 | - name:'orderBy', | ||
132 | - type: 'Number' | ||
133 | - },{ | ||
134 | - name: 'notSaleOrderBy', | ||
135 | - type: 'Number' | ||
136 | - }, { | ||
137 | - name: 'dayFlag', | ||
138 | - type: 'Number' | ||
139 | - } | ||
140 | - ] | ||
141 | - }, { | ||
142 | - route: '/limit/ajax/getCodeCount', | ||
143 | - method: 'POST', | ||
144 | - url: '/limitProduct/getCountByStatus', | ||
145 | - params: [ | ||
146 | - { | ||
147 | - name: 'hotFlag', | ||
148 | - type: 'Number' | ||
149 | - },{ | ||
150 | - name: 'saleFlag', | ||
151 | - type: 'Number' | ||
152 | - },{ | ||
153 | - name: 'showFlag', | ||
154 | - type: 'Number' | ||
155 | - },{ | ||
156 | - name: 'productName', | ||
157 | - type: 'String' | ||
158 | - },{ | ||
159 | - name: 'productSkn', | ||
160 | - type: 'String' | ||
161 | - } | ||
162 | - ] | ||
163 | - }, { | ||
164 | - route: '/limit/audit', | ||
165 | - method: 'POST', | ||
166 | - url: '/limitProduct/auditLimitProduct', | ||
167 | - params: [ | ||
168 | - { | ||
169 | - name: 'id', | ||
170 | - type: 'Number' | ||
171 | - }, | ||
172 | - { | ||
173 | - name: 'showFlag', | ||
174 | - type: 'Number' | ||
175 | - }, | ||
176 | - { | ||
177 | - name: 'hotFlag', | ||
178 | - type: 'Number' | ||
179 | - }, | ||
180 | - { | ||
181 | - name: 'orderBy', | ||
182 | - type: 'Number' | ||
183 | - }, | ||
184 | - { | ||
185 | - name: 'notSaleOrderBy', | ||
186 | - type: 'Number' | ||
187 | - } | ||
188 | - ] | ||
189 | - }, { | ||
190 | - route: '/limit/delete', | ||
191 | - method: 'POST', | ||
192 | - url: '/limitProduct/deleteLimitProduct', | ||
193 | - params: [ | ||
194 | - { | ||
195 | - name: 'id', | ||
196 | - type: 'Number' | ||
197 | - } | ||
198 | - ] | ||
199 | - }, { | ||
200 | - route: '/limit/checkBatch', | ||
201 | - method: 'POST', | ||
202 | - url: '/limitProduct/checkBatchNoExist', | ||
203 | - params: [ | ||
204 | - { | ||
205 | - name: 'batchNo', | ||
206 | - type: 'Number' | ||
207 | - }, | ||
208 | - { | ||
209 | - name: 'id', | ||
210 | - type: 'Number' | ||
211 | - } | ||
212 | - ] | 38 | + |
39 | + ] | ||
40 | +}, { | ||
41 | + // 【限购商品】添加页面渲染 | ||
42 | + route: '/limit/product/add', | ||
43 | + method: 'GET', | ||
44 | + view: 'pages/limit/add', | ||
45 | + src: '/product/limit-add', | ||
46 | + data: { | ||
47 | + data: {}, | ||
48 | + action: '/limit/product/add' | ||
213 | } | 49 | } |
214 | -]; | 50 | +}, { |
51 | + // 【限购商品】ajax添加 | ||
52 | + route: '/limit/product/add', | ||
53 | + method: 'POST', | ||
54 | + url: '/limitProduct/addLimitProduct', | ||
55 | + params: [{ | ||
56 | + name: 'productName', | ||
57 | + type: 'String' | ||
58 | + }, { | ||
59 | + name: 'attachmentContent', | ||
60 | + type: 'String' | ||
61 | + }, { | ||
62 | + name: 'batchNo', | ||
63 | + type: 'Number' | ||
64 | + }, { | ||
65 | + name: 'saleTime', | ||
66 | + type: 'String' | ||
67 | + }, { | ||
68 | + name: 'hotFlag', | ||
69 | + type: 'Number' | ||
70 | + }, { | ||
71 | + name: 'orderBy', | ||
72 | + type: 'Number' | ||
73 | + }, { | ||
74 | + name: 'notSaleOrderBy', | ||
75 | + type: 'Number' | ||
76 | + }, { | ||
77 | + name: 'limitProductType', | ||
78 | + type: 'Number' | ||
79 | + }, { | ||
80 | + name: 'activityId', | ||
81 | + type: 'Number' | ||
82 | + }] | ||
83 | + | ||
84 | +}, { | ||
85 | + route: '/limit/edit/:id', | ||
86 | + method: 'GET', | ||
87 | + view: 'pages/limit/add', | ||
88 | + url: '/limitProduct/getLimitProduct', | ||
89 | + data: { | ||
90 | + action: "/limit/update", | ||
91 | + type: "update" | ||
92 | + }, | ||
93 | + src: '/product/limit-add', | ||
94 | + params: [{ | ||
95 | + name: "id", | ||
96 | + type: "String" | ||
97 | + }] | ||
98 | +}, { | ||
99 | + route: '/limit/update', | ||
100 | + method: 'POST', | ||
101 | + url: '/limitProduct/updateLimitProduct', | ||
102 | + params: [{ | ||
103 | + name: 'id', | ||
104 | + type: 'Number' | ||
105 | + }, { | ||
106 | + name: 'productName', | ||
107 | + type: 'String' | ||
108 | + }, { | ||
109 | + name: 'attachmentContent', | ||
110 | + type: 'String' | ||
111 | + }, { | ||
112 | + name: 'batchNo', | ||
113 | + type: 'Number' | ||
114 | + }, { | ||
115 | + name: 'saleTime', | ||
116 | + type: 'String' | ||
117 | + }, { | ||
118 | + name: 'hotFlag', | ||
119 | + type: 'Number' | ||
120 | + }, { | ||
121 | + name: 'orderBy', | ||
122 | + type: 'Number' | ||
123 | + }, { | ||
124 | + name: 'notSaleOrderBy', | ||
125 | + type: 'Number' | ||
126 | + }, { | ||
127 | + name: 'dayFlag', | ||
128 | + type: 'Number' | ||
129 | + }] | ||
130 | +}, { | ||
131 | + route: '/limit/ajax/getCodeCount', | ||
132 | + method: 'POST', | ||
133 | + url: '/limitProduct/getCountByStatus', | ||
134 | + params: [{ | ||
135 | + name: 'hotFlag', | ||
136 | + type: 'Number' | ||
137 | + }, { | ||
138 | + name: 'saleFlag', | ||
139 | + type: 'Number' | ||
140 | + }, { | ||
141 | + name: 'showFlag', | ||
142 | + type: 'Number' | ||
143 | + }, { | ||
144 | + name: 'productName', | ||
145 | + type: 'String' | ||
146 | + }, { | ||
147 | + name: 'productSkn', | ||
148 | + type: 'String' | ||
149 | + }] | ||
150 | +}, { | ||
151 | + route: '/limit/audit', | ||
152 | + method: 'POST', | ||
153 | + url: '/limitProduct/auditLimitProduct', | ||
154 | + params: [{ | ||
155 | + name: 'id', | ||
156 | + type: 'Number' | ||
157 | + }, { | ||
158 | + name: 'showFlag', | ||
159 | + type: 'Number' | ||
160 | + }, { | ||
161 | + name: 'hotFlag', | ||
162 | + type: 'Number' | ||
163 | + }, { | ||
164 | + name: 'orderBy', | ||
165 | + type: 'Number' | ||
166 | + }, { | ||
167 | + name: 'notSaleOrderBy', | ||
168 | + type: 'Number' | ||
169 | + }] | ||
170 | +}, { | ||
171 | + route: '/limit/delete', | ||
172 | + method: 'POST', | ||
173 | + url: '/limitProduct/deleteLimitProduct', | ||
174 | + params: [{ | ||
175 | + name: 'id', | ||
176 | + type: 'Number' | ||
177 | + }] | ||
178 | +}, { | ||
179 | + route: '/limit/checkBatch', | ||
180 | + method: 'POST', | ||
181 | + url: '/limitProduct/checkBatchNoExist', | ||
182 | + params: [{ | ||
183 | + name: 'batchNo', | ||
184 | + type: 'Number' | ||
185 | + }, { | ||
186 | + name: 'id', | ||
187 | + type: 'Number' | ||
188 | + }] | ||
189 | +}]; |
1 | var request = require('request'); | 1 | var request = require('request'); |
2 | var fs = require('fs'); | 2 | var fs = require('fs'); |
3 | -var domain = require('../../config/common.js').domain; | 3 | +//var domain = require('../../config/common.js').domain; |
4 | //var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力 | 4 | //var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力 |
5 | -//var domain = 'http://192.168.102.202:8088/platform'; | 5 | +var domain = 'http://192.168.102.202:8088/platform'; |
6 | 6 | ||
7 | var env = process.env.NODE_ENV || 'development'; | 7 | var env = process.env.NODE_ENV || 'development'; |
8 | 8 | ||
@@ -14,8 +14,8 @@ exports.uploadFile = function(req, res) { | @@ -14,8 +14,8 @@ exports.uploadFile = function(req, res) { | ||
14 | url: domain + '/batch/import', | 14 | url: domain + '/batch/import', |
15 | formData: req.body | 15 | formData: req.body |
16 | }, function optionalCallback(err, httpResponse, body) { | 16 | }, function optionalCallback(err, httpResponse, body) { |
17 | - var json=JSON.parse(body); | ||
18 | - json.status=true; | 17 | + var json = JSON.parse(body); |
18 | + json.status = true; | ||
19 | res.json(json); | 19 | res.json(json); |
20 | }); | 20 | }); |
21 | } else { | 21 | } else { |
@@ -23,8 +23,8 @@ exports.uploadFile = function(req, res) { | @@ -23,8 +23,8 @@ exports.uploadFile = function(req, res) { | ||
23 | url: domain + '/fileupload/upload', | 23 | url: domain + '/fileupload/upload', |
24 | formData: req.body | 24 | formData: req.body |
25 | }, function optionalCallback(err, httpResponse, body) { | 25 | }, function optionalCallback(err, httpResponse, body) { |
26 | - var json=JSON.parse(body); | ||
27 | - json.status=true; | 26 | + var json = JSON.parse(body); |
27 | + json.status = true; | ||
28 | res.json(json); | 28 | res.json(json); |
29 | }); | 29 | }); |
30 | } | 30 | } |
@@ -34,4 +34,4 @@ exports.uploadFile = function(req, res) { | @@ -34,4 +34,4 @@ exports.uploadFile = function(req, res) { | ||
34 | message: "请求类型错误" | 34 | message: "请求类型错误" |
35 | }); | 35 | }); |
36 | } | 36 | } |
37 | -} | 37 | +} |
-
Please register or login to post a comment