Showing
6 changed files
with
33 additions
and
22 deletions
@@ -180,7 +180,9 @@ grid.prototype={ | @@ -180,7 +180,9 @@ grid.prototype={ | ||
180 | //发送请求 | 180 | //发送请求 |
181 | }, | 181 | }, |
182 | success: function (res) { | 182 | success: function (res) { |
183 | + console.log(res); | ||
183 | var data = res.data.data; | 184 | var data = res.data.data; |
185 | + p.callback && (data = p.callback(res.data));//data.data,data.data1 | ||
184 | 186 | ||
185 | g.__pagination({total:data.totalPage,page:data.page}); | 187 | g.__pagination({total:data.totalPage,page:data.page}); |
186 | g.__bodyClomun(data.list); | 188 | g.__bodyClomun(data.list); |
@@ -98,7 +98,6 @@ var edit=require('../common/edit'); | @@ -98,7 +98,6 @@ var edit=require('../common/edit'); | ||
98 | }, | 98 | }, |
99 | dataType: 'json' | 99 | dataType: 'json' |
100 | }).then(function(data) { | 100 | }).then(function(data) { |
101 | - console.log(data); | ||
102 | data = data.data; | 101 | data = data.data; |
103 | if (data.code == "200") { | 102 | if (data.code == "200") { |
104 | var badcode = []; | 103 | var badcode = []; |
@@ -142,6 +141,7 @@ var edit=require('../common/edit'); | @@ -142,6 +141,7 @@ var edit=require('../common/edit'); | ||
142 | option.error=function(res){ | 141 | option.error=function(res){ |
143 | e.$tip("提交失败"); | 142 | e.$tip("提交失败"); |
144 | } | 143 | } |
144 | + console.log(option.data); | ||
145 | callback&&callback(option.data); | 145 | callback&&callback(option.data); |
146 | }); | 146 | }); |
147 | }; | 147 | }; |
@@ -25,6 +25,17 @@ e.on("bind",function(){ | @@ -25,6 +25,17 @@ e.on("bind",function(){ | ||
25 | }); | 25 | }); |
26 | 26 | ||
27 | e.init(); | 27 | e.init(); |
28 | + | ||
29 | + | ||
30 | +e.on("validate",function(){ | ||
31 | + var title=$.trim($("#title").val()); | ||
32 | + if(/[~#^$@%&!*]/gi.test(title)) { | ||
33 | + return "名称不能包含特殊字符"; | ||
34 | + } | ||
35 | + | ||
36 | + return true; | ||
37 | +}); | ||
38 | + | ||
28 | //提交 | 39 | //提交 |
29 | var submit=function(callback){ | 40 | var submit=function(callback){ |
30 | e.submit($("#basicForm").attr("action"),function(option){ | 41 | e.submit($("#basicForm").attr("action"),function(option){ |
@@ -43,9 +54,8 @@ var submit=function(callback){ | @@ -43,9 +54,8 @@ var submit=function(callback){ | ||
43 | e.$tip("提交失败"); | 54 | e.$tip("提交失败"); |
44 | } | 55 | } |
45 | 56 | ||
46 | - | ||
47 | - option.data.startTime = new Date(option.data.startTime.replace('-',',')).getTime() / 1000; | ||
48 | - option.data.endTime = new Date(option.data.endTime.replace('-',',')).getTime() / 1000; | 57 | + option.data.startTime = new Date(option.data.startTime.replace(/-/g,'/')).getTime() / 1000; |
58 | + option.data.endTime = new Date(option.data.endTime.replace(/-/g,'/')).getTime() / 1000; | ||
49 | console.log(option.data); | 59 | console.log(option.data); |
50 | callback&&callback(option.data); | 60 | callback&&callback(option.data); |
51 | }); | 61 | }); |
@@ -6,7 +6,8 @@ var g = new common.grid({ | @@ -6,7 +6,8 @@ var g = new common.grid({ | ||
6 | el: '#basicTable', | 6 | el: '#basicTable', |
7 | parms: function(){ | 7 | parms: function(){ |
8 | return { | 8 | return { |
9 | - type: 1 | 9 | + type: 1, |
10 | + status: 1 | ||
10 | }; | 11 | }; |
11 | }, | 12 | }, |
12 | columns:[ | 13 | columns:[ |
@@ -39,9 +40,15 @@ var g = new common.grid({ | @@ -39,9 +40,15 @@ var g = new common.grid({ | ||
39 | } | 40 | } |
40 | 41 | ||
41 | }} | 42 | }} |
42 | - ] | 43 | + ], |
44 | + callback: function(data) { | ||
45 | + if (data.activity.data.list.length > 0) { | ||
46 | + $('#add-btn').addClass('disabled'); | ||
47 | + } | ||
48 | + return data.vipList.data; | ||
49 | + } | ||
43 | }); | 50 | }); |
44 | -/*g.init($("#gridurl").val());*/ | 51 | +g.init($("#gridurl").val()); |
45 | 52 | ||
46 | $('#basicTable').on('click', '.end-btn', function() { | 53 | $('#basicTable').on('click', '.end-btn', function() { |
47 | var activeId = $(this).data('id'); | 54 | var activeId = $(this).data('id'); |
@@ -57,11 +64,3 @@ $('#basicTable').on('click', '.end-btn', function() { | @@ -57,11 +64,3 @@ $('#basicTable').on('click', '.end-btn', function() { | ||
57 | }); | 64 | }); |
58 | }); | 65 | }); |
59 | 66 | ||
60 | -common.util.__ajax({ | ||
61 | - url: $("#gridurl").val(), | ||
62 | - data:{ | ||
63 | - status: 1 | ||
64 | - } | ||
65 | -}, function(res){ | ||
66 | - console.log(res); | ||
67 | -}, true); |
@@ -4,8 +4,8 @@ exports.domain = require('../config/common.js').domain; | @@ -4,8 +4,8 @@ exports.domain = require('../config/common.js').domain; | ||
4 | 4 | ||
5 | //营销管理路由配置 | 5 | //营销管理路由配置 |
6 | exports.res = [ | 6 | exports.res = [ |
7 | -{route: '/-p-l-a-t-f-o-r-m/3',method:"GET"}//此模块上线将此删除 | ||
8 | - /*{ | 7 | +//{route: '/-p-l-a-t-f-o-r-m/3',method:"GET"}//此模块上线将此删除 |
8 | + { | ||
9 | //营销码管理 -> 页面渲染 | 9 | //营销码管理 -> 页面渲染 |
10 | route: '/market/coupon/index', | 10 | route: '/market/coupon/index', |
11 | method: 'GET', | 11 | method: 'GET', |
@@ -393,7 +393,7 @@ exports.res = [ | @@ -393,7 +393,7 @@ exports.res = [ | ||
393 | method: 'POST', | 393 | method: 'POST', |
394 | //url: '/activity/queryActivityList', | 394 | //url: '/activity/queryActivityList', |
395 | apis: { | 395 | apis: { |
396 | - data: { | 396 | + vipList: { |
397 | url:'/activity/queryActivityList', | 397 | url:'/activity/queryActivityList', |
398 | params: [ | 398 | params: [ |
399 | { | 399 | { |
@@ -411,10 +411,10 @@ exports.res = [ | @@ -411,10 +411,10 @@ exports.res = [ | ||
411 | ], | 411 | ], |
412 | isJsonRaw: true | 412 | isJsonRaw: true |
413 | }, | 413 | }, |
414 | - data2: { | 414 | + activity: { |
415 | url: '/activity/queryActivityList', | 415 | url: '/activity/queryActivityList', |
416 | params:[ | 416 | params:[ |
417 | - {name: 'status', type: 'Number'} | 417 | + {name: 'status', type: 'Number',def: 0} |
418 | ], | 418 | ], |
419 | isJsonRaw: true | 419 | isJsonRaw: true |
420 | } | 420 | } |
@@ -467,5 +467,5 @@ exports.res = [ | @@ -467,5 +467,5 @@ exports.res = [ | ||
467 | type: 'Number' | 467 | type: 'Number' |
468 | } | 468 | } |
469 | ] | 469 | ] |
470 | - }*/ | 470 | + } |
471 | ] | 471 | ] |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <div class="form-group"> | 9 | <div class="form-group"> |
10 | <label for="title" class="col-sm-2 control-label">促销活动名称<i class="red">*</i></label> | 10 | <label for="title" class="col-sm-2 control-label">促销活动名称<i class="red">*</i></label> |
11 | <div class="col-sm-8"> | 11 | <div class="col-sm-8"> |
12 | - <input type="text" id="title" placeholder="促销活动名称,支持中英文、数字,建议20个字以内" class="form-control" required maxlength="15" value="{{name}}"> | 12 | + <input type="text" id="title" placeholder="促销活动名称,支持中英文、数字,建议20个字以内" class="form-control" required maxlength="20" value="{{name}}"> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
15 | <div class="form-group"> | 15 | <div class="form-group"> |
-
Please register or login to post a comment