ce69081abf85bc8d0307bfeafec2dceb.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:71:"/www/wwwroot/baoxian/public/../application/admin/view/product/edit.html";i:1627984190;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. .demo_line_01{
  59. padding: 0 20px 0;
  60. margin: 20px 0;
  61. line-height: 1px;
  62. border-left: 200px solid #ddd;
  63. border-right: 200px solid #ddd;
  64. text-align: center;
  65. color: red;
  66. border-top: 80px;
  67. }
  68. </style>
  69. <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  70. <div class="form-group">
  71. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Name'); ?>:</label>
  72. <div class="col-xs-12 col-sm-8">
  73. <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="<?php echo htmlentities($row['name']); ?>">
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Category_id'); ?>:</label>
  78. <div class="col-xs-12 col-sm-8">
  79. <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[category_id]">
  80. <?php if(is_array($parentList) || $parentList instanceof \think\Collection || $parentList instanceof \think\Paginator): if( count($parentList)==0 ) : echo "" ;else: foreach($parentList as $key=>$vo): ?>
  81. <option data-type="<?php echo $vo['type']; ?>" value="<?php echo $key; ?>" <?php if(in_array(($key), is_array($row['category_id'])?$row['category_id']:explode(',',$row['category_id']))): ?>selected<?php endif; ?>><?php echo $vo['name']; ?></option>
  82. <?php endforeach; endif; else: echo "" ;endif; ?>
  83. </select>
  84. </div>
  85. </div>
  86. <div class="form-group" style="display: block">
  87. <input type="hidden" id="hidecate" value="<?php echo $row['category_id']; ?>">
  88. <label class="control-label col-xs-12 col-sm-2">包含属性:</label>
  89. <div id="shuxing" style="margin-left: 150px">
  90. <notempty name="content_one">
  91. <?php if(is_array($content_one) || $content_one instanceof \think\Collection || $content_one instanceof \think\Paginator): if( count($content_one)==0 ) : echo "" ;else: foreach($content_one as $key=>$vo): ?>
  92. <div class="col-xs-6 col-sm-8">
  93. <input readonly="readonly" data-rule="required" style="width: 30%;" name="row[key1][]" value="<?php echo $vo['key']; ?>" type="text">
  94. <input data-rule="required" style="width: 30%;" name="row[name1][]" value="<?php echo $vo['name']; ?>" type="text">
  95. </div>
  96. <?php endforeach; endif; else: echo "" ;endif; ?>
  97. </notempty>
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Company_id'); ?>:</label>
  102. <div class="col-xs-12 col-sm-8">
  103. <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="<?php echo htmlentities($row['company_id']); ?>">
  104. </div>
  105. </div>
  106. <div class="form-group">
  107. <label class="control-label col-xs-12 col-sm-2"><?php echo __('Sort'); ?>:</label>
  108. <div class="col-xs-12 col-sm-8">
  109. <input id="c-sort" class="form-control" name="row[sort]" type="number" value="<?php echo htmlentities($row['sort']); ?>">
  110. </div>
  111. </div>
  112. <div class="form-group">
  113. <label class="control-label col-xs-12 col-sm-2"><?php echo __('P_image'); ?>:</label>
  114. <div class="col-xs-12 col-sm-8">
  115. <div class="input-group">
  116. <input id="c-p_image" class="form-control" size="50" name="row[p_image]" type="text" value="<?php echo htmlentities($row['p_image']); ?>">
  117. <div class="input-group-addon no-border no-padding">
  118. <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>
  119. <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>
  120. </div>
  121. <span class="msg-box n-right" for="c-p_image"></span>
  122. </div>
  123. <ul class="row list-inline faupload-preview" id="p-p_image"></ul>
  124. </div>
  125. </div>
  126. <div class="form-group">
  127. <label class="control-label col-xs-12 col-sm-2">是否保存草稿:</label>
  128. <!-- <div class="col-xs-12 col-sm-8">-->
  129. <!-- <input id="c-status" class="form-control" name="row[status]" type="number" value="0">-->
  130. <!-- </div>-->
  131. <div class="col-xs-12 col-sm-8">
  132. <select class="form-control selectpicker" name="row[status]"
  133. <?php if($row['status'] == 1 && $group_id == 6): ?> disabled="disabled" <?php endif; ?>
  134. >
  135. <?php if($group_id == 7): ?>
  136. <option value="0" >发布状态</option>
  137. <?php elseif($group_id == 6): if($row['status'] == 1): ?>
  138. <option value="0" selected="selected" >发布状态</option>
  139. <?php else: ?>
  140. <option value="1" >草稿状态</option>
  141. <?php endif; elseif($group_id == 1): ?>
  142. <option value="0"
  143. <?php if($row['status'] == 0): ?> selected <?php endif; ?>
  144. >发布状态</option>
  145. <option value="1" <?php if($row['status'] == 1): ?> selected <?php endif; ?> >草稿状态</option>
  146. <?php else: ?>
  147. <option value="0" >发布状态</option>
  148. <?php endif; ?>
  149. </select>
  150. </div>
  151. </div>
  152. <div class="form-group">
  153. <label class="control-label col-xs-12 col-sm-2">状态属性:</label>
  154. <div class="col-xs-12 col-sm-8">
  155. <select id="c-attribute" class="form-control selectpicker" name="row[attribute]">
  156. <?php if(is_array($attributeList) || $attributeList instanceof \think\Collection || $attributeList instanceof \think\Paginator): if( count($attributeList)==0 ) : echo "" ;else: foreach($attributeList as $key=>$vo): ?>
  157. <option value="<?php echo $key; ?>" <?php if(in_array(($key), is_array($row['attribute'])?$row['attribute']:explode(',',$row['attribute']))): ?>selected<?php endif; ?>><?php echo $vo; ?></option>
  158. <?php endforeach; endif; else: echo "" ;endif; ?>
  159. </select>
  160. </div>
  161. </div>
  162. <div class="demo_line_01">
  163. 下方添加其他保险属性
  164. </div>
  165. <div class="form-group">
  166. <dl class="fieldlist" data-name="row[content]" data-template="fieldtpl" style="margin-left: 100px">
  167. <dd>
  168. <ins>名称</ins>
  169. <ins>内容</ins>
  170. </dd>
  171. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> <?php echo __('Append'); ?></a></dd>
  172. <textarea name="row[content]" class="form-control hide" cols="30" rows="5"><?php echo $row['content']; ?></textarea>
  173. </dl>
  174. </div>
  175. <div class="form-group layer-footer">
  176. <label class="control-label col-xs-12 col-sm-2"></label>
  177. <div class="col-xs-12 col-sm-8">
  178. <?php if($group_id == 6 && $row['status'] == 0): else: ?>
  179. <button type="submit" class="btn btn-success btn-embossed disabled"><?php echo __('OK'); ?></button>
  180. <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
  181. <?php endif; ?>
  182. </div>
  183. </div>
  184. </form>
  185. <!--以下是自定义模板的内容-->
  186. <script id="fieldtpl">
  187. <dd class="form-inline">
  188. <input type="text" name="<%=name%>[<%=index%>][key]" class="form-control" value="<%=row.key%>" size="10" />
  189. <input type="text" name="<%=name%>[<%=index%>][name]" class="form-control" value="<%=row.name%>" size="30" />
  190. <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
  191. <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
  192. </dd>
  193. </script>
  194. <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
  195. <script>
  196. function myFocus(obj){
  197. //判断文本框中的内容是否是默认内容
  198. obj.value="";
  199. //设置文本框获取焦点时候背景颜色变换
  200. }
  201. // var catid = $("#hidecate").val();
  202. // if(catid > 0)
  203. // {
  204. // var list = {id:15};
  205. // var addHtml = "";
  206. // $("#shuxing").html(addHtml);
  207. // $.ajax({
  208. // //请求方式
  209. // type : "POST",
  210. // //请求的媒体类型
  211. // contentType: "application/json;charset=UTF-8",
  212. // //请求地址
  213. // url : "Product/params",
  214. // //数据,json字符串
  215. // data:JSON.stringify(list),
  216. // //请求成功
  217. // success : function(result) {
  218. // // $("#fieldlist").dataset.name = result.data;
  219. // // var ele = document.getElementById("test");
  220. // // ele.value = ele.value + result.data;
  221. // // document.getElementById('shuxing').style.display = "block";
  222. // // document.getElementById("content1").value = result.data;
  223. // if(result.code == 1){
  224. // var obj_json = result.data;
  225. // var packJson = JSON.parse(obj_json);
  226. // var addHtml = "";
  227. // for(var i = 0; i < packJson.length; i++){
  228. // console.log(packJson[i].key + " " + packJson[i].name);
  229. // addHtml += "<div class=\"col-xs-6 col-sm-8\">\n" +
  230. // " <input data-rule=\"required\" style=\"width: 30%;\" name=\"row[key1][]\"" +
  231. // " value="+packJson[i].key+ " type=\"text\">\n" +
  232. // " <input data-rule=\"required\" style=\"width: 30%;\" name=\"row[name1][]\"" +
  233. // " value="+packJson[i].name+ " type=\"text\">\n" +
  234. // " </div>";
  235. // }
  236. // $("#shuxing").append(addHtml);
  237. // }else{
  238. // console.log(result.msg);
  239. // }
  240. // },
  241. // //请求失败,包含具体的错误信息
  242. // error : function(e){
  243. // var addHtml = "";
  244. // $("#shuxing").append(addHtml);
  245. // console.log(e.status);
  246. // console.log(e.responseText);
  247. // }
  248. // });
  249. // }
  250. $(document).on("change", "#c-pid", function(){
  251. var id = $("#c-pid").val();
  252. var list = {id:id};
  253. var addHtml = "";
  254. $("#shuxing").html(addHtml);
  255. $.ajax({
  256. //请求方式
  257. type : "POST",
  258. //请求的媒体类型
  259. contentType: "application/json;charset=UTF-8",
  260. //请求地址
  261. url : "Product/params",
  262. //数据,json字符串
  263. data:JSON.stringify(list),
  264. //请求成功
  265. success : function(result) {
  266. // $("#fieldlist").dataset.name = result.data;
  267. // var ele = document.getElementById("test");
  268. // ele.value = ele.value + result.data;
  269. // document.getElementById('shuxing').style.display = "block";
  270. // document.getElementById("content1").value = result.data;
  271. if(result.code == 1){
  272. var obj_json = result.data;
  273. var packJson = JSON.parse(obj_json);
  274. var addHtml = "";
  275. for(var i = 0; i < packJson.length; i++){
  276. console.log(packJson[i].key + " " + packJson[i].name);
  277. addHtml += "<div class=\"col-xs-6 col-sm-8\">\n" +
  278. " <input readonly=\"readonly\" data-rule=\"required\" style=\"width: 30%;\" name=\"row[key1][]\"" +
  279. " value="+packJson[i].key+ " type=\"text\">\n" +
  280. " <input data-rule=\"required\" style=\"width: 30%;\" name=\"row[name1][]\"" +
  281. " value="+packJson[i].name+ " type=\"text\">\n" +
  282. " </div>";
  283. }
  284. $("#shuxing").append(addHtml);
  285. }else{
  286. console.log(result.msg);
  287. }
  288. },
  289. //请求失败,包含具体的错误信息
  290. error : function(e){
  291. var addHtml = "";
  292. $("#shuxing").append(addHtml);
  293. console.log(e.status);
  294. console.log(e.responseText);
  295. }
  296. });
  297. });
  298. </script>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. <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>
  306. </body>
  307. </html>