Authored by Li

违禁词

@@ -250,27 +250,51 @@ $('#saveBasicInfo').on('click', function() { @@ -250,27 +250,51 @@ $('#saveBasicInfo').on('click', function() {
250 return; 250 return;
251 } 251 }
252 252
253 - common.util.__ajax({  
254 - url:'/goods/product/saveNetSaleBaseInfo',  
255 - data:{  
256 - productSkn:basicInfo.productSkn,  
257 - productName:common.util.__input('productName'),  
258 - isNew:common.util.__input('[name=isNew]:checked'),  
259 - sellChannels:common.util.__input('[name=sellChannels]:checked'),  
260 - phrase:phraseValue,  
261 - outSaleTime:common.util.__input('outSaleTime'),  
262 - shopIds:common.util.__input('[name=shopIds]:checked'),  
263 - delayArrivalNotice:common.util.__input('delayArrivalNotice'),  
264 - grade:common.util.__input('grade')||0,  
265 - isLimited:common.util.__input('isLimited')||'N',  
266 - isOutlets:common.util.__input('isOutLets2')||'N',  
267 - seasons:common.util.__input('seasons')  
268 - }  
269 - })  
270 -  
271 - if (common.util.__sknOperateLog(basicInfo.productSkn, common.util.__input('phrase'), oldphrase, 6)) {  
272 - oldphrase = common.util.__input('phrase');  
273 - } 253 + var params = {
  254 + phrase: phraseValue
  255 + }
  256 + common.util.__ajax(
  257 + {
  258 + url:'/sensitiveWord/validate',
  259 + data: {
  260 + "validateContent": JSON.stringify(params)
  261 + }
  262 + },
  263 + function(rs) {
  264 + var tipText = "";
  265 + if (rs.data) {
  266 + var jsonMain = rs.data;
  267 + if(!$.isEmptyObject(jsonMain.phrase)){
  268 + tipText = "推荐短语包含违禁词:"+jsonMain.phrase+"!";
  269 + }
  270 + }
  271 + common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
  272 +
  273 + common.util.__ajax({
  274 + url:'/goods/product/saveNetSaleBaseInfo',
  275 + data:{
  276 + productSkn:basicInfo.productSkn,
  277 + productName:common.util.__input('productName'),
  278 + isNew:common.util.__input('[name=isNew]:checked'),
  279 + sellChannels:common.util.__input('[name=sellChannels]:checked'),
  280 + phrase:phraseValue,
  281 + outSaleTime:common.util.__input('outSaleTime'),
  282 + shopIds:common.util.__input('[name=shopIds]:checked'),
  283 + delayArrivalNotice:common.util.__input('delayArrivalNotice'),
  284 + grade:common.util.__input('grade')||0,
  285 + isLimited:common.util.__input('isLimited')||'N',
  286 + isOutlets:common.util.__input('isOutLets2')||'N',
  287 + seasons:common.util.__input('seasons')
  288 + }
  289 + })
  290 +
  291 + if (common.util.__sknOperateLog(basicInfo.productSkn, common.util.__input('phrase'), oldphrase, 6)) {
  292 + oldphrase = common.util.__input('phrase');
  293 + }
  294 +
  295 + });
  296 + },true);
  297 +
