Authored by Li

Merge branch 'dev_sensitive_word' into test6.0

... ... @@ -78,4 +78,6 @@ module.exports = function (app){
app.post("/brandImage/detail","brandImage_detail");
//修改
app.post("/brandImage/update","brandImage_update");
app.post("/sensitiveWord/validate","brand_validateSensitiveWord");
}
... ...
... ... @@ -41,7 +41,8 @@ module.exports={
{name: 'registerCertUrl',type: 'string'},
{name: 'authorizeCerts',type: 'string'},
{name:'brandBanner',type:'string'},
{name:'certParty',type:'string'}
{name:'certParty',type:'string'},
{name:'countryId', type : 'Number'}
]
},
... ... @@ -116,6 +117,14 @@ module.exports={
{name: 'isShipping',type: 'string'},
{name: 'offlineBrandIco',type: 'string'}
]
},
validateSensitiveWord: {
title:"品牌装修-验证违禁词",
url:"/sensitiveWord/validate",
params:[
{name: 'validateContent',type: 'string'}
]
}
}
}
... ...
... ... @@ -98,7 +98,7 @@ $(document).on('click', '.download-btn', function() {
$(document).on('click','#save_brand',function () {
e.submit($("#basicForm").attr("action"), function (option) {
//option.data.authorizeCerts = authorizeCertList;
//option.data.authorizeCerts = authorizeCertList.join(',');
option.data.countryId = option.data.brandHeadstream;
option.data.authorizeCerts = JSON.stringify(authorizeCertList);
option.success = function (res) {
... ...
... ... @@ -29,30 +29,54 @@ e.on("validate", function () {
e.init();
$(document).on('click','#save_branddecorate',function () {
e.submit($("#basicForm").attr("action"), function (option) {
option.data.brandIntro=UMdescriptioner.getContent();
var isShipping=$("input[type='checkbox'][name='isShipping']");
if(isShipping.is(':checked')){
option.data.isShipping=1;
}else{
option.data.isShipping=0;
}
option.success = function (res) {
if (res.code == "200") {
e.$tip("提交成功", function () {
location.href = "/erpproduct/brands/decorate/index"
}, 'growl-success');
} else {
e.$tip(res.message);
var params = {
brandIntro: UMdescriptioner.getContent()
}
common.util.__ajax(
{
url:'/sensitiveWord/validate',
data: {
"validateContent": JSON.stringify(params)
}
},
function(rs) {
var tipText = "";
if (rs.data) {
var jsonMain = rs.data;
if(!$.isEmptyObject(jsonMain.brandIntro)){
tipText = "品牌介绍包含违禁词:"+jsonMain.brandIntro+"!";
}
}
return false;
};
option.error = function (res) {
e.$tip(res.message);
};
console.log(option.data);
});
common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
e.submit($("#basicForm").attr("action"), function (option) {
option.data.brandIntro=UMdescriptioner.getContent();
var isShipping=$("input[type='checkbox'][name='isShipping']");
if(isShipping.is(':checked')){
option.data.isShipping=1;
}else{
option.data.isShipping=0;
}
option.success = function (res) {
if (res.code == "200") {
e.$tip("提交成功", function () {
location.href = "/erpproduct/brands/decorate/index"
}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
};
option.error = function (res) {
e.$tip(res.message);
};
console.log(option.data);
});
});
},true);
return false;
});
... ...
... ... @@ -250,27 +250,51 @@ $('#saveBasicInfo').on('click', function() {
return;
}
common.util.__ajax({
url:'/goods/product/saveNetSaleBaseInfo',
data:{
productSkn:basicInfo.productSkn,
productName:common.util.__input('productName'),
isNew:common.util.__input('[name=isNew]:checked'),
sellChannels:common.util.__input('[name=sellChannels]:checked'),
phrase:phraseValue,
outSaleTime:common.util.__input('outSaleTime'),
shopIds:common.util.__input('[name=shopIds]:checked'),
delayArrivalNotice:common.util.__input('delayArrivalNotice'),
grade:common.util.__input('grade')||0,
isLimited:common.util.__input('isLimited')||'N',
isOutlets:common.util.__input('isOutLets2')||'N',
seasons:common.util.__input('seasons')
}
})
if (common.util.__sknOperateLog(basicInfo.productSkn, common.util.__input('phrase'), oldphrase, 6)) {
oldphrase = common.util.__input('phrase');
}
var params = {
phrase: phraseValue
}
common.util.__ajax(
{
url:'/sensitiveWord/validate',
data: {
"validateContent": JSON.stringify(params)
}
},
function(rs) {
var tipText = "";
if (rs.data) {
var jsonMain = rs.data;
if(!$.isEmptyObject(jsonMain.phrase)){
tipText = "推荐短语包含违禁词:"+jsonMain.phrase+"!";
}
}
common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
common.util.__ajax({
url:'/goods/product/saveNetSaleBaseInfo',
data:{
productSkn:basicInfo.productSkn,
productName:common.util.__input('productName'),
isNew:common.util.__input('[name=isNew]:checked'),
sellChannels:common.util.__input('[name=sellChannels]:checked'),
phrase:phraseValue,
outSaleTime:common.util.__input('outSaleTime'),
shopIds:common.util.__input('[name=shopIds]:checked'),
delayArrivalNotice:common.util.__input('delayArrivalNotice'),
grade:common.util.__input('grade')||0,
isLimited:common.util.__input('isLimited')||'N',
isOutlets:common.util.__input('isOutLets2')||'N',
seasons:common.util.__input('seasons')
}
})
if (common.util.__sknOperateLog(basicInfo.productSkn, common.util.__input('phrase'), oldphrase, 6)) {
oldphrase = common.util.__input('phrase');
}
});
},true);
})
// var e = new common.edit('#basicInfoWrap');
// e.init();
... ...
... ... @@ -36,13 +36,35 @@ $(document).on("click", "#btn-descriptioner", function () {
var content = UMdescriptioner.getContent();
var reg2=new RegExp("\\?imageView2/0/q/75","g");
content = content.replace(reg2,'');
common.util.__ajax({
url:'/product/saveProductDesc',
data:{
productSkn:productSkn,
productDesc:content
}
});
var params = {
content: content
}
common.util.__ajax(
{
url:'/sensitiveWord/validate',
data: {
"validateContent": JSON.stringify(params)
}
},
function(rs) {
var tipText = "";
if (rs.data) {
var jsonMain = rs.data;
if(!$.isEmptyObject(jsonMain.content)){
tipText = "商品描述包含违禁词:"+jsonMain.content+"!";
}
}
common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
common.util.__ajax({
url:'/product/saveProductDesc',
data:{
productSkn:productSkn,
productDesc:content
}
});
});
},true);
});
... ...
... ... @@ -289,36 +289,57 @@ e.on("validate", function() {
e.init();
var submit=function(callback){
var result = e.submit($("#storeForm").attr("action"),function(option){
option.data=$.extend({},option.data,_arr);
option.data.shopIntro = UMshopintro.getContent();
console.log(option.data);
option.success=function(res){
if(res.code=="200"){
e.$tip('提交成功',function(){
//location.href="/supplier/store/index";
history.go(-1);
},'growl-success');
}else{
e.$tip(res.message);
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
var params = {
shopIntro: UMshopintro.getContent()
}
common.util.__ajax(
{
url:'/sensitiveWord/validate',
data: {
"validateContent": JSON.stringify(params)
}
return false;
},
option.error=function(res){
e.$tip("提交失败");
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
}
callback&&callback(option.data);
});
function(rs) {
var tipText = "";
if (rs.data) {
var jsonMain = rs.data;
if(!$.isEmptyObject(jsonMain.shopIntro)){
tipText = "店铺简介包含违禁词:"+jsonMain.shopIntro+"!";
}
}
common.dialog.confirm("温馨提示",tipText + "确定提交吗?",function(){
var result = e.submit($("#storeForm").attr("action"),function(option){
option.data=$.extend({},option.data,_arr);
option.data.shopIntro = UMshopintro.getContent();
console.log(option.data);
option.success=function(res){
if(res.code=="200"){
e.$tip('提交成功',function(){
//location.href="/supplier/store/index";
history.go(-1);
},'growl-success');
}else{
e.$tip(res.message);
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
}
return false;
},
option.error=function(res){
e.$tip("提交失败");
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
}
callback&&callback(option.data);
});
// 发生校验错误
if(result === false) {
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
}
});
},true);
// 发生校验错误
if(result === false) {
$(".btn-cun").removeAttr("disabled");
$(".btn-success").removeAttr("disabled");
}
};
//提交
... ...