关闭
¥
¥21.90
移入收藏
删除
¥
¥24.00
移入收藏
删除
结 算
//js部分
/**
* Created by zongjuan.wang on 2016/6/1.
*/
/*关闭窗口*/
function close_plan(){
window.close();
}
function collection(){
var flag=confirm("移入收藏后,将不再购物车显示,是否继续 *** 作?");
if(flag==true){
alert("移入收藏成功!");
}
}
function del(){
var flag=confirm("您确定要删除商品吗?");
if(flag==true){
alert("删除成功!");
}
}
//减一
var a=0;
var zz;
function jian(){
a-=1;
document.getElementById('jj').value=a;
if(a<1){
a=1;
document.getElementById('jj').value=a;
}
var ss=parseFloat(document.getElementById('price2').value);
zz="¥"+parseFloat(a*ss).toFixed(2);
document.getElementById('price0').innerHTML=zz;
//结算代码
jiesuan();
}
//加一
function jia(){
a+=1;
document.getElementById('jj').value=a;
var ss=parseFloat(document.getElementById('price2').value);
zz="¥"+parseFloat(a*ss).toFixed(2);
document.getElementById('price0').innerHTML=zz;
//结算代码
jiesuan();
}
var b=0;
var zz1;
function jian1(){
b-=1;
document.getElementById('jj1').value=b;
if(b<1){
b=1;
document.getElementById('jj1').value=b;
}
var ss1=parseFloat(document.getElementById('price3').value);
zz1="¥"+parseFloat(b*ss1).toFixed(2);
document.getElementById('price1').innerHTML=zz1;
//结算代码
jiesuan();
}
function jia1(){
b+=1;
document.getElementById('jj1').value=b;
var ss1=parseFloat(document.getElementById('price3').value);
zz1="¥"+parseFloat(b*ss1).toFixed(2);
document.getElementById('price1').innerHTML=zz1;
//结算代码
jiesuan();
}
//结算按钮
function accounts(){
var shu1=parseInt(document.getElementById('jj').value);
var shu2=parseInt(document.getElementById('jj1').value);
var zhshu=parseInt(shu1+shu2);
var je1=parseFloat(document.getElementById('price0').innerHTML.substring(1));
var je2=parseFloat(document.getElementById('price1').innerHTML.substring(1));
var jezong=parseFloat(je1+je2).toFixed(2);
var flag=confirm("您本次购买的商品信息如下:\n\n商品名称:白岩松:白说、岛上书店;\n商品数量:"+zhshu+"件;\n商品总计:"+jezong+";\n运费:0元;\n\n请确认以上信息是否有误!!!");
if(flag){
alert("您的订单已提交");
}
}
//结算总价代码
function jiesuan(){
var je1=parseFloat(document.getElementById('price0').innerHTML.substring(1));
var je2=parseFloat(document.getElementById('price1').innerHTML.substring(1));
var jezong="¥"+parseFloat(je1+je2).toFixed(2);
document.getElementById('totalPrice').innerHTML=jezong;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)