<%@ page language="C#" autoeventwireup="true" inherits="Add_Products, WebApp_deploy" enableeventvalidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品发布页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link href="Skin/TopStyle/Basic.css" rel="stylesheet" type="text/css" />
    <link href="Skin/ProductClassStyle/Style.css" rel="stylesheet" type="text/css" />
    <script src="Js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="Skin/CommStyle/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="Skin/ProductClassStyle/js/saleProduct.js" type="text/javascript"></script>
    <link href="CKEdit/kindedit/themes/default/default.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="CKEdit/kindedit/plugins/code/prettify.css" />
    <script charset="utf-8" src="CKEdit/kindedit/plugins/code/prettify.js" type="text/javascript"></script>
    <script charset="utf-8" src="CKEdit/kindedit/kindeditor.js" type="text/javascript"></script>
    <script charset="utf-8" src="CKEdit/kindedit/lang/zh_CN.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        KindEditor.ready(function (K) {
            var editor1 = K.create('#<%=TxtDesc.ClientID %>', {
                items: [
        		                'source', '|', 'undo', 'redo', '|', 'preview', 'code', 'cut', 'copy', 'paste',
        		                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
        		                'justifyfull', 'insertorderedlist', 'insertunorderedlist',
        		                '|', 'fullscreen', '/',
        		                'fontname', 'fontsize', '|', 'forecolor', 'bold',
        		                'italic', 'underline', 'lineheight', '|', 'image', 'multiimage',
        		                'flash', 'media', 'table', 'baidumap',
        		                'link', 'unlink'
        	            ],
                pasteType: 1,
                cssPath: 'CKEdit/kindedit/plugins/code/prettify.css',
                uploadJson: 'CKEdit/kindedit/asp.net/upload_json.ashx',
                fileManagerJson: 'CKEdit/kindedit/asp.net/file_manager_json.ashx',
                allowFileManager: true
            });
            prettyPrint();
        });
    </script>
    <style type="text/css">
        .wp
        {
            font-size: 12px;
        }
    </style>
</head>
<script language="javascript" type="text/javascript">
    function clearLabelInput() {
        //if (document.getElementById("goods_lbl1").value == "黄山")
        //document.getElementById("goods_lbl1").value = "";
    }
    function labelInputBlur() {
        //if (document.getElementById("goods_lbl1").value == "") {
        //document.getElementById("goods_lbl1").value = "泰山";
        // }
    }
