| | |
| | | |
| | | function loadPageList() { |
| | | var name = $("#Name").val(); |
| | | var classes = $("#Classes").val(); |
| | | //var classes = $("#Classes").val(); |
| | | var classes = 1; |
| | | $.ajax({ |
| | | url: "GwProduct.ashx", |
| | | type: "POST", |
| | |
| | | } |
| | | |
| | | $(document).on("click", ".action-modal-add", function() { |
| | | $("#productDialog .modal-title").text("添加产品或产品分类"); |
| | | $("#productDialog .modal-title").text("添加产品"); |
| | | $("#productDialog #action").val("add"); |
| | | $("#productDialog #id").val("").attr("readonly", false); |
| | | $("#productDialog #name").val(""); |
| | | $("#productDialog #icon").val(""); |
| | | $("#productDialog #instructions").val(""); |
| | | $("#productDialog #classes").val(""); |
| | | //$("#productDialog #classes").val(""); |
| | | $("#productDialog #parentId").val(""); |
| | | //$("#productDialog #path").val(""); |
| | | $("#productDialog #isDefault").val(""); |
| | | //$("#productDialog #isDefault").val(""); |
| | | $("#productDialog #isDnable").val(1); |
| | | $("#productDialog #sort").val(1); |
| | | $("#productDialog #routerType").val(1); |
| | |
| | | } |
| | | }); |
| | | |
| | | //选择图标下拉框 |
| | | $("#icon").on("change", function () { |
| | | console.log("icon:" + $(this).val()); |
| | | if ($(this).val() != "") { |
| | | document.getElementById('showImg').src = "../static/images/productIcon/" + $(this).val(); |
| | | } |
| | | }); |
| | | |
| | | $("#icon").trigger("change"); |
| | | |
| | | //选择类别下拉框,控制相关输入项显示 |
| | | $("#classes").on("change", function () { |
| | | $(".classes-span").hide(); |
| | |
| | | |
| | | $(document).on("click", ".action-modal-edit", function() { |
| | | var id = $(this).data("id"); |
| | | $("#productDialog .modal-title").text("编辑产品或产品分类"); |
| | | $("#productDialog .modal-title").text("编辑产品"); |
| | | $("#productDialog #id").val(id).attr("readonly", true); |
| | | |
| | | $.get("gwProduct.ashx", { "action": "get", id: id }, function(r) { |
| | |
| | | |
| | | } |
| | | |
| | | //设置类别 |
| | | $("#classes").trigger("change"); |
| | | |
| | | //设置图标 |
| | | $("#icon").trigger("change"); |
| | | |
| | | $("#productDialog").modal("show"); |
| | | } |
| | |
| | | }); |
| | | }); |
| | | |
| | | //上传图标文件 |
| | | $(document).on("click", ".action-upLoad", function () { |
| | | //var id = $(this).data("id"); |
| | | var name = "上传图标文件" ; |
| | | //$("#ablackpool").val(id); |
| | | $("#upLoad_form .modal-title").text(name); |
| | | $("#stopwatchTime").text(''); |
| | | $("#upLoad").modal("show"); |
| | | }); |
| | | |
| | | $("#upLoad_form").ajaxForm({ |
| | | beforeSend: function () { |
| | | $('#upLoad_form .action-save').attr('disabled', "true"); |
| | | $('#upLoad_form .action-save').text('正在上传...'); |
| | | }, |
| | | success: function (result) { |
| | | if (result.OK) { |
| | | mytek.alert(result.Message.Message); |
| | | $("#stopwatchTime").text(result.Message.Msg); |
| | | $('#upLoad_form .action-save').removeAttr("disabled"); |
| | | $("#certPath").val(''); |
| | | $('#upLoad_form .action-save').text('上传'); |
| | | } else { |
| | | mytek.alert(result.Message, result.False); |
| | | $('#upLoad_form .action-save').removeAttr("disabled"); |
| | | $('#upLoad_form .action-save').text('上传'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | $(document).on("click", ".action-btn-GwProductQuery", function() { |
| | | pagination.setPageIndex(1); |
| | | loadPageList(); |
| | |
| | | }); |
| | | </script> |
| | | </asp:Content> |
| | | <asp:Content runat="server" ID="Content2" ContentPlaceHolderID="title">产品或产品分类管理</asp:Content> |
| | | <asp:Content runat="server" ID="Content2" ContentPlaceHolderID="title">产品管理</asp:Content> |
| | | <asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server"> |
| | | |
| | | <form name="queryForm" method="get" action="GwProduct.aspx" id="queryForm" class="form-inline" |
| | |
| | | <input type="text" name="Name" id="Name" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | <!-- |
| | | <div class="form-group"> |
| | | <div class="input-group"> |
| | | <select name="Classes" id="Classes" class="form-control"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | --> |
| | | <div class="form-group"> |
| | | <div class="input-group"> |
| | | <input type="button" value="查询" class="btn btn-primary action-btn-GwProductQuery" /> |
| | |
| | | <tr class="header"> |
| | | <th>图标 |
| | | </th> |
| | | <th>产品类别 |
| | | </th> |
| | | <th>名称 |
| | | </th> |
| | | <th>使用说明 |
| | | </th> |
| | | <!-- |
| | | <th>类别 |
| | | </th> |
| | | --> |
| | | <th>通道 |
| | | </th> |
| | | <th>父级产品分类ID |
| | | </th> |
| | | <th>是否默认 |
| | | </th> |
| | | <th>是否启用 |
| | | </th> |
| | | <!-- |
| | | <th>排序 |
| | | </th> |
| | | --> |
| | | <th>赠送条数 |
| | | </th> |
| | | <th>参考单价 |
| | | </th> |
| | | <th>创建时间 |
| | | </th> |
| | | <th>使用说明 |
| | | </th> |
| | | <th class="text-right">操作 |
| | | </th> |
| | |
| | | <h4 class="modal-title">编辑产品资料</h4> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <div class="form-group"> |
| | | <div class="form-group" style="display: none"> |
| | | <label class="col-sm-2 control-label"> |
| | | 类别</label> |
| | | <div class="col-sm-4 "> |
| | |
| | | <label class="col-sm-2 control-label"> |
| | | 父级分类ID</label> |
| | | <div class="col-sm-4 "> |
| | | <select name="parentId" id="parentId"> |
| | | <select name="parentId" id="parentId" class="form-control"> |
| | | <%=GetProductClassOptions("0")%> |
| | | </select> |
| | | </div> |
| | |
| | | <label class="col-sm-2 control-label"> |
| | | 图标</label> |
| | | <div class="col-sm-4 "> |
| | | <a class="action-upLoad btn btn-info btn-xs " href="javascript:; ">选择上传文件</a> |
| | | <!-- |
| | | <input type="file" id="certPath" name="certPath" /> |
| | | <span id="stopwatchTime" style="- word-wrap: break-word; word-break: break-all;"></span> |
| | | |
| | | <input type="text" class="form-control" name="icon" id="icon" value="" /> |
| | | --> |
| | | <div><img id="showImg" name="showImg" src=""></div> |
| | | <select id="icon" name="icon" class="form-control" > |
| | | <option value="">--请选择图标--</option> |
| | | <option value="marketingSMS-32.png" >marketingSMS-32.png</option> |
| | | <option value="noticeSMS-32.png" >noticeSMS-32.png</option> |
| | | <option value="VerificationCodeSMS-32.png" >VerificationCodeSMS-32.png</option> |
| | | </select> |
| | | </div> |
| | | <span class="help-block m-b-none">类别为产品时,产品的图标标识;上传文件格式为BMP(位图)、JPG、JPEG、PNG、GIF文件(文件大小不能超过5M)。 |
| | | </span> |
| | | <span class="help-block m-b-none">类别为产品时,产品的图标标识。 |
| | | </span> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 名称</label> |
| | | 名称 <span style="color:red">*</span> |
| | | </label> |
| | | <div class="col-sm-4 "> |
| | | <input type="text" class="form-control" name="name" id="name" value="" /> |
| | | </div> |
| | |
| | | <input type="text" class="form-control" name="path" id="path" value="" /> |
| | | </div> |
| | | </div> |
| | | --> |
| | | <div class="form-group classes-span classes-span-1"> |
| | | <label class="col-sm-2 control-label"> |
| | | 推广方式</label> |
| | |
| | | </div> |
| | | <span class="help-block m-b-none">个性化客户是指特殊推送给客户;系统默认是指系统默认可推送所有客户。</span> |
| | | </div> |
| | | --> |
| | | <input type="hidden" class="form-control" name="isDefault" id="isDefault" value="1" /> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 是否启用</label> |
| | |
| | | </form> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="modal inmodal fade" id="upLoad" tabindex="-1" role="dialog" |
| | | aria-hidden="true"> |
| | | <form name="upLoad_form" method="post" action="GwProduct.ashx?action=upLoad" |
| | | id="upLoad_form" class="form-horizontal"> |
| | | <div class="modal-dialog form-horizontal"> |
| | | <div class="modal-content "> |
| | | <input type="hidden" id="ablackpool" value="" name="ablackpool" /> |
| | | <div class="modal-header"> |
| | | <button type="button" class="close" data-dismiss="modal"> |
| | | <span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
| | | <h4 class="modal-title"> |
| | | 上传文件 |
| | | </h4> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <div class="form-group"> |
| | | <label class="control-label col-sm-3"> |
| | | 请选择要上传的图标文件</label> |
| | | <input type="file" id="certPath" name="certPath" /> |
| | | |
| | | <span id="stopwatchTime" style="word-wrap: break-word; word-break: break-all;"></span> |
| | | </div> |
| | | <div> |
| | | <h3> |
| | | 说明</h3> |
| | | <ul> |
| | | <li class="text-info">上传文件格式为BMP(位图)、JPG、JPEG、PNG、GIF文件(文件大小不能超过5M);</li> |
| | | |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button class="btn btn-default " data-dismiss="modal" aria-hidden="true"> |
| | | 取消</button> |
| | | <button class="btn btn-primary action-save"> |
| | | 上传</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- footBar --> |
| | | <div id="mask" class="mask"> |
| | | <span></span> |