interactive_survey_input_question.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <{include file="get_kindeditor.html"}>
  5. <style>
  6. .set-nav {
  7. margin: 0 auto;
  8. }
  9. .set-nav-hr {
  10. background-color: #ddd;
  11. height: 1px;
  12. position: relative;
  13. }
  14. .form-group label {
  15. font-weight: 600;
  16. }
  17. .checkbox-inline, .radio-inline {
  18. font-weight: 400!important;
  19. }
  20. .rowlabel {
  21. font-weight: 300!important;
  22. }
  23. .music_play_hide {
  24. display:none;
  25. }
  26. </style>
  27. <div id="activity_container">
  28. <form id="activity_form">
  29. <div class="activity_center">
  30. <{include file="./admin/activity/common_nav.html"}>
  31. <input name="events_id" type="hidden" value="<{$events_Data.events.id}>">
  32. <div class="panel panel-default">
  33. <div class="panel-heading"><h3 class="panel-title" id="panel-title">表单设置</h3></div>
  34. <div class="panel-body">
  35. <table class="table">
  36. <thead>
  37. <tr>
  38. <th>名称</th>
  39. <th>类型</th>
  40. <th>是否必填</th>
  41. </tr>
  42. <{foreach from=$events_Data.events.forms item=form}>
  43. <tr>
  44. <td><{$form.name}></td>
  45. <td><{if $form.type== 'text'}>单行文本<{/if}>
  46. <{if $form.type== 'textarea'}>多行文本<{/if}>
  47. <{if $form.type== 'select'}>下拉菜单<{/if}></td>
  48. <td><{if $form.required==1}>必填<{else}> 选填<{/if}></td>
  49. </tr>
  50. <{/foreach}>
  51. </thead>
  52. </table>
  53. </div>
  54. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>&typ=input">点击编辑</a></div>
  55. </div>
  56. <div class="panel panel-default">
  57. <div class="panel-heading"><h3 class="panel-title" id="panel-title">奖品设置</h3></div>
  58. <div class="panel-body">
  59. <table class="table">
  60. <thead>
  61. <tr>
  62. <th>序号</th>
  63. <th>奖品名称</th>
  64. <th>图片</th>
  65. <th>数量</th>
  66. <th>操作</th>
  67. </tr>
  68. <{foreach from=$events_Data.events.survery_prize key=index item=survery_prize name=survery}>
  69. <tr>
  70. <td><{$smarty.foreach.survery.iteration}></td>
  71. <td><{$survery_prize.name}></td>
  72. <td><img src="<{$survery_prize.img_url}>" class="img-thumbnail" style="width:50px;"></td>
  73. <td><{$survery_prize.num}><{$survery_prize.unit_name}></td>
  74. <td><a class="del_survery_prize" survery_prize_id='<{$index}>' href="javascript:;">删除</a></td>
  75. </tr>
  76. <{/foreach}>
  77. </thead>
  78. </table>
  79. </div>
  80. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>&typ=prize"><i class="fa fa-plus"></i>添加奖品</a></div>
  81. </div>
  82. <div class="panel panel-default">
  83. <div class="panel-heading"><h3 class="panel-title" id="panel-title">问题设置</h3></div>
  84. <div class="panel-body">
  85. <div class="form-group">
  86. <{foreach from=$events_Data.events.survery_question key=index item=survery_question}>
  87. <{if $survery_question.type=='img'}>
  88. <div class="panel panel-default" style="padding: 10px;">
  89. <{*<div style="margin: 10px;" >排序: &nbsp; &nbsp; &nbsp; <{$index}></div>*}>
  90. <div style="margin: 10px;">问题: &nbsp; &nbsp; &nbsp; <{$survery_question.question}></div>
  91. <div style="margin: 10px;">类型: &nbsp; &nbsp; &nbsp; 图片</div>
  92. <div style="clear:both;"></div>
  93. <table class="table">
  94. <tr>
  95. <{foreach from=$survery_question.answer key=key item=answer}>
  96. <td style="text-align:center;">
  97. <img id="img_url_tag" src="<{$answer.img_url}>" style="width:100px;" class="img-thumbnail"><br>
  98. <div style="text-align:center;">选择:<{$answer.answer}></div>
  99. </td>
  100. <{/foreach}>
  101. </tr>
  102. </table>
  103. <div style="margin: 10px;">操作: &nbsp; &nbsp; &nbsp; <a survery_question_id="<{$index}>" href="javascript:;" class="del_survery_question">点击删除</a></div>
  104. </div>
  105. <{/if}>
  106. <{if $survery_question.type=='txt'}>
  107. <div class="panel panel-default" style="padding: 10px;">
  108. <{*<div style="margin: 10px;">排序: &nbsp; &nbsp; &nbsp; <{$index}></div>*}>
  109. <div style="margin: 10px;">问题: &nbsp; &nbsp; &nbsp; <{$survery_question.question}></div>
  110. <div style="margin: 10px;">类型: &nbsp; &nbsp; &nbsp; 文字</div>
  111. <div style="clear:both;"></div>
  112. <{foreach from=$survery_question.answer key=key item=answer}>
  113. <div style="text-align:left;margin:10px;"><{$answer.answer}></div>
  114. <{/foreach}>
  115. <div style="margin: 10px;">操作: &nbsp; &nbsp; &nbsp; <a survery_question_id="<{$index}>" href="javascript:;" class="del_survery_question">点击删除</a></div>
  116. </div>
  117. <{/if}>
  118. <{/foreach}>
  119. </div>
  120. </div>
  121. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>&typ=question"><i class="fa fa-plus"></i>添加一个问题</a></div>
  122. </div>
  123. </div>
  124. <{include file="./admin/activity/common_right.html"}>
  125. <div style="clear:both;"></div>
  126. </form>
  127. </div>
  128. <script>
  129. KISSY.use('node, io, event, jquery', function (S, Node, IO, Event, jQuery) {
  130. var $ = S.all;
  131. $(".del_survery_question").on('click', function () {
  132. var survery_question_id = $(this).attr('survery_question_id');
  133. var events_id = <{$events_Data.events.id}>;
  134. var formData = {'survery_question_id':survery_question_id,'events_id':events_id};
  135. new IO({
  136. type: "post"
  137. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqDelSurveyQuestion'
  138. , data: formData
  139. , success: function (data) {
  140. if (data.ok) { //ok
  141. var url = data.msg;
  142. location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>';
  143. } else {
  144. alert('操作失败,原因:'+data.msg);
  145. }
  146. return false;
  147. }
  148. , error: function (NULL, textStatus) {
  149. alert("请求服务器失败,原因:"+textStatus);
  150. }
  151. , dataType: "json"
  152. });
  153. });
  154. $(".del_survery_prize").on('click', function () {
  155. var survery_prize_id = $(this).attr('survery_prize_id');
  156. var events_id = <{$events_Data.events.id}>;
  157. var formData = {'survery_prize_id':survery_prize_id,'events_id':events_id};
  158. new IO({
  159. type: "post"
  160. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqDelSurveyPrize'
  161. , data: formData
  162. , success: function (data) {
  163. if (data.ok) { //ok
  164. var url = data.msg;
  165. location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<{$events_Data.events.id}>';
  166. } else {
  167. alert('操作失败,原因:'+data.msg);
  168. }
  169. return false;
  170. }
  171. , error: function (NULL, textStatus) {
  172. alert("请求服务器失败,原因:"+textStatus);
  173. }
  174. , dataType: "json"
  175. });
  176. });
  177. });
  178. </script>
  179. <{include file="./admin/bottom.html"}>