how2j.cn


步骤 1 :

效果

注:这里的原型是展示效果,让大家有个感性的认识,编码不在这里进行,项目开发过程会在后面的章节从零开始。
"); window.frames["iframe_show6086"].document.write(decodeHtml($("textarea#stepcodeTextarea6086").val())); window.frames["iframe_show6086"].document.close(); $(window.frames["iframe_show6086"]).load(function(){ $("#iframe_show6086").height($("#iframe_show6086").contents().find("body").height()+showittryitheight); }); $("#iframe_show6086").height($("#iframe_show6086").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <html> <head> <script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script> <link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet"> <script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script> <link href="http://127.0.0.1/tmall../../../css/back/style.css" rel="stylesheet"> <script> function checkEmpty(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } return true; } function checkNumber(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } if(isNaN(value)){ alert(name+ "必须是数字"); $("#"+id)[0].focus(); return false; } return true; } function checkInt(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } if(parseInt(value)!=value){ alert(name+ "必须是整数"); $("#"+id)[0].focus(); return false; } return true; } $(function(){ $("a").click(function(){ var deleteLink = $(this).attr("deleteLink"); console.log(deleteLink); if("true"==deleteLink){ var confirmDelete = confirm("确认要删除"); if(confirmDelete) return true; return false; } }); }) </script> </head> <body> <div class="navitagorDiv"> <nav class="navbar navbar-default navbar-fixed-top navbar-inverse"> <img style="margin-left:10px;margin-right:0px" class="pull-left" src="http://127.0.0.1/tmall../../../img/site/tmallbuy.png" height="45px"> <a class="navbar-brand" href="#nowhere">天猫后台</a> <a class="navbar-brand" href="#nowhere">分类管理</a> <a class="navbar-brand" href="#nowhere">用户管理</a> <a class="navbar-brand" href="#nowhere">订单管理</a> </nav> </div> <title>编辑产品属性值</title> <script> $(function() { $("input.pvValue").keyup(function(){ var value = $(this).val(); var page = "admin_product_updatePropertyValue"; var pvid = $(this).attr("pvid"); var parentSpan = $(this).parent("span"); parentSpan.css("border","1px solid yellow"); if(false)$.post( page, {"value":value,"pvid":pvid}, function(result){ if("success"==result) parentSpan.css("border","1px solid green"); else parentSpan.css("border","1px solid red"); } ); }); }); </script> <div class="workingArea"> <ol class="breadcrumb"> <li><a href="#nowhere">所有分类</a></li> <li><a href="#nowhere">太阳镜</a></li> <li class="active">好先生同款墨镜孙红雷偏光男士太阳镜韩明星女款圆脸方框金属近视</li> <li class="active">编辑产品属性</li> </ol> <div class="editPVDiv"> <div class="eachPV"> <span class="pvName" >适合脸型</span> <span class="pvValue"><input class="pvValue" pvid="13169" type="text" value="圆脸 长脸 方脸 椭圆形脸"></span> </div> <div class="eachPV"> <span class="pvName" >是否可调</span> <span class="pvValue"><input class="pvValue" pvid="13170" type="text" value="镜面弧度 镜架松紧"></span> </div> <div class="eachPV"> <span class="pvName" >颜色分类</span> <span class="pvValue"><input class="pvValue" pvid="13171" type="text" value="黑框黑灰片 枪框渐灰片 银框反光膜天蓝片 金框G15片"></span> </div> <div class="eachPV"> <span class="pvName" >货号</span> <span class="pvValue"><input class="pvValue" pvid="13172" type="text" value="8009"></span> </div> <div class="eachPV"> <span class="pvName" >镜片材质</span> <span class="pvValue"><input class="pvValue" pvid="13173" type="text" value="其他"></span> </div> <div class="eachPV"> <span class="pvName" >是否商场同款</span> <span class="pvValue"><input class="pvValue" pvid="13174" type="text" value="否"></span> </div> <div class="eachPV"> <span class="pvName" >眼镜配件类型</span> <span class="pvValue"><input class="pvValue" pvid="13175" type="text" value="镜布 镜盒"></span> </div> <div class="eachPV"> <span class="pvName" >价格区间</span> <span class="pvValue"><input class="pvValue" pvid="13176" type="text" value="100 - 200元"></span> </div> <div class="eachPV"> <span class="pvName" >风格</span> <span class="pvValue"><input class="pvValue" pvid="13177" type="text" value="个性 舒适 运动"></span> </div> <div class="eachPV"> <span class="pvName" >适用性别</span> <span class="pvValue"><input class="pvValue" pvid="13178" type="text" value="男"></span> </div> <div class="eachPV"> <span class="pvName" >功能</span> <span class="pvValue"><input class="pvValue" pvid="13179" type="text" value="防UVA 防UVB 偏光"></span> </div> <div class="eachPV"> <span class="pvName" >型号</span> <span class="pvValue"><input class="pvValue" pvid="13180" type="text" value="8009"></span> </div> <div class="eachPV"> <span class="pvName" >上市时间</span> <span class="pvValue"><input class="pvValue" pvid="13181" type="text" value="2014年春夏季"></span> </div> <div class="eachPV"> <span class="pvName" >产地</span> <span class="pvValue"><input class="pvValue" pvid="13182" type="text" value="厦门"></span> </div> <div class="eachPV"> <span class="pvName" >品牌</span> <span class="pvValue"><input class="pvValue" pvid="13183" type="text" value="PARZIN/帕森"></span> </div> <div style="clear:both"></div> </div> </div>
"); window.frames["iframe6086"].document.write(decodeHtml(code6086)); window.frames["iframe6086"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe6086"]).load(function(){ $("#iframe6086").height($("#iframe6086").contents().find("body").height()+showittryitheight); }); $("#iframe6086").height($("#iframe6086").contents().find("body").height()+showittryitheight); alreadyWriteCode6086 = code6086; $("#rendering6086").hide(); $("#rendered6086").show(); } var tRereshRetry2DemoPanel6086 = setInterval(rereshRetry2DemoPanel6086,1000); var binded6086 = false; $("textarea#stepcodeTextarea6086").keyup(function(){ if(!binded6086){ $(window).bind('beforeunload',function(){ binded6086 = true; return "xxxx"; }); } var newCode = $(this).val() code6086 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code6086!=newCode){ // window.frames["iframe6086"].document.write("
"); // window.frames["iframe6086"].document.write(decodeHtml($("textarea#stepcodeTextarea6086").val())); // window.frames["iframe6086"].document.close(); // $(window.frames["iframe6086"]).load(function(){ // $("#iframe6086").height($("#iframe6086").contents().find("body").height()+showittryitheight); // }); // code6086 = newCode; // } }); $(".tryButton6086").click(function(){ $("#tryDiv6086").show(); $("#stepcodeTextarea6086").focus(); $("#stepcodeTextarea6086").height(200); $("#iframe6086").height(0); window.frames["iframe6086"].document.write("
"); window.frames["iframe6086"].document.write(decodeHtml($("textarea#stepcodeTextarea6086").val())); window.frames["iframe6086"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe6086"]).load(function(){ $("#iframe6086").height($("#iframe6086").contents().find("body").height()+showittryitheight); }); $("#iframe6086").height($("#iframe6086").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor6086.focus(); editor6086.setSize(null, "250"); $("#rendering6086").hide(); $("#rendered6086").hide(); }); var mixedMode = { name: "htmlmixed", scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i, mode: null}, {matches: /(text|application)\/(x-)?vb(a|script)/i, mode: "vbscript"}] }; var editor6086 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea6086"), { lineNumbers: true, styleActiveLine: true, matchBrackets: true, mode:"text/html", theme:"eclipse", selectionPointer: true, lineWrapping: true, extraKeys: { "Alt-/": "autocomplete", "Ctrl-F": "findPersistent", "F8": function(cm) { cm.setOption("fullScreen", !cm.getOption("fullScreen")); }, "Esc": function(cm) { if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); } } }); editor6086.on("change",function(doc){ if(!binded6086){ $(window).bind('beforeunload',function(){ binded6086 = true; return "xxxx"; }); } var newCode = doc.getValue(); code6086 = newCode; $("textarea#stepcodeTextarea6086").val(newCode); if(alreadyWriteCode6086!=code6086){ lastModifedTime6086 = new Date().getTime(); $("#rendering6086").show(); $("#rendered6086").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor6086 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor6086.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv6086").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


关于 实践项目-天猫整站SSM-产品属性设置 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 620943819
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图