form.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form method="post" id="marketmanage_form">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td class="required w120">{$Think.lang.marketmanage_name}</td>
  8. <td class="vatop rowform"><input id="marketmanage_name" name="marketmanage_name" value="{$marketmanage.marketmanage_name|default=''}" class="input-txt" type="text"></td>
  9. <td class="vatop tips"></td>
  10. </tr>
  11. <tr class="noborder">
  12. <td class="required w120">{$Think.lang.marketmanage_detail}</td>
  13. <td class="vatop rowform"><textarea name="marketmanage_detail">{$marketmanage.marketmanage_detail|default=''}</textarea></td>
  14. <td class="vatop tips"></td>
  15. </tr>
  16. <tr class="noborder">
  17. <td class="required w120">{$Think.lang.ds_begin_time}</td>
  18. <td class="vatop rowform"><input id="marketmanage_begintime" name="marketmanage_begintime" value="{$marketmanage.marketmanage_begintime|date='Y-m-d H:i'}" class="input-txt" type="text"></td>
  19. <td class="vatop tips"></td>
  20. </tr>
  21. <tr class="noborder">
  22. <td class="required w120">{$Think.lang.ds_end_time}</td>
  23. <td class="vatop rowform"><input id="marketmanage_endtime" name="marketmanage_endtime" value="{$marketmanage.marketmanage_endtime|date='Y-m-d H:i'}" class="input-txt" type="text"></td>
  24. <td class="vatop tips"></td>
  25. </tr>
  26. <tr class="noborder">
  27. <td class="required w120">{$Think.lang.marketmanage_joincount}</td>
  28. <td class="vatop rowform" id="marketmanage_jointype">
  29. <input name="marketmanage_jointype" value="0" type="radio" {if $marketmanage.marketmanage_jointype eq '0'}checked{/if}>{$Think.lang.ds_total}
  30. <input id="marketmanage_joincount_0" name="marketmanage_joincount" value="{$marketmanage.marketmanage_joincount|default=''}" class="input-txt w36" type="text" {if $marketmanage.marketmanage_jointype neq '0'}disabled{/if}>
  31. {$Think.lang.ds_times}
  32. <input name="marketmanage_jointype" value="1" type="radio" {if $marketmanage.marketmanage_jointype eq '1'}checked{/if}>{$Think.lang.marketmanage_jointype_1}
  33. <input id="marketmanage_joincount_1" name="marketmanage_joincount" value="{$marketmanage.marketmanage_joincount|default=''}" class="input-txt w36" type="text" {if $marketmanage.marketmanage_jointype neq '1'}disabled{/if}>
  34. {$Think.lang.ds_times}
  35. <input name="marketmanage_jointype" value="2" type="radio" {if $marketmanage.marketmanage_jointype eq '2'}checked{/if}>{$Think.lang.marketmanage_jointype_2}
  36. </td>
  37. <td class="vatop tips"></td>
  38. </tr>
  39. <tr class="noborder">
  40. <td class="required w120">{$Think.lang.marketmanage_point}</td>
  41. <td class="vatop rowform">
  42. <input id="marketmanage_point_type" name="marketmanage_point_type" value="0" type="radio" {if $marketmanage.marketmanage_point eq '0'}checked{/if}>{$Think.lang.marketmanage_point_type_0}
  43. <input id="marketmanage_point_type" name="marketmanage_point_type" value="1" type="radio" {if $marketmanage.marketmanage_point neq '0'}checked{/if}>{$Think.lang.marketmanage_point_type_1}
  44. <input id="marketmanage_point" name="marketmanage_point" value="{$marketmanage.marketmanage_point|default=''}" class="input-txt w36" type="text">
  45. </td>
  46. <td class="vatop tips"></td>
  47. </tr>
  48. <tr class="noborder">
  49. <td class="required w120">{$Think.lang.marketmanage_failed}</td>
  50. <td class="vatop rowform"><textarea name="marketmanage_failed">{$marketmanage.marketmanage_failed|default=''}</textarea></td>
  51. <td class="vatop tips"></td>
  52. </tr>
  53. <tr class="noborder">
  54. <td class="required w120">{$Think.lang.marketmanage_award_set}</td>
  55. <td class="vatop rowform" style="width:500px;">
  56. <div class="marketmanage_award_list" dstype="marketmanage_award_list">
  57. <ul class="tab-menu">
  58. <li class="current">{$Think.lang.marketmanage_award_1}</li>
  59. <li>{$Think.lang.marketmanage_award_2}</li>
  60. <li>{$Think.lang.marketmanage_award_3}</li>
  61. <li>{$Think.lang.marketmanage_award_4}</li>
  62. </ul>
  63. {foreach name="marketmanageaward_list" item="award"}
  64. <div class="marketmanage_award" {if $award.marketmanageaward_level neq '1'}style="display:none"{/if}>
  65. {if $Request.action eq 'edit'}
  66. <input name="id_{$award.marketmanageaward_level}" type="hidden" value="{$award.marketmanageaward_id|default='0'}"/>
  67. {/if}
  68. <dl>
  69. <dt>{$Think.lang.choose_prizes}</dt>
  70. <dd>
  71. <label><input name="type_{$award.marketmanageaward_level}" type="radio" value="1" {if $award.marketmanageaward_type eq '1'}checked{/if}>{$Think.lang.ds_member_points}</label>
  72. <label><input name="type_{$award.marketmanageaward_level}" type="radio" value="2" {if $award.marketmanageaward_type eq '2'}checked{/if}>{$Think.lang.ds_bonus}</label>
  73. <label><input name="type_{$award.marketmanageaward_level}" type="radio" value="3" {if $award.marketmanageaward_type eq '3'}checked{/if}>{$Think.lang.ds_voucher}</label>
  74. </dd>
  75. </dl>
  76. <dl class="award_type_show" id="award_type_show_1" {if $award.marketmanageaward_type neq '1'}style="display:none"{/if}>
  77. <dt>{$Think.lang.gift_points}:</dt>
  78. <dd>
  79. <input name="point_{$award.marketmanageaward_level}" value="{$award.marketmanageaward_point}" class="input-txt w36" type="text">
  80. </dd>
  81. </dl>
  82. <dl class="award_type_show" id="award_type_show_2" {if $award.marketmanageaward_type neq '2'}style="display:none"{/if}>
  83. <dt>{$Think.lang.choose_bonus}:</dt>
  84. <dd>
  85. <select name="bonus_id_{$award.marketmanageaward_level}">
  86. {foreach name="bonus_list" item="bonus"}
  87. <option value="{$bonus.bonus_id}" {if $award.bonus_id eq $bonus.bonus_id}selected{/if}>{$bonus.bonus_name}</option>
  88. {/foreach}
  89. </select>
  90. </dd>
  91. </dl>
  92. <dl class="award_type_show" id="award_type_show_3" {if $award.marketmanageaward_type neq '3'}style="display:none"{/if}>
  93. <dt>{$Think.lang.choose_voucher}:</dt>
  94. <dd>
  95. <select name="vouchertemplate_id_{$award.marketmanageaward_level}">
  96. {foreach name="vouchertemplate_list" item="vouchertemplate"}
  97. <option value="{$vouchertemplate.vouchertemplate_id}" {if $award.vouchertemplate_id eq $vouchertemplate.vouchertemplate_id}selected{/if}>{$vouchertemplate.vouchertemplate_title}[{$vouchertemplate.vouchertemplate_storename}]</option>
  98. {/foreach}
  99. </select>
  100. </dd>
  101. </dl>
  102. <dl>
  103. <dt>{$Think.lang.marketmanageaward_count}:</dt>
  104. <dd><input name="count_{$award.marketmanageaward_level}" value="{$award.marketmanageaward_count}" class="input-txt w36" type="text"><em>{$Think.lang.marketmanageaward_send}:{$award.marketmanageaward_send|default='0'}</em></dd>
  105. </dl>
  106. <dl>
  107. <dt>{$Think.lang.marketmanageaward_probability}:</dt>
  108. <dd><input name="probability_{$award.marketmanageaward_level}" value="{$award.marketmanageaward_probability}" class="input-txt w36" type="text">%<em>{$Think.lang.marketmanageaward_probability_tips}</em></dd>
  109. </dl>
  110. </div>
  111. {/foreach}
  112. </div>
  113. </td>
  114. <td class="vatop tips"></td>
  115. </tr>
  116. </tbody>
  117. <tfoot>
  118. <tr class="tfoot">
  119. <td colspan="15"><input type="submit" value="{$Think.lang.ds_confirm_submit}" class="btn" /></td>
  120. </tr>
  121. </tfoot>
  122. </table>
  123. </form>
  124. </div>
  125. <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.css">
  126. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.js"></script>
  127. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/i18n/jquery-ui-timepicker-zh-CN.js"></script>
  128. <script>
  129. $(function () {
  130. $('#marketmanage_begintime').datetimepicker({dateFormat: 'yy-mm-dd'});
  131. $('#marketmanage_endtime').datetimepicker({dateFormat: 'yy-mm-dd'});
  132. $('div[dstype="marketmanage_award_list"] > ul').find('li').click(function () {
  133. $(this).addClass('current').siblings().removeClass('current');
  134. var _index = $(this).index();
  135. var _div = $('div[dstype="marketmanage_award_list"]').find('.marketmanage_award');
  136. _div.hide();
  137. _div.eq(_index).show();
  138. });
  139. $('.marketmanage_award').find(':radio').click(function () {
  140. var _value = $(this).val();
  141. $(this).parents('.marketmanage_award').find('.award_type_show').hide();
  142. $(this).parents('.marketmanage_award').find('#award_type_show_' + _value).show();
  143. });
  144. $('#marketmanage_jointype').find(':radio').click(function () {
  145. var _value = $(this).val();
  146. var _text = $('#marketmanage_jointype').find(':text');
  147. _text.attr("disabled",true);
  148. $('#marketmanage_joincount_'+_value).attr("disabled",false);
  149. });
  150. $('#marketmanage_form').validate({
  151. errorPlacement: function(error, element) {
  152. error.appendTo(element.parent().parent().find('td:last'));
  153. },
  154. rules: {
  155. marketmanage_name : {
  156. required: true
  157. }
  158. },
  159. messages: {
  160. marketmanage_name : {
  161. required : '{$Think.lang.marketmanage_name_error}'
  162. }
  163. }
  164. });
  165. });
  166. </script>
  167. <style>
  168. .marketmanage_award_list{border: 1px solid #ccc;background:#f2f2f2;}
  169. .marketmanage_award_list .tab-menu{display: flex;margin:0;width:auto;}
  170. .marketmanage_award_list .tab-menu li{background:#fff;margin:0;flex:1;height:40px;text-align:center;line-height:40px;padding:0;border: 1px solid #ccc;border-left-color: transparent;border-top-color: transparent;cursor: pointer;}
  171. .marketmanage_award_list .tab-menu li.current {background: #f2f2f2;border-bottom-color: transparent;}
  172. .marketmanage_award_list .tab-menu li:last-child {border-right-color: transparent;}
  173. .marketmanage_award{margin-bottom:10px;padding:30px 50px;}
  174. .marketmanage_award dl{margin:15px 0;height:30px;line-height:30px;}
  175. .marketmanage_award dt{float:left;width:80px;height:30px;}
  176. .marketmanage_award dd{height:30px;float:left;}
  177. .marketmanage_award dd {height:30px;float:left;}
  178. .marketmanage_award dd em{font-size:12px;margin-left:10px;color: #999;}
  179. .marketmanage_award select{width:100px;}
  180. </style>