123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- {Template header}
- <body>
- <style type="text/css">
- .datatext .txtcolor{background:#f5f5f5;}
- .datatext tr:nth-child(even) .txtcolor {background-color:#e7e7e7;}
- </style>
- <div class="warp">
- <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>
- <ul class="setting" style="min-width:100%;width:100%;padding:20px 0;">
- <div class="datalist">
- <li class="length">
- <em>所属类目:</em>
- <div class="checkbox">
- {loop typeclass(16) as $val}
- {if $val['id'] != 132}
- <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>
- {/loop}
- {/if}
- </div>
- </li>
- </div>
- <div style="clear:both;"></div>
- </ul>
- <div class="packing">
- <table class="datatitle data" border="0" style="border-collapse:collapse;">
- <tr>
- <td>SKU</td>
- <td>SKU名称</td>
- <td>本地SKU</td>
- </tr>
- </table>
- <table class="datatext data" border="0" style="border-collapse:collapse;">
- {loop $sku as $val}
- <tr class="{$val['id']}" data-list="{$val['id']}">
- <td data-a=><p>{$val['code']}</p><!-- <p>{$val['skuid']}</p> --></td>
- <td data-a=>{$val['codeid']}</td>
- <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>
- </tr>
- {/loop}
- </table>
- </div>
- <div class="hidden">
- <input type="hidden" name="id" value="{$commodity['id']}" />
- </div>
- <div class="button"><font class="comdata">提 交</font> <font class="fh">关 闭</font></div>
- </div>
- <script>
- var addedit="/commodity/edit/";var fh="/commodity";
- $(document).ready(function() { custom(); wh(); });
- function custom() {
- var num = $('.packing .datatitle tr').children().length;
- $('.data tr td').css("width","15%");
- $(".data tr").each(function() {
- $(this).find('td:eq(1)').css("width","40%");
- $(this).find('td:eq(2)').css("width","45%");
- });}
- function wh() {
- $(".datatext tr").each(function() {
- $(this).find("td:eq(2) textarea").height($(this).find("td:eq(2)").height());
- });
- }
- $(".comdata").click(function() {
- $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> 正在添加中,请稍后...");
- $(".ts").show();
- var f = "";var e = "";
- $(".hidden input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- for(i=0;i<$(".datalist .checkbox").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".datalist .checkbox:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname == "")
- {
- $(".ts p").text($(".datalist .checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- f = f + checkname + "=" + checkid + "&";
- }
- $(".datatext tr").each(function() {
- var str = $(this).find("td:eq(2) textarea").val().replace(/\+/g,"%2B");
- e = e + $(this).data("list") + "@" + str + "|";
- });
- if(e != "")
- {
- f = f + "data=" + e;
- }
- $.ajax({
- url: addedit,
- data: f,
- type: "POST",
- dataType: "json",
- success: function(a) {
- if (a && a.success) {
- $(".ts").hide();
- $(".express p:eq(0)").html(a.msg+"是否关闭?");
- $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
- $(".express").show();
- } else {
- $(".ts").hide();
- $(".ts p").html("添加失败,请重试");
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 600);
- }
- }
- });
- })
- </script>
- {Template footer}
|