Merge branch 'release/1.6' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into release/1.6
Showing
5 changed files
with
13 additions
and
11 deletions
@@ -95,6 +95,7 @@ var util = { | @@ -95,6 +95,7 @@ var util = { | ||
95 | return result; | 95 | return result; |
96 | }, | 96 | }, |
97 | __template2: function(str, source) { | 97 | __template2: function(str, source) { |
98 | + // console.log(str); | ||
98 | var script = []; | 99 | var script = []; |
99 | script.push('var each=function(obj,fn){'); | 100 | script.push('var each=function(obj,fn){'); |
100 | script.push(' var that=this;'); | 101 | script.push(' var that=this;'); |
@@ -136,7 +137,7 @@ var util = { | @@ -136,7 +137,7 @@ var util = { | ||
136 | } else if (/^else$/.test(trim)) { | 137 | } else if (/^else$/.test(trim)) { |
137 | return trim.replace(/else/, '}else{'); | 138 | return trim.replace(/else/, '}else{'); |
138 | } else{ | 139 | } else{ |
139 | - return code; | 140 | + return "result.push("+code+")"; |
140 | } | 141 | } |
141 | } | 142 | } |
142 | // var PARAMS={}; | 143 | // var PARAMS={}; |
@@ -198,10 +199,11 @@ var util = { | @@ -198,10 +199,11 @@ var util = { | ||
198 | 199 | ||
199 | 200 | ||
200 | var result=header + code.join('\n')+"return result.join('');"; | 201 | var result=header + code.join('\n')+"return result.join('');"; |
201 | - // console.log(result); | 202 | + |
203 | + console.log(result); | ||
202 | 204 | ||
203 | var fn = new Function(script.join('')+result); | 205 | var fn = new Function(script.join('')+result); |
204 | - return fn.call(null,source); | 206 | + return fn.call(source); |
205 | }, | 207 | }, |
206 | __input: function(id) { | 208 | __input: function(id) { |
207 | return !!~$.trim($('#' + id).val()) ? $('#' + id).val() : "" | 209 | return !!~$.trim($('#' + id).val()) ? $('#' + id).val() : "" |
@@ -120,9 +120,8 @@ $(document).on("click", "#saveAllInfo", function() { | @@ -120,9 +120,8 @@ $(document).on("click", "#saveAllInfo", function() { | ||
120 | res = res.data; | 120 | res = res.data; |
121 | if (res.code == '200') { | 121 | if (res.code == '200') { |
122 | e.$tip(res.message, function() { | 122 | e.$tip(res.message, function() { |
123 | - //history.go(-1); | 123 | + history.go(-1); |
124 | }, 'growl-success'); | 124 | }, 'growl-success'); |
125 | - | ||
126 | } else { | 125 | } else { |
127 | e.$tip(res.message); | 126 | e.$tip(res.message); |
128 | } | 127 | } |
@@ -273,7 +273,7 @@ common.edit.ajaxfileupload(".fenmianfile", { | @@ -273,7 +273,7 @@ common.edit.ajaxfileupload(".fenmianfile", { | ||
273 | goodsList[$(this).data("index")].goodsImagesList = item; | 273 | goodsList[$(this).data("index")].goodsImagesList = item; |
274 | $(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data)); | 274 | $(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data)); |
275 | } else { | 275 | } else { |
276 | - common.util.__tip(response.message); | 276 | + common.util.__tip(response.message, 'warning'); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | }); | 279 | }); |
@@ -55,7 +55,6 @@ e.on("validate", function() { | @@ -55,7 +55,6 @@ e.on("validate", function() { | ||
55 | if (+num > 100000 || +num < 1) { | 55 | if (+num > 100000 || +num < 1) { |
56 | return "数量(范围:1-100000)"; | 56 | return "数量(范围:1-100000)"; |
57 | } | 57 | } |
58 | - | ||
59 | return true; | 58 | return true; |
60 | }); | 59 | }); |
61 | e.on("validate", function() { | 60 | e.on("validate", function() { |
@@ -63,7 +62,6 @@ e.on("validate", function() { | @@ -63,7 +62,6 @@ e.on("validate", function() { | ||
63 | if (skn.length > 8) { | 62 | if (skn.length > 8) { |
64 | return "skn长度不能超过8位"; | 63 | return "skn长度不能超过8位"; |
65 | } | 64 | } |
66 | - | ||
67 | return true; | 65 | return true; |
68 | }); | 66 | }); |
69 | 67 | ||
@@ -79,7 +77,9 @@ e.on("validate", function() { | @@ -79,7 +77,9 @@ e.on("validate", function() { | ||
79 | e.init(); | 77 | e.init(); |
80 | 78 | ||
81 | var submit = function(callback) { | 79 | var submit = function(callback) { |
80 | + | ||
82 | e.submit($("#basicForm").attr("action"), function(option) { | 81 | e.submit($("#basicForm").attr("action"), function(option) { |
82 | + $("#save_brand").addClass('disabled'); | ||
83 | option.success = function(res) { | 83 | option.success = function(res) { |
84 | res = res.data; | 84 | res = res.data; |
85 | if (res.code == "200") { | 85 | if (res.code == "200") { |
@@ -88,8 +88,9 @@ var submit = function(callback) { | @@ -88,8 +88,9 @@ var submit = function(callback) { | ||
88 | }, 'growl-success'); | 88 | }, 'growl-success'); |
89 | } else { | 89 | } else { |
90 | e.$tip(res.message); | 90 | e.$tip(res.message); |
91 | - }; | ||
92 | $("#save_brand").removeClass('disabled'); | 91 | $("#save_brand").removeClass('disabled'); |
92 | + }; | ||
93 | + | ||
93 | return false; | 94 | return false; |
94 | }; | 95 | }; |
95 | option.error = function(res) { | 96 | option.error = function(res) { |
@@ -103,7 +104,7 @@ var submit = function(callback) { | @@ -103,7 +104,7 @@ var submit = function(callback) { | ||
103 | 104 | ||
104 | 105 | ||
105 | $("#save_brand").click(function() { | 106 | $("#save_brand").click(function() { |
106 | - $(this).addClass('disabled'); | 107 | + |
107 | submit(function(data) { | 108 | submit(function(data) { |
108 | // 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废 | 109 | // 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废 |
109 | if (+data.status == 1) { | 110 | if (+data.status == 1) { |
@@ -16,7 +16,7 @@ var config = { | @@ -16,7 +16,7 @@ var config = { | ||
16 | // domain: 'http://172.16.6.240:8088/platform', | 16 | // domain: 'http://172.16.6.240:8088/platform', |
17 | // domain:'http://172.16.6.240:8088/platform',//王书生 | 17 | // domain:'http://172.16.6.240:8088/platform',//王书生 |
18 | // domain: 'http://172.16.6.252:9080',//陈超 | 18 | // domain: 'http://172.16.6.252:9080',//陈超 |
19 | - //domain:'http://172.16.6.227:8088/platform',//玛丽 | 19 | + //domain: 'http://172.16.6.227:8088/platform', //玛丽 |
20 | // domain: 'http://192.168.102.202:8088/platform', | 20 | // domain: 'http://192.168.102.202:8088/platform', |
21 | // domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超 | 21 | // domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超 |
22 | domain: 'http://192.168.102.202:8088/platform', | 22 | domain: 'http://192.168.102.202:8088/platform', |
-
Please register or login to post a comment