diy.htm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ##tlayout("www/layout.htm"){
  2. <nav class="my-nav">
  3. <ul class="container list-unstyled nav-list clearfix">
  4. <li><a href="/user">个人中心</a></li>
  5. <li><a href="/user/orders">我的订单</a></li>
  6. <li class="active"><a href="/user/diy">我的定制</a></li>
  7. <li><a href="/user/address">收货地址</a></li>
  8. </ul>
  9. </nav>
  10. <section class="container" style="min-height: 600px;">
  11. <div style="height: 20px;"></div>
  12. <div class="product-wrapper">
  13. <div class="product-content">
  14. <ul class="product-list row list-unstyled clearfix">
  15. ##for(_item in diy_list!){
  16. <li>
  17. <div class="list_item">
  18. <img src="${_item.img_url!}" class="img-responsive prduct-img"/>
  19. <div class="product-title">
  20. <div class="title">${_item.diy_title!}</div>
  21. <div class="remark">${_item.diy_remark!}</div>
  22. <div class="remark">创建时间:${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</div>
  23. <a style="color: #fff;" target="_blank" href='/diy?id=${_item.id!}&type=2' class="btn">编辑定制</a>
  24. <span onclick="addCart(${_item.id!})" class="btn">加入购物车</span>
  25. <span onclick="showImg('${_item.img_url!}')" class="btn btn_two">查看设计</span>
  26. <div class="del_diy_btn" onclick="deleteDiy(${_item.id!})"><img src="/www/image/del_diy.png" /></div>
  27. </div>
  28. </div>
  29. </li>
  30. ##}
  31. </ul>
  32. </div>
  33. </div>
  34. </section>
  35. <script>
  36. function addCart(id){
  37. $.post("/shop/addCart",{id:id},function(data){
  38. alert(data.msg);
  39. if(data.success){
  40. location.reload();
  41. }
  42. });
  43. }
  44. function showImg(imgUrl){
  45. window.open(imgUrl);
  46. }
  47. function deleteDiy(id){
  48. if(confirm("确定要删除该条记录?")){
  49. $.post("/user/deleteDiy",{id:id},function(data){
  50. alert(data.msg);
  51. if(data.success){
  52. location.reload();
  53. }
  54. });
  55. }
  56. }
  57. $(document).ready(function(){
  58. $('.product-list li').hover(function(){
  59. $(this).find('.product-title').stop().fadeIn();
  60. },function(){
  61. $(this).find('.product-title').stop().fadeOut();
  62. });
  63. });
  64. </script>
  65. ##}