add_prize.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <{include file="admin/header.html"}><{include file="admin/nav.html"}>
  2. <div class="container">
  3. <form id="myform" method="post" action="<{$web_cfg.domain}>?c=admin_Lottery&a=AddPrize" enctype="multipart/form-data" >
  4. <table class="table">
  5. <input type="hidden" name="events_id" value="<{$events_id}>">
  6. <tr>
  7. <td>活动名称:</td>
  8. <td><{$events_Data.events_name}></td>
  9. </tr>
  10. <tr>
  11. <td>奖项名称:</td>
  12. <td><input type="text" name="prize_name" value=""></td>
  13. </tr>
  14. <tr>
  15. <td>图片:</td>
  16. <td>
  17. <input type="file" accept="image/jpeg,image/png,image/bmp" name="image" multiple="multiple">
  18. </td>
  19. </tr>
  20. <tr>
  21. <td>发奖时间段:</td>
  22. <td>
  23. <input type="text" value="0" name="begin_hour" id="begin_hour" size="3px"/> -
  24. <input type="text" value="24" name="end_hour" id="end_hour" size="3px"/>
  25. </td>
  26. </tr>
  27. <tr>
  28. <td>是否需要快递:</td>
  29. <td>
  30. <select name="express" id="express">
  31. <option value="-1" selected="selected" >==未选择==</option>
  32. <{foreach from=$prizeExpress key=index item=type}>
  33. <option value="<{$index}>"><{$type.desc}></option>
  34. <{/foreach}>
  35. </select>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td>属性:</td>
  40. <td>
  41. <select name="type" id="type">
  42. <option value="-1" selected="selected" >==未选择==</option>
  43. <{foreach from=$prizeType key=index item=type}>
  44. <option value="<{$index}>"><{$type.desc}></option>
  45. <{/foreach}>
  46. </select>
  47. </td>
  48. </tr>
  49. <tr id="prize_num_tr" style="display:none;">
  50. <td>数量:</td>
  51. <td>
  52. <input type="text" value="" name="prize_num" id="prize_num" size="5px"/>
  53. </td>
  54. </tr>
  55. <tr id="virtual_data_tr" style="display:none;">
  56. <td>虚拟数据:<br>注:换行分割</td>
  57. <td>
  58. <textarea name="virtual_data" rows="10" id="virtual_data" cols="47" >
  59. </textarea>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td>白名单:</td>
  64. <td><textarea name="white_list" rows="5" cols="47" ></textarea></td></td>
  65. </tr>
  66. <tr>
  67. <td>黑名单:</td>
  68. <td><textarea name="black_list" rows="5" cols="47" ></textarea></td></td>
  69. </tr>
  70. </table>
  71. <a href="javascript:;" class="btn btn-primary" id="ti_sut" style="padding:1px;">添加奖项</a>
  72. </form>
  73. </div>
  74. <br>
  75. <script type="text/javascript">
  76. KISSY.use("node, io, json,jquery", function(S, Node, IO, JSON, jQuery){
  77. $('#ti_sut').click(function(){
  78. var prize_name=$("#prize_name").val();
  79. var typeValue=$("#type").val();
  80. var prize_num = $('#prize_num').val();
  81. var virtual_data = $('#virtual_data').val();
  82. var begin_hour = $('#begin_hour').val();
  83. var end_hour = $('#end_hour').val();
  84. var express = $('#express').val();
  85. if(express==-1){
  86. alert('请选择是否需要快递');
  87. return ;
  88. }
  89. if(typeValue=='' || prize_name=='' || begin_hour == '' || end_hour == '' || typeValue==-1){
  90. alert('请填写完整的参数');
  91. return ;
  92. }
  93. if(begin_hour*1>=end_hour*1){
  94. alert('发奖时间段填写错误');
  95. return ;
  96. }
  97. if(typeValue==1 && prize_num==''){
  98. alert('请填写奖项数量');
  99. return ;
  100. }
  101. if(typeValue==2 && virtual_data==''){
  102. alert('请填写虚拟数据');
  103. return ;
  104. }
  105. $("#myform").submit();
  106. });
  107. // 获取类型 动态显示(虚拟 & 实物)
  108. $('#prize_num').val('');
  109. $('#virtual_data').val('');
  110. var typeValue=$("#type").val();
  111. if(typeValue == -1){
  112. $('#prize_num_tr').hide();
  113. $('#virtual_data_tr').hide();
  114. }
  115. if(typeValue == 1){
  116. $('#prize_num_tr').show();
  117. $('#virtual_data_tr').hide();
  118. }
  119. if(typeValue == 2){
  120. $('#prize_num_tr').hide();
  121. $('#virtual_data_tr').show();
  122. }
  123. // 当下拉选框发生变化的时候
  124. $("#type").change(function(){
  125. $('#prize_num').val('');
  126. $('#virtual_data').val('');
  127. var ck_value = $(this).val();
  128. if(ck_value == -1){
  129. $('#prize_num_tr').hide();
  130. $('#virtual_data_tr').hide();
  131. }
  132. if(ck_value == 1){
  133. $('#prize_num_tr').show();
  134. $('#virtual_data_tr').hide();
  135. }
  136. if(ck_value == 2){
  137. $('#prize_num_tr').hide();
  138. $('#virtual_data_tr').show();
  139. }
  140. });
  141. });
  142. </script>
  143. <{include file="admin/bottom.html"}>