up_prize.html 4.0 KB

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