| 
 
京东标题技术
V:ads1994y
Q:485591720 | 
 
|   将检测标题入口开始转化为关闭
 
 //敏感词入口关闭需求
 initTitle: function() {
 if($("#info-attr").closest(".J-con").find(".J-drag").find('.J-model-name')[0].innerText=="商品属性"){//商品属性
 /* if(!globalAttr.isMedicine){
 $("#info-attr").closest(".J-con").find(".J-drag").append('<p class="title-right">' +
 this.$t('user.widget_ware_attr.attrNotBusinessNeed')+
 '<a href="/rest/shop/wareAttriBackRest/toAttriPage/' + globalAttr.categoryId1 + '/' + globalAttr.categoryId2 + '/' + globalAttr.categoryId3 +
 '" target="_blank">'+this.$t('user.widget_ware_attr.clickFeedback')+'</a>' +
 '</p>');
 };*/
 $("#info-attr").closest(".J-con").find(".J-drag").append('<div style="float: right;margin-right: 222px"" class="tipEffect3" clstag="pageclick|keycount|newWare|43"><img src="/common/images/effect.png"/ class="eye"><span class="effect">'+this.$t('user.widget_ware_attr.showResults')+'</span></div>')
 }
 },
 showImg: function(src){
 this.tipImg = src;
 },
 loadCategoryAttrList: function () {
 var _this = this;
 shopLayer.lockWindow();
 var subData="";
 if(this.lastCategoryId){
 subData=this.lastCategoryId;
 }else{
 subData=this.catId;
 }
 PublishApi.loadCategoryAttrList(subData, function (res) {
 shopLayer.unlockWindow();
 if (res.status == 200) {
 res.data.forEach(function (group) {
 group.catAttrList.forEach(function (attr) {
 if(attr.inputType==2&&attr.attrValueList.length>5){
 attr.attrValueList.forEach(function(item){
 item.actions = false;
 })
 }
 attr["choseName"]=false;
 attr["tipwarn"]="";
 attr["choseNum"]=[];
 //添加空数组存
 if(attr.inputType==2){
 attr.checkedName=[];
 attr.checked=false;
 }
 });
 })
 var categoryGroupList = res.data;
 categoryGroupList.forEach(function (group) {
 var titShow = false;
 group.catAttrList.forEach(function (attr) {
 attr.val = []; // 默认值
 // 构造验证规则
 attr.rule = [{
 required: attr.required,
 message: _this.$t('user.widget_ware_attr.enterTheValue')
 }];
 
 if(attr.featureMap && attr.featureMap.attrLevel === '1'){
 attr.show = false;
 }else{
 attr.show = true;
 titShow = true;
 }
 
 // 回显取值字段
 _this.attrType[attr.categoryAttributeId] = 0;
 if(attr.inputType == 1 || attr.inputType == 2){
 _this.attrType[attr.categoryAttributeId] = 1;
 }
 
 attr.errMsg = "";
 
 if(!attr.features){
 return;
 }
 
 if(attr.features.indexOf("xznum")>-1){
 attr.rule.push({
 pattern: /(^[1-9](\d+)?(\.\d{1,2})?$)|(^0\.[1-9])|(^0\.\d[1-9])/,
 max: parseInt(attr.featureMap.xznum),
 message: _this.$t('user.widget_ware_attr.onlyNum')+ attr.featureMap.xznum
 });
 } else if(attr.features.indexOf("xzns")>-1){
 attr.rule.push({
 pattern: /^[A-Za-z0-9]*$/,
 max: parseInt(attr.featureMap.xzns),
 message: _this.$t('user.widget_ware_attr.onlyCharactersAndNumbers')+ attr.featureMap.xzns
 });
 } else if(attr.features.indexOf("xzchi")>-1){
 attr.rule.push({
 pattern: /^[\u4e00-\u9fa5]*$/,
 max: parseInt(attr.featureMap.xzchi),
 message: _this.$t('user.widget_ware_attr.onlyChinese')+ attr.featureMap.xzchi
 });
 } else if(attr.features.indexOf("xzstr")>-1){
 attr.rule.push({
 max: parseInt(attr.featureMap.xzstr),
 message: _this.$t('user.widget_ware_attr.overLength') + attr.featureMap.xzstr
 });
 }
 });
 group.titShow = titShow;
 });
 
 
 
 //构造响应函数
 
   (function () {
 
 // 获取 wangEditor 构造函数和 jquery
 var E = window.wangEditor;
 var jQuery = window.jQuery;
 //wangEditor编辑器实现多语言
 if (i18nUtil.getCurrentLocale()&&E.langs[i18nUtil.getCurrentLocale()]) {
 E.config.lang = E.langs[i18nUtil.getCurrentLocale()];
 }
 // 用 createMenu 方法创建菜单
 E.createMenu(function (check) {
 
 // 定义菜单id,不要和其他菜单id重复。编辑器自带的所有菜单id,可通过『参数配置-自定义菜单』一节查看
 var menuId = 'hanyi';
 
 // check将检查菜单配置(『参数配置-自定义菜单』一节描述)中是否该菜单id,如果没有,则忽略下面的代码。
 if (!check(menuId)) {
 return;
 }
 
 // this 指向 editor 对象自身
 var editor = this;
 
 // 创建 menu 对象
 var menu = new E.Menu({
 editor: editor,  // 编辑器对象
 id: menuId,  // 菜单id
 title: E.config.lang.hanYiCharacter, // 菜单标题
 commandName: 'fontName', // 命令名称
 
 // 正常状态和选中装下的dom对象,样式需要自定义
 $domNormal: jQuery('<a href="#" tabindex="-1"><i class="wangeditor-menu-img-font2"></i></a>'),
 $domSelected: jQuery('<a href="#" tabindex="-1" class="selected"><i class="wangeditor-menu-img-font2"></i></a>')
 });
 
 // 定义 update selected 事件
 menu.updateSelectedEvent = function () {
 var rangeElem = editor.getRangeElem();
 rangeElem = editor.getSelfOrParentByName(rangeElem, 'font[face]');
 if (rangeElem) {
 return true;
 }
 return false;
 };
 
 
   
 
 
 
 
 
 | 
 评分
查看全部评分
 |