274 }) 298 })
275 // var e = new common.edit('#basicInfoWrap'); 299 // var e = new common.edit('#basicInfoWrap');
276 // e.init(); 300 // e.init();
@@ -36,13 +36,35 @@ $(document).on("click", "#btn-descriptioner", function () { @@ -36,13 +36,35 @@ $(document).on("click", "#btn-descriptioner", function () {
36 var content = UMdescriptioner.getContent(); 36 var content = UMdescriptioner.getContent();
37 var reg2=new RegExp("\\?imageView2/0/q/75","g"); 37 var reg2=new RegExp("\\?imageView2/0/q/75","g");
38 content = content.replace(reg2,''); 38 content = content.replace(reg2,'');
39 - common.util.__ajax({  
40 - url:'/product/saveProductDesc',  
41 - data:{  
42 - productSkn:productSkn,  
43 - productDesc:content  
44 - }  
45 - }); 39 +
  40 + var params = {
  41 + content: content
  42 + }
  43 + common.util.__ajax(
  44 + {
  45 + url:'/sensitiveWord/validate',
  46 + data: {
  47 + "validateContent": JSON.stringify(params)
  48 + }
  49 + },
  50 + function(rs) {
  51 + var tipText = "";
  52 + if (rs.data) {
  53 + var jsonMain = rs.data;
  54 + if(!$.isEmptyObject(jsonMain.content)){
  55 + tipText = "商品描述包含违禁词:"+jsonMain.content+"!";
  56 + }
  57 + }
  58 + common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
  59 + common.util.__ajax({
  60 + url:'/product/saveProductDesc',
  61 + data:{
  62 + productSkn:productSkn,
  63 + productDesc:content
  64 + }
  65 + });
  66 + });
  67 + },true);
46 }); 68 });
47 69
48 70
@@ -289,36 +289,57 @@ e.on("validate", function() { @@ -289,36 +289,57 @@ e.on("validate", function() {
289 e.init(); 289 e.init();
290 290
291 var submit=function(callback){ 291 var submit=function(callback){
292 - var result = e.submit($("#storeForm").attr("action"),function(option){  
293 - option.data=$.extend({},option.data,_arr);  
294 - option.data.shopIntro = UMshopintro.getContent();  
295 - console.log(option.data);  
296 - option.success=function(res){  
297 - if(res.code=="200"){  
298 - e.$tip('提交成功',function(){  
299 - //location.href="/supplier/store/index";  
300 - history.go(-1);  
301 - },'growl-success');  
302 - }else{  
303 - e.$tip(res.message);  
304 - $(".btn-cun").removeAttr("disabled");  
305 - $(".btn-success").removeAttr("disabled"); 292 + var params = {
  293 + shopIntro: UMshopintro.getContent()
  294 + }
  295 + common.util.__ajax(
  296 + {
  297 + url:'/sensitiveWord/validate',
  298 + data: {
  299 + "validateContent": JSON.stringify(params)
306 } 300 }
307 - return false;  
308 }, 301 },
309 - option.error=function(res){  
310 - e.$tip("提交失败");  
311 - $(".btn-cun").removeAttr("disabled");  
312 - $(".btn-success").removeAttr("disabled");  
313 - }  
314 - callback&&callback(option.data);  
315 - }); 302 + function(rs) {
  303 + var tipText = "";
  304 + if (rs.data) {
  305 + var jsonMain = rs.data;
  306 + if(!$.isEmptyObject(jsonMain.shopIntro)){
  307 + tipText = "店铺简介包含违禁词:"+jsonMain.shopIntro+"!";
  308 + }
  309 + }
  310 + common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
  311 + var result = e.submit($("#storeForm").attr("action"),function(option){
  312 + option.data=$.extend({},option.data,_arr);
  313 + option.data.shopIntro = UMshopintro.getContent();
  314 + console.log(option.data);
  315 + option.success=function(res){
  316 + if(res.code=="200"){
  317 + e.$tip('提交成功',function(){
  318 + //location.href="/supplier/store/index";
  319 + history.go(-1);
  320 + },'growl-success');
  321 + }else{
  322 + e.$tip(res.message);
  323 + $(".btn-cun").removeAttr("disabled");
  324 + $(".btn-success").removeAttr("disabled");
  325 + }
  326 + return false;
  327 + },
  328 + option.error=function(res){
  329 + e.$tip("提交失败");
  330 + $(".btn-cun").removeAttr("disabled");
  331 + $(".btn-success").removeAttr("disabled");
  332 + }
  333 + callback&&callback(option.data);
  334 + });
  335 + // 发生校验错误
  336 + if(result === false) {
  337 + $(".btn-cun").removeAttr("disabled");
  338 + $(".btn-success").removeAttr("disabled");
  339 + }
  340 + });
  341 + },true);
316 342
317 - // 发生校验错误  
318 - if(result === false) {  
319 - $(".btn-cun").removeAttr("disabled");  
320 - $(".btn-success").removeAttr("disabled");  
321 - }  
322 }; 343 };
323 344
324 //提交 345 //提交