因为购物车里面的订单项部分比较复杂,所以先把结算按钮这部分简单的拿出来单独讲解。 后面就可以专注在订单项部分的讲解了
");
window.frames["iframe_show3262"].document.write(decodeHtml($("textarea#stepcodeTextarea3262").val()));
window.frames["iframe_show3262"].document.close();
$(window.frames["iframe_show3262"]).load(function(){
$("#iframe_show3262").height($("#iframe_show3262").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3262").height($("#iframe_show3262").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
</head>
<style>
body{
font-size: 12px;
font-family: Arial;
}
div.cartDiv{
max-width: 1013px;
margin: 10px auto;
color: black;
}
div.cartTitle button{
background-color: #AAAAAA;
border: 1px solid #AAAAAA;
color: white;
width: 53px;
height: 25px;
border-radius: 2px;
}
span.cartTitlePrice{
color: #C40000;
font-size: 14px;
font-weight: bold;
margin-left: 5px;
margin-right: 3px;
}
div.cartFoot{
background-color: #E5E5E5;
line-height: 50px;
margin: 20px 0px;
color: black;
padding-left: 20px;
}
div.cartFoot button{
background-color: #AAAAAA;
border: 0px solid #AAAAAA;
color: white;
width: 120px;
height: 50px;
font-size: 20px;
text-align: center;
}
img.cartProductItemIfSelected, img.selectAllItem{
cursor: pointer;
}
span.cartSumNumber{
color: #C40000;
font-weight: bold;
font-size: 16px;
}
span.cartSumPrice{
color: #C40000;
font-weight: bold;
font-size: 20px;
}
</style>
<div class="cartDiv">
<div class="cartTitle pull-right">
<span>已选商品 (不含运费)</span>
<span class="cartTitlePrice">¥0.00</span>
<button class="createOrderButton" style="background-color: rgb(170, 170, 170);" disabled="disabled">结 算</button>
</div>
<div style="text-align:center;color:gray;line-height:100px" >
订单项内容,在下个知识点讲解
</div>
<div class="cartFoot">
<img src="http://127.0.0.1/tmall../../../img/site/cartNotSelected.png" class="selectAllItem" selectit="false">
<span>全选</span>
<!-- <a href="#">删除</a> -->
<div class="pull-right">
<span>已选商品 <span class="cartSumNumber">0</span> 件</span>
<span>合计 (不含运费): </span>
<span class="cartSumPrice">¥0.00</span>
<button class="createOrderButton" style="background-color: rgb(170, 170, 170);" disabled="disabled">结 算</button>
</div>
</div>
</div>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
</head>
<style>
body{
font-size: 12px;
font-family: Arial;
}
div.cartDiv{
max-width: 1013px;
margin: 10px auto;
color: black;
}
div.cartTitle button{
background-color: #AAAAAA;
border: 1px solid #AAAAAA;
color: white;
width: 53px;
height: 25px;
border-radius: 2px;
}
span.cartTitlePrice{
color: #C40000;
font-size: 14px;
font-weight: bold;
margin-left: 5px;
margin-right: 3px;
}
div.cartFoot{
background-color: #E5E5E5;
line-height: 50px;
margin: 20px 0px;
color: black;
padding-left: 20px;
}
div.cartFoot button{
background-color: #AAAAAA;
border: 0px solid #AAAAAA;
color: white;
width: 120px;
height: 50px;
font-size: 20px;
text-align: center;
}
img.cartProductItemIfSelected, img.selectAllItem{
cursor: pointer;
}
span.cartSumNumber{
color: #C40000;
font-weight: bold;
font-size: 16px;
}
span.cartSumPrice{
color: #C40000;
font-weight: bold;
font-size: 20px;
}
</style>
<div class="cartDiv">
<div class="cartTitle pull-right">
<span>已选商品 (不含运费)</span>
<span class="cartTitlePrice">¥0.00</span>
<button class="createOrderButton" style="background-color: rgb(170, 170, 170);" disabled="disabled">结 算</button>
</div>
<div style="text-align:center;color:gray;line-height:100px" >
订单项内容,在下个知识点讲解
</div>
<div class="cartFoot">
<img src="http://127.0.0.1/tmall../../../img/site/cartNotSelected.png" class="selectAllItem" selectit="false">
<span>全选</span>
<!-- <a href="#">删除</a> -->
<div class="pull-right">
<span>已选商品 <span class="cartSumNumber">0</span> 件</span>
<span>合计 (不含运费): </span>
<span class="cartSumPrice">¥0.00</span>
<button class="createOrderButton" style="background-color: rgb(170, 170, 170);" disabled="disabled">结 算</button>
</div>
</div>
</div>
");
window.frames["iframe3262"].document.write(decodeHtml(code3262));
window.frames["iframe3262"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3262"]).load(function(){
$("#iframe3262").height($("#iframe3262").contents().find("body").height()+showittryitheight);
});
$("#iframe3262").height($("#iframe3262").contents().find("body").height()+showittryitheight);
alreadyWriteCode3262 = code3262;
$("#rendering3262").hide();
$("#rendered3262").show();
}
var tRereshRetry2DemoPanel3262 = setInterval(rereshRetry2DemoPanel3262,1000);
var binded3262 = false;
$("textarea#stepcodeTextarea3262").keyup(function(){
if(!binded3262){
$(window).bind('beforeunload',function(){
binded3262 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3262 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3262!=newCode){
// window.frames["iframe3262"].document.write("
");
// window.frames["iframe3262"].document.write(decodeHtml($("textarea#stepcodeTextarea3262").val()));
// window.frames["iframe3262"].document.close();
// $(window.frames["iframe3262"]).load(function(){
// $("#iframe3262").height($("#iframe3262").contents().find("body").height()+showittryitheight);
// });
// code3262 = newCode;
// }
});
$(".tryButton3262").click(function(){
$("#tryDiv3262").show();
$("#stepcodeTextarea3262").focus();
$("#stepcodeTextarea3262").height(200);
$("#iframe3262").height(0);
window.frames["iframe3262"].document.write("
");
window.frames["iframe3262"].document.write(decodeHtml($("textarea#stepcodeTextarea3262").val()));
window.frames["iframe3262"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3262"]).load(function(){
$("#iframe3262").height($("#iframe3262").contents().find("body").height()+showittryitheight);
});
$("#iframe3262").height($("#iframe3262").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3262.focus();
editor3262.setSize(null, "250");
$("#rendering3262").hide();
$("#rendered3262").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 editor3262 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3262"), {
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);
}
}
});
editor3262.on("change",function(doc){
if(!binded3262){
$(window).bind('beforeunload',function(){
binded3262 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3262 = newCode;
$("textarea#stepcodeTextarea3262").val(newCode);
if(alreadyWriteCode3262!=code3262){
lastModifedTime3262 = new Date().getTime();
$("#rendering3262").show();
$("#rendered3262").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3262 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3262.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3262").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|