123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <{include file="./admin/header.html"}>
- <{include file="./admin/left.html"}>
- <{include file="./admin/nav.html"}>
- <{include file="get_kindeditor.html"}>
- <style>
- .set-nav {
- margin: 0 auto;
- }
- .set-nav-hr {
- background-color: #ddd;
- height: 1px;
- position: relative;
- }
- .form-group label {
- font-weight: 600;
- }
- .checkbox-inline, .radio-inline {
- font-weight: 400!important;
- }
- .rowlabel {
- font-weight: 300!important;
- }
- .music_play_hide {
- display:none;
- }
- </style>
- <div id="activity_container">
- <form id="activity_form">
- <div class="activity_center">
- <{include file="./admin/activity/common_nav.html"}>
- <input name="events_id" type="hidden" value="<{$events_Data.events.id}>">
- <div class="form-group">
- <label class="control-label rowlabel">奖品名称:</label>
- <input name="survery_prize_name" type="text" value="" class="form-control"/>
- </div>
-
- <div class="form-group">
- <label class="control-label rowlabel">图片:<small class="text-danger">(JPG、PNG,100x100,统一固定图片高度),小于20k)</small></label>
- <div>
- <img id="img_url_tag" src="http://placehold.it/200&text=100x100" style="width:100px;" class="img-thumbnail">
- <input id="img_url_input" name="img_url" type="hidden" value="">
- <input id="image_upload" type="button" value="选择图片" >
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label rowlabel">数量:</label>
- <input name="survery_prize_num" type="text" value="0" class="form-control" style="width:100px;"/>
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">单位名称:</label>
- <input name="survery_prize_unit_name" type="text" value="份" class="form-control" style="width:100px;"/>
- </div>
- <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>
-
- <div style="text-align:right;">
- <a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>" >返回互动设置</a>
- </div>
-
- </div>
- <{include file="./admin/activity/common_right.html"}>
- <div style="clear:both;"></div>
- </form>
- </div>
- <script>
- KISSY.use('node, io', function (S, Node, IO) {
- var $ = S.all;
- var activity_submit_status = false; //按钮状态
- function submit_button_active() {
- activity_submit_status = true;
- $("#activity_submit").addClass('active').all('i').show();
- }
- function submit_button_default() {
- activity_submit_status = false;
- $("#activity_submit").removeClass('active').all('i').hide();
- }
-
- $("#activity_submit").on('click', function () {
- if (activity_submit_status) {
- return false;
- }
- submit_button_active();
-
- var title = S.trim($("input[name=survery_prize_name]").val());
- if (!title) {
- alert('请填奖品名称');
- submit_button_default();
- return false;
- }
-
- formData = IO.serialize("#activity_form");
-
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqAddSurveyPrize'
- , data: formData
- , success: function (data) {
- if (data.ok) { //ok
- var url = data.msg;
- location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>';
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
- });
- });
- //图片上传
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#image_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#img_url_input').val(data.url);
- K('#img_url_tag').attr('src', data.url);
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
- </script>
- <{include file="./admin/bottom.html"}>
|