123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <{include file="./admin/header.html"}>
- <{include file="./admin/left.html"}>
- <{include file="./admin/nav.html"}>
- <{include file="get_kindeditor.html"}>
- <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery-1.7.2.min.js"></script>
- <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.css" />
- <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.js"></script>
- <style>
- .set-nav {
- margin: 0 auto;
- }
- .set-nav-hr {
- background-color: #ddd;
- height: 1px;
- position: relative;
- }
- .form-group label {
- font-weight: 600;
- }
- .checkbox-inline, .radio-inline {
- font-weight: 400!important;
- }
- .rowlabel {
- font-weight: 300!important;
- }
- .music_play_hide {
- display:none;
- }
- </style>
- <form id="add_platform_form">
- <input name="id" type="hidden" value="<{$CategoryData.id}>">
- <div class="col-md-5" style="padding-left: 30px;">
- <div class="form-group">
- <label class="control-label">编辑分类信息</label>
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">分类名称</label>
- <input name="name" type="text" class="form-control" value="<{$CategoryData.name}>">
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">分类图标</label>
- <div>
- <img id="icon_image_tag" src="<{$CategoryData.icon}>" style="width:30px;" class="img-thumbnail">
- <input id="icon_image_input" name='icon' type="hidden" value="<{$CategoryData.icon}>">
- <input id="icon_image_upload" type="button" value="选中图片" >
- </div>
- </div>
-
- <div>
- <a id="add_platform_btn" href="javascript:;" class="button button-primary button-small">修改分类</a>
- </div>
- </div>
- </form>
- <script>
- KISSY.use('node, io', function (S, Node, IO) {
- var $ = S.all;
-
- $("#add_platform_btn").on('click', function () {
-
- var name = $("input[name=name]").val();
- if (!name) {
- alert('请填写名称');
- return false;
- }
-
- var icon = $("input[name=icon]").val();
- if (!icon) {
- alert('请选择分类图标');
- return false;
- }
-
-
-
- var data = IO.serialize("#add_platform_form");
-
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Category_index&a=PageList&a=ReqUp'
- , data: data
- , success: function (data) {
- if (data.ok) { //ok
- var url = data.msg;
- location.href = VG.conf.root_domain + '/?c=Admin_Category_index&a=PageList';
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
- });
- });
- //icon image
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#icon_image_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#icon_image_input').val(data.url);
- K('#icon_image_tag').attr('src', data.url);
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
- </script>
- <{include file="./admin/bottom.html"}>
|