index.htm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##tlayout("www/layout.htm"){
  2. <nav class="my-nav">
  3. <ul class="container list-unstyled nav-list clearfix">
  4. <li class="active"><a href="/user">个人中心</a></li>
  5. <li><a href="/user/orders">我的订单</a></li>
  6. <li><a href="/user/diy">我的定制</a></li>
  7. <li><a href="/user/address">收货地址</a></li>
  8. </ul>
  9. </nav>
  10. <div class="template">
  11. <img src="/www/image/banner-center.jpg" class="center" />
  12. <div class="user-info">
  13. <div class="user-head">
  14. <img src="${user.img_url!}" class="user-img" />
  15. </div>
  16. <p class="user-name">${user.name!}</p>
  17. <div class="user-email"><span style="border: 0px;">注册时间:${user.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</span></div>
  18. </div>
  19. </div>
  20. <section class="container">
  21. <h3 class="template-title text-center">
  22. 我的订单
  23. <a href="/user/orders" class="check-all">查看全部订单<span class="glyphicon glyphicon-menu-right"></span></a>
  24. </h3>
  25. <table class="table order-table">
  26. <thead>
  27. <tr>
  28. <th>订单号</th>
  29. <th>创建时间</th>
  30. <th>支付方式</th>
  31. <th>总计</th>
  32. <th>状态</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. ##if(results!=null && results.list.~size!=0){
  37. ##for(_item in results.list!){
  38. <tr>
  39. <td><a class="red" href="/user/ordersMsg?code=${_item.code!}">${_item.code!}</a></td>
  40. <td>${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</td>
  41. <td>
  42. ##if(_item.payment==1){
  43. 微信支付
  44. ##}else if(_item.payment==2){
  45. 银行卡支付
  46. ##}else if(_item.payment==3){
  47. 支付宝支付
  48. ##}
  49. </td>
  50. <td>¥${_item.grand_total!}</td>
  51. <td>
  52. ##if(_item.status==0){
  53. 未付款
  54. ##}else if(_item.status==1){
  55. 付款审核中
  56. ##}else if(_item.status==2){
  57. 待发货
  58. ##}else if(_item.status==3){
  59. 已发货
  60. ##}else if(_item.status==4){
  61. 已收货
  62. ##}else if(_item.status==5){
  63. 已完成
  64. ##}else{
  65. 退款中
  66. ##}
  67. </td>
  68. </tr>
  69. ##}
  70. ##}else{
  71. <tr><td colspan="5">没有订单信息!</td></tr>
  72. ##}
  73. </tbody>
  74. </table>
  75. </section>
  76. <section class="container">
  77. <h3 class="template-title text-center">
  78. 我的定制
  79. <a href="/user/diy" class="check-all">查看全部定制<span class="glyphicon glyphicon-menu-right"></span></a>
  80. </h3>
  81. ##if(diy_list!=null && diy_list.~size!=0){
  82. <div class="product-wrapper">
  83. <div class="product-content">
  84. <ul class="product-list row list-unstyled clearfix">
  85. ##for(_item in diy_list!){
  86. <li>
  87. <div class="list_item">
  88. <img src="${_item.img_url!}" class="img-responsive prduct-img"/>
  89. <div class="product-title">
  90. <div class="title">${_item.diy_title!}</div>
  91. <div class="remark">${_item.diy_remark!}</div>
  92. <div class="remark">创建时间:${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</div>
  93. <a style="color: #fff;" target="_blank" href='/diy?id=${_item.id!}&type=2' class="btn">编辑定制</a>
  94. <span onclick="addCart(${_item.id!})" class="btn">加入购物车</span>
  95. <span onclick="showImg('${_item.img_url!}')" class="btn btn_two">查看设计</span>
  96. <div class="del_diy_btn" onclick="deleteDiy(${_item.id!})"><img src="/www/image/del_diy.png"/></div>
  97. </div>
  98. </div>
  99. </li>
  100. ##}
  101. </ul>
  102. </div>
  103. </div>
  104. ##}else{
  105. <table class="table order-table">
  106. <tbody>
  107. <tr><td>没有定制信息!</td></tr>
  108. </tbody>
  109. </table>
  110. ##}
  111. </section>
  112. <script>
  113. function addCart(id){
  114. $.post("/shop/addCart",{id:id},function(data){
  115. alert(data.msg);
  116. if(data.success){
  117. location.reload();
  118. }
  119. });
  120. }
  121. function showImg(imgUrl){
  122. window.open(imgUrl);
  123. }
  124. function deleteDiy(id){
  125. if(confirm("确定要删除该条记录?")){
  126. $.post("/user/deleteDiy",{id:id},function(data){
  127. alert(data.msg);
  128. if(data.success){
  129. location.reload();
  130. }
  131. });
  132. }
  133. }
  134. $(document).ready(function(){
  135. $('.product-list li').hover(function(){
  136. $(this).find('.product-title').stop().fadeIn();
  137. },function(){
  138. $(this).find('.product-title').stop().fadeOut();
  139. });
  140. });
  141. </script>
  142. ##}