groupbuy.slider.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <h3><?php echo $lang['groupbuy_index_manage'];?></h3>
  6. <ul class="tab-base">
  7. <?php foreach($output['menu'] as $menu) { if($menu['menu_type'] == 'text') { ?>
  8. <li><a href="JavaScript:void(0);" class="current"><span><?php echo $menu['menu_name'];?></span></a></li>
  9. <?php } else { ?>
  10. <li><a href="<?php echo $menu['menu_url'];?>" ><span><?php echo $menu['menu_name'];?></span></a></li>
  11. <?php } } ?>
  12. </ul>
  13. </div>
  14. </div>
  15. <div class="fixed-empty"></div>
  16. <table id="prompt" class="table tb-type2">
  17. <tbody>
  18. <tr class="space odd">
  19. <th colspan="12" class="nobg"> <div class="title">
  20. <h5><?php echo $lang['nc_prompts'];?></h5>
  21. <span class="arrow"></span> </div>
  22. </th>
  23. </tr>
  24. <tr class="odd">
  25. <td><ul>
  26. <li>该组幻灯片滚动图片应用于抢购聚合页上部使用,最多可上传4张图片。</li>
  27. <li>图片要求使用宽度为970像素,高度为300像素jpg/gif/png格式的图片。</li>
  28. <li>上传图片后请添加格式为“http://网址...”链接地址,设定后将在显示页面中点击幻灯片将以另打开窗口的形式跳转到指定网址。</li>
  29. <li>清空操作将删除聚合页上的滚动图片,请注意操作</li>
  30. </ul></td>
  31. </tr>
  32. </tbody>
  33. </table>
  34. <form id="live_form" method="post" enctype="multipart/form-data">
  35. <input type="hidden" name="form_submit" value="ok" />
  36. <table class="table tb-type2">
  37. <tbody>
  38. <tr>
  39. <td class="required"><label>滚动图片1:</label></td>
  40. <td><label>链接地址:</label></td>
  41. </tr>
  42. <tr class="noborder">
  43. <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  44. <div class="type-file-preview"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_LIVE.DS.$output['list_setting']['live_pic1'];?>"></div>
  45. </span><span class="type-file-box">
  46. <input type='text' name='textfield1' id='textfield1' class='type-file-text' />
  47. <input type='button' name='button' id='button' value='' class='type-file-button' />
  48. <input name="live_pic1" type="file" class="type-file-file" id="live_pic1" size="30" hidefocus="true" />
  49. </span></td>
  50. <td class="vatop"><input type="text" name="live_link1" class="w200" value="<?php echo $output['list_setting']['live_link1']?>"></td>
  51. </tr>
  52. <tr>
  53. <td class="required"><label>滚动图片2:</label></td>
  54. <td><label>链接地址:</label></td>
  55. </tr>
  56. <tr class="noborder">
  57. <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  58. <div class="type-file-preview"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_LIVE.DS.$output['list_setting']['live_pic2'];?>"></div>
  59. </span><span class="type-file-box">
  60. <input type='text' name='textfield2' id='textfield2' class='type-file-text' />
  61. <input type='button' name='button' id='button' value='' class='type-file-button' />
  62. <input name="live_pic2" type="file" class="type-file-file" id="live_pic2" size="30" hidefocus="true" />
  63. </span></td>
  64. <td class="vatop tips"><input type="text" name="live_link2" class="w200" value="<?php echo $output['list_setting']['live_link2']?>"></td>
  65. </tr>
  66. <tr>
  67. <td class="required"><label>滚动图片3:</label></td>
  68. <td><label>链接地址:</label></td>
  69. </tr>
  70. <tr class="noborder">
  71. <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  72. <div class="type-file-preview"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_LIVE.DS.$output['list_setting']['live_pic3'];?>"></div>
  73. </span><span class="type-file-box">
  74. <input type='text' name='textfield3' id='textfield3' class='type-file-text' />
  75. <input type='button' name='button' id='button' value='' class='type-file-button' />
  76. <input name="live_pic3" type="file" class="type-file-file" id="live_pic3" size="30" hidefocus="true" />
  77. </span></td>
  78. <td class="vatop tips"><input type="text" name="live_link3" class="w200" value="<?php echo $output['list_setting']['live_link3']?>"></td>
  79. </tr>
  80. <tr>
  81. <td class="required"><label>滚动图片4:</label></td>
  82. <td><label>链接地址:</label></td>
  83. </tr>
  84. <tr class="noborder">
  85. <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
  86. <div class="type-file-preview"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_LIVE.DS.$output['list_setting']['live_pic4'];?>"></div>
  87. </span><span class="type-file-box">
  88. <input type='text' name='textfield4' id='textfield4' class='type-file-text' />
  89. <input type='button' name='button' id='button' value='' class='type-file-button' />
  90. <input name="live_pic4" type="file" class="type-file-file" id="live_pic4" size="30" hidefocus="true" />
  91. </span></td>
  92. <td class="vatop tips"><input type="text" name="live_link4" class="w200" value="<?php echo $output['list_setting']['live_link4']?>"></td>
  93. </tr>
  94. </tbody>
  95. <tfoot>
  96. <tr>
  97. <td colspan="2">
  98. <a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>保存</span></a>
  99. <a href="JavaScript:void(0);" class="btn" id="clearBtn"><span>清空</span></a>
  100. </td>
  101. </tr>
  102. </tfoot>
  103. </table>
  104. </form>
  105. </div>
  106. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.edit.js" charset="utf-8"></script>
  107. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
  108. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/jquery.ui.js"></script>
  109. <script>
  110. //按钮先执行验证再提交表单
  111. $(function(){
  112. // 图片js
  113. $("#live_pic1").change(function(){$("#textfield1").val($("#live_pic1").val());});
  114. $("#live_pic2").change(function(){$("#textfield2").val($("#live_pic2").val());});
  115. $("#live_pic3").change(function(){$("#textfield3").val($("#live_pic3").val());});
  116. $("#live_pic4").change(function(){$("#textfield4").val($("#live_pic4").val());});
  117. $('#live_form').validate({
  118. errorPlacement: function(error, element){
  119. error.appendTo(element.parent().parent().prev().find('td:first'));
  120. },
  121. success: function(label){
  122. label.addClass('valid');
  123. },
  124. rules : {
  125. live_link1: {
  126. url : true
  127. },
  128. live_link2:{
  129. url : true
  130. },
  131. live_link3:{
  132. url : true
  133. },
  134. live_link4:{
  135. url : true
  136. },
  137. },
  138. messages : {
  139. live_link1: {
  140. url : '链接地址格式不正确'
  141. },
  142. live_link2:{
  143. url : '链接地址格式不正确'
  144. },
  145. live_link3:{
  146. url : '链接地址格式不正确'
  147. },
  148. live_link4:{
  149. url : '链接地址格式不正确'
  150. },
  151. }
  152. });
  153. $('#clearBtn').click(function(){
  154. if (!confirm('确认清空虚拟抢购幻灯片设置?')) {
  155. return false;
  156. }
  157. $.ajax({
  158. type:'get',
  159. url:'index.php?act=vr_groupbuy&op=slider_clear',
  160. dataType:'json',
  161. success:function(result){
  162. if(result.result){
  163. alert('清空成功');
  164. location.reload();
  165. }
  166. }
  167. });
  168. });
  169. $("#submitBtn").click(function(){
  170. $("#live_form").submit();
  171. });
  172. });
  173. </script>