commodity_edit_old.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <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>
  5. <ul class="setting" style="min-width:100%;width:100%;padding:20px 0;">
  6. <div class="datalist">
  7. <li class="length">
  8. <em>所属类目:</em>
  9. <div class="checkbox">
  10. {loop typeclass(16) as $val}
  11. {if $val['id'] != 132}
  12. <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>
  13. {/loop}
  14. {/if}
  15. </div>
  16. </li>
  17. </div>
  18. <div style="clear:both;"></div>
  19. </ul>
  20. <div class="control">
  21. <a href="javascript:void(0);" class="cdedit">批量修改</a>
  22. </div>
  23. <div class="packing">
  24. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  25. <tr>
  26. <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
  27. <td>SKU</td>
  28. <td>SKU名称</td>
  29. <td>SKU产品</td>
  30. <td>操作</td>
  31. </tr>
  32. </table>
  33. <table class="datatext data" border="0" style="border-collapse:collapse;">
  34. {loop $sku as $val}
  35. <tr class="{$val['id']}" data-list="{$val['id']}">
  36. <td><input name="check" type="checkbox" value="{$val['id']}"></td>
  37. <td>{$val['code']}</td>
  38. <td>{$val['codeid']}</td>
  39. <td>{$val['fpdata']}</td>
  40. <td><span class="commoditysku" data-h="/commodity/skuedit/{$val['id']}" data-t="SKU - 编辑">编 辑</span></td>
  41. </tr>
  42. {/loop}
  43. </table>
  44. </div>
  45. <div class="cdread">
  46. <div class="exp">
  47. <div class="expwp">
  48. <ul class="setting">
  49. <div class="datalist">
  50. <li class="cike2">
  51. <em>类 目:</em>
  52. <select name="category" class="select">
  53. </select>
  54. </li>
  55. <li>
  56. <em>等 级:</em>
  57. <select name="grade" class="select">
  58. <option value="80">9A</option>
  59. {loop typeclass(13) as $val}
  60. {if $val['id'] != 80}
  61. <option value="{$val['id']}">{$val['title']}</option>
  62. {/if}
  63. {/loop}
  64. </select>
  65. </li>
  66. <li>
  67. <em>头发颜色:</em>
  68. <select name="color" class="select">
  69. <option value="a">未选择</option>
  70. <option value="57">Natural Black</option>
  71. {loop typeclassyc(8) as $val} <!-- 这个是不显示部分颜色 -->
  72. {if $val['id'] != 57}
  73. <option value="{$val['id']}">{$val['title']}</option>
  74. {/if}
  75. {/loop}
  76. </select>
  77. </li>
  78. <li>
  79. <em>曲 度:</em>
  80. <select name="lowe" class="select">
  81. {loop typeclassyc(15) as $val} <!-- 这个是不显示部分曲度 -->
  82. <option value="{$val['id']}">{$val['title']}</option>
  83. {/loop}
  84. </select>
  85. </li>
  86. </div>
  87. <div class="pttab">
  88. <select class="none select"><option></option></select>
  89. <li class="127 none cikeb">
  90. <em>类 型:</em>
  91. <select name="type" class="select">
  92. {loop typeclass(27) as $val}
  93. <option value="{$val['id']}">{$val['title']}</option>
  94. {/loop}
  95. </select>
  96. </li>
  97. <li class="127 none">
  98. <em>头路设计:</em>
  99. <select name="headroad" class="select">
  100. <option value="c">未选择</option>
  101. {loop typeclass(12) as $val}
  102. <option value="{$val['id']}">{$val['title']}</option>
  103. {/loop}
  104. </select>
  105. </li>
  106. <li class="127 none">
  107. <em>密 度:</em>
  108. <select name="density" class="select">
  109. <option value="b">未选择</option>
  110. <option value="71">150%</option>
  111. {loop typeclass(10) as $val}
  112. {if $val['id']!=71}
  113. <option value="{$val['id']}">{$val['title']}</option>
  114. {/if}
  115. {/loop}
  116. </select>
  117. </li>
  118. <li class="127 a1 none">
  119. <em>蕾丝尺寸:</em>
  120. <select name="lacesize" class="select">
  121. {loop typeclassyc(25) as $val} <!-- 这个是不显示部分尺寸 -->
  122. <option value="{$val['id']}">{$val['title']}</option>
  123. {/loop}
  124. </select>
  125. </li>
  126. <li class="a2 none">
  127. <em>蕾丝尺寸:</em>
  128. <select name="lacesize" class="select">
  129. {loop typeclassyc(26) as $val}
  130. <option value="{$val['id']}">{$val['title']}</option>
  131. {/loop}
  132. </select>
  133. </li>
  134. <li class="a3 none">
  135. <em>蕾丝尺寸:</em>
  136. <select name="lacesize" class="select">
  137. <option value="186">4" x 4"</option>
  138. <option value="191">13" x 4"</option>
  139. </select>
  140. </li>
  141. <li class="128 none">
  142. <em>头套种类:</em>
  143. <select name="lacetype" class="select">
  144. <option value="146">13*4 Lace Front wigs</option>
  145. {loop typeclassyc(18) as $val}
  146. {if $val['id']!=146}
  147. <option value="{$val['id']}">{$val['title']}</option>
  148. {/if}
  149. {/loop}
  150. </select>
  151. </li>
  152. <li class="128 none">
  153. <em>发帽大小:</em>
  154. <select name="haircap" class="select">
  155. <option value="30">Medium</option>
  156. {loop typeclass(6) as $val}
  157. {if $val['id']!=30}
  158. <option value="{$val['id']}">{$val['title']}</option>
  159. {/if}
  160. {/loop}
  161. </select>
  162. </li>
  163. <li class="128 none">
  164. <em>密 度:</em>
  165. <select name="density" class="select">
  166. <option value="b">未选择</option>
  167. <option value="72">180%</option>
  168. {loop typeclass(10) as $val}
  169. {if $val['id']!=72}
  170. <option value="{$val['id']}">{$val['title']}</option>
  171. {/if}
  172. {/loop}
  173. </select>
  174. </li>
  175. <li class="127 128 none">
  176. <em>蕾丝颜色:</em>
  177. <select name="lacecolor" class="select">
  178. {loop typeclassyc(9) as $val}
  179. <option value="{$val['id']}">{$val['title']}</option>
  180. {/loop}
  181. </select>
  182. </li>
  183. <li class="130 none">
  184. <em>重 量:</em>
  185. <select name="weight" class="select">
  186. {loop typeclass(7) as $val}
  187. <option value="{$val['id']}">{$val['title']}</option>
  188. {/loop}
  189. </select>
  190. </li>
  191. </div>
  192. <div style="clear:both;"></div>
  193. </ul>
  194. <div class="sonbut"><font class="cdtj">提 交</font> <font class="datasavegb">关 闭</font></div>
  195. </div>
  196. </div></div>
  197. <div class="hidden">
  198. <input type="hidden" name="id" value="{$commodity['id']}" />
  199. </div>
  200. <div class="button"><font class="produtdata">提 交</font> <font class="fh">关 闭</font></div>
  201. </div>
  202. <script>
  203. $(".commoditysku").click(function() {
  204. $("input[name='t']",window.parent.document).val($(this).data("t"));
  205. $("input[name='h']",window.parent.document).val($(this).data("h"));
  206. $(".commodityread",window.parent.document).click();
  207. });
  208. var addedit="/commodity/edit/";var fh="/commodity";
  209. $(document).ready(function() { custom(); });
  210. function custom() {
  211. var num = $('.packing .datatitle tr').children().length;
  212. $('.data tr td').css("width","20%");
  213. $(".data tr").each(function() {
  214. $(this).find('td:eq(0)').css("width","2%");
  215. $(this).find('td:eq(3)').css("width","48%");
  216. $(this).find('td:eq(4)').css("width","10%");
  217. });}
  218. function oMainFn(id,e){
  219. $("."+id+" td:eq(3)").html(e);
  220. }
  221. $(".sonbut .datasavegb").click(function() {
  222. $(".cdread").hide()});
  223. $(".cike2 select").change(function(){
  224. var index = $(this).find("option:selected").val();
  225. $(".pttab li").hide(); $(".pttab li").removeClass("post");
  226. $("."+index).show();$("."+index).addClass("post");
  227. $('.pttab select option:eq(0)').prop('selected','selected');
  228. if(index == 127)
  229. {
  230. $(".pttab .a1").show();$(".pttab .a2").hide();
  231. }
  232. });
  233. //提交时tr增加data信息
  234. $(".exp").on('click',".cdtj",function() {
  235. var f = "";var e = "";var o = "";var d = "";
  236. $(".exp .datalist .select").each(function() {
  237. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  238. {
  239. f = f + $(this).children("option:selected").val() + "-";
  240. e = e + $(this).children("option:selected").text() + " ";
  241. }
  242. });
  243. $(".exp .post .select").each(function() {
  244. if($(this).children("option:selected").val() != 0 || $(this).children("option:selected").val() != '')
  245. {
  246. f = f + $(this).children("option:selected").val() + "-";
  247. e = e + $(this).children("option:selected").text() + " ";
  248. }
  249. });
  250. $(".datatext input[name='check']:checked").each(function() {
  251. d = d + $(this).val()+",";
  252. });
  253. if($("select[name='category']").val() == "")
  254. {
  255. $(".ts p").text($(".datalist .checkbox").prevAll("em").text()+"为必填项");
  256. $(".ts").show();
  257. setTimeout('$(".ts").fadeOut()', 600);
  258. return false;
  259. }
  260. else
  261. {
  262. layx.load('loadId','处理中');
  263. $.ajax({
  264. url: "/commodity/batchedit/",
  265. data: "data="+f+"&id="+d,
  266. type: "POST",
  267. dataType: "json",
  268. success: function(a) {
  269. layx.destroy('loadId');
  270. if (a && a.success) {
  271. for (i = 0; i < a.rows.length; i++) {
  272. $(".datatext ." + a.rows[i]["id"] + " td:eq(3)").html(a.rows[i]["title"]);
  273. };
  274. }
  275. else
  276. {
  277. $(".ts p").text("操作失败,请重试");
  278. $(".ts").show();
  279. setTimeout('$(".ts").fadeOut()', 800);
  280. }
  281. }
  282. });
  283. $(".cdread").hide()
  284. }
  285. });
  286. </script>
  287. {Template footer}