slider.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_groupbuy}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="explanation" id="explanation">
  13. <div class="title" id="checkZoom">
  14. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  15. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  16. </div>
  17. <ul>
  18. <li>{$Think.lang.groupbuy_slider_help1}</li>
  19. <li>{$Think.lang.groupbuy_slider_help2}</li>
  20. <li>{$Think.lang.groupbuy_slider_help3}</li>
  21. <li>{$Think.lang.groupbuy_slider_help4}</li>
  22. </ul>
  23. </div>
  24. <form id="live_form" method="post" enctype="multipart/form-data">
  25. <table class="ds-default-table">
  26. <tbody>
  27. <tr>
  28. <td class="required"><label>{$Think.lang.live_pic}1:</label></td>
  29. <td><label>{$Think.lang.ds_link}:</label></td>
  30. </tr>
  31. <tr class="noborder">
  32. <td class="vatop rowform">
  33. {notempty name="$list_setting.live_pic1"}
  34. <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
  35. <div class="type-file-preview"><img src="{:ds_get_pic('home/groupbuy/slider',$list_setting.live_pic1)}"></div>
  36. </span>
  37. {/notempty}
  38. <span class="type-file-box">
  39. <input type='text' name='textfield1' id='textfield1' class='type-file-text' />
  40. <input type='button' name='button' id='button' value='上传' class='type-file-button' />
  41. <input name="live_pic1" type="file" class="type-file-file" id="live_pic1" size="30" hidefocus="true" />
  42. </span>
  43. </td>
  44. <td class="vatop"><input type="text" name="live_link1" class="w200" value="{$list_setting.live_link1}"></td>
  45. </tr>
  46. <tr>
  47. <td class="required"><label>{$Think.lang.live_pic}2:</label></td>
  48. <td><label>{$Think.lang.ds_link}:</label></td>
  49. </tr>
  50. <tr class="noborder">
  51. <td class="vatop rowform">
  52. {notempty name="$list_setting.live_pic2"}
  53. <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
  54. <div class="type-file-preview"><img src="{:ds_get_pic('home/groupbuy/slider',$list_setting.live_pic2)}"></div>
  55. </span>
  56. {/notempty}
  57. <span class="type-file-box">
  58. <input type='text' name='textfield2' id='textfield2' class='type-file-text' />
  59. <input type='button' name='button' id='button' value='上传' class='type-file-button' />
  60. <input name="live_pic2" type="file" class="type-file-file" id="live_pic2" size="30" hidefocus="true" />
  61. </span>
  62. </td>
  63. <td class="vatop tips"><input type="text" name="live_link2" class="w200" value="{$list_setting.live_link2}"></td>
  64. </tr>
  65. <tr>
  66. <td class="required"><label>{$Think.lang.live_pic}3:</label></td>
  67. <td><label>{$Think.lang.ds_link}:</label></td>
  68. </tr>
  69. <tr class="noborder">
  70. <td class="vatop rowform">
  71. {notempty name="$list_setting.live_pic3"}
  72. <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
  73. <div class="type-file-preview"><img src="{:ds_get_pic('home/groupbuy/slider',$list_setting.live_pic3)}"></div>
  74. </span>
  75. {/notempty}
  76. <span class="type-file-box">
  77. <input type='text' name='textfield3' id='textfield3' class='type-file-text' />
  78. <input type='button' name='button' id='button' value='上传' class='type-file-button' />
  79. <input name="live_pic3" type="file" class="type-file-file" id="live_pic3" size="30" hidefocus="true" />
  80. </span>
  81. </td>
  82. <td class="vatop tips"><input type="text" name="live_link3" class="w200" value="{$list_setting.live_link3}"></td>
  83. </tr>
  84. <tr>
  85. <td class="required"><label>{$Think.lang.live_pic}4:</label></td>
  86. <td><label>{$Think.lang.ds_link}:</label></td>
  87. </tr>
  88. <tr class="noborder">
  89. <td class="vatop rowform">
  90. {notempty name="$list_setting.live_pic4"}
  91. <span class="type-file-show"><img class="show_image" src="{$Think.ADMIN_SITE_ROOT}/images/preview.png">
  92. <div class="type-file-preview"><img src="{:ds_get_pic('home/groupbuy/slider',$list_setting.live_pic4)}"></div>
  93. </span>
  94. {/notempty}
  95. <span class="type-file-box">
  96. <input type='text' name='textfield4' id='textfield4' class='type-file-text' />
  97. <input type='button' name='button' id='button' value='上传' class='type-file-button' />
  98. <input name="live_pic4" type="file" class="type-file-file" id="live_pic4" size="30" hidefocus="true" />
  99. </span>
  100. </td>
  101. <td class="vatop tips"><input type="text" name="live_link4" class="w200" value="{$list_setting.live_link4}"></td>
  102. </tr>
  103. </tbody>
  104. <tfoot>
  105. <tr>
  106. <td colspan="2">
  107. <input class="btn" type="submit" value="{$Think.lang.ds_submit}"/>
  108. <input class="btn" type="button" id="clearBtn" value="{$Think.lang.ds_clear}"/>
  109. </td>
  110. </tr>
  111. </tfoot>
  112. </table>
  113. </form>
  114. </div>
  115. <script>
  116. //按钮先执行验证再提交表单
  117. $(function(){
  118. // 图片js
  119. $("#live_pic1").change(function(){$("#textfield1").val($("#live_pic1").val());});
  120. $("#live_pic2").change(function(){$("#textfield2").val($("#live_pic2").val());});
  121. $("#live_pic3").change(function(){$("#textfield3").val($("#live_pic3").val());});
  122. $("#live_pic4").change(function(){$("#textfield4").val($("#live_pic4").val());});
  123. $('#live_form').validate({
  124. errorPlacement: function(error, element){
  125. error.appendTo(element.parent().parent().prev().find('td:first'));
  126. },
  127. rules : {
  128. live_link1: {
  129. url : true
  130. },
  131. live_link2:{
  132. url : true
  133. },
  134. live_link3:{
  135. url : true
  136. },
  137. live_link4:{
  138. url : true
  139. },
  140. },
  141. messages : {
  142. live_link1: {
  143. url : '{$Think.lang.ds_url_error}'
  144. },
  145. live_link2:{
  146. url : '{$Think.lang.ds_url_error}'
  147. },
  148. live_link3:{
  149. url : '{$Think.lang.ds_url_error}'
  150. },
  151. live_link4:{
  152. url : '{$Think.lang.ds_url_error}'
  153. },
  154. }
  155. });
  156. $('#clearBtn').click(function(){
  157. layer.confirm('{$Think.lang.confirm_clear}', {
  158. btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
  159. title: false,
  160. }, function () {
  161. $.ajax({
  162. type:'get',
  163. url:"{:url('Groupbuy/slider_clear')}",
  164. dataType:'json',
  165. success:function(result){
  166. if(result.result){
  167. layer.alert('{$Think.lang.confirm_succ}');
  168. location.reload();
  169. }
  170. }
  171. });
  172. });
  173. });
  174. });
  175. </script>