interactive_prize_edit.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. <!-- <form method="post" action="<{$web_cfg.domain}>?c=Admin_Activity_SetInteractive&a=ReqUp"> -->
  32. <input name="events_id" type="hidden" value="<{$events_Data.events.id}>">
  33. <input name="prize_id" type="hidden" value="<{$prize_id}>">
  34. <div class="form-group">
  35. <label class="control-label rowlabel">奖项名称: </label>
  36. <div>
  37. <input name="prize_name" type="text" class="form-control" value="<{$prize.prize_name}>">
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. <label class="control-label rowlabel">奖项图片: </label>
  42. <div>
  43. <img id="img_url_tag" src="<{$prize.img_url}>" style="width:150px;" class="img-thumbnail">
  44. <input id="img_url_input" name="img_url" type="hidden" value="<{$prize.img_url}>">
  45. <input id="image_upload" type="button" value="选择图片" >
  46. </div>
  47. </div>
  48. <div class="form-group">
  49. <label class="control-label rowlabel">状态: </label>
  50. <div class="row">
  51. <div class="col-md-2">
  52. <select name="display" class="form-control">
  53. <{foreach from=$prizeDisplay key=key item=item}>
  54. <option value="<{$key}>" <{if $key == $prize.display}>selected<{/if}>><{$item.desc}></option>
  55. <{/foreach}>
  56. </select>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label class="control-label rowlabel">发奖时间段: </label>
  62. <div class="row">
  63. <div class="col-md-2">
  64. <input name="begin_hour" type="text" class="form-control" value="<{$prize.begin_hour}>">
  65. </div>
  66. <div class="col-md-2">
  67. <input name="end_hour" type="text" class="form-control" value="<{$prize.end_hour}>">
  68. </div>
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label class="control-label rowlabel">属性: </label>
  73. <div class="row">
  74. <div class="col-md-2">
  75. <input type="text" class="form-control" value="<{if $prize.type == 1}>实物<{/if}><{if $prize.type == 2}>虚拟<{/if}>" disabled="disabled">
  76. </div>
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="control-label rowlabel">是否需要快递: </label>
  81. <div class="row">
  82. <div class="col-md-2">
  83. <select name="express" class="form-control">
  84. <option value="1" <{if $prize.express == 1}>selected<{/if}>>需要</option>
  85. <option value="2" <{if $prize.express == 2}>selected<{/if}>>不需要</option>
  86. </select>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label class="control-label rowlabel">白名单: "换行"分割UID </label>
  92. <div>
  93. <textarea name="white_list" class="form-control" rows="3"><{$prize.white_list}></textarea>
  94. </div>
  95. </div>
  96. <div class="form-group">
  97. <label class="control-label rowlabel">100%中奖名单:"换行"分割UID</label>
  98. <div>
  99. <textarea name="hundred_percent_list" class="form-control" rows="3"><{$prize.hundred_percent_list}></textarea>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <label class="control-label rowlabel">黑名单:"换行"分割UID</label>
  104. <div>
  105. <textarea name="black_list" class="form-control" rows="3"><{$prize.black_list}></textarea>
  106. </div>
  107. </div>
  108. <a id="activity_submit" href="javascript:;" class="button button-3d button-primary button-rounded"><i class="fa fa-refresh fa-spin" style="display:none;"></i> 修改奖项</a>
  109. </div>
  110. <{include file="./admin/activity/common_right.html"}>
  111. <div style="clear:both;"></div>
  112. </form>
  113. </div>
  114. <script>
  115. KISSY.use('node, io, event', function (S, Node, IO, Event) {
  116. var $ = S.all;
  117. var activity_submit_status = false; //按钮状态
  118. function submit_button_active() {
  119. activity_submit_status = true;
  120. $("#activity_submit").addClass('active').all('i').show();
  121. }
  122. function submit_button_default() {
  123. activity_submit_status = false;
  124. $("#activity_submit").removeClass('active').all('i').hide();
  125. }
  126. $("#activity_submit").on('click', function () {
  127. if (activity_submit_status) {
  128. return false;
  129. }
  130. submit_button_active();
  131. var events_id = $("input[name=events_id]").val();
  132. var prize_id = $("input[name=prize_id]").val();
  133. var post_data = {};
  134. post_data.events_id = events_id;
  135. post_data.prize_id = prize_id;
  136. post_data.prize_name = $('input[name=prize_name]').val();
  137. post_data.prize_image_url = $("input[name=img_url]").val();
  138. post_data.begin_hour = $("input[name=begin_hour]").val();
  139. post_data.end_hour = $("input[name=end_hour]").val();
  140. post_data.express = $("select[name=express]").val();
  141. post_data.white_list = $("textarea[name=white_list]").val();
  142. post_data.hundred_percent_list = $("textarea[name=hundred_percent_list]").val();
  143. post_data.black_list = $("textarea[name=black_list]").val();
  144. post_data.display = $("select[name=display]").val();
  145. new IO({
  146. type: "post"
  147. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqUpPrize'
  148. , data: post_data
  149. , success: function (data) {
  150. if (data.ok) { //ok
  151. alert('操作成功');
  152. var redirect_url = data.msg;
  153. location.href = redirect_url;
  154. } else {
  155. alert('操作失败,原因:'+data.msg);
  156. }
  157. return false;
  158. }
  159. , error: function (NULL, textStatus) {
  160. alert("请求服务器失败,原因:"+textStatus);
  161. }
  162. , dataType: "json"
  163. });
  164. });
  165. });
  166. //列表默认图
  167. KindEditor.ready(function(K) {
  168. var uploadbutton = K.uploadbutton({
  169. button : K('#image_upload')[0],
  170. fieldName : 'imgFile',
  171. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  172. afterUpload : function(data) {
  173. if (data.error === 0) {
  174. var url = K.formatUrl(data.url, 'absolute');
  175. K('#img_url_input').val(data.url);
  176. K('#img_url_tag').attr('src', data.url);
  177. } else {
  178. alert(data.message);
  179. }
  180. },
  181. afterError : function(str) {
  182. alert('自定义错误信息: ' + str);
  183. }
  184. });
  185. uploadbutton.fileBox.change(function(e) {
  186. uploadbutton.submit();
  187. });
  188. });
  189. </script>
  190. <{include file="./admin/bottom.html"}>