%%AC^AC2^AC2E0A37%%interactive_prize_edit.html.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php /* Smarty version 2.6.17, created on 2018-04-26 11:28:54
  2. compiled from admin/activity/interactive_prize_edit.html */ ?>
  3. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  4. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
  5. $this->_tpl_vars = $_smarty_tpl_vars;
  6. unset($_smarty_tpl_vars);
  7. ?>
  8. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  9. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
  10. $this->_tpl_vars = $_smarty_tpl_vars;
  11. unset($_smarty_tpl_vars);
  12. ?>
  13. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  14. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
  15. $this->_tpl_vars = $_smarty_tpl_vars;
  16. unset($_smarty_tpl_vars);
  17. ?>
  18. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  19. $this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
  20. $this->_tpl_vars = $_smarty_tpl_vars;
  21. unset($_smarty_tpl_vars);
  22. ?>
  23. <style>
  24. .set-nav {
  25. margin: 0 auto;
  26. }
  27. .set-nav-hr {
  28. background-color: #ddd;
  29. height: 1px;
  30. position: relative;
  31. }
  32. .form-group label {
  33. font-weight: 600;
  34. }
  35. .checkbox-inline, .radio-inline {
  36. font-weight: 400!important;
  37. }
  38. .rowlabel {
  39. font-weight: 300!important;
  40. }
  41. .music_play_hide {
  42. display:none;
  43. }
  44. </style>
  45. <div id="activity_container">
  46. <form id="activity_form">
  47. <div class="activity_center">
  48. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  49. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
  50. $this->_tpl_vars = $_smarty_tpl_vars;
  51. unset($_smarty_tpl_vars);
  52. ?>
  53. <!-- <form method="post" action="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  54. ?c=Admin_Activity_SetInteractive&a=ReqUp"> -->
  55. <input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  56. ">
  57. <input name="prize_id" type="hidden" value="<?php echo $this->_tpl_vars['prize_id']; ?>
  58. ">
  59. <div class="form-group">
  60. <label class="control-label rowlabel">奖项名称: </label>
  61. <div>
  62. <input name="prize_name" type="text" class="form-control" value="<?php echo $this->_tpl_vars['prize']['prize_name']; ?>
  63. ">
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <label class="control-label rowlabel">奖项图片: </label>
  68. <div>
  69. <img id="img_url_tag" src="<?php echo $this->_tpl_vars['prize']['img_url']; ?>
  70. " style="width:150px;" class="img-thumbnail">
  71. <input id="img_url_input" name="img_url" type="hidden" value="<?php echo $this->_tpl_vars['prize']['img_url']; ?>
  72. ">
  73. <input id="image_upload" type="button" value="选择图片" >
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="control-label rowlabel">状态: </label>
  78. <div class="row">
  79. <div class="col-md-2">
  80. <select name="display" class="form-control">
  81. <?php $_from = $this->_tpl_vars['prizeDisplay']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  82. foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['item']):
  83. ?>
  84. <option value="<?php echo $this->_tpl_vars['key']; ?>
  85. " <?php if ($this->_tpl_vars['key'] == $this->_tpl_vars['prize']['display']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['item']['desc']; ?>
  86. </option>
  87. <?php endforeach; endif; unset($_from); ?>
  88. </select>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="control-label rowlabel">发奖时间段: </label>
  94. <div class="row">
  95. <div class="col-md-2">
  96. <input name="begin_hour" type="text" class="form-control" value="<?php echo $this->_tpl_vars['prize']['begin_hour']; ?>
  97. ">
  98. </div>
  99. <div class="col-md-2">
  100. <input name="end_hour" type="text" class="form-control" value="<?php echo $this->_tpl_vars['prize']['end_hour']; ?>
  101. ">
  102. </div>
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <label class="control-label rowlabel">属性: </label>
  107. <div class="row">
  108. <div class="col-md-2">
  109. <input type="text" class="form-control" value="<?php if ($this->_tpl_vars['prize']['type'] == 1): ?>实物<?php endif; ?><?php if ($this->_tpl_vars['prize']['type'] == 2): ?>虚拟<?php endif; ?>" disabled="disabled">
  110. </div>
  111. </div>
  112. </div>
  113. <div class="form-group">
  114. <label class="control-label rowlabel">是否需要快递: </label>
  115. <div class="row">
  116. <div class="col-md-2">
  117. <select name="express" class="form-control">
  118. <option value="1" <?php if ($this->_tpl_vars['prize']['express'] == 1): ?>selected<?php endif; ?>>需要</option>
  119. <option value="2" <?php if ($this->_tpl_vars['prize']['express'] == 2): ?>selected<?php endif; ?>>不需要</option>
  120. </select>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <label class="control-label rowlabel">白名单: "换行"分割UID </label>
  126. <div>
  127. <textarea name="white_list" class="form-control" rows="3"><?php echo $this->_tpl_vars['prize']['white_list']; ?>
  128. </textarea>
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="control-label rowlabel">100%中奖名单:"换行"分割UID</label>
  133. <div>
  134. <textarea name="hundred_percent_list" class="form-control" rows="3"><?php echo $this->_tpl_vars['prize']['hundred_percent_list']; ?>
  135. </textarea>
  136. </div>
  137. </div>
  138. <div class="form-group">
  139. <label class="control-label rowlabel">黑名单:"换行"分割UID</label>
  140. <div>
  141. <textarea name="black_list" class="form-control" rows="3"><?php echo $this->_tpl_vars['prize']['black_list']; ?>
  142. </textarea>
  143. </div>
  144. </div>
  145. <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>
  146. </div>
  147. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  148. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
  149. $this->_tpl_vars = $_smarty_tpl_vars;
  150. unset($_smarty_tpl_vars);
  151. ?>
  152. <div style="clear:both;"></div>
  153. </form>
  154. </div>
  155. <script>
  156. KISSY.use('node, io, event', function (S, Node, IO, Event) {
  157. var $ = S.all;
  158. var activity_submit_status = false; //按钮状态
  159. function submit_button_active() {
  160. activity_submit_status = true;
  161. $("#activity_submit").addClass('active').all('i').show();
  162. }
  163. function submit_button_default() {
  164. activity_submit_status = false;
  165. $("#activity_submit").removeClass('active').all('i').hide();
  166. }
  167. $("#activity_submit").on('click', function () {
  168. if (activity_submit_status) {
  169. return false;
  170. }
  171. submit_button_active();
  172. var events_id = $("input[name=events_id]").val();
  173. var prize_id = $("input[name=prize_id]").val();
  174. var post_data = {};
  175. post_data.events_id = events_id;
  176. post_data.prize_id = prize_id;
  177. post_data.prize_name = $('input[name=prize_name]').val();
  178. post_data.prize_image_url = $("input[name=img_url]").val();
  179. post_data.begin_hour = $("input[name=begin_hour]").val();
  180. post_data.end_hour = $("input[name=end_hour]").val();
  181. post_data.express = $("select[name=express]").val();
  182. post_data.white_list = $("textarea[name=white_list]").val();
  183. post_data.hundred_percent_list = $("textarea[name=hundred_percent_list]").val();
  184. post_data.black_list = $("textarea[name=black_list]").val();
  185. post_data.display = $("select[name=display]").val();
  186. new IO({
  187. type: "post"
  188. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqUpPrize'
  189. , data: post_data
  190. , success: function (data) {
  191. if (data.ok) { //ok
  192. alert('操作成功');
  193. var redirect_url = data.msg;
  194. location.href = redirect_url;
  195. } else {
  196. alert('操作失败,原因:'+data.msg);
  197. }
  198. return false;
  199. }
  200. , error: function (NULL, textStatus) {
  201. alert("请求服务器失败,原因:"+textStatus);
  202. }
  203. , dataType: "json"
  204. });
  205. });
  206. });
  207. //列表默认图
  208. KindEditor.ready(function(K) {
  209. var uploadbutton = K.uploadbutton({
  210. button : K('#image_upload')[0],
  211. fieldName : 'imgFile',
  212. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  213. afterUpload : function(data) {
  214. if (data.error === 0) {
  215. var url = K.formatUrl(data.url, 'absolute');
  216. K('#img_url_input').val(data.url);
  217. K('#img_url_tag').attr('src', data.url);
  218. } else {
  219. alert(data.message);
  220. }
  221. },
  222. afterError : function(str) {
  223. alert('自定义错误信息: ' + str);
  224. }
  225. });
  226. uploadbutton.fileBox.change(function(e) {
  227. uploadbutton.submit();
  228. });
  229. });
  230. </script>
  231. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  232. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  233. $this->_tpl_vars = $_smarty_tpl_vars;
  234. unset($_smarty_tpl_vars);
  235. ?>