commodity_edit.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {Template header}
  2. <body>
  3. <style type="text/css">
  4. .datatext .txtcolor{background:#f5f5f5;}
  5. .datatext tr:nth-child(even) .txtcolor {background-color:#e7e7e7;}
  6. </style>
  7. <div class="warp">
  8. <div class="title" style="height:auto;line-height:28px;padding:15px 0;color:#000"><a href="http://www.aliexpress.com/item/{$commodity['productid']}.html" target="_blank">{$commodity['title']}</a></div>
  9. <ul class="setting" style="min-width:100%;width:100%;padding:20px 0;">
  10. <div class="datalist">
  11. <li class="length">
  12. <em>所属类目:</em>
  13. <div class="checkbox">
  14. {loop typeclass(16) as $val}
  15. {if $val['id'] != 132}
  16. <span class="ckrows"><label><input name="category" type="checkbox" value="{$val['id']}" {if stripos($commodity['category'],','.$val['id'].',') !== false}checked{/if}><font>{$val['title']}</font></label></span>
  17. {/loop}
  18. {/if}
  19. </div>
  20. </li>
  21. </div>
  22. <div style="clear:both;"></div>
  23. </ul>
  24. <div class="packing">
  25. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  26. <tr>
  27. <td>SKU</td>
  28. <td>SKU名称</td>
  29. <td>本地SKU</td>
  30. </tr>
  31. </table>
  32. <table class="datatext data" border="0" style="border-collapse:collapse;">
  33. {loop $sku as $val}
  34. <tr class="{$val['id']}" data-list="{$val['id']}">
  35. <td data-a=><p>{$val['code']}</p><!-- <p>{$val['skuid']}</p> --></td>
  36. <td data-a=>{$val['codeid']}</td>
  37. <td style="padding:0px;line-height:0px;"><textarea name="sku" style="width:96%;border: 0px solid Transparent;line-height:30px;padding:0 2%" class="txtcolor">{$val['sku']}</textarea></td>
  38. </tr>
  39. {/loop}
  40. </table>
  41. </div>
  42. <div class="hidden">
  43. <input type="hidden" name="id" value="{$commodity['id']}" />
  44. </div>
  45. <div class="button"><font class="comdata">提 交</font> <font class="fh">关 闭</font></div>
  46. </div>
  47. <script>
  48. var addedit="/commodity/edit/";var fh="/commodity";
  49. $(document).ready(function() { custom(); wh(); });
  50. function custom() {
  51. var num = $('.packing .datatitle tr').children().length;
  52. $('.data tr td').css("width","15%");
  53. $(".data tr").each(function() {
  54. $(this).find('td:eq(1)').css("width","40%");
  55. $(this).find('td:eq(2)').css("width","45%");
  56. });}
  57. function wh() {
  58. $(".datatext tr").each(function() {
  59. $(this).find("td:eq(2) textarea").height($(this).find("td:eq(2)").height());
  60. });
  61. }
  62. $(".comdata").click(function() {
  63. $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在添加中,请稍后...");
  64. $(".ts").show();
  65. var f = "";var e = "";
  66. $(".hidden input:hidden").each(function() {
  67. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  68. });
  69. for(i=0;i<$(".datalist .checkbox").length;i++)
  70. {
  71. var checkid = ""; var checkname = "";
  72. $(".datalist .checkbox:eq("+i+") .ckrows input:checked").each(function(){
  73. checkname = $(this).attr("name");
  74. checkid = checkid + $(this).val()+",";
  75. });
  76. if(checkname == "")
  77. {
  78. $(".ts p").text($(".datalist .checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
  79. $(".ts").show();
  80. setTimeout('$(".ts").fadeOut()', 600);
  81. return false;
  82. }
  83. f = f + checkname + "=" + checkid + "&";
  84. }
  85. $(".datatext tr").each(function() {
  86. var str = $(this).find("td:eq(2) textarea").val().replace(/\+/g,"%2B");
  87. e = e + $(this).data("list") + "@" + str + "|";
  88. });
  89. if(e != "")
  90. {
  91. f = f + "data=" + e;
  92. }
  93. $.ajax({
  94. url: addedit,
  95. data: f,
  96. type: "POST",
  97. dataType: "json",
  98. success: function(a) {
  99. if (a && a.success) {
  100. $(".ts").hide();
  101. $(".express p:eq(0)").html(a.msg+"是否关闭?");
  102. $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
  103. $(".express").show();
  104. } else {
  105. $(".ts").hide();
  106. $(".ts p").html("添加失败,请重试");
  107. $(".ts").fadeIn();
  108. setTimeout('$(".ts").fadeOut()', 600);
  109. }
  110. }
  111. });
  112. })
  113. </script>
  114. {Template footer}