</script>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <hl:Top ID="Top1" runat="server" />
    <div class="wp" id="wp1">
        <ul class="flow-chart">
            <li class="step a2" title="选择商品所在分类"></li>
            <li class="step b1" title="填写商品详细信息"></li>
            <li class="step c2" title="商品发布成功"></li>
        </ul>
        <div class="item-publish">
            <div class="goods-attribute">
                <dl class="tit">
                    <h3>
                        商品基本信息</h3>
                </dl>
                <dl>
                    <dt>商品分类：</dt>
                    <dd id="gcategory">
                        <span class="f_l">
                            <asp:Literal ID="ltrProClass" runat="server"></asp:Literal></span> <a class="edit_gcategory btn"
                                id="edit_gcategory" href="ClassChoose.aspx?showProType=<%=ProType %>">编辑</a>
                    </dd>
                </dl>
                <dl id="productType_Edit_1" runat="server">
                    <dt>商品类型：</dt>
                    <dd>
                        <p style="padding-right: 8px;">
                            <asp:RadioButton ID="rdoProductType1" runat="server" GroupName="type" Text="一口价"
                                Checked="true" />
                            <asp:RadioButton ID="rdoProductType2" runat="server" GroupName="type" Text="拍卖" />
                            <asp:RadioButton ID="rdoProductType3" runat="server" GroupName="type" Text="团购" />
                            <asp:RadioButton ID="rdoProductType4" runat="server" GroupName="type" Text="促销" />
                            <asp:RadioButton ID="rdoProductType5" runat="server" GroupName="type" Text="积分商品" />
                        </p>
                    </dd>
                </dl>
                <dl id="productType_Edit_2" runat="server" visible="false">
                    <dt>商品类型：</dt>
                    <dd>
                        <asp:Literal ID="ltrProductType" runat="server"></asp:Literal>
                        <asp:HiddenField ID="HiddenFieldProductType" runat="server" />
                        <asp:HiddenField ID="HiddenFieldProductID" runat="server" />
                        <asp:HiddenField ID="HiddenFieldImgID" runat="server" />
                    </dd>
                </dl>
                <dl>
                    <dt>新旧程度：</dt>
                    <dd>
                        <p style="padding-right: 8px;">
                            <asp:RadioButton ID="rdoProductStandard1" runat="server" GroupName="stamp" Text="全新"
                                Checked="true" />
                            <asp:RadioButton ID="rdoProductStandard2" runat="server" GroupName="stamp" Text="二手" />
                        </p>
                    </dd>
                </dl>
                <dl>
                    <dt><span class="red">*</span>商品名称：</dt>
                    <dd>
                        <p>
                            <input id="goods_name" type="text" class="text width9" runat="server" />
                        </p>
                        <p class="hint">
                            商品标题名称长度至少3个字符，最长50个汉字</p>
                    </dd>
                </dl>
                <dl>
                    <dt><span class="red">*</span>标签：</dt>
                    <dd>
                        <p>
                            <input id="goods_lbl1" type="text" class="text width11" onfocus="clearLabelInput();"
                                onblur="labelInputBlur();" runat="server" value="" />
                            <input id="goods_lbl2" type="text" class="text width11" onfocus="clearLabelInput();"
                                onblur="labelInputBlur();" runat="server" value="" />
                            <input id="goods_lbl3" type="text" class="text width11" onfocus="clearLabelInput();"
                                onblur="labelInputBlur();" runat="server" value="" />
                            <input id="goods_lbl4" type="text" class="text width11" onfocus="clearLabelInput();"
                                onblur="labelInputBlur();" runat="server" value="" />
                        </p>
                        <p class="hint">
                            每个框输入一个标签。如：黄山一</p>
                    </dd>
                </dl>
                <dl>
                    <dt nc_type="no_spec"><span class="red">*</span>商品价格：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <input id="goods_store_price" runat="server" type="text" class="text width11" />
                            <!-- 价格区间 -->
                        </p>
                        <p class="hint">
                            价格必须是0.01~1000000之间的数字</p>
                    </dd>
                </dl>
                <dl id="display_CustomPrice">
                    <dt nc_type="no_spec"><span class="red"></span>市场参考价：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <input id="CustomPrice" runat="server" type="text" class="text width11" />
                            <!-- 价格区间 -->
                        </p>
                        <p class="hint">
                            价格必须是0.01~1000000之间的数字</p>
                    </dd>
                </dl>
                <!--拍卖 加价幅度-->
                <dl id="display_productType_2" style="display: none;">
                    <dt>加价幅度：</dt>
                    <dd>
                        <input id="txtImcrementPrice" runat="server" type="text" class="text width11" />
                    </dd>
                </dl>
                <dl id="display_productType_dc2" style="display: none">
                    <dt>起拍价：</dt>
                    <dd>
                        <input id="txtAuctionStartPrice" runat="server" type="text" class="text width11" />
                    </dd>
                </dl>
                <!--团购 档次-->
                <dl id="display_productType_3" style="display: none;">
                    <dt>价格档次：</dt>
                    <dd>
                        <asp:DropDownList ID="DropTeamNum" runat="server" onchange="return changeTeam()" />
                    </dd>
                </dl>
                <dl id="Dl_3" style="display: none;">
                    <dt>档次：</dt>
                    <dd>
                        <p id="team_1">
                            档次1：&nbsp;<span class="team_name">
                                <asp:Literal ID="TeamName1" runat="server" /></span> 最低商品数 ：<input id="TeamNumber1"
                                    value="" type="text" class="text width50" runat="server" />
                            <input id="TeamPrice1" value="0" type="text" class="text width50" runat="server" />
                            &nbsp;元 &nbsp;
                        </p>
                        <p id="team_2">
                            档次2：&nbsp; <span class="team_name">
                                <asp:Literal ID="TeamName2" runat="server" /></span> 最低商品数 ：<input id="TeamNumber2"
                                    value="" type="text" class="text width50" runat="server" />
                            <input id="TeamPrice2" value="0" type="text" class="text width50" runat="server" />&nbsp;元&nbsp;
                        </p>
                        <p id="team_3">
                            档次3：&nbsp; <span class="team_name">
                                <asp:Literal ID="TeamName3" runat="server" /></span> 最低商品数 ：<input id="TeamNumber3"
                                    value="" type="text" class="text width50" runat="server" />
                            <input id="TeamPrice3" value="0" type="text" class="text width50" runat="server" />&nbsp;元&nbsp;
                        </p>
                        <p id="team_4">
                            档次4：&nbsp; <span class="team_name">
                                <asp:Literal ID="TeamName4" runat="server" /></span> 最低商品数 ：<input id="TeamNumber4"
                                    value="" type="text" class="text width50" runat="server" />
                            <input id="TeamPrice4" value="0" type="text" class="text width50" runat="server" />&nbsp;元&nbsp;
                        </p>
                        <p id="team_5">
                            档次5：&nbsp; <span class="team_name">
                                <asp:Literal ID="TeamName5" runat="server" /></span> 最低商品数 ：<input id="TeamNumber5"
                                    value="" type="text" class="text width50" runat="server" />
                            <input id="TeamPrice5" value="0" type="text" class="text width50" runat="server" />&nbsp;元&nbsp;
                        </p>
                    </dd>
                </dl>
                <dl id="Dl_Price_3" style="display: none">
                    <dt>预付诚意金： </dt>
                    <dd>
                        原始价的
                        <input id="OrderMoneyPercent" value="0" type="text" class="text width50" runat="server" />
                        % 请填写1-100的数字，0表示不需预付诚意金 (若设置预付诚意 金为0，则风险由卖家承担)
                    </dd>
                </dl>
                <!--秒杀 开始-->
                <dl id="display_productType_4" style="display: none">
                    <dt>秒杀价:</dt>
                    <dd>
                        <input id="txtPromotePrice" value="" type="text" class="text width11" runat="server" /></dd>
                </dl>
                <dl id="Dl_4" style="display: none">
                    <dt>开始时间:</dt>
                    <dd>
                        <input id="BeginTimeDay" value="" type="text" class="text width11" runat="server"
                            onclick="WdatePicker()" readonly="readonly" />
                        <asp:DropDownList ID="ddlBeginTimeHour" runat="server" Style="float: none;">
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddlBeginTimeMM" runat="server" Style="float: none;">
                            <asp:ListItem Value="05">05</asp:ListItem>
                            <asp:ListItem Value="10">10</asp:ListItem>
                            <asp:ListItem Value="15">15</asp:ListItem>
                            <asp:ListItem Value="20">20</asp:ListItem>
                            <asp:ListItem Value="25">25</asp:ListItem>
                            <asp:ListItem Value="30">30</asp:ListItem>
                            <asp:ListItem Value="35">35</asp:ListItem>
                            <asp:ListItem Value="40">40</asp:ListItem>
                            <asp:ListItem Value="45">45</asp:ListItem>
                            <asp:ListItem Value="50">50</asp:ListItem>
                            <asp:ListItem Value="55">55</asp:ListItem>
                        </asp:DropDownList>
                    </dd>
                </dl>
                <dl id="end_4" style="display: none">
                    <dt>结束时间:</dt>
                    <dd>
                        <input id="EndTimeDay" value="" type="text" class="text width11" runat="server" onfocus="WdatePicker({ minDate: '#F{$dp.$D(\'BeginTimeDay\')||\'2020-10-01\'}' })"
                            readonly="readonly" />
                        <asp:DropDownList ID="ddlEndTimeHour" runat="server" Style="float: none;">
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddlEndTimeMM" runat="server" Style="float: none;">
                            <asp:ListItem Value="05">05</asp:ListItem>
                            <asp:ListItem Value="10">10</asp:ListItem>
                            <asp:ListItem Value="15">15</asp:ListItem>
                            <asp:ListItem Value="20">20</asp:ListItem>
                            <asp:ListItem Value="25">25</asp:ListItem>
                            <asp:ListItem Value="30">30</asp:ListItem>
                            <asp:ListItem Value="35">35</asp:ListItem>
                            <asp:ListItem Value="40">40</asp:ListItem>
                            <asp:ListItem Value="45">45</asp:ListItem>
                            <asp:ListItem Value="50">50</asp:ListItem>
                            <asp:ListItem Value="55">55</asp:ListItem>
                        </asp:DropDownList>
                    </dd>
                </dl>
                <!--秒杀 结束-->
                <%--积分商品 开始--%>
                <dl id="display_productType_5" style="display: none">
                    <dt>换购积分:</dt>
                    <dd>
                        <input id="txtNeedPresentExp" value="1" type="text" class="text width11" runat="server" /></dd>
                </dl>
                <!--积分商品 结束-->
                <div id="ltrSpec_value" class="none" style="width: 100%;">
                </div>
                <div id="ltrSpec_kc" class="none">
                </div>
                <dl>
                    <dt nc_type="no_spec"><span class="red">*</span>商品库存：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <input id="goods_storage" value="" type="text" class="text width11" runat="server" />
                        </p>
                        <p class="hint">
                            商铺库存数量必须为1~1000000000之间的整数</p>
                    </dd>
                </dl>
                <dl>
                    <dt nc_type="no_spec"><span class="red">*</span>库存报警下限：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <input id="txtAlarmNum" value="0" type="text" class="text width11" runat="server" />
                        </p>
                        <p class="hint">
                            商铺库存报警下限数量必须为数字！</p>
                    </dd>
                </dl>
                <dl>
                    <dt nc_type="no_spec">商品单位：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <asp:DropDownList ID="ddlCalculateUnit" runat="server">
                            </asp:DropDownList>
                        </p>
                        <p class="hint">
                            商品计量单位，没有选择时，系统默认为“件”！</p>
                    </dd>
                </dl>
                <dl>
                    <dt nc_type="no_spec">商品货号：</dt>
                    <dd nc_type="no_spec">
                        <p>
                            <input id="goods_serial" value="" type="text" class="text width9" runat="server" />
                        </p>
                        <p class="hint">
                            商品货号是指卖家个人管理商品的编号，买家不可见</br>最多可输入20个字符，支持输入中文、字母、数字、_、/、-和小数点</p>
                    </dd>
                </dl>
                <dl>
                    <dt>商品图片：</dt>
                    <dd>
                        <div class="pic_list">
                            <ul id="menus" class="menu">
                                <li class="active" id="li_1"><a href="javascript:void(0);">商品图片</a></li>
                            </ul>
                            <div class="content">
                                <div id="demo">
                                </div>
                                <div class="standard">
                                    <div class="small_pic">
                                        <ul id="goods_images">
                                            <li nc_type="handle_pic" id="thumbnail_0">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" width="60"
                                                            height="60" id="img1" runat="server" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FileUpload1" runat="server" Width="60px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField1" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                            <li nc_type="handle_pic" id="thumbnail_1">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" width="60"
                                                            height="60" id="img2" runat="server" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FileUpload2" runat="server" Width="60px" Height="25px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField2" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                            <li nc_type="handle_pic" id="thumbnail_2">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" id="img3"
                                                            runat="server" height="60" width="60" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FileUpload3" runat="server" Width="60px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField3" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                            <li nc_type="handle_pic" id="thumbnail_3">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" id="img4"
                                                            runat="server" width="60" height="60" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FileUpload4" runat="server" Width="60px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField4" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                            <li nc_type="handle_pic" id="thumbnail_4">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" id="img5"
                                                            runat="server" width="60" height="60" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FileUpload5" runat="server" Width="60px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField5" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <div class="help">
                                        <p class="ico">
                                            最多可发布5张商品图片。</p>
                                        <p>
                                            支持图片上传、从用户空间添加两种方式发布。支持jpg、jpeg、gif、png格式图片，建议上传尺寸300x300以上、大小1.00M内的图片。</p>
                                        <p>
                                        </p>
                                        <p>
                                        </p>
                                    </div>
                                    <label class='error none' generated='true' for='goods_img'>
                                        上传的第一张图片不能为空</label>
                                    <div class="clear">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </dd>
                </dl>
                <dl>
                    <dt>首页推荐图</dt>
                    <dd>
                        <div class="pic_list">
                            <div class="content" style="border: 0px;">
                                <div class="standard">
                                    <div class="small_pic">
                                        <ul id="Ul2">
                                            <li nc_type="handle_pic">
                                                <div class="picture">
                                                    <span class="thumb size60"><i></i>
                                                        <img src="Skin/ProductClassStyle/images/default_goods_image.gif_tiny.gif" id="img6"
                                                            runat="server" width="60" height="60" />
                                                    </span>
                                                </div>
                                                <div class="upload-btn">
                                                    <a href="javascript:void(0);"><span style="width: 66px; height: 28px; position: absolute;
                                                        overflow: hidden; left: 0; top: 0; z-index: 999; cursor: pointer;">
                                                        <asp:FileUpload ID="FilePic" runat="server" Width="60px" />
                                                    </span>
                                                        <asp:HiddenField ID="HiddenField6" runat="server" />
                                                    </a>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <div class="help">
                                        <p class="ico">
                                            最多可发布1张商品图片。</p>
                                        <p>
                                            支持图片上传、从用户空间添加两种方式发布。支持jpg、jpeg、gif、png格式图片，建议上传尺寸310x220以上、大小1.00M内的图片。</p>
                                        <p>
                                        </p>
                                        <p>
                                        </p>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </div>
                    </dd>
                </dl>
                
                <dl class="tit">
                    <h3>
                        商品详情描述</h3>
                </dl>
                <dl id="spec_group_dl_1" runat="server" visible="false">
                    <dt>商品属性：</dt>
                    <dd>
                        <asp:UpdatePanel ID="upAttribute" runat="server">
                            <ContentTemplate>
                                <div id="AttributesDiv" runat="server" align="left" visible="false">
                                    <asp:Panel ID="AttributesPanel" runat="server">
                                    </asp:Panel>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </dd>
                </dl>
                <dl style="display: none">
                    <dt>商品品牌：</dt>
                    <dd>
                        <input type="text" id="txtBrand" class="text width13" runat="server" />
                    </dd>
                </dl>
                <dl>
                    <dt>商品描述：</dt>
                    <dd>
                        <p>
                            <asp:TextBox runat="server" ID="TxtDesc" Width="850" Height="500" TextMode="MultiLine" />
                        </p>
                    </dd>
                </dl>
                <!--transport info begin-->
                <!--团购-->
                <dl class="tit">
                    <h3>
                        商品物流信息</h3>
                </dl>
                <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>--%>
                <dl>
                    <dt>所在地：</dt>
                    <dd>
                        <p id="region">
                            <asp:DropDownList ID="ddlProvince" runat="server">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlCity" runat="server" CssClass="none">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlArea" runat="server" CssClass="none">
                            </asp:DropDownList>
                        </p>
                        <div class="clear">
                        </div>
                    </dd>
                </dl>
                <%--</ContentTemplate>
                </asp:UpdatePanel>--%>
                <dl>
                    <dt>运费：</dt>
                    <dd>
                        <p style="float: left; clear: both; margin-top: 8px;">
                            <asp:RadioButton ID="whops_seller" runat="server" Checked="true" GroupName="whop" />
                            <label for="whops_seller">
                                卖家承担运费</label>
                        </p>
                        <p style="float: left; clear: both; margin-top: 8px;">
                            <asp:RadioButton ID="whops_buyer" runat="server" GroupName="whop" />
                            <label for="whops_buyer">
                                买家承担运费</label>
                        </p>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <div class="transport_tpl" id="whops_buyer_box">
                                    <ul style="line-height: 30px;">
                                        <li>
                                            <asp:RadioButton ID="isApplyPostage_true" runat="server" GroupName="whops" Checked="true" />
                                            <label for="isApplyPostage_true">
                                                使用运费模板</label>
                                            &nbsp;<div id="Postage">
                                                <div class="freight-template">
                                                    <asp:RadioButtonList ID="CheckBoxList_DeliverType" runat="server" RepeatLayout="Flow" />
                                                    <asp:Label runat="server" Text="" ID="deliverText" Style="color: red"></asp:Label>
                                                    <span class="template-name" id="postageName"></span>
                                                    <input onclick="postageButton_click();" type="button" value="新增运费模板" class="select-templ"
                                                        id="postageButton">
                                                    <%--<input onclick="SelectDeliver()"
                                                        type="button" value="新增运费模板" class="select-templ" id="postageButton">--%>
                                                    <asp:Button ID="Button_refresh" runat="server" OnClick="Button_refresh_Click" Text="刷新"
                                                        Style="width: 40px;" class="select-templ none" />
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <script type="text/javascript">
                                    try { setwhop(); } catch (e) { }
                                </script>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </dd>
                </dl>
                <script type="text/javascript">
                    function postageButton_click() {
                        $('#<%=Button_refresh.ClientID %>').removeClass("none"); window.open("/Member/Shop_AddDeliver.aspx?action=add&from=publish")
                    }
                </script>
                <!--transport info end-->
                <dl class="tit">
                    <h3>
                        其他信息</h3>
                </dl>
                <dl style="display: none">
                    <dt>本店分类：</dt>
                    <dd>
                        <p>
                            <asp:DropDownList ID="DDLClass" runat="server" class="sgcategory">
                            </asp:DropDownList>
                            <span class="new_add"><a href="javascript:;" id="add_sgcategory" class="btn">新增分类</a>
                            </span>
                        </p>
                        <p class="hint">
                            商品可以从属于店铺的多个分类之下,</br>店铺分类可以由 "用户中心 -> 卖家 -> 商品管理 -> 分类管理" 中自定义</p>
                    </dd>
                </dl>
                <dl>
                    <dt>有效期：</dt>
                    <dd>
                        <p>
                            <asp:DropDownList ID="ValidDay" runat="server">
                                <asp:ListItem Value="7"></asp:ListItem>
                                <asp:ListItem Value="14"></asp:ListItem>
                                <asp:ListItem Value="30"></asp:ListItem>
                                <asp:ListItem Value="100"></asp:ListItem>
                                <asp:ListItem Value="360"></asp:ListItem>
                            </asp:DropDownList>
                        </p>
                    </dd>
                </dl>
                <dl>
                    <dt>商品发布：</dt>
                    <dd>
                        <p style="float: left; clear: both; margin-top: 8px;">
                            <label>
                                <asp:RadioButton ID="rdo_lj" runat="server" Checked="true" Text="立即发布" GroupName="rdo" />
                            </label>
                        </p>
                        <p style="float: left; clear: both; margin-top: 8px;">
                            <label>
                                <asp:RadioButton ID="rdo_fb" runat="server" Text=" 发布时间" GroupName="rdo" />
                            </label>
                            <input class="text sel" disabled="disabled" id="starttime" onclick="WdatePicker()"
                                readonly="readonly" name="starttime" runat="server" />
                            <asp:DropDownList ID="ddlStattime" runat="server" disabled="disabled" Style="float: none;"
                                CssClass="sel">
                            </asp:DropDownList>
                            时
                            <asp:DropDownList ID="ddlStattime_minute" runat="server" Style="float: none;" CssClass="sel">
                                <asp:ListItem Value="00">00</asp:ListItem>
                                <asp:ListItem Value="05">05</asp:ListItem>
                                <asp:ListItem Value="10">10</asp:ListItem>
                                <asp:ListItem Value="15">15</asp:ListItem>
                                <asp:ListItem Value="20">20</asp:ListItem>
                                <asp:ListItem Value="25">25</asp:ListItem>
                                <asp:ListItem Value="30">30</asp:ListItem>
                                <asp:ListItem Value="35">35</asp:ListItem>
                                <asp:ListItem Value="40">40</asp:ListItem>
                                <asp:ListItem Value="45">45</asp:ListItem>
                                <asp:ListItem Value="50">50</asp:ListItem>
                                <asp:ListItem Value="55">55</asp:ListItem>
                            </asp:DropDownList>
                            分
                        </p>
                        <p style="float: left; clear: both; margin-top: 8px;">
                            <label>
                                <asp:RadioButton ID="rdo_ck" runat="server" Text="放入仓库" GroupName="rdo" /></label>
                        </p>
                    </dd>
                </dl>
                <dl>
                    <dt>商品推荐：</dt>
                    <dd>
                        <p>
                            <label style="padding-right: 8px;">
                                <asp:RadioButton ID="rdo_commend" runat="server" Checked="true" Text="是" GroupName="is" />
                            </label>
                            <label>
                                <asp:RadioButton ID="rdo_none" runat="server" Text="否" GroupName="is" /></label>
                        </p>
                        <p class="hint">
                            被推荐的商品会显示在店铺首页</p>
                    </dd>
                </dl>
                <dl>
                    <dt>SEO关键字<br />
                        (keywords)：</dt>
                    <dd>
                        <p>
                            <input id="seo_keywords" type="text" class="text width9" value="" maxlength="10"
                                runat="server" />
                        </p>
                        <p class="hint">
                        <span style="color:Red;">最多10个字。</span><br />
                            SEO关键字 (keywords) 出现在商品详细页面头部的 Meta 标签中，<br />
                            用于记录本页面商品的关键字，多个关键字间请用半角逗号 "," 隔开</p>
                    </dd>
                </dl>
                <dl>
                    <dt>SEO描述<br />
                        (description)：</dt>
                    <dd>
                        <p>
                            <textarea id="seo_description" class="text width9 h80" name="seo_description" runat="server"></textarea>
                        </p>
                        <p class="hint">
                            SEO描述 (description) 出现在商品详细页面头部的 Meta 标签中，<br />
                            用于记录本页面商品内容的概要与描述，建议120字以内</p>
                    </dd>
                </dl>
                <div class="clear">
                    <p>
                        &nbsp;</p>
                    <p>
                        &nbsp;</p>
                </div>
                <div class="issuance">
                    <asp:HiddenField ID="HiddenFieldTitle" runat="server" />
                    <asp:HiddenField ID="HiddenFieldValue" runat="server" />
                    <asp:Button ID="btnSubmit2" runat="server" CssClass="btn" Text="提交" OnClick="btnSubmit2_Click"
                        OnClientClick="return SubmitForm()" />
                </div>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="HFTitle" runat="server" />
    <asp:HiddenField ID="HFValue" runat="server" />
    <asp:HiddenField ID="HFValueDetail" runat="server" />
    <hl:Foot ID="Foot1" runat="server" />
    </form>
    <script type="text/javascript">
        function ajaxProductPicUpload(fileid) {
            var srcPath = '<%=Request.Url.ToString().Remove(Request.Url.ToString().IndexOf(Request.Url.AbsolutePath)) %>';
            $.ajaxFileUpload(
                               {
                                   url: 'WebService/UploadSigleImg.ashx',            //需要链接到服务器地址
                                   secureuri: false,
                                   fileElementId: fileid,                        //文件选择框的id属性
                                   dataType: 'text',                                     //服务器返回的格式，可以是json
                                   success: function (data, status)            //相当于try语句块的用法
                                   {
                                       var _uploadF = $("#" + fileid);
                                       var _src = data.toLowerCase().replace("<pre>", "").replace("</pre>", "");
                                       _uploadF.parent().siblings().val(_src);
                                       _uploadF.parent().parent().parent().siblings().find("img").attr("src", srcPath + "/" + _src);


                                   },
                                   error: function (data, status, e)            //相当于catch语句块的用法
                                   {
                                       alert("上传失败！");
                                       return;
                                   }
                               }

                           );
        }
        function ajaxFileUpload(fileid) {
            var srcPath = '<%=Request.Url.ToString().Remove(Request.Url.ToString().IndexOf(Request.Url.AbsolutePath)) %>';
            //var fileN = $("#" + fileid).val();
            $.ajaxFileUpload(
                               {
                                   url: 'WebService/UploadSigleImg.ashx',            //需要链接到服务器地址
                                   secureuri: false,
                                   fileElementId: fileid,                        //文件选择框的id属性
                                   dataType: 'text',                                     //服务器返回的格式，可以是json
                                   success: function (data, status)            //相当于try语句块的用法
                                   {
                                       var _uploadF = $("#" + fileid);
                                       var _src = data.toLowerCase().replace("<pre>", "").replace("</pre>", "");
                                       _uploadF.parent().parent().siblings().find("img").attr("src", srcPath + "/" + _src);
                                   },
                                   error: function (data, status, e)            //相当于catch语句块的用法
                                   {
                                       alert("上传失败！");
                                       return;
                                   }
                               }

                           );

        }

        //上传图片
        function SubmitPicFile(fileUploadId) {
            $('#' + fileUploadId).click();
        }
        function removeparent_tr() {
            alert($(this).parent().html());
            $(this).parent().parent().remove();
        }
        function setwhop() {
            if ($("#<%=whops_seller.ClientID %>").is(":checked")) $("#whops_buyer_box").addClass("none");
            else $("#whops_buyer_box").removeClass("none");
        }
        $(function () {
            //不显示运费
            try { setwhop(); } catch (e) { }
            $("#<%=whops_seller.ClientID %>").click(function () {
                $("#whops_buyer_box").addClass("none");
            });
            $("#<%=whops_buyer.ClientID %>").click(function () {
                $("#whops_buyer_box").removeClass("none");
            });
            //发布时间
            $("#<%=rdo_fb.ClientID %>").click(function () {
                //$("#<%=starttime.ClientID %>").attr("disabled", ""); 
                $("#<%=starttime.ClientID %>").removeAttr("disabled"); //日期可用
                //$("#<%=ddlStattime.ClientID %>").attr("disabled", "");
                $("#<%=ddlStattime.ClientID %>").removeAttr("disabled");//时下拉列表可用
                //$("#<%=ddlStattime_minute.ClientID %>").attr("disabled", "");
                $("#<%=ddlStattime_minute.ClientID %>").removeAttr("disabled");//分下拉列表可用
                $("#<%=starttime.ClientID %>").removeClass("sel");
                $("#<%=ddlStattime.ClientID %>").attr("class", "");
                $("#<%=ddlStattime_minute.ClientID %>").attr("class", "");
            });
            //立即发布
            $("#<%=rdo_lj.ClientID %>").click(function () {
                $("#<%=starttime.ClientID %>").attr("disabled", "disabled");
                $("#<%=ddlStattime.ClientID %>").attr("disabled", "disabled");
                $("#<%=ddlStattime_minute.ClientID %>").attr("disabled", "disabled");
                $("#<%=starttime.ClientID %>").addClass("sel");
                $("#<%=ddlStattime.ClientID %>").attr("class", "sel");
                $("#<%=ddlStattime_minute.ClientID %>").attr("class", "sel");
            });
            //放入仓库
            $("#<%=rdo_ck.ClientID %>").click(function () {
                $("#<%=starttime.ClientID %>").attr("disabled", "disabled");
                $("#<%=ddlStattime.ClientID %>").attr("disabled", "disabled");
                $("#<%=ddlStattime_minute.ClientID %>").attr("disabled", "disabled");
                $("#<%=starttime.ClientID %>").addClass("sel");
                $("#<%=ddlStattime.ClientID %>").attr("class", "sel");
                $("#<%=ddlStattime_minute.ClientID %>").attr("class", "sel");
            });
            //团购 档次(商品类型)
            $("input[name='type']").click(function () {
                var pp = $(this).val();
                if (pp != "") {
                    //积分商品
                    document.getElementById("display_productType_5").style.display = "none";
                    //秒杀
                    document.getElementById("display_productType_4").style.display = "none";
                    document.getElementById("Dl_4").style.display = "none";
                    document.getElementById("end_4").style.display = "none";
                    //团购
                    document.getElementById("display_productType_3").style.display = "none";
                    document.getElementById("Dl_3").style.display = "none";
                    document.getElementById("Dl_Price_3").style.display = "none";
                    //拍卖
                    document.getElementById("display_productType_2").style.display = "none";
                    document.getElementById("display_productType_dc2").style.display = "none";
                    //规格
                    $("#ltrSpec_value").addClass("none");

                    if (pp == 'rdoProductType3') {  //团购
                        document.getElementById("display_productType_3").style.display = "";
                        document.getElementById("Dl_3").style.display = "";
                        document.getElementById("Dl_Price_3").style.display = "";
                        document.getElementById("display_CustomPrice").style.display = "none";
                        changeTeam();
                    } else if (pp == 'rdoProductType4') {  //秒杀
                        document.getElementById("display_productType_4").style.display = "";
                        document.getElementById("Dl_4").style.display = "";
                        document.getElementById("end_4").style.display = "";
                    } else if (pp == 'rdoProductType2') {  //拍卖
                        //拍卖
                        document.getElementById("display_productType_2").style.display = "";
                        document.getElementById("display_productType_dc2").style.display = "";
                    } else if (pp == 'rdoProductType1') {
                        //规格
                        $("#ltrSpec_value").removeClass("none");
                    } else if (pp == 'rdoProductType5') {
                        //积分商品
                        document.getElementById("display_productType_5").style.display = "";
                    }
                }
            });
            //Ajax开始
            //规格分类
            var ClassID = '<%=AttributesClassID %>';
            ajaxMethod("GetProSpec_valueByTypeName", function (d) {
                $.each(d.table1, function (i) {
                    //规格
                    $("#ltrSpec_value").removeClass("none");
                    if (d.table1[i].Sp_id == 1) {
                        ajaxMethod("GetSpec_valueBySp_id", function (dd) {
                            var html = "<dl id='spec_group_dl_" + i + "' nctype='spec_group_dl' class='spec-bg' spec_img='t'><dt><input type='hidden' name='" + dd.table1[0].sp_id + "' value='" + dd.table1[0].sp_name + "' />" + dd.table1[0].sp_name + "：</dt><dd nctype='sp_group_val'><ul class='spec'>";
                            $.each(dd.table1, function (k) {
                                if (dd.table1[k].sp_format == "image") {
                                    html += "<li><span nctype='input_checkbox' class='checkbox'><input type='checkbox'  nc_type='y" + k + "' class='sp_val' onclick='Shownc(" + k + ")' value='" + dd.table1[k].sp_value_name + "' name='" + dd.table1[k].sp_value_id + "'></span><span class='img'><img style='width:16px;height:16px;' src='" + dd.table1[k].sp_value_image + "'></span><span nctype='pv_name' class='pvname'>" + dd.table1[k].sp_value_name + "</span></li>";
                                } else {
                                    html += "<li><span nctype='input_checkbox' class='checkbox'><input type='checkbox'  nc_type='y" + k + "' class='sp_val' onclick='Shownc(" + k + ")' value='" + dd.table1[k].sp_value_name + "' name='" + dd.table1[k].sp_value_id + "'></span><span nctype='pv_name' class='pvname'>" + dd.table1[k].sp_value_name + "</span></li>";
                                }
                            });

                            html += "</ul><div class='clear'></div>";
                            ajaxMethod("GetSpec_valueBySp_id", function (ddd) {
                                //上传图片颜色 begin
                                html += "<table cellspacing='0' cellpadding='0' border='0' nctype='col_img_table'  class='spec_table' id='specImag' style='display:none'><thead><tr><th>颜色</th><th class='width7'>图片（无图片可不填）</th></tr></thead><tbody>";
                                var _num = 0;
                                $.each(ddd.table1, function (m) {
                                    if (ddd.table1[m].sp_format == "image") {
                                        html += "<tr nctype='file_tr_" + m + "' style='display:none;'><td><span class='img'><img style='width:16px;height:16px;' src='" + ddd.table1[m].sp_value_image + "'></span><span nctype='pv_name' class='pvname' id='file_tr_" + m + "'>" + ddd.table1[m].sp_value_name + "</span></td><td class='w300'><span class='pvname'><input type='file' id='file_t_" + _num + "'  onchange='ajaxFileUpload(\"file_t_" + _num + "\")' name='file_t_" + _num + "' onchange='onloadup(" + m + ")'></span></td></tr>";
                                    } else {
                                        html += "<tr nctype='file_tr_" + m + "' style='display:none;'><td><span nctype='pv_name' class='pvname'>" + ddd.table1[m].sp_value_name + "</span></td><td class='w300'><span class='pvname'><input type='file' id='file_t_" + _num + "' onchange='ajaxFileUpload(\"file_t_" + _num + "\")' name='file_t_" + _num + "' onchange='onloadup(" + m + ")'></span></td></tr>";

                                    }
                                    _num++;
                                });
                                html += "<tr><td colspan='15'><p style='padding-left:10px;' class='hint'>支持jpg、jpeg、gif、png格式图片。<br>建议上传尺寸310x310、大小1.00M内的图片。<br>商品详细页选中颜色图片后，颜色图片将会在商品展示图区域展示。</p></td></tr></tbody></table>";
                                //上传图片颜色 end
                                html += " </dd></dl>";
                                $("#ltrSpec_value").append(html);
                                $("#ltrSpec_value").removeClass("none");
                                //库存数量
                                kc();
                            }, "{ 'sp_id': '" + d.table1[i].Sp_id + "' }");
                            setTimeout("GetSpec()", 500);
                        }, "{ 'sp_id': '" + d.table1[i].Sp_id + "' }");

                    } else {
                        ajaxMethod("GetSpec_valueBySp_id", function (dd) {
                            var html = "<dl id='spec_group_dl_" + i + "' nctype='spec_group_dl' class='spec-bg' spec_img='t'><dt><input type='hidden' name='" + dd.table1[0].sp_id + "' value='" + dd.table1[0].sp_name + "' />" + dd.table1[0].sp_name + "：</dt><dd nctype='sp_group_val'><ul class='spec'>";
                            $.each(dd.table1, function (k) {

                                if (dd.table1[k].sp_format == "image") {
                                    html += "<li><span nctype='input_checkbox'  class='checkbox'><input type='checkbox'  nc_type='" + dd.table1[k].sp_value_id + "' class='sp_val' value='" + dd.table1[k].sp_value_name + "' onclick='show()' name='" + dd.table1[k].sp_value_id + "'></span><span class='img'><img style='width:16px;height:16px;' src='" + dd.table1[k].sp_value_image + "'></span><span nctype='pv_name' class='pvname'>" + dd.table1[k].sp_value_name + "</span></li>";
                                } else {
                                    html += "<li><span nctype='input_checkbox'   class='checkbox'><input type='checkbox'  nc_type='" + dd.table1[k].sp_value_id + "' class='sp_val' value='" + dd.table1[k].sp_value_name + "' onclick='show()' name='" + dd.table1[k].sp_value_id + "'></span><span nctype='pv_name' class='pvname'>" + dd.table1[k].sp_value_name + "</span></li>";
                                }
                            });
                            html += "</ul><div class='clear'></div></dd></dl>";
                            $("#ltrSpec_value").append(html);
                            setTimeout("GetSpec()", 500);
                        }, "{ 'sp_id': '" + d.table1[i].Sp_id + "' }");
                    }
                });

            }, "{ 'ClassID': '" + ClassID + "' }");


            //Ajax结束
        });


        function ajaxMethod(method, callback, d) {
            var json = {};
            $.ajax({
                type: 'POST',
                url: "WebService/WebService.asmx/" + method,
                data: d || {},
                contentType: "application/json",
                success: function (data) {
                    if (data.d == null) {
                        return;
                    } else {
                        callback(eval('(' + data.d + ')'));
                    }
                },
                dataType: "json"
            });
            return json;
        }
        //颜色
        function Shownc(p) {
            var nc = $("input[type='checkbox'][nc_type=y" + p + "]");
            if (nc.is(":checked")) {
                $("#specImag").css("display", "");
                $("#specImag tbody tr[nctype=file_tr_" + p + "]").show();
            } else {
                $("#specImag tbody tr[nctype=file_tr_" + p + "]").hide();
            }
            var flag = false;
            $("#specImag tbody tr").each(function () {
                if ($(this).find("img").length > 0 && $(this).css("display") == "table-row") {
                    flag = true;
                }
            });
            if (!flag) {
                $("#specImag").css("display", "none");
            }
            show();

        }

        function SumKuCun(sen) {
            var trc = $(sen).parent().parent().parent().children("tr");

            var cl = trc.eq(0).children("td").length;
            var counts = 0;
            trc.each(function () {
                $(this).children("td").each(function (i) {
                    if (i == (cl - 2)) {
                        var _m = $(this).children("input").val();
                        if (_m != "") {
                            counts = counts + parseInt(_m);
                        }
                    }
                });

            });
            $("#goods_storage").val(counts);
        }

        function show() {
            var arrDD = $("#ltrSpec_value dl dd");
            var arrAB = $("#ltrSpec_kc dl dd table tbody");
            var y = 1;
            var allArr = new Array();
            var rowsCount = 1;
            arrDD.each(function () {
                var tempArr = new Array();
                $(this).children("ul").children("li").children("span").children("input").each(function () {
                    if ($(this).attr("checked")) {
                        tempArr.push($(this).val());
                    }
                });
                rowsCount = rowsCount * tempArr.length;
                allArr.push(tempArr);

            });

            var columCount = $("#ltrSpec_kc .spec-bg .spec-dd .spec_table thead tr th").length;
            var onetr = "<tr>";
            for (var i = 0; i < columCount; i++) {
                if (i >= columCount - 3) {
                    if (i == columCount - 2) {
                        onetr += "<td><input class='text' type='text' onblur='SumKuCun(this)' value='' data_type='price' ></td>";
                    }
                    else {
                        onetr += "<td><input class='text' type='text' value='' data_type='price' ></td>";
                    }

                }
                else {
                    onetr += "<td>&nbsp;</td>";
                }

            }
            onetr += "</tr>";
            var htm = "";
            for (var i = 0; i < rowsCount; i++) {
                htm += onetr;
            }

            arrAB.html(htm);
            if (rowsCount < 1) {
                $("#ltrSpec_kc").hide();
            }
            else {
                $("#ltrSpec_kc").show();
            }
            arrDD.each(function (i) {
                var tempArr = new Array();
                var hh = -1;
                var ddThis = $(this);
                $(this).children("ul").children("li").children("span").children("input").each(function () {
                    if ($(this).attr("checked")) {
                        if (i == 0) {
                            var _th = $(this);
                            var _tmVal = $(this).val();
                            hh++;
                            arrAB.children("tr").each(function (jj) {
                                var k = rowsCount / allArr[i].length;
                                if (jj >= k * hh && jj < k * (hh + 1)) {
                                    $(this).children("td").each(function (ii) {
                                        if (i == ii) {
                                            $(this).html(_tmVal);
                                            $(this).append('<input type="hidden" name="' + _tmVal + '" value="' + _th.attr("name") + '" >');
                                        }

                                    });
                                }

                            });
                        } else {
                            var _tmVal = $(this).val();
                            hh++;
                            var gg = 0;
                            var rindex = ddThis.children("ul").children("li").children("span").children("input:checked").length;
                            arrAB.children("tr").each(function (jj) {
                                var k = rowsCount / allArr[i].length;
                                $(this).children("td").each(function (ii) {
                                    if (i == ii) {
                                        if (gg >= allArr[i].length) { gg = 0; }
                                        var _v = ddThis.children("ul").children("li").children("span").children("input:checked").eq(gg++);
                                        $(this).html(_v.val());
                                        $(this).append('<input type="hidden" name="' + _v.val() + '"  value="' + _v.attr("name") + '" >');
                                    }

                                });
                                //                                if (jj >= k * hh && jj < k * (hh + 1)) {
                                //                                    $(this).children("td").each(function (ii) {
                                //                                        if (i == ii) {
                                //                                            $(this).html(ddThis.children("ul").children("li").children("span").children("input:checked").eq(gg++).val());
                                //                                        }

                                //                                    });
                                //                                }


                            });
                        }
                        //tempArr.push($(this).val());
                    }
                });

            });

            //                $(this).find("dd li input[type='checkbox']").each(function () {
            //                    if ($(this).attr("checked")) {
            //                        y = y + 1;
            //                        htm += "<td><input type='hidden' value='" + $(this).val() + "' >" + $(this).val() + "</td>";
            //                        if (y = arrCB.length) {
            //                            htm += "<td><input type='text' value=''  class='text'></td><td><input type='text' value=''  class='text'></td><td><input type='text' value=''  class='text'></td>";
            //                        }
            //                    }
            //                });

        }
        //库存数量
        function kc() {
            //库存数量
            var vv = $("#ltrSpec_value dl dt");
            var ht = "<dl  class='spec-bg' nc_type='spec_dl'><dt>库存配置：</dt><dd class='spec-dd'><table cellspacing='0' cellpadding='0' border='0' class='spec_table'><thead><tr>";
            vv.each(function () {
                ht += "<th>" + $(this).html() + "</th>";
            });
            ht += "<th><span class='red'>*</span>价格</th><th><span class='red'>*</span>库存</th><th>商品货号</th></tr></thead><tbody nc_type='spec_table'></tbody></table></dd></dl>";
            $("#ltrSpec_kc").append(ht);
        }

        //上传图片
        function onloadup(n) {
            alert(n);
            var file = $("#ltrSpec_value table tr[nctype='file_tr_" + n + "']").find("input[type='file']");
            if (file.val() == "") {
                alert("请选择上传的图片");
            } else {
                //上传图片
                alert(file.val());
                $.post("WebService/ShopService.ashx", { 'Action': 'GetImagePreview' }, function (data, state) {
                    if (state == "success") {
                        alert(data);
                        //alert("上传成功");
                    }
                });
            }
        }




        //表单验证
        function SubmitForm() {
            var goods_name = $("#goods_name");
            var goods_lbl = $("#goods_lbl");
            var goods_store_price = $("#goods_store_price");
            var goods_storage = $("#goods_storage");
            var whops_buyer = $("#<%=whops_buyer.ClientID %>");
            var HiddenField1 = $("#<%=HiddenField1.ClientID %>");

            //商品名称
            if (goods_name.val() == "") {
                goods_name.next().remove();
                goods_name.addClass("error");
                goods_name.after("<label class='error' generated='true' for='goods_name'> 商品名称不能为空</label>");
                return false;
            } else {
                goods_name.removeClass("error");
                goods_name.next().addClass("none");
            }
            //商品标签
            if (goods_lbl.val() == "") {
                goods_lbl.next().remove();
                goods_lbl.addClass("error");
                goods_lbl.after("<label class='error' generated='true' for='goods_lbl'> 商品标签不能为空</label>");
                return false;
            } else {
                goods_lbl.removeClass("error");
                goods_lbl.next().addClass("none");
            }
            //商品价格
            if (goods_store_price.val() == "") {
                goods_store_price.next().remove();
                goods_store_price.addClass("error");
                goods_store_price.after("<label class='error' generated='true' for='goods_store_price'> 商品价格不能为空</label>");
                return false;
            } else {
                if (isNaN(goods_store_price.val())) {
                    goods_store_price.next().remove();
                    goods_store_price.addClass("error");
                    goods_store_price.after("<label class='error' generated='true' for='goods_store_price'> 商品价格不能是为字符串</label>");
                    return false;
                } else {
                    goods_store_price.removeClass("error");
                    goods_store_price.next().addClass("none");
                }
            }
            //商品库存
            if (goods_storage.val() == "") {
                goods_storage.next().remove();
                goods_storage.addClass("error");
                goods_storage.after("<label class='error' generated='true' for='goods_storage'> 商铺库存数量必须为1~1000000000之间的整数</label>");
                return false;
            } else {
                if (isNaN(goods_storage.val())) {
                    goods_storage.next().remove();
                    goods_storage.addClass("error");
                    goods_storage.after("<label class='error' generated='true' for='goods_storage'> 商铺库存数量必须为1~1000000000之间的整数</label>");
                    return false;
                } else {
                    goods_storage.removeClass("error");
                    goods_storage.next().addClass("none");
                }
            }
            var goods_alarmnum = $("#txtAlarmNum");
            //库存报警数
            if (goods_alarmnum.val() == "") {
                goods_alarmnum.next().remove();
                goods_alarmnum.addClass("error");
                goods_alarmnum.after("<label class='error' generated='true' for='goods_storage'> 商铺库存报警下限数量必须为数字！</label>");
                return false;
            } else {
                if (isNaN(goods_alarmnum.val())) {
                    goods_alarmnum.next().remove();
                    goods_alarmnum.addClass("error");
                    goods_alarmnum.after("<label class='error' generated='true' for='goods_storage'> 商铺库存报警下限数量必须为数字！</label>");
                    return false;
                } else {
                    goods_alarmnum.removeClass("error");
                    goods_alarmnum.next().addClass("none");
                }
            }



            //图片上传
            if (HiddenField1.val() == "") {
                $("label[for='goods_img']").removeClass("none");
                return false;
            } else {
                $("label[for='goods_img']").addClass("none");
            }
           
            //获取规格的数据
            FormSpec();

            return true;
        }

        //获取规格数据
        function FormSpec() {
            //标题
            var n_dt = $("#ltrSpec_kc dl dd table thead tr th input[type='hidden']");
            //获取规格ID
            var hid_title = new Array();
            var temptit = '';
            n_dt.each(function () {
                var n = $(this).attr("name");
                hid_title.push(n);
                temptit += n + ",";
            });

            if (temptit.length > 1) {
                temptit = temptit.substring(0, temptit.length - 1);
            }
            $("#HFTitle").val(temptit);
            //获取选中规格的种类
            var arrDD = $("#ltrSpec_value dl dd ul");
            var allArr = new Array();
            arrDD.each(function () {
                var tempArr = new Array();
                $(this).children("li").children("span").children("input").each(function () {
                    if ($(this).attr("checked")) {
                        tempArr.push($(this).attr("name"));
                    }
                });
                allArr.push(tempArr);
            });

            var tempVal = '';
            for (var _j = 0; _j < hid_title.length; _j++) {
                tempVal += hid_title[_j] + ":"; //规格名称ID
                var t = '';
                for (var b = 0; b < allArr[_j].length; b++) {
                    t += allArr[_j][b] + ","; //规格名称对应的规格值ID
                }
                if (t.length > 0) {
                    t = t.substring(0, t.length - 1);
                }
                //规格名称为颜色时
                if (hid_title[_j] == 1) {
                    var titlecolor1 = ""; //字符串（颜色名称%颜色图片）
                    //上传图片
                    var imgTrCount = $("#specImag tbody tr");
                    imgTrCount.each(function (c) {
                        var nc = $("input[type='checkbox'][nc_type=y" + c + "]");
                        var hidtname2 = "";
                        var colorimgsrc = "null";
                        var titlecolor = "";
                        if (nc.is(":checked")) {
                            hidtname2 = nc.attr("value"); //颜色名称
                            //被选中的颜色，上传图片
                            $(this).children("td").each(function (tdi) {
                                var colorsrc = "";
                                var colorname = "";
                                if (tdi == 0) {
                                    $(this).children("span").each(function (spani) {
                                        var colorclassname = $(this).attr("class");
                                        if (colorclassname == "img") {
                                            colorsrc = $(this).children("img").attr("src"); //图片路径
                                        } else if (colorclassname == "pvname") {
                                            colorname = $("#file_tr_" + c).text(); //图片名称
                                        }
                                    });
                                }
                                if (hidtname2 == colorname) {//名称
                                    colorimgsrc = colorsrc;
                                    var srcPath = '<%=Request.Url.ToString().Remove(Request.Url.ToString().IndexOf(Request.Url.AbsolutePath)) %>'; //http://ce.52cmyp.com
                                    var pa = srcPath + "/";
                                    if (colorimgsrc.length > 0 && colorimgsrc.length > pa.length) {
                                        var pastr = colorimgsrc.substring(0, pa.length);
                                        if (pastr == pa) {
                                            colorimgsrc = colorimgsrc.substring(pa.length, colorimgsrc.length);
                                        }
                                    }
                                    titlecolor = "$" + hidtname2 + colorimgsrc;
                                    //图片http://ce.52cmyp.com/uploadfile/shoppic/201211/2012111914326670.jpg
                                    return false;
                                }
                            });
                            titlecolor1 += titlecolor;
                        }
                    }); //图片
                    var tc1 = titlecolor1;
                    if (tc1.length > 1) {
                        if (tc1.substring(tc1.length - 1) == ";") {
                            tc1 = tc1.substring(0, tc1.length - 1);
                        }
                    }
                    t += "," + tc1; //图片路径保存
                }

                tempVal += t + "|";
            }

            if (tempVal.length > 1) {
                tempVal = tempVal.substring(0, tempVal.length - 1);
            }
            $('#<%=HFValue.ClientID%>').val(tempVal);

            var standPrice = $("#goods_store_price").val(); //价格
            var tempValDet = '[';
            var arrAB = $("#ltrSpec_kc dl dd table tbody");
            //库存配置
            arrAB.children("tr").each(function (jj) {
                tempValDet += "["
                var cou = $(this).children("td").length;
                var tvd = '';
                $(this).children("td").children("input").each(function (ii) {
                    if (ii == (cou - 3)) {
                        if ($(this).val() == "") {
                            tvd += standPrice + ",";
                        }
                        else {
                            tvd += $(this).val() + ",";
                        }
                    }
                    else {
                        if ($(this).val() == "") {
                            tvd += "0,";
                        }
                        else {
                            tvd += $(this).val() + ",";
                        }
                    }

                });
                if (tvd.length > 0) {
                    tvd = tvd.substring(0, tvd.length - 1);
                }
                tempValDet += tvd;
                tempValDet += "],"
            });
            if (tempValDet.length > 1) {
                tempValDet = tempValDet.substring(0, tempValDet.length - 1);
            }
            tempValDet += ']';
            $('#<%=HFValueDetail.ClientID %>').val(tempValDet);
        }

        //获取商品规格信息
        function GetSpec() {
            var specValue = '<%=SpValues %>'; //（规格名称Id：规格值）2:13,17|1:5,10
            //  alert("specValue：" + specValue);
            if (specValue != "") {
                var specValueDetial = '<%=SpValueDetail %>'; //[[13,5,1,1,11],[13,10,2,2,22],[17,5,3,3,33],[17,10,4,4,44]]
                var vdpofirst = specValueDetial.indexOf('[[');
                var vdplast = specValueDetial.lastIndexOf(']]');
                var newSpecValueDetail = specValueDetial;
                if (vdpofirst >= 0 && vdplast > 0) {
                    var vd = specValueDetial.replace('[[', '');
                    newSpecValueDetail = vd.replace(']]', '');
                }
                var specvdsplit = newSpecValueDetail.split('],['); //分割字符
                var array1 = new Array();
                for (var vdi = 0; vdi < specvdsplit.length; vdi++) {
                    array1.push(specvdsplit[vdi]);
                }
                var arrDetail = $("#ltrSpec_kc dl dd table tbody"); //库存配置
                var arrDL = $("#ltrSpec_value dl");
                //alert("长度：" + arrDL.length);
                arrDL.each(function () {
                    var specValueSplit = specValue.split('|'); //以（'|'）分割的规格数组（规格名称Id：规格值如{2:13,17},{1:5,10}）
                    for (var specVIndexed = 0; specVIndexed < specValueSplit.length; specVIndexed++) {
                        var specValueS = specValueSplit[specVIndexed].split(':'); //以（':'）分割的规格数组，第一项是规格名称ID，其他都是规格的值
                        for (var valueIndexed = 0; valueIndexed < specValueS.length; valueIndexed++) {
                            var valueBool = "false";
                            var valuestr = "";

                            var specTitleId = $(this).children("dt").children("input").attr("name"); //规格名称Id
                            //当规格名称Id一样时
                            if (specTitleId == specValueS[0]) {
                                $(this).children("dd").each(function (ddindex) {
                                    //复选框列表
                                    $(this).eq(ddindex).children("ul").children("li").children("span").children("input").each(function () {
                                        if (valueIndexed != 0) {
                                            if (specValueS[valueIndexed] != "") {
                                                var titleimg = "";
                                                valuestr = specValueS[valueIndexed];
                                                //颜色
                                                if (specTitleId == "1") {
                                                    var pv = valuestr.indexOf('$');
                                                    var pvjia = pv;
                                                    var pvjian = pv;
                                                    if (pvjia > 0) {
                                                        if ((parseInt(pv) + 1) < valuestr.length) {
                                                            pvjia = parseInt(pvjia) + 1;
                                                        }
                                                        titleimg = valuestr.substring(pvjia, valuestr.length);
                                                        if ((parseInt(pvjian) - 1) > 0) {
                                                            pvjian = parseInt(pvjian) - 1;
                                                        }
                                                        valuestr = valuestr.substring(0, pvjian);
                                                    }
                                                    //alert("jia：" + pvjia + "   " + titleimg + "\njian：" + pvjian + "   " + valuestr);
                                                }
                                                var specValueId = valuestr;
                                                if ((valuestr.indexOf(',')) > 0) { //判断数组中是否存在","
                                                    specValueId = valuestr.split(','); //以（','）分割的规格值id数组
                                                    for (var indexVId = 0; indexVId < specValueId.length; indexVId++) {
                                                        //当已选的规格值与复选框的列表的值相等
                                                        if ($(this).attr("name") == specValueId[indexVId]) {
                                                            $(this).attr("checked", "true");
                                                            valueBool = "true";
                                                            if (specTitleId == "1") {
                                                                showcolorimg(titleimg); //图片
                                                            }
                                                        }
                                                    }
                                                } else {
                                                    //当已选的规格值与复选框的列表的值相等
                                                    if ($(this).attr("name") == specValueId) {
                                                        $(this).attr("checked", "true");
                                                        valueBool = "true";
                                                        if (specTitleId == "1") {
                                                            showcolorimg(titleimg); //图片调用函数
                                                        }
                                                    }
                                                }
                                            }
                                        } //if (valueIndexed != 0) end
                                    });
                                });
                            } //if (specTitleId == specValueS[0]) end                            
                            if (valueBool) {
                                stockpeizhi(array1);
                            } //if(valueBool)

                        } //for end
                    } //for end


                });
            }
        }

        function showcolorimg(titleimg) {//图片
            var imgTrCount = $("#specImag tbody tr");
            imgTrCount.each(function (c) {
                var nc = $("input[type='checkbox'][nc_type=y" + c + "]");
                if (nc.is(":checked")) {
                    $("#specImag").css("display", "");
                    $("#specImag tbody tr[nctype=file_tr_" + c + "]").show();
                    $("#specImag tbody tr[nctype=file_tr_" + c + "]").children("td").each(function (tdi) {
                        var colorsrc1 = ""; //图片路径
                        var colorname1 = ""; //名称
                        if (tdi == 0) {
                            $(this).children("span").each(function (spani) {
                                var colorclassname = $(this).attr("class");
                                colorname1 = nc.val(); //选中的复选框的值
                                if (titleimg != "") {
                                    var titleimgsplit = titleimg.split('$');
                                    var cname1 = "";
                                    for (var i = 0; i < titleimgsplit.length; i++) {
                                        if (colorname1.length < titleimgsplit[i].length) {
                                            cname1 = titleimgsplit[i].substring(0, colorname1.length);
                                        }
                                        if (cname1 == colorname1) {
                                            colorsrc1 = titleimgsplit[i].substring(colorname1.length, titleimgsplit[i].length);
                                            $(this).children("img").attr("src", colorsrc1); //图片路径
                                            //return false;
                                        }
                                    }
                                }
                            });
                        }
                        //return false;
                    });
                } else {
                    $("#specImag tbody tr[nctype=file_tr_" + c + "]").hide();
                }
            });
            //图片
        }

        function stockpeizhi(array1) {
            //库存配置信息
            $("#ltrSpec_kc").show();
            show();
            var arrDetail = $("#ltrSpec_kc dl dd table tbody"); //库存配置
            for (var vdi = 0; vdi < array1.length; vdi++) {
                var arrayad = (array1[vdi]).split(','); //分割字符
                var array2 = new Array();
                for (var newvdi = 0; newvdi < arrayad.length; newvdi++) {
                    array2.push(arrayad[newvdi]); //数组重新组合
                }
                if (array2.length > 0) {//重新组合的数组存在值
                    var arraynew1 = new Array();
                    arrDetail.children("tr").each(function (tri) {
                        var cou = $(this).children("td").length;
                        var hidnew = ""; //价格文本框前面的项
                        $(this).children("td").children("input").each(function (inputIndexed) {
                            var inputType = $(this).attr("type"); //input 的类型是隐藏域还是文本框
                            var hidbool = false;
                            if (inputType == "text") {
                                hidbool = true;
                            } else if (inputType == "hidden") {
                                var hid = $(this).attr("value"); //hidden的值
                                hidnew += hid + ","; //库存配置隐藏域中的项（即价格文本框前面的项）
                            }
                            if (hidbool == true) {
                                var hidsub = hidnew.substring(0, hidnew.length - 1); //库存配置 价格前面的项
                                var hidstr = hidsub.split(',');
                                var strnew = "";
                                for (var i = 0; i < hidstr.length; i++) {
                                    strnew += array2[i] + ","; //数组中价格前面的项                                                            
                                }
                                if (strnew == hidnew) {//数组中值与文本框中的相等
                                    if (inputIndexed == hidstr.length) {
                                        $(this).attr("value", array2[hidstr.length]); //商品价格
                                    } else if (inputIndexed == (hidstr.length + 1)) {
                                        $(this).attr("value", array2[hidstr.length + 1]); //商品库存
                                    } else if (inputIndexed == (hidstr.length + 2)) {
                                        $(this).attr("value", array2[hidstr.length + 2]); //商品货号
                                    }
                                }
                            }
                        });
                    });
                }
            }
        }
        
        //参数依次为：父id号、ClassType-类型、下拉控件id、要选中的值value
        function getOption(parentid, _type, selectid, selectedvalue) {
            $.post("/WebService/MBFmember.ashx", { 'action': 'GetClassOptionByPIDType', 'parentid': parentid, 'type': _type },
                function (_data, state) {
                    if (state == "success") {
                        if (_data == "") {
                            alert("加载参数类别失败！");
                            return;
                        }
                        if (_data.length > 4) {//if-start
                            var arrData = eval(_data);
                            $sel = $("#" + selectid);
                            $sel.empty();
                            $sel.append("<option value=''>请选择</option>");
                            $.each(arrData.table1, function (i, n) {
                                if (selectedvalue == n.FieldValue) {
                                    $sel.append("<option selected=\"selected\" value='" + n.FieldValue + "'>" + n.FieldText + "</option>");
                                }
                                else $sel.append("<option value='" + n.FieldValue + "'>" + n.FieldText + "</option>");
                            });
                        } //if-end
                    }
                });
        }
        $(function () {
            
            
            


            var stamp = '<%=Stamp %>';
            if (stamp == "edit") {
                //  GetSpec();
                //  alert("B");
                $("#edit_gcategory").addClass("none");
                if ($("#<%=whops_buyer.ClientID %>").is(":checked")) {
                    $("#whops_buyer_box").removeClass("none");
                }
                var productID = $("#<%=HiddenFieldProductType.ClientID %>").val();
                if(productID==2){
                    //拍卖
                    document.getElementById("display_productType_2").style.display = "";
                    document.getElementById("display_productType_dc2").style.display = "";
                }else if (productID == 3) {
                    document.getElementById("display_productType_3").style.display = "";
                    document.getElementById("Dl_3").style.display = "";
                    document.getElementById("Dl_Price_3").style.display = "";
                    document.getElementById("display_CustomPrice").style.display = "none";
                    changeTeam();
                } else if (productID == 4) {
                    document.getElementById("display_productType_4").style.display = "";
                    document.getElementById("Dl_4").style.display = "";
                    document.getElementById("end_4").style.display = "";
                } else if (productID == 5) {
                    //积分商品
                    document.getElementById("display_productType_5").style.display = "";
                }
            }
            $('#<%=ddlProvince.ClientID %>').change(function () {
                if ($(this).val() == '0' || $(this).val() == '') $('#<%=ddlArea.ClientID %>,#<%=ddlCity.ClientID %>').hide();
                else {
                    $('#<%=ddlArea.ClientID %>').hide();
                    getOptionPro($(this).val(), 'city', '<%=ddlCity.ClientID %>', '');
                }
            });
            $('#<%=ddlCity.ClientID %>').change(function () {
                if ($(this).val() == '0' || $(this).val() == '') $('#<%=ddlArea.ClientID %>').hide();
                else {
                    getOptionPro($(this).val(), 'area', '<%=ddlArea.ClientID %>', '');
                }
            });
            try {
                var city = '<%=strcity %>';
                if (city != '')
                    getOptionPro($('#<%=ddlProvince.ClientID %>').val(), 'city', '<%=ddlCity.ClientID %>', city);
                var area = '<%=strarea %>';
                if (area != '')
                    getOptionPro(city, 'area', '<%=ddlArea.ClientID %>', area);
            } catch (e) { }
        });
        //参数依次为：上级名称、_type-类型(有city、area)、下拉控件id、要选中的值value
        function getOptionPro(pname, _type, selectid, selectedvalue) {
            $.post("/WebService/MBFmember.ashx", { 'action': 'GetPCOptionByPName', 'pname': encodeURIComponent(pname), 'type': _type },
                function (_data, state) {
                    if (state == "success") {
                        if (_data == "") {
                            alert("地区数据加载失败！");
                            return;
                        }
                        $sel = $("#" + selectid);
                        $sel.empty(); //清空
                        if (_data.length > 4) {//if-start
                            var arrData = eval(_data);

                            $sel.append("<option value=''>请选择</option>");
                            $.each(arrData.table1, function (i, n) {
                                if (selectedvalue == n.FieldValue) {
                                    $sel.append("<option selected=\"selected\" value='" + n.FieldValue + "'>" + n.FieldValue + "</option>");
                                }
                                else $sel.append("<option value='" + n.FieldValue + "'>" + n.FieldValue + "</option>");
                            });
                            $('#' + selectid).show();
                        } //if-end
                        else {
                            $('#' + selectid).hide();
                        }
                    }
                });
        }
        function SelectType() {
            var obj = $("input[name='type']");
            var objvalue;
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].checked)
                    objvalue = obj[i].value;
            }

            //商品类型
            var varProType = "<%=ProType %>";
            if (varProType != "") {
                if (varProType == "5") {
                    objvalue = "rdoProductType5";
                } else if (varProType == "4") {
                    objvalue = "rdoProductType4";
                } else {

                }
            }
            if (objvalue != "") {
                //积分商品
                document.getElementById("display_productType_5").style.display = "none";
                //团购
                document.getElementById("display_productType_3").style.display = "none";
                document.getElementById("Dl_3").style.display = "none";
                document.getElementById("Dl_Price_3").style.display = "none";
                //秒杀
                document.getElementById("display_productType_4").style.display = "none";
                document.getElementById("Dl_4").style.display = "none";
                document.getElementById("end_4").style.display = "none";
                //拍卖
                document.getElementById("display_productType_2").style.display = "none";
                document.getElementById("display_productType_dc2").style.display = "none";

                //规格
                $("#ltrSpec_value").addClass("none");
                if (objvalue == 'rdoProductType3') {
                    document.getElementById("display_productType_3").style.display = "";
                    document.getElementById("Dl_3").style.display = "";
                    document.getElementById("Dl_Price_3").style.display = "";
                    document.getElementById("display_CustomPrice").style.display = "none";
                    changeTeam();
                } else if (objvalue == 'rdoProductType4') {
                    //秒杀
                    document.getElementById("display_productType_4").style.display = "";
                    document.getElementById("Dl_4").style.display = "";
                    document.getElementById("end_4").style.display = "";
                } else if (objvalue == 'rdoProductType2') {
                    //拍卖
                    document.getElementById("display_productType_2").style.display = "";
                    document.getElementById("display_productType_dc2").style.display = "";
                } else if (objvalue == 'rdoProductType1') {
                    //规格
                    $("#ltrSpec_value").removeClass("none");
                } else if (objvalue == 'rdoProductType5') {
                    //积分商品
                    document.getElementById("display_productType_5").style.display = "";
                }
            }
            //            var $doc = $("input[name='whop']");
            //            var objDoc;
            //            for (var i = 0; i < $doc.length; i++) {
            //                if ($doc[i].checked)
            //                    objDoc = $doc[i].value;
            //            }
            //            if (objDoc == "whops_buyer") {
            //                $("#whops_buyer_box").removeClass("none");
            //            }
            try { setwhop(); } catch (e) { }
        }
        SelectType();
    </script>
    <script src="Js/ajaxfileupload.js" type="text/javascript"></script>
</body>
</html>
