123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <?php /* Smarty version 2.6.17, created on 2018-04-25 19:29:39
- compiled from admin/activity/interactive_question.html */ ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <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">
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
- ">
-
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">设置问题</h3></div>
-
- <div class="panel-body" style="padding: 10px; display: none;" id="show_div">
- <div style="margin: 10px; display: none;" >排序: <font id="f_sort"></font></div>
- <input type="hidden" value="<?php echo $this->_tpl_vars['nextSort']; ?>
- " id="f_sort_h" name="f_sort_h">
- <div style="margin: 10px;">问题: <font id="f_question"></font></div>
- <input type="hidden" value="" id="f_question_h" name="f_question_h">
- <div style="margin: 10px;">选项类型: <font id="f_type"></font></div>
- <div style="margin: 10px;">选项规则: <font id="f_choice"></font></div>
- <input type="hidden" value="" id="f_type_h" name="f_type_h">
- <input type="hidden" value="" id="f_num_h" name="f_num_h">
- <input type="hidden" value="" id="f_choice_h" name="f_choice_h">
- <div style="clear:both;"></div>
- <div id="show_html">
-
- </div>
-
- <div style="clear:both;"></div>
- <div style="margin: 10px; text-align: left: ;">
- <a href="javascript:;" id="add_but" class="button button-3d button-primary button-rounded">点击保存</a>
- <div style="text-align: right;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
- &typ=question" style="text-align: right;"><<返回上一级</a></div>
- </div>
-
-
-
- </div>
-
- <div id="img_html" style="display:none;">
- <div class="panel panel-default" style="padding:10px 10px 0px 10px;">
- <div class="form-group">
- <div>
- <img id="img_url_tag" src="http://placehold.it/200&text=290x(>290)" 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>
- <p> 答案: <input type="text" name="img_url_answer"></p>
- </div>
- </div>
-
- <div id="txt_html" style="display:none;">
- <div class="panel panel-default" style="padding:10px 10px 0px 10px;">
- <p>答案: <input type="text" name="txt" id="txt"></p>
- </div>
- </div>
-
-
- <div class="panel-body" id="add_div" >
- <div class="form-group">
- <p style="display: none;">顺序:<input type="text" id="sort" size="2" value="<?php echo $this->_tpl_vars['nextSort']; ?>
- " ></p>
- <p>问题:<input type="text" id="question" size="50" ></p>
- <p>选项:<input type="text" id ="num" value="0" size="2" >个</p>
- <p>选项类型:<select name="type" id="type">
- <option value="img">图片</option>
- <option value="txt">文字</option>
- </select>
- </p>
- <p>选项规则:<select name="choice" id="choice">
- <option value="0">单选</option>
- <option value="1">多选</option>
- </select>
- </p>
- <div>
- <p style="margin-top: 20px;"><a href="javascript:;" id="add"><i class="fa fa-plus"></i> 点击创建问题</a></p>
- <div style="text-align: right;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
- " style="text-align: right;"><<返回上一级</a></div>
- </div>
- </div>
- </div>
-
-
- </div>
- </div>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <div style="clear:both;"></div>
- </form>
- </div>
- <script>
- KISSY.use('node, io, event, jquery', function (S, Node, IO, Event, jQuery) {
- var $ = S.all;
- $("#add").on('click', function () {
- var tyepData = {'img':'图片','txt':'文字'};
- var choiceData = {'1':'多选','0':'单选'};
- var question = $('#question').val();
- var sort = $('#sort').val();
- var num = $('#num').val();
- var type = $('#type').val();
- var choice = $('#choice').val();
-
- $('#f_sort').html(sort);
- $('#f_question').html(question);
- $('#f_type').html(tyepData[type]);
- $('#f_choice').html(choiceData[choice]);
-
- $('#f_sort_h').val(sort);
- $('#f_question_h').val(question);
- $('#f_type_h').val(type);
- $('#f_choice_h').val(choice);
- $('#f_num_h').val(num);
-
-
- $('#add_div').hide();
- $('#show_div').show();
- if(type == 'img'){
- var inHtml = '';
- for (var i=1;i<=num;i++){
- var html = $('#img_html').html();
- html = html.replace("img_url_tag", "img_url_tag_"+i);
- html = html.replace("img_url_input", "img_url_input_"+i);
- html = html.replace("image_upload", "image_upload_"+i);
- html = html.replace("name=\"img_url", "name=\"img_url_"+i);
- html = html.replace("img_url_answer", "img_url_answer_"+i);
- inHtml+=html;
- }
- $('#show_html').html(inHtml);
- for (var i=1;i<=num;i++){
- runImg('image_upload_'+i,'img_url_input_'+i,'img_url_tag_'+i);
- }
- return ;
- }
-
- if(type=='txt'){
- var inHtml = '';
- for (var i=1;i<=num;i++){
- var html = $('#txt_html').html();
- html = html.replace("\"txt\"", '"txt_'+i+'"');
- html = html.replace("\"txt\"", '"txt_'+i+'"');
- inHtml+=html;
- }
- $('#show_html').html(inHtml);
- return ;
- }
- });
-
-
- $("#add_but").on('click', function () {
- var formData = IO.serialize("#activity_form");
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqAddSurveyQuestion'
- , data: formData
- , success: function (data) {
- if (data.ok) { //ok
- location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
- ';
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
-
-
- });
-
- //图片上传
- function runImg(image_upload,img_url_input,img_url_tag){
- var K = KindEditor;
- 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>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
|