5f5f394be3e609df3f0f6b72a1c941b4.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <?php /*a:3:{s:74:"/data/web/mall.valimart.net/app/admin/view/goodsclass/goods_class_add.html";i:1657785096;s:61:"/data/web/mall.valimart.net/app/admin/view/public/header.html";i:1657785098;s:66:"/data/web/mall.valimart.net/app/admin/view/public/admin_items.html";i:1657785098;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <title><?php echo htmlentities((isset($html_title) && ($html_title !== '')?$html_title:config('ds_config.site_name'))); ?><?php echo htmlentities(lang('system_backend')); ?></title>
  8. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  9. <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
  10. <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
  11. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
  12. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
  13. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
  14. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
  15. <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
  16. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
  17. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
  18. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
  19. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
  20. <script type="text/javascript">
  21. var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
  22. var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
  23. var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
  24. var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
  25. var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
  26. </script>
  27. </head>
  28. <body>
  29. <div id="append_parent"></div>
  30. <div id="ajaxwaitid"></div>
  31. <div class="page">
  32. <div class="fixed-bar">
  33. <div class="item-title">
  34. <div class="subject">
  35. <h3><?php echo htmlentities(lang('goods_class_index_class')); ?></h3>
  36. </div>
  37. <?php if($admin_item): ?>
  38. <ul class="tab-base ds-row">
  39. <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): ?>
  40. <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
  41. <?php endforeach; endif; else: echo "" ;endif; ?>
  42. </ul>
  43. <?php endif; ?>
  44. </div>
  45. </div>
  46. <form id="goods_class_form" enctype="multipart/form-data" method="post">
  47. <table class="ds-default-table">
  48. <tbody>
  49. <tr class="noborder">
  50. <td colspan="2" class="required"><label class="validation" for="gc_name"><?php echo htmlentities(lang('goods_class_index_name')); ?>:</label></td>
  51. </tr>
  52. <tr class="noborder">
  53. <td class="vatop rowform"><input type="text" value="" name="gc_name" id="gc_name" maxlength="20" class="txt"></td>
  54. <td class="vatop tips"></td>
  55. </tr>
  56. <tr>
  57. <td colspan="2" class="required"><label for="parent_id"><?php echo htmlentities(lang('goods_class_add_sup_class')); ?>:</label></td>
  58. </tr>
  59. <tr class="noborder">
  60. <td class="vatop rowform"><select name="gc_parent_id" id="gc_parent_id">
  61. <option value="0"><?php echo htmlentities(lang('ds_please_choose')); ?>...</option>
  62. <?php if(!(empty($parent_list) || (($parent_list instanceof \think\Collection || $parent_list instanceof \think\Paginator ) && $parent_list->isEmpty()))): if(is_array($parent_list) || $parent_list instanceof \think\Collection || $parent_list instanceof \think\Paginator): if( count($parent_list)==0 ) : echo "" ;else: foreach($parent_list as $k=>$v): ?>
  63. <option <?php if($gc_parent_id == $v['gc_id']): ?>selected='selected'<?php endif; ?> value="<?php echo htmlentities($v['gc_id']); ?>"><?php echo $v['gc_name']; ?></option>
  64. <?php endforeach; endif; else: echo "" ;endif; ?>
  65. <?php endif; ?>
  66. </select></td>
  67. <td class="vatop tips"><?php echo htmlentities(lang('goods_class_add_sup_class_notice')); ?></td>
  68. </tr>
  69. <tr>
  70. <td colspan="2" class="required"><label for="pic"><?php echo htmlentities(lang('goods_class_pic')); ?>:</label></td>
  71. </tr>
  72. <tr class="noborder">
  73. <td class="vatop rowform">
  74. <span class="type-file-box">
  75. <input type='text' name='textfield' id='textfield1' class='type-file-text' />
  76. <input type='button' name='button' id='button1' value='上传' class='type-file-button' />
  77. <input name="pic" type="file" class="type-file-file" id="pic" size="30" hidefocus="true" ds_type="change_pic">
  78. </span>
  79. </td>
  80. <td class="vatop tips"><?php echo htmlentities(lang('goods_class_pic_tips')); ?></td>
  81. </tr>
  82. <tr>
  83. <td colspan="2" class="required"><label><?php echo htmlentities(lang('gc_virtual')); ?>:</label></td>
  84. </tr>
  85. <tr class="noborder">
  86. <td class="vatop rowform"><label><input type="checkbox" name="gc_virtual" id="gc_virtual" value="1"><?php echo htmlentities(lang('ds_allow')); ?></label></td>
  87. <td class="vatop tips"><?php echo htmlentities(lang('gc_virtual_tips')); ?></td>
  88. </tr>
  89. <tr>
  90. <td colspan="2" class="required"><label class="validation"><?php echo htmlentities(lang('commis_rate')); ?>:</label></td>
  91. </tr>
  92. <tr class="noborder">
  93. <td class="vatop rowform"><input id="commis_rate" class="w60" type="text" value="5" name="commis_rate">%</td>
  94. <td class="vatop tips"><?php echo htmlentities(lang('commis_rate_tips')); ?></td>
  95. </tr>
  96. <tr>
  97. <td colspan="2" class="required"><label for="gc_name"><?php echo htmlentities(lang('goods_class_add_type')); ?>:</label></td>
  98. </tr>
  99. <tr class="noborder">
  100. <td colspan="2" id="gcategory"><select class="class-select">
  101. <option value="0"><?php echo htmlentities(lang('ds_please_choose')); ?>...</option>
  102. <?php if(!(empty($gc_list) || (($gc_list instanceof \think\Collection || $gc_list instanceof \think\Paginator ) && $gc_list->isEmpty()))): if(is_array($gc_list) || $gc_list instanceof \think\Collection || $gc_list instanceof \think\Paginator): if( count($gc_list)==0 ) : echo "" ;else: foreach($gc_list as $k=>$v): if($v['gc_parent_id'] == 0): ?>
  103. <option value="<?php echo htmlentities($v['gc_id']); ?>"><?php echo htmlentities($v['gc_name']); ?></option>
  104. <?php endif; ?>
  105. <?php endforeach; endif; else: echo "" ;endif; ?>
  106. <?php endif; ?>
  107. </select>
  108. <?php echo htmlentities(lang('ds_quickly_targeted')); ?>
  109. </td>
  110. </tr>
  111. <tr class="noborder">
  112. <td class="vatop rowform"><input type="hidden" name="t_name" id="t_name" value="" />
  113. <div id="type_div" class="goods-sort-type">
  114. <div class="container">
  115. <dl>
  116. <dd>
  117. <input type="radio" name="t_id" value="0" checked="checked" /><?php echo htmlentities(lang('goods_class_null_type')); ?> </dd>
  118. </dl>
  119. <?php if(!(empty($type_list) || (($type_list instanceof \think\Collection || $type_list instanceof \think\Paginator ) && $type_list->isEmpty()))): if(is_array($type_list) || $type_list instanceof \think\Collection || $type_list instanceof \think\Paginator): if( count($type_list)==0 ) : echo "" ;else: foreach($type_list as $k=>$val): if(!(empty($val['type']) || (($val['type'] instanceof \think\Collection || $val['type'] instanceof \think\Paginator ) && $val['type']->isEmpty()))): ?>
  120. <dl>
  121. <dt id="type_dt_<?php echo htmlentities($k); ?>"><?php echo htmlentities($val['name']); ?></dt>
  122. <?php if(is_array($val['type']) || $val['type'] instanceof \think\Collection || $val['type'] instanceof \think\Paginator): if( count($val['type'])==0 ) : echo "" ;else: foreach($val['type'] as $key=>$v): ?>
  123. <dd>
  124. <input type="radio" name="t_id" value="<?php echo htmlentities($v['type_id']); ?>" />
  125. <span><?php echo htmlentities($v['type_name']); ?></span></dd>
  126. <?php endforeach; endif; else: echo "" ;endif; ?>
  127. </dl>
  128. <?php endif; ?>
  129. <?php endforeach; endif; else: echo "" ;endif; ?>
  130. <?php endif; ?>
  131. </div>
  132. </div></td>
  133. <td class="vatop tips"><?php echo htmlentities(lang('goods_class_add_type_desc_one')); ?><a onclick="window.parent.openItem('index,type,goods')" href="JavaScript:void(0);"><?php echo htmlentities(lang('ds_type')); ?></a><?php echo htmlentities(lang('goods_class_add_type_desc_two')); ?></td>
  134. </tr>
  135. <tr>
  136. <td colspan="2" class="required"><label><?php echo htmlentities(lang('ds_sort')); ?>:</label></td>
  137. </tr>
  138. <tr class="noborder">
  139. <td class="vatop rowform"><input type="text" value="255" name="gc_sort" id="gc_sort" class="txt"></td>
  140. <td class="vatop tips"><?php echo htmlentities(lang('goods_class_add_update_sort')); ?></td>
  141. </tr>
  142. </tbody>
  143. <tfoot>
  144. <tr>
  145. <td colspan="2"><input class="btn" type="submit" value="<?php echo htmlentities(lang('ds_submit')); ?>"/></td>
  146. </tr>
  147. </tfoot>
  148. </table>
  149. </form>
  150. </div>
  151. <script type="text/javascript" src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/mlselection.js" charset="utf-8"></script>
  152. <script type="text/javascript" src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.mousewheel.js"></script>
  153. <script>
  154. //按钮先执行验证再提交表单
  155. $(function() {
  156. $("#pic").change(function() {
  157. $("#textfield1").val($(this).val());
  158. });
  159. $('input[type="radio"][name="t_id"]').click(function() {
  160. if ($(this).val() == '0') {
  161. $('#t_name').val('');
  162. } else {
  163. $('#t_name').val($(this).next('span').html());
  164. }
  165. });
  166. $('#goods_class_form').validate({
  167. errorPlacement: function(error, element) {
  168. error.appendTo(element.parent().parent().prev().find('td:first'));
  169. },
  170. rules: {
  171. gc_name: {
  172. required: true,
  173. remote: {
  174. url: "<?php echo url('Goodsclass/ajax',['branch'=>'check_class_name']); ?>",
  175. type: 'get',
  176. data: {
  177. gc_name: function() {
  178. return $('#gc_name').val();
  179. },
  180. gc_parent_id: function() {
  181. return $('#gc_parent_id').val();
  182. },
  183. gc_id: ''
  184. }
  185. }
  186. },
  187. commis_rate: {
  188. required: true,
  189. max: 100,
  190. min: 0,
  191. digits: true
  192. },
  193. gc_sort: {
  194. number: true
  195. }
  196. },
  197. messages: {
  198. gc_name: {
  199. required: '<?php echo htmlentities(lang('goods_class_add_name_null')); ?>',
  200. remote: '<?php echo htmlentities(lang('goods_class_add_name_exists')); ?>'
  201. },
  202. commis_rate: {
  203. required: '<?php echo htmlentities(lang('goods_class_add_commis_rate_error')); ?>',
  204. max: '<?php echo htmlentities(lang('goods_class_add_commis_rate_error')); ?>',
  205. min: '<?php echo htmlentities(lang('goods_class_add_commis_rate_error')); ?>',
  206. digits: '<?php echo htmlentities(lang('goods_class_add_commis_rate_error')); ?>'
  207. },
  208. gc_sort: {
  209. number: '<?php echo htmlentities(lang('goods_class_add_sort_int')); ?>'
  210. }
  211. }
  212. });
  213. // 所属分类
  214. $(document).off('change',"#gc_parent_id").on("change","#gc_parent_id", function() {
  215. type_scroll($(this));
  216. });
  217. // 类型搜索
  218. $(document).off('change',"#gcategory > select").on("change","#gcategory > select", function() {
  219. type_scroll($(this));
  220. });
  221. });
  222. var typeScroll = 0;
  223. function type_scroll(o) {
  224. var id = o.val();
  225. if (!$('#type_dt_' + id).is('dt')) {
  226. return false;
  227. }
  228. $('#type_div').scrollTop(-typeScroll);
  229. var sp_top = $('#type_dt_' + id).offset().top;
  230. var div_top = $('#type_div').offset().top;
  231. $('#type_div').scrollTop(sp_top - div_top);
  232. typeScroll = sp_top - div_top;
  233. }
  234. gcategoryInit('gcategory');
  235. </script>