diy.htm 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ##tlayout("wap/layout.htm",{head_title:"我的定制"}){
  2. <div class="body">
  3. <div class="base-list-wrapper" >
  4. ##for(_item in list!){
  5. <div class="double-grid-one">
  6. <div class="double-grid-item">
  7. <div class="list-img_content">
  8. <a href="/wap/diy?id=${_item.id!}&type=2 "><img src="${_item.img_url!}" /></a>
  9. </div>
  10. <a class="add_cart_btn" href="javascript:addCart(${_item.id!})"></a>
  11. <a class="add_cart_btn see_btn" href="${_item.img_url!}"></a>
  12. <a class="add_cart_btn dels_btn" href="javascript:void(0);" onclick="deleteDiy(${_item.id!})"></a>
  13. </div>
  14. </div>
  15. ##}
  16. </div>
  17. </div>
  18. <a href="/wap/shop/cart" class="goback add_cart_num">
  19. <span>购物车</span>
  20. ##if(cart_number!=0){
  21. <i class="num">${cart_number!0}</i>
  22. ##}
  23. </a>
  24. <script>
  25. function addCart(id){
  26. $.post("/wap/shop/addCart",{id:id},function(data){
  27. alert(data.msg);
  28. if(data.success){
  29. location.reload();
  30. }
  31. });
  32. }
  33. function deleteDiy(id){
  34. if(confirm("确定要删除该条记录?")){
  35. $.post("/wap/user/deleteDiy",{id:id},function(data){
  36. alert(data.msg);
  37. if(data.success){
  38. location.reload();
  39. }
  40. });
  41. }
  42. }
  43. </script>
  44. ##}