国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

125 行
5.5KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>购物车 - {dede:var.carts.orders_id/}订单号</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset={dede:global.cfg_soft_lang/}">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/font/css/font-awesome.min.css">
  9. <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css">
  10. <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/index.css">
  11. <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script>
  12. </head>
  13. <body class="buycarpage">
  14. <?php include(DEDETEMPLATE."/plus/plus_header.htm") ;?>
  15. <div class="container">
  16. <div class="sp-title">
  17. <h2>购物车</h2>
  18. </div>
  19. <div id="errorChickCookie" class="clear center mt1" style="font-style:inherit;color:#424b51;font-weight:normal;padding-top:8px;padding-bottom:8px;text-align:center;">
  20. </div>
  21. <div class="buycar">
  22. <h3>我的购物车 - <em id="carId">{dede:var.carts.orders_id/}</em>订单号</h3>
  23. <form id="form1" name="form1" method="post" action="posttocar.php">
  24. <input id="dopost" name="do" type="hidden" value="del">
  25. <!--startprint1-->
  26. <table width="100%" cellpadding="0" cellspacing="0" class="table trlist">
  27. <thead>
  28. <tr>
  29. <td colspan="6">商品列表</td>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <!--以下列出购物车内购商品列表(数组),开始遍历数组-->
  34. <tr>
  35. <th>选择</th>
  36. <th>编号</th>
  37. <th>名称</th>
  38. <th>数量</th>
  39. <th>单价(元)</th>
  40. <th>操作</th>
  41. </tr>
  42. {dede:array.Items}
  43. <tr>
  44. <td height="26"><input type="checkbox" name="ids[]" value="{dede:value.id/}"></td>
  45. <td height="26">{dede:value.id/}</td>
  46. <td height="26"><a href="view.php?aid={dede:value.id/}" target="_bank">{dede:value.title/}</a></td>
  47. <td height="26">
  48. <input name="buynum{dede:value.id/}" type="text" id="buynum{dede:value.id/}" value="{dede:value.buynum/}" size="5" maxlength="5" class="ipt-txt">
  49. <small>{dede:value.units/}</small></td>
  50. <td height="26">{dede:value.price/}</td>
  51. <td height="26"><a href="posttocar.php?do=del&ids={dede:value.id/}">删除</a></td>
  52. </tr>
  53. {/dede:array}
  54. <!--构造购物车内商品列表结束-->
  55. </tbody>
  56. <tfoot>
  57. <tr>
  58. <td colspan="6" align="right">
  59. <div style="float:left">共 <span style="color:#dc3545">{dede:var.carts.cart_count/}</span> 件商品,合计: <span style='color:#dc3545'>{dede:var.carts.price_count/}</span> 元</div>
  60. <div style="float:right">
  61. <!--<input type="button" value="打印购物车" class="btn-2" onclick="printPage(1)"/>-->
  62. <input type="button" value="更新订单号" class="btn btn-success btn-sm" onClick="makeCarId()">
  63. <input type="button" value="删除已选定" class="btn btn-success btn-sm" onClick="DelPost()">
  64. <input type="button" value="清空" onClick="if(confirm('确定清空购物车中的商品吗')){ location='posttocar.php?do=clear' }" class="btn btn-success btn-sm">
  65. <input onclick="ChangePost()" type="button" value="更新数量" class="btn btn-success btn-sm">
  66. <input type="button" value="下一步" onclick="location='carbuyaction.php'" class="btn btn-success btn-sm">
  67. </div>
  68. </td>
  69. </tr>
  70. </tfoot>
  71. </table>
  72. <!--endprint1-->
  73. </form>
  74. </div>
  75. </div>
  76. <!--购物车列表操作javascript请不要随意改动-->
  77. <script language="JavaScript" type="text/javascript">
  78. //遍历checkbox使之全选中,或反选
  79. function CheckAll() {
  80. for (var i = 0; i < document.form1.elements.length; i++) {
  81. var e = document.form1.elements[i];
  82. e.checked == true ? e.checked = false : e.checked = true;
  83. }
  84. }
  85. //改变表单dopost值为:update,后submit提交表单
  86. function ChangePost() {
  87. CheckAll();
  88. document.getElementById("dopost").value = 'update';
  89. document.form1.submit();
  90. }
  91. //改变表单dopost值为:del,后submit提交表单
  92. function DelPost() {
  93. document.getElementById("dopost").value = 'del';
  94. document.form1.submit();
  95. }
  96. //AJAX产生一个新的订单编号
  97. function makeCarId() {
  98. $.ajax({ type: "POST", url: "car.php", data: "dopost=makeid", dataType: 'text', success: function (result) { $("#carId").html(result); } });
  99. }
  100. //Print Page
  101. function printPage(oper) {
  102. if (oper < 10) {
  103. bdhtml = window.document.body.innerHTML;//获取当前页的html代码
  104. sprnstr = "<!--startprint" + oper + "-->";//设置打印开始区域
  105. eprnstr = "<!--endprint" + oper + "-->";//设置打印结束区域
  106. prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
  107. prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html
  108. window.document.body.innerHTML = prnhtml;
  109. window.print();
  110. window.document.body.innerHTML = bdhtml;
  111. } else {
  112. window.print();
  113. }
  114. }
  115. </script>
  116. <!--购物车列表操作javascript结束-->
  117. <?php include(DEDETEMPLATE."/plus/plus_footer.htm") ;?>
  118. <script language="JavaScript" type="text/javascript">
  119. if (!navigator.cookieEnabled) {
  120. $('#errorChickCookie').html('您浏览器的 cookie 功能被禁用,请启用此功能');
  121. $('.buycar').hide();
  122. }
  123. </script>
  124. </body>
  125. </html>