123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <{include file="admin/header.html"}><{include file="admin/nav.html"}>
- <div class="container">
-
- <form id="myform" method="post" action="<{$web_cfg.domain}>?c=admin_Lottery&a=AddPrize" enctype="multipart/form-data" >
- <table class="table">
- <input type="hidden" name="events_id" value="<{$events_id}>">
- <tr>
- <td>活动名称:</td>
- <td><{$events_Data.events_name}></td>
- </tr>
- <tr>
- <td>奖项名称:</td>
- <td><input type="text" name="prize_name" value=""></td>
- </tr>
- <tr>
- <td>图片:</td>
- <td>
- <input type="file" accept="image/jpeg,image/png,image/bmp" name="image" multiple="multiple">
- </td>
- </tr>
- <tr>
- <td>发奖时间段:</td>
- <td>
- <input type="text" value="0" name="begin_hour" id="begin_hour" size="3px"/> -
- <input type="text" value="24" name="end_hour" id="end_hour" size="3px"/>
- </td>
- </tr>
- <tr>
- <td>是否需要快递:</td>
- <td>
- <select name="express" id="express">
- <option value="-1" selected="selected" >==未选择==</option>
- <{foreach from=$prizeExpress key=index item=type}>
- <option value="<{$index}>"><{$type.desc}></option>
- <{/foreach}>
- </select>
- </td>
- </tr>
- <tr>
- <td>属性:</td>
- <td>
- <select name="type" id="type">
- <option value="-1" selected="selected" >==未选择==</option>
- <{foreach from=$prizeType key=index item=type}>
- <option value="<{$index}>"><{$type.desc}></option>
- <{/foreach}>
- </select>
- </td>
- </tr>
- <tr id="prize_num_tr" style="display:none;">
- <td>数量:</td>
- <td>
- <input type="text" value="" name="prize_num" id="prize_num" size="5px"/>
- </td>
- </tr>
- <tr id="virtual_data_tr" style="display:none;">
- <td>虚拟数据:<br>注:换行分割</td>
- <td>
- <textarea name="virtual_data" rows="10" id="virtual_data" cols="47" >
- </textarea>
- </td>
- </tr>
- <tr>
- <td>白名单:</td>
- <td><textarea name="white_list" rows="5" cols="47" ></textarea></td></td>
- </tr>
-
- <tr>
- <td>黑名单:</td>
- <td><textarea name="black_list" rows="5" cols="47" ></textarea></td></td>
- </tr>
-
- </table>
-
-
- <a href="javascript:;" class="btn btn-primary" id="ti_sut" style="padding:1px;">添加奖项</a>
- </form>
- </div>
- <br>
- <script type="text/javascript">
- KISSY.use("node, io, json,jquery", function(S, Node, IO, JSON, jQuery){
-
- $('#ti_sut').click(function(){
- var prize_name=$("#prize_name").val();
- var typeValue=$("#type").val();
- var prize_num = $('#prize_num').val();
- var virtual_data = $('#virtual_data').val();
- var begin_hour = $('#begin_hour').val();
- var end_hour = $('#end_hour').val();
- var express = $('#express').val();
- if(express==-1){
- alert('请选择是否需要快递');
- return ;
- }
- if(typeValue=='' || prize_name=='' || begin_hour == '' || end_hour == '' || typeValue==-1){
- alert('请填写完整的参数');
- return ;
- }
-
- if(begin_hour*1>=end_hour*1){
- alert('发奖时间段填写错误');
- return ;
- }
-
- if(typeValue==1 && prize_num==''){
- alert('请填写奖项数量');
- return ;
- }
- if(typeValue==2 && virtual_data==''){
- alert('请填写虚拟数据');
- return ;
- }
-
-
- $("#myform").submit();
- });
-
-
- // 获取类型 动态显示(虚拟 & 实物)
- $('#prize_num').val('');
- $('#virtual_data').val('');
- var typeValue=$("#type").val();
- if(typeValue == -1){
- $('#prize_num_tr').hide();
- $('#virtual_data_tr').hide();
- }
- if(typeValue == 1){
- $('#prize_num_tr').show();
- $('#virtual_data_tr').hide();
- }
- if(typeValue == 2){
- $('#prize_num_tr').hide();
- $('#virtual_data_tr').show();
- }
-
- // 当下拉选框发生变化的时候
- $("#type").change(function(){
- $('#prize_num').val('');
- $('#virtual_data').val('');
-
- var ck_value = $(this).val();
- if(ck_value == -1){
- $('#prize_num_tr').hide();
- $('#virtual_data_tr').hide();
- }
- if(ck_value == 1){
- $('#prize_num_tr').show();
- $('#virtual_data_tr').hide();
- }
- if(ck_value == 2){
- $('#prize_num_tr').hide();
- $('#virtual_data_tr').show();
- }
- });
-
-
-
-
- });
- </script>
- <{include file="admin/bottom.html"}>
|