f63c23fbed5f5357eaea3f18010d20be.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:70:"/www/wwwroot/baoxian/public/../application/admin/view/product/add.html";i:1627915017;s:63:"/www/wwwroot/baoxian/application/admin/view/layout/default.html";i:1627698986;s:60:"/www/wwwroot/baoxian/application/admin/view/common/meta.html";i:1627698986;s:62:"/www/wwwroot/baoxian/application/admin/view/common/script.html";i:1627698986;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="<?php echo $config['language']; ?>">
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <meta name="referrer" content="never">
  10. <meta name="robots" content="noindex, nofollow">
  11. <link rel="shortcut icon" href="/assets/img/favicon.ico" />
  12. <!-- Loading Bootstrap -->
  13. <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  14. <?php if(\think\Config::get('fastadmin.adminskin')): ?>
  15. <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  16. <?php endif; ?>
  17. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  18. <!--[if lt IE 9]>
  19. <script src="/assets/js/html5shiv.js"></script>
  20. <script src="/assets/js/respond.min.js"></script>
  21. <![endif]-->
  22. <script type="text/javascript">
  23. var require = {
  24. config: <?php echo json_encode($config); ?>
  25. };
  26. </script>
  27. </head>
  28. <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
  29. <div id="main" role="main">
  30. <div class="tab-content tab-addtabs">
  31. <div id="content">
  32. <div class="row">
  33. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  34. <section class="content-header hide">
  35. <h1>
  36. <?php echo __('Dashboard'); ?>
  37. <small><?php echo __('Control panel'); ?></small>
  38. </h1>
  39. </section>
  40. <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
  41. <!-- RIBBON -->
  42. <div id="ribbon">
  43. <ol class="breadcrumb pull-left">
  44. <?php if($auth->check('dashboard')): ?>
  45. <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
  46. <?php endif; ?>
  47. </ol>
  48. <ol class="breadcrumb pull-right">
  49. <?php foreach($breadcrumb as $vo): ?>
  50. <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
  51. <?php endforeach; ?>
  52. </ol>
  53. </div>
  54. <!-- END RIBBON -->
  55. <?php endif; ?>
  56. <div class="content">
  57. <style>
  58. #shuxing{
  59. min-height: 100%;
  60. height: auto;
  61. }
  62. .demo_line_01{
  63. padding: 0 20px 0;
  64. margin: 20px 0;
  65. line-height: 1px;
  66. border-left: 200px solid #ddd;
  67. border-right: 200px solid #ddd;
  68. text-align: center;
  69. color: red;
  70. border-top: 80px;
  71. }
  72. </style>
  73. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  74. <div class="form-group">
  75. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Name'); ?>:</label>
  76. <div class="col-xs-12 col-sm-8">
  77. <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="control-label col-xs-12 col-sm-2">所属保险分类:</label>
  82. <div class="col-xs-12 col-sm-8">
  83. <select id="c-pid" data-live-search="true" data-rule="required" class="form-control selectpicker" name="row[category_id]">
  84. <?php if(is_array($parentList) || $parentList instanceof \think\Collection || $parentList instanceof \think\Paginator): if( count($parentList)==0 ) : echo "" ;else: foreach($parentList as $key=>$vo): ?>
  85. <option data-type="<?php echo $vo['type']; ?>" value="<?php echo $key; ?>" <?php if(in_array(($key), explode(',',""))): ?>selected<?php endif; ?>><?php echo $vo['name']; ?></option>
  86. <?php endforeach; endif; else: echo "" ;endif; ?>
  87. </select>
  88. </div>
  89. </div>
  90. <div class="form-group" style="display: block">
  91. <label class="control-label col-xs-12 col-sm-2">包含属性:</label>
  92. <div id="shuxing" style="margin-left: 150px">
  93. </div>
  94. </div>
  95. <!-- <div class="form-group">-->
  96. <!-- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Category_id'); ?>:</label>-->
  97. <!-- <div class="col-xs-12 col-sm-8">-->
  98. <!-- <input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"product"}' class="form-control selectpage" name="row[category_id]" type="text" value="">-->
  99. <!-- </div>-->
  100. <!-- </div>-->
  101. <div class="form-group">
  102. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Company_id'); ?>:</label>
  103. <div class="col-xs-12 col-sm-8">
  104. <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="">
  105. </div>
  106. </div>
  107. <div class="form-group">
  108. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Sort'); ?>:</label>
  109. <div class="col-xs-12 col-sm-8">
  110. <input id="c-sort" class="form-control" name="row[sort]" type="number" value="0">
  111. </div>
  112. </div>
  113. <!-- <div class="form-group">-->
  114. <!-- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Content'); ?>:</label>-->
  115. <!-- <div class="col-xs-12 col-sm-8">-->
  116. <!-- <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>-->
  117. <!-- </div>-->
  118. <!-- </div>-->
  119. <div class="form-group">
  120. <label class="control-label col-xs-12 col-sm-2"><?php echo __('P_image'); ?>:</label>
  121. <div class="col-xs-12 col-sm-8">
  122. <div class="input-group">
  123. <input id="c-p_image" class="form-control" size="50" name="row[p_image]" type="text">
  124. <div class="input-group-addon no-border no-padding">
  125. <span><button type="button" id="faupload-p_image" class="btn btn-danger faupload" data-input-id="c-p_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-p_image"><i class="fa fa-upload"></i> <?php echo __('Upload'); ?></button></span>
  126. <span><button type="button" id="fachoose-p_image" class="btn btn-primary fachoose" data-input-id="c-p_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> <?php echo __('Choose'); ?></button></span>
  127. </div>
  128. <span class="msg-box n-right" for="c-p_image"></span>
  129. </div>
  130. <ul class="row list-inline faupload-preview" id="p-p_image"></ul>
  131. </div>
  132. </div>
  133. <div class="form-group">
  134. <label class="control-label col-xs-12 col-sm-2">是否保存草稿:</label>
  135. <!-- <div class="col-xs-12 col-sm-8">-->
  136. <!-- <input id="c-status" class="form-control" name="row[status]" type="number" value="0">-->
  137. <!-- </div>-->
  138. <div class="col-xs-12 col-sm-8">
  139. <select class="form-control selectpicker" name="row[status]">
  140. <?php if($group_id == 7): ?>
  141. <option value="0" >发布状态</option>
  142. <?php elseif($group_id == 6): ?>
  143. <option value="1" >草稿状态</option>
  144. <?php elseif($group_id == 1): ?>
  145. <option value="0" >发布状态</option>
  146. <option value="1" >草稿状态</option>
  147. <?php else: ?>
  148. <option value="0" >发布状态</option>
  149. <?php endif; ?>
  150. </select>
  151. </div>
  152. </div>
  153. <div class="form-group">
  154. <label class="control-label col-xs-12 col-sm-2">状态属性:</label>
  155. <div class="col-xs-12 col-sm-8">
  156. <select id="c-attribute" class="form-control selectpicker" name="row[attribute]">
  157. <?php if(is_array($attributeList) || $attributeList instanceof \think\Collection || $attributeList instanceof \think\Paginator): if( count($attributeList)==0 ) : echo "" ;else: foreach($attributeList as $key=>$vo): ?>
  158. <option value="<?php echo $key; ?>" <?php if(in_array(($key), explode(',',""))): ?>selected<?php endif; ?>><?php echo $vo; ?></option>
  159. <?php endforeach; endif; else: echo "" ;endif; ?>
  160. </select>
  161. </div>
  162. </div>
  163. <div class="demo_line_01">
  164. 下方添加其他保险属性
  165. </div>
  166. <div class="form-group">
  167. <dl class="fieldlist" id="fieldlist" data-name="row[content]" data-template="fieldtpl" style="margin-left: 100px">
  168. <dd>
  169. <ins>名称</ins>
  170. <ins>内容</ins>
  171. </dd>
  172. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>追加</a></dd>
  173. <textarea name="row[content]" id="sendcontent" class="form-control hide" cols="30" rows="5">
  174. <!-- [{"key":"特殊数据1","name":"内容1"},{"key":"特殊数据2","name":"内容2"}]-->
  175. </textarea>
  176. </dl>
  177. </div>
  178. <div class="form-group layer-footer">
  179. <label class="control-label col-xs-12 col-sm-2"></label>
  180. <div class="col-xs-12 col-sm-8">
  181. <button type="submit" class="btn btn-success btn-embossed disabled"><?php echo __('OK'); ?></button>
  182. <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
  183. </div>
  184. </div>
  185. </form>
  186. <!--以下是自定义模板的内容-->
  187. <script id="fieldtpl">
  188. <dd class="form-inline">
  189. <input type="text" name="<%=name%>[<%=index%>][key]" class="form-control" value="" size="10" />
  190. <input type="text" name="<%=name%>[<%=index%>][name]" class="form-control" value="" size="30" />
  191. <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
  192. <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
  193. <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
  194. </dd>
  195. </script>
  196. <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
  197. <script>
  198. function myFocus(obj){
  199. //判断文本框中的内容是否是默认内容
  200. obj.value="";
  201. //设置文本框获取焦点时候背景颜色变换
  202. }
  203. $(document).on("focus", "#c-pid", function(){
  204. obj.value="";
  205. })
  206. $(document).on("change", "#c-pid", function(){
  207. var id = $("#c-pid").val();
  208. var list = {id:id};
  209. var addHtml = "";
  210. $("#shuxing").html(addHtml);
  211. $.ajax({
  212. //请求方式
  213. type : "POST",
  214. //请求的媒体类型
  215. contentType: "application/json;charset=UTF-8",
  216. //请求地址
  217. url : "Product/params",
  218. //数据,json字符串
  219. data:JSON.stringify(list),
  220. //请求成功
  221. success : function(result) {
  222. // $("#fieldlist").dataset.name = result.data;
  223. // var ele = document.getElementById("test");
  224. // ele.value = ele.value + result.data;
  225. // document.getElementById('shuxing').style.display = "block";
  226. // document.getElementById("content1").value = result.data;
  227. if(result.code == 1){
  228. var obj_json = result.data;
  229. var packJson = JSON.parse(obj_json);
  230. var addHtml = "";
  231. for(var i = 0; i < packJson.length; i++){
  232. console.log(packJson[i].key + " " + packJson[i].name);
  233. addHtml += "<div class=\"col-xs-6 col-sm-8\">\n" +
  234. " <input readonly=\"readonly\" data-rule=\"required\" style=\"width: 30%;\" name=\"row[key1][]\"" +
  235. " value="+packJson[i].key+ " type=\"text\">\n" +
  236. " <input data-rule=\"required\" style=\"width: 30%;\" name=\"row[name1][]\"" +
  237. " value="+packJson[i].name+ " type=\"text\">\n" +
  238. " </div>";
  239. }
  240. $("#shuxing").append(addHtml);
  241. }else{
  242. console.log(result.msg);
  243. }
  244. },
  245. //请求失败,包含具体的错误信息
  246. error : function(e){
  247. var addHtml = "";
  248. $("#shuxing").append(addHtml);
  249. console.log(e.status);
  250. console.log(e.responseText);
  251. }
  252. });
  253. });
  254. </script>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
  262. </body>
  263. </html>