delivery_channels_add.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <{include file="get_kindeditor.html"}>
  5. <style>
  6. .set-nav {
  7. margin: 0 auto;
  8. }
  9. .set-nav-hr {
  10. background-color: #ddd;
  11. height: 1px;
  12. position: relative;
  13. }
  14. .form-group label {
  15. font-weight: 600;
  16. }
  17. .checkbox-inline, .radio-inline {
  18. font-weight: 400!important;
  19. }
  20. .rowlabel {
  21. font-weight: 300!important;
  22. }
  23. .music_play_hide {
  24. display:none;
  25. }
  26. </style>
  27. <div id="activity_container">
  28. <form id="activity_form">
  29. <div class="activity_center">
  30. <{include file="./admin/activity/common_nav.html"}>
  31. <input name="events_id" type="hidden" value="<{$eventData.id}>">
  32. <div class="panel panel-default">
  33. <div class="panel-heading"><h3 class="panel-title" id="panel-title">添加投放渠道</h3></div>
  34. <div class="panel-body">
  35. <div class="form-group">
  36. <label class="control-label rowlabel">渠道名称:</label> <small class="text-danger"><24个字</small>
  37. <input class="form-control" type="text" value="" name="str_name" id="str_name"/>
  38. <{if $platFormIds}>
  39. <br>
  40. <label class="control-label rowlabel">选择列表:</label> <small class="text-danger">选择投放渠道所在列表</small><br>
  41. <{foreach from=$platFormData item=form key=index}>
  42. <{if $platFormIds[$index]}>
  43. <label class="checkbox-inline">
  44. <input type="checkbox" value="<{$index}>" name="platform_ids"><{$form.name}>
  45. </label>
  46. <{/if}>
  47. <{/foreach}>
  48. <{/if}>
  49. </div>
  50. </div>
  51. </div>
  52. <a href="javaScript:;" class="button button-3d button-primary button-rounded " style="width:150px;" id="add_delivery_channels">
  53. <i class="fa fa-refresh fa-spin add_button" style="display:none;"></i> 添加 </a>
  54. </div>
  55. <{include file="./admin/activity/common_right.html"}>
  56. <div style="clear:both;"></div>
  57. </form>
  58. </div>
  59. <script>
  60. KISSY.use('node, io, event', function (S, Node, IO, Event) {
  61. var $ = S.all;
  62. var ing = false;
  63. $("#add_delivery_channels").on('click', function () {
  64. $('.add_button').show();
  65. var post_data = {};
  66. post_data.events_id = $("input[name=events_id]").val();
  67. post_data.str_name = $('input[name=str_name]').val();
  68. if(post_data.str_name==null){
  69. $('.add_button').hide();
  70. alert('请填写渠道名称');return ;
  71. }
  72. post_data.platform_ids_str="";
  73. $("[type='checkbox'][name='platform_ids']:checked").each(function(){
  74. post_data.platform_ids_str+=$(this).val()+"|";
  75. });
  76. if(post_data.platform_ids_str==''){
  77. $('.add_button').hide();
  78. alert('请勾选所属列表');return ;
  79. }
  80. $(this).hide();
  81. new IO({
  82. type: "post"
  83. , url: VG.conf.root_domain+'/?c=Admin_Activity_DeliveryChannels&a=ReqAddDeliveryChannels'
  84. , data: post_data
  85. , success: function (data) {
  86. if (data.ok) { //ok
  87. location = VG.conf.root_domain+'?c=Admin_Activity_DeliveryChannels&a=PageList&events_id='+post_data.events_id;
  88. } else {
  89. alert('操作失败,原因:'+data.msg);
  90. }
  91. return false;
  92. }
  93. , error: function (NULL, textStatus) {
  94. alert("请求服务器失败,原因:"+textStatus);
  95. }
  96. , dataType: "json"
  97. });
  98. });
  99. });
  100. </script>
  101. <{include file="./admin/bottom.html"}>