b2fe1787c7d5136fc070e9ea01519a2e.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <?php /*a:3:{s:66:"D:\project\gyx\gaoyixia\application\operate\view\recruit\form.html";i:1711351117;s:56:"D:\project\gyx\gaoyixia\application\admin\view\main.html";i:1699858976;s:73:"D:\project\gyx\gaoyixia\application\mall\view\store_goods\form_style.html";i:1699858976;}*/ ?>
  2. <div class="layui-card layui-bg-gray"><?php if(!(empty($title) || (($title instanceof \think\Collection || $title instanceof \think\Paginator ) && $title->isEmpty()))): ?><div class="layui-card-header layui-anim layui-anim-fadein notselect"><span class="layui-icon layui-icon-next font-s10 color-desc margin-right-5"></span><?php echo htmlentities((isset($title) && ($title !== '')?$title:'')); ?><div class="pull-right"></div></div><?php endif; ?><div class="layui-card-body layui-anim layui-anim-upbit"><style> .inner-input {
  3. width: 80px;
  4. height: 14px;
  5. padding: 1px 5px;
  6. line-height: 12px;
  7. }
  8. .goods-spec-box {
  9. position: relative;
  10. margin: 0 10px 10px 0;
  11. vertical-align: middle;
  12. }
  13. .goods-spec-title {
  14. z-index: 2;
  15. width: 40px;
  16. color: #fff;
  17. height: 28px;
  18. position: absolute;
  19. background: #999;
  20. line-height: 28px;
  21. }
  22. .goods-spec-close {
  23. right: 8px;
  24. z-index: 2;
  25. line-height: 28px;
  26. position: absolute;
  27. display: inline-block
  28. }
  29. .goods-spec-btn {
  30. height: 28px;
  31. margin-left: 5px !important;
  32. line-height: 26px !important;
  33. }
  34. .goods-spec-box input {
  35. z-index: 1;
  36. width: 120px;
  37. position: relative;
  38. border: 1px solid #999;
  39. padding: 5px 0 5px 45px;
  40. display: inline-block !important;
  41. }
  42. .goods-spec-box input[type=checkbox] {
  43. z-index: 2;
  44. width: 40px;
  45. height: 28px;
  46. border: none;
  47. cursor: pointer;
  48. appearance: none;
  49. position: absolute;
  50. -webkit-appearance: none;
  51. }
  52. .goods-spec-box input[type=checkbox]:before {
  53. top: 1px;
  54. left: 1px;
  55. width: 40px;
  56. height: 26px;
  57. content: ' ';
  58. position: absolute;
  59. background: #c9c9c9;
  60. }
  61. .goods-spec-box input[type=checkbox]:after {
  62. top: 1px;
  63. left: 1px;
  64. color: #999;
  65. width: 40px;
  66. height: 26px;
  67. content: '\e63f';
  68. font-size: 16px;
  69. line-height: 26px;
  70. position: absolute;
  71. text-align: center;
  72. font-family: 'layui-icon';
  73. }
  74. .goods-spec-box input[type=checkbox]:checked:after {
  75. color: #333;
  76. content: '\e605';
  77. }
  78. </style><header><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"><link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/><style> .layui-form-radio{
  79. margin: 0 !important;
  80. padding-right:0 !important;
  81. }
  82. .layui-form-select{
  83. margin-right: 10px !important;
  84. }
  85. .layui-col-xs9{
  86. width: 90%;
  87. }
  88. .amap-icon img,
  89. .amap-marker-content img{
  90. width: 25px;
  91. height: 34px;
  92. }
  93. .marker {
  94. position: absolute;
  95. top: -20px;
  96. right: -118px;
  97. color: #fff;
  98. padding: 4px 10px;
  99. box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
  100. white-space: nowrap;
  101. font-size: 12px;
  102. font-family: "";
  103. background-color: #25A5F7;
  104. border-radius: 3px;
  105. }
  106. .input-card{
  107. width: 18rem;
  108. z-index: 170;
  109. }
  110. .input-card .btn{
  111. margin-right: .8rem;
  112. }
  113. .input-card .btn:last-child{
  114. margin-right: 0;
  115. }
  116. .input-item-text, input[type=text], input[type=date], select {
  117. height: calc(3rem + 2px) !important;
  118. }
  119. #panel {
  120. position: absolute;
  121. background-color: white;
  122. max-height: 90%;
  123. overflow-y: auto;
  124. top: 35px;
  125. right: 10px;
  126. width: 280px;
  127. }
  128. </style></header><form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off"><div class="layui-card-body think-box-shadow padding-left-40"><div class="layui-tab"><ul class="layui-tab-title"><li class="layui-this">招聘设置</li></ul><div class="layui-tab-content"><!--基础设置--><div class="layui-tab-item layui-show"><!--基础设置start--><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">标题</span><input name="title" class="layui-input" placeholder="请输入招聘标题" value="<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">会员账号</span><input name="user_phone" class="layui-input" placeholder="请输入会员账号" value="<?php echo htmlentities((isset($vo['user_phone']) && ($vo['user_phone'] !== '')?$vo['user_phone']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">标签</span><span class="margin-left-10 color-gray">多个半角逗号(,)隔开</span><textarea placeholder="请输入招聘标签" class="layui-textarea" name="label"><?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:'')); ?></textarea></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">排序</span><input name="sort" class="layui-input" placeholder="请输入排序号" value="<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">阅读量</span><input name="read_num" class="layui-input" placeholder="请输入阅读量" value="<?php echo htmlentities((isset($vo['read_num']) && ($vo['read_num'] !== '')?$vo['read_num']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">热搜阅读量</span><input name="hot_num" value='<?php echo htmlentities((isset($vo['hot_num']) && ($vo['hot_num'] !== '')?$vo['hot_num']:"")); ?>' placeholder="请输入热搜阅读量" class="layui-input"><input name="hot_num_old" type="hidden" value='<?php echo htmlentities((isset($vo['hot_num']) && ($vo['hot_num'] !== '')?$vo['hot_num']:"")); ?>' class="layui-input"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">热搜定时时间</span><input name="regular_hot_end_time" value='<?php echo htmlentities((isset($vo['regular_hot_end_time']) && ($vo['regular_hot_end_time'] !== '')?$vo['regular_hot_end_time']:"")); ?>' class="layui-input"></label><label class="layui-col-xs3 relative"><span class="color-green">目标热搜阅读量</span><input name="hot_target_num" value='<?php echo htmlentities((isset($vo['hot_target_num']) && ($vo['hot_target_num'] !== '')?$vo['hot_target_num']:"")); ?>' placeholder="请输入目标热搜阅读量" class="layui-input"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">学历</span><select class="layui-select" name="education" id="education" lay-filter="education" lay-search><?php foreach($education as $e): ?><option value="<?php echo htmlentities($e); ?>" <?php if(isset($vo['education']) && $vo['education'] == $e): ?>selected<?php endif; ?>><?php echo htmlentities($e); ?></option><?php endforeach; ?></select></label><label class="layui-col-xs3 relative"><span class="color-green">招聘人数</span><input name="num" class="layui-input" placeholder="请输入招聘人数" value="<?php echo htmlentities((isset($vo['num']) && ($vo['num'] !== '')?$vo['num']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">上架时间</span><input name="release_time" id="release_time" class="layui-input" placeholder="" value="<?php echo htmlentities((isset($vo['release_time']) && ($vo['release_time'] !== '')?$vo['release_time']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative" style="width: 100%;"><span class="color-green">分类</span></label><div style="width: 100%"><div style="width: 15%;float: left;"><select class="layui-select" id="first_classify" name="first_classify" lay-filter="first_classify" lay-search><option selected data-first_key="-1" selected value="0">请选择</option><?php if(!empty($cate_tree)): foreach($cate_tree as $ck=>$cv): if(isset_full_check($vo,'first_classify',$cv['id'])): ?><option selected data-first_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($cv['id']); ?>"><?php echo htmlentities($cv['title']); ?></option><?php else: ?><option data-first_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($cv['id']); ?>"><?php echo htmlentities($cv['title']); ?></option><?php endif; ?><?php endforeach; ?><?php endif; ?></select></div><div style="width: 15%;float: left"><select class="layui-select" id="second_classify" name="second_classify" lay-filter="second_classify" lay-search></select></div><div style="width: 15%;float: left"><select class="layui-select" id="third_classify" name="third_classify" lay-filter="third_classify" lay-search></select></div><input type="hidden" id="first" value="<?php echo htmlentities((isset($vo['first_classify']) && ($vo['first_classify'] !== '')?$vo['first_classify']:'-1')); ?>"/><input type="hidden" id="second" value="<?php echo htmlentities((isset($vo['second_classify']) && ($vo['second_classify'] !== '')?$vo['second_classify']:'-1')); ?>"/><input type="hidden" id="third" value="<?php echo htmlentities((isset($vo['third_classify']) && ($vo['third_classify'] !== '')?$vo['third_classify']:'-1')); ?>"/></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">工作年限</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><div class="layui-input-inline"><input type="number" name="experience_min" value="<?php echo htmlentities((isset($vo['experience_min']) && ($vo['experience_min'] !== '')?$vo['experience_min']:'')); ?>" placeholder="" autocomplete="off" class="layui-input"></div><div class="layui-form-mid">-</div><div class="layui-input-inline"><input type="number" name="experience_max" value="<?php echo htmlentities((isset($vo['experience_max']) && ($vo['experience_max'] !== '')?$vo['experience_max']:'')); ?>" placeholder="" autocomplete="off" class="layui-input"></div></div></div><!--<div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">薪资</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><div class="layui-input-inline"><input type="number" required name="price_min" value="<?php echo htmlentities((isset($vo['price_min']) && ($vo['price_min'] !== '')?$vo['price_min']:'')); ?>" placeholder="¥" autocomplete="off" class="layui-input"></div><div class="layui-form-mid">-</div><div class="layui-input-inline" ><input type="number" required name="price_max" value="<?php echo htmlentities((isset($vo['price_max']) && ($vo['price_max'] !== '')?$vo['price_max']:'')); ?>"placeholder="¥" autocomplete="off" class="layui-input"></div></div></div>--><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">薪资</span><input name="salary" value="<?php echo htmlentities((isset($vo['salary']) && ($vo['salary'] !== '')?$vo['salary']:'')); ?>" placeholder="请输入薪资" autocomplete="off" class="layui-input"></label><label class="layui-col-xs3 relative"><span class="color-green">工作时长</span><span class="margin-left-10 color-gray">兼职、全职或具体时长</span><input name="work_hours" value="<?php echo htmlentities((isset($vo['work_hours']) && ($vo['work_hours'] !== '')?$vo['work_hours']:'')); ?>" placeholder="请输入工作时长" autocomplete="off" class="layui-input"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">福利待遇</span><span class="margin-left-10 color-gray">多个半角逗号(,)隔开</span><textarea placeholder="请输入内容" class="layui-textarea" name="welfare"><?php echo htmlentities((isset($vo['welfare']) && ($vo['welfare'] !== '')?$vo['welfare']:'')); ?></textarea></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs2 relative"><span class="color-green">公司名称</span><input name="company" class="layui-input" placeholder="请输入公司名称" value="<?php echo htmlentities((isset($vo['company']) && ($vo['company'] !== '')?$vo['company']:'')); ?>"></label><label class="layui-col-xs2 relative"><span class="color-green">是否上市</span><select class="layui-select" name="is_ss" id="is_ss" lay-filter="is_ss" lay-search><option <?php if(isset($vo['is_ss']) && $vo['is_ss'] == 1): ?>selected<?php endif; ?> value="1">是</option><option <?php if(isset($vo['is_ss']) && $vo['is_ss'] == 0): ?>selected<?php endif; ?> value="0">否</option></select></label><label class="layui-col-xs2 relative"><span class="color-green">公司规模</span><input name="scale" class="layui-input" placeholder="请输入公司人数" value="<?php echo htmlentities((isset($vo['scale']) && ($vo['scale'] !== '')?$vo['scale']:'')); ?>"></label><label class="layui-col-xs2 relative"><span class="color-green">公司简介</span><input name="company_intro" class="layui-input" placeholder="请输入公司简介" value="<?php echo htmlentities((isset($vo['company_intro']) && ($vo['company_intro'] !== '')?$vo['company_intro']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">联系人</span><input name="principal" class="layui-input" placeholder="请输入联系人" value="<?php echo htmlentities((isset($vo['principal']) && ($vo['principal'] !== '')?$vo['principal']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">邮箱</span><input name="email" class="layui-input" placeholder="请输入邮箱" value="<?php echo htmlentities((isset($vo['email']) && ($vo['email'] !== '')?$vo['email']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">电话</span><input name="phone" class="layui-input" placeholder="请输入电话" value="<?php echo htmlentities((isset($vo['phone']) && ($vo['phone'] !== '')?$vo['phone']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">公司标签</span><span class="margin-left-10 color-gray">多个半角逗号(,)隔开</span><textarea placeholder="请输入公司标签" class="layui-textarea" name="company_label"><?php echo htmlentities((isset($vo['company_label']) && ($vo['company_label'] !== '')?$vo['company_label']:'')); ?></textarea></label></div><div class="layui-form-item " style="display: none"><span class="color-green ">这个东西别删也别显示</span><table class="layui-table"><thead><tr><td width="auto" class="text-left"><input name="hr_headimg66" type="hidden" value="<?php echo htmlentities((isset($vo['hr_headimg66']) && ($vo['hr_headimg66'] !== '')?$vo['hr_headimg66']:'')); ?>"></td></tr></thead></table><script> $('[name="hr_headimg66"]').uploadOneImage();</script></div><div class="layui-form-item "><span class="color-green ">HR头像</span><table class="layui-table"><thead><tr><td width="auto" class="text-left"><input name="hr_headimg" type="hidden" value="<?php echo htmlentities((isset($vo['hr_headimg']) && ($vo['hr_headimg'] !== '')?$vo['hr_headimg']:'')); ?>"></td></tr></thead></table><script> $('[name="hr_headimg"]').uploadOneImage();</script></div><div class="layui-form-item "><span class="color-green ">二维码</span><table class="layui-table"><thead><tr><td width="auto" class="text-left"><input name="hr_code" type="hidden" value="<?php echo htmlentities((isset($vo['hr_code']) && ($vo['hr_code'] !== '')?$vo['hr_code']:'')); ?>"></td></tr></thead></table><script> $('[name="hr_code"]').uploadOneImage();</script></div><div class="layui-form-item "><span class="color-green ">公司LOGO</span><table class="layui-table"><thead><tr><td width="auto" class="text-left"><input name="cover" type="hidden" value="<?php echo htmlentities((isset($vo['cover']) && ($vo['cover'] !== '')?$vo['cover']:'')); ?>"></td></tr></thead></table><script> $('[name="cover"]').uploadOneImage();</script></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">地址</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><div class="layui-input-inline"><select name="province" lay-filter ="province"><option value="0">请选择</option><?php foreach($all_area as $ak=>$cv): if(isset($vo['province']) && $vo['province'] == $cv['name']): ?><option selected data-al_key="<?php echo htmlentities($ak); ?>" value="<?php echo htmlentities($cv['name']); ?>"><?php echo htmlentities($cv['name']); ?></option><?php else: ?><option data-al_key="<?php echo htmlentities($ak); ?>" value="<?php echo htmlentities($cv['name']); ?>"><?php echo htmlentities($cv['name']); ?></option><?php endif; ?><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="city" lay-filter ="city"><option value="0">请选择</option><?php foreach($all_area as $ck=>$cv): if(isset($vo['province']) && $vo['province'] == $cv['name']): foreach($cv['children'] as $clk=>$cln): if(isset($vo['city']) && $vo['city'] == $cln['name']): ?><option selected data-bl_key="<?php echo htmlentities($clk); ?>" value="<?php echo htmlentities($cln['name']); ?>"><?php echo htmlentities($cln['name']); ?></option><?php else: ?><option data-bl_key="<?php echo htmlentities($clk); ?>" value="<?php echo htmlentities($cln['name']); ?>"><?php echo htmlentities($cln['name']); ?></option><?php endif; ?><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="county" lay-filter ="county"><option value="0">请选择</option><?php foreach($all_area as $ck=>$cv): if(isset($vo['province']) && $vo['province'] == $cv['name']): foreach($cv['children'] as $cln): if(isset($vo['city']) && $vo['city'] == $cln['name']): foreach($cln['children'] as $dln): if(isset($vo['county']) && $vo['county'] == $dln['name']): ?><option selected value="<?php echo htmlentities($dln['name']); ?>"><?php echo htmlentities($dln['name']); ?></option><?php else: ?><option value="<?php echo htmlentities($dln['name']); ?>"><?php echo htmlentities($dln['name']); ?></option><?php endif; ?><?php endforeach; ?><?php endif; ?><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div><div class="layui-input-inline"><input name="address" style="width: 400px" class="layui-input" placeholder="请输入公司地址" value="<?php echo htmlentities((isset($vo['address']) && ($vo['address'] !== '')?$vo['address']:'')); ?>"></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">地图</span><div><div id="container" style="width:100%; height: 600px;"></div><div id="panel" ></div></div><div class="layui-input-inline"><input type="hidden" id="longitude" name="longitude" value="<?php echo htmlentities((isset($vo['longitude']) && ($vo['longitude'] !== '')?$vo['longitude']:'')); ?>"><input type="hidden" id="latitude" name="latitude" value="<?php echo htmlentities((isset($vo['latitude']) && ($vo['latitude'] !== '')?$vo['latitude']:'')); ?>"><input id='lnglat' type="hidden" value="<?php echo htmlentities((isset($vo['longitude']) && ($vo['longitude'] !== '')?$vo['longitude']:'')); ?>,<?php echo htmlentities((isset($vo['latitude']) && ($vo['latitude'] !== '')?$vo['latitude']:'')); ?>"></div></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">招聘详情</span><textarea name="content"><?php echo htmlentities((isset($vo['content']) && ($vo['content'] !== '')?$vo['content']:"")); ?></textarea></label></div><div class="layui-form-item text-center"><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><input type="hidden" name="id" value="<?php echo htmlentities($vo['id']); ?>"><?php endif; ?><button class="layui-btn" type="submit">保存</button><button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1)" data-close>返回</button></div></div></div></div></div></form></div><textarea class="layui-hide" id="goods-specs"><?php echo (isset($vo['specs']) && ($vo['specs'] !== '')?$vo['specs']:''); ?></textarea><textarea class="layui-hide" id="goods-value"><?php echo (isset($defaultValues) && ($defaultValues !== '')?$defaultValues:''); ?></textarea><script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script><script src="https://webapi.amap.com/maps?v=1.4.15&key=5295cbb966c063bde1ed33c1de7ed6bd&callback=init"></script><script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script><script> layui.config({}).extend({}).use(['index', 'form'], function(){ var $ = layui.$,form = layui.form;})
  129. laydate.render({type: 'datetime', elem: '[name="regular_hot_end_time"]'})
  130. var longitude = "<?php echo htmlentities((isset($vo['longitude']) && ($vo['longitude'] !== '')?$vo['longitude']:'118.356655')); ?>";
  131. var latitude = "<?php echo htmlentities((isset($vo['latitude']) && ($vo['latitude'] !== '')?$vo['latitude']:'35.102929')); ?>";
  132. window._AMapSecurityConfig = {
  133. securityJsCode: "d9ec1c40b3aa3504369f304e359586b0",
  134. }
  135. var placeSearch , sel_list;
  136. window.init = function(){
  137. var marker, map = new AMap.Map('container', {
  138. center:[longitude,latitude],
  139. resizeEnable: true,
  140. zoom:13
  141. });
  142. AMap.service(["AMap.PlaceSearch"], function() {
  143. //构造地点查询类
  144. placeSearch = new AMap.PlaceSearch({
  145. pageSize: 5, // 单页显示结果条数
  146. pageIndex: 1, // 页码
  147. city: "", // 兴趣点城市
  148. citylimit: true, //是否强制限制在设置的城市内搜索
  149. map: map, // 展现结果的地图实例
  150. panel: "panel", // 结果列表将在此容器中进行展示。
  151. autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
  152. extensions: 'all' ,
  153. callback: 'aaa' ,
  154. });
  155. //关键字查询
  156. });
  157. addMark(longitude,latitude)
  158. map.on( 'click', function (e) {
  159. lnglatInput.value = e.lnglat.toString();
  160. var inputVal = lnglatInput.value.split(',');
  161. clearMarker();
  162. addMark(inputVal[0], inputVal[1])
  163. $("longitude").value =inputVal[0] ;
  164. $("latitude").value = inputVal[1];
  165. });
  166. var $ = function(elementId){
  167. return document.getElementById(elementId);
  168. };
  169. var lnglatInput = $('lnglat');
  170. var pixelInput = $('pixel');
  171. lnglat2container();
  172. // 经纬度坐标转成容器像素坐标
  173. function lnglat2container() {
  174. if(!lnglatInput.value) return
  175. var inputVal = lnglatInput.value.split(',');
  176. var lnglat = new AMap.LngLat(inputVal[0], inputVal[1]);
  177. var pixel = map.lngLatToContainer(lnglat);
  178. pixelInput.value = pixel.round();
  179. }
  180. // 添加mark
  181. function addMark(lng,pix) {
  182. console.log(lng,pix)
  183. if(!lng || !pix) return ;
  184. marker = new AMap.Marker({
  185. icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
  186. position: [lng, pix],
  187. offset: new AMap.Pixel(-13, -30)
  188. });
  189. marker.setMap(map);
  190. }
  191. // 清除 marker
  192. function clearMarker() {
  193. if (marker) {
  194. marker.setMap(null);
  195. marker = null;
  196. }
  197. }
  198. }
  199. $(document).on('click','.poibox',function (){
  200. var click_poi = $(".poibox").index(this);
  201. // console.log(sel_list[click_poi]);
  202. //console.log(sel_list[click_poi].location.lng);
  203. $("#longitude").val(sel_list[click_poi].location.lng);
  204. $("#latitude").val(sel_list[click_poi].location.lat);
  205. $("#lnglat").val(sel_list[click_poi].location.lng + ',' + sel_list[click_poi].location.lat ) ;
  206. })
  207. $("input[name='address']").on('change',function (e) {
  208. placeSearch.search( $("input[name='address']").val(),function (a,ls) {
  209. sel_list = ls.poiList.pois;
  210. }) ;
  211. })
  212. </script><script src="https://webapi.amap.com/maps?v=1.4.15&key=5295cbb966c063bde1ed33c1de7ed6bd&callback=init"></script><script src="https://webapi.amap.com/js/require.js" data-main="./require-init"></script><script src="https://webapi.amap.com/loader.js"></script><script> window.form.render();
  213. layui.use('form', function () {
  214. var form = layui.form;
  215. //日期时间范围
  216. laydate.render({
  217. elem: '#start_time'
  218. ,type: 'datetime'
  219. });
  220. laydate.render({
  221. elem: '#end_time'
  222. ,type: 'datetime'
  223. });
  224. })
  225. laydate.render({
  226. elem: '#release_time'
  227. ,type: 'datetime'
  228. });
  229. layui.use('element', function(){
  230. var $ = layui.jquery
  231. ,element = layui.element;
  232. var active = {
  233. tabAdd: function(){
  234. element.tabAdd('demo', {
  235. title: '新选项'+ (Math.random()*1000|0)
  236. ,content: '内容'+ (Math.random()*1000|0)
  237. ,id: new Date().getTime()
  238. })
  239. }
  240. ,tabDelete: function(othis){
  241. element.tabDelete('demo', '44');
  242. othis.addClass('layui-btn-disabled');
  243. }
  244. ,tabChange: function(){
  245. element.tabChange('demo', '22');
  246. }
  247. };
  248. $('.site-demo-active').on('click', function(){
  249. var othis = $(this), type = othis.data('type');
  250. active[type] ? active[type].call(this, othis) : '';
  251. });
  252. //Hash地址的定位
  253. var layid = location.hash.replace(/^#test=/, '');
  254. element.tabChange('test', layid);
  255. element.on('tab(test)', function(elem){
  256. location.hash = 'test='+ $(this).attr('lay-id');
  257. });
  258. });
  259. require(['ckeditor', 'angular'], function () {
  260. window.createEditor('[name="content"]', {
  261. height: 500,
  262. });
  263. })
  264. // 添加设置
  265. $(document).on('click',".add_goods_no",function () {
  266. var knum = $('.no_html tr').length;
  267. var no_html = get_ht(knum);
  268. $(".no_html").append(no_html);
  269. form.render();
  270. console.log(a);// 别删这个!!!
  271. })
  272. // 删除设置
  273. $(document).on('click',".del_no",function (){
  274. var knum = $('.no_html tr').length;
  275. if(knum == 1) {
  276. layer.msg('不能全部删除!')
  277. form.render();
  278. console.log(a);// 别删这个!!!
  279. }
  280. var index= $(".del_no").index(this);
  281. $(".no_detail").eq(index).remove();
  282. form.render();
  283. console.log(a);// 别删这个!!!
  284. })
  285. var is_add = parseInt('<?php echo htmlentities((isset($isAddMode) && ($isAddMode !== '')?$isAddMode:0)); ?>');
  286. if(is_add){
  287. $(".no_html").html(get_ht(0));
  288. }else{
  289. var ladder = <?php echo json_encode($ladder); ?>;
  290. if(ladder && ladder.length > 0) {
  291. var no_html = '';
  292. $.each(ladder,function (lk,lv) {
  293. no_html += ' <tr class="no_detail change_del" data-dh ="'+lk+'">';
  294. no_html += "<td class='text-left nowrap'>" +
  295. "<input type='text' class='layui-input' name='ladder_title[]' value='"+lv.ladder_title+"'/>" +
  296. "</td>";
  297. no_html += "<td class='text-left nowrap'>" +
  298. "<input type='' class='layui-input' name='ladder_num[]' value='"+lv.ladder_num+"'/>" +
  299. "</td>";
  300. no_html += "<td class='text-left nowrap'>" +
  301. "<input type='' class='layui-input' name='ladder_price[]' value='"+lv.ladder_price+"'/>" +
  302. "</td>";
  303. no_html += "<td class='text-left nowrap'>" +
  304. "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
  305. "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
  306. "</td>"
  307. no_html += "</tr>";
  308. })
  309. $(".no_html").html(no_html);
  310. }else{
  311. $(".no_html").html(get_ht(0));
  312. }
  313. window.form.render();
  314. }
  315. function get_ht(k) {
  316. var award_length = $(".no_detail").length;
  317. var no_html = '';
  318. no_html += ' <tr class="no_detail change_del" data-dh ="'+k+'">';
  319. no_html += "<td class='text-left nowrap'>" +
  320. "<input type='text' class='layui-input' name='ladder_title[]' value=''/>" +
  321. "</td>";
  322. no_html += "<td class='text-left nowrap'>" +
  323. "<input type='' class='layui-input' name='ladder_num[]' value=''/>" +
  324. "</td>";
  325. no_html += "<td class='text-left nowrap'>" +
  326. "<input type='' class='layui-input' name='ladder_price[]' value=''/>" +
  327. "</td>";
  328. no_html += "<td class='text-left nowrap'>" +
  329. "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
  330. "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
  331. "</td>"
  332. no_html += "</tr>";
  333. return no_html;
  334. }
  335. //地址监听
  336. var goods_spec = <?php echo json_encode($all_area); ?>;
  337. console.log(goods_spec)
  338. form.on('select(province)', function(data){
  339. var cl_html = '<option value="0">请选择</option>';
  340. if(data.value == 0) {
  341. $("select[name='city']").html(cl_html);
  342. $("select[name='county']").html(cl_html);
  343. }else{
  344. var cl_key = data.elem[data.elem.selectedIndex].dataset.al_key;
  345. console.log(cl_key,goods_spec[cl_key])
  346. $.each(goods_spec[cl_key]['children'],function (ck,cv) {
  347. cl_html +='<option data-bl_key="'+ck+'" value="'+cv.name+'">'+cv.name+'</option>';
  348. })
  349. $("select[name='city']").html(cl_html);
  350. }
  351. $("select[name='county']").html('');
  352. window.form.render();
  353. });
  354. form.on('select(city)', function(data){
  355. second()
  356. })
  357. function second() {
  358. var cl_html = '<option value="0">请选择</option>';
  359. var first_key = $("select[name='province']").find("option:selected").data("al_key");
  360. var second_key = $("select[name='city']").find("option:selected").data("bl_key");
  361. console.log(first_key,second_key)
  362. var to_each = goods_spec[first_key]['children'][second_key]['children'];
  363. console.log(to_each);
  364. $.each(to_each,function (ck,cv) {
  365. cl_html +='<option value="'+cv.name+'">'+cv.name+'</option>';
  366. })
  367. $("select[name='county']").html(cl_html);
  368. window.form.render();
  369. }
  370. // 三级分类联动 start
  371. var sel_second = <?php echo isset($vo['second_classify']) ? $vo['second_classify']:0; ?>;
  372. var sel_third = <?php echo isset($vo['third_classify']) ? $vo['third_classify']:0; ?>;
  373. var cate_tree = <?php echo json_encode($cate_tree); ?>;
  374. first_c(1);
  375. function first_c(source){
  376. // 将其他选择框置空
  377. var first_key = $("select[name='first_classify']").find("option:selected").data("first_key")
  378. $("#first").val(first_key);
  379. $("select[name='second_classify']").html('');
  380. $("select[name='third_classify']").html('');
  381. $("select[name='fourth_classify']").html('');
  382. // 没有下级不继续
  383. if(first_key == -1 || !("children" in cate_tree[first_key])){
  384. $("#second").val(-1);
  385. $("#third").val(-1);
  386. window.form.render();
  387. return true;
  388. }else{
  389. var second_html = '<option data-second_key="-1" selected value="0">请选择分类</option>';
  390. var to_each = cate_tree[first_key]['children'];
  391. $.each(to_each,function (ck,cv) {
  392. if(source == 1 && sel_second == cv.id){
  393. second_html +='<option selected data-second_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
  394. $("#second").val(ck);
  395. }else{
  396. second_html +='<option data-second_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
  397. }
  398. })
  399. $("select[name='second_classify']").html(second_html);
  400. window.form.render();
  401. second_c(source);
  402. }
  403. }
  404. function second_c(source){
  405. var first_key = $("select[name='first_classify']").find("option:selected").data("first_key");
  406. var second_key = $("select[name='second_classify']").find("option:selected").data("second_key");
  407. // 将其他选择框置空
  408. $("#second").val(second_key);
  409. $("select[name='third_classify']").html('');
  410. $("select[name='fourth_classify']").html('');
  411. // 没有下级不继续
  412. if(second_key == -1 || !("children" in cate_tree[first_key]['children'][second_key])){
  413. $("#third").val(-1);
  414. window.form.render();
  415. return true;
  416. }
  417. var to_each = cate_tree[first_key]['children'][second_key]['children'];
  418. var third_html = '<option data-third_key="-1" selected value="0">请选择分类</option>';
  419. $.each(to_each,function (ck,cv) {
  420. if(source == 1 && sel_third == cv.id){
  421. third_html +='<option selected data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
  422. $("#third").val(ck);
  423. }else{
  424. third_html +='<option data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
  425. }
  426. })
  427. $("select[name='third_classify']").html(third_html);
  428. $("select[name='fourth_classify']").html('');
  429. window.form.render();
  430. }
  431. // 一级分类监听
  432. form.on('select(first_classify)', function(data){
  433. var first_key = data.elem[data.elem.selectedIndex].dataset.first_key;
  434. //与之前选择的一样不处理
  435. if($("#first").val() == first_key){
  436. return true;
  437. }
  438. first_c(2);
  439. })
  440. // 二级分类监听
  441. form.on('select(second_classify)', function(data){
  442. var second_key = data.elem[data.elem.selectedIndex].dataset.second_key;
  443. //与之前选择的一样不处理
  444. if($("#second").val() == second_key){
  445. return true;
  446. }
  447. second_c(2)
  448. })
  449. // 三级分类end
  450. </script></div>