acc9de5bdb54001d5659c253ab36c3bf.php 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <?php /*a:3:{s:67:"D:\project\gyx\gaoyixia\application\operate\view\activity\form.html";i:1711350354;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-layedit{
  79. width: 1200px;
  80. height: 500px;
  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. background-color: #25A5F7;
  103. border-radius: 3px;
  104. }
  105. .input-card{
  106. width: 18rem;
  107. z-index: 170;
  108. }
  109. .input-card .btn{
  110. margin-right: .8rem;
  111. }
  112. .input-card .btn:last-child{
  113. margin-right: 0;
  114. }
  115. .input-item-text, input[type=text], input[type=date], select {
  116. height: calc(3rem + 2px) !important;
  117. }
  118. .layui-form-radio{
  119. margin: 0 !important;
  120. padding-right:0 !important;
  121. }
  122. .layui-form-select{
  123. margin-right: 10px !important;
  124. }
  125. #panel {
  126. position: absolute;
  127. background-color: white;
  128. max-height: 90%;
  129. overflow-y: auto;
  130. top: 35px;
  131. right: 10px;
  132. width: 280px;
  133. }
  134. </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><li class="">其他</li></ul><div class="layui-tab-content"><!--基础设置--><div class="layui-tab-item layui-show"><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">标题</span><input name="title" required 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><textarea placeholder="请输入活动标签" required class="layui-textarea" name="label"><?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:"")); ?></textarea></label></div><div class="layui-form-item"><span class="color-green label-required-prev">海报</span><table class="layui-table"><thead><tr><td width="90px" 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-xs3 relative"><span class="color-green">报名模板</span><select class="layui-select" name="template_id" id="template_id" lay-filter="template_id" lay-search><option value="0">请选择</option><?php foreach($template_list as $vk=>$vv): ?><option <?php if(isset($vo['template_id']) && $vo['template_id'] == $vv['id']): ?>selected<?php endif; ?> value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></label><label class="layui-col-xs3 relative"><span class="color-green">评论开关</span><select class="layui-select" name="comment_switch" id="comment_switch" lay-filter="comment_switch" lay-search><option <?php if(isset($vo['comment_switch']) && $vo['comment_switch'] == 1): ?>selected<?php endif; ?> value="1">开启</option><option <?php if(isset($vo['comment_switch']) && $vo['comment_switch'] == 0): ?>selected<?php endif; ?> value="0">关闭</option></select></label><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><label class="layui-col-xs3 relative"><span class="color-green">消息推送</span><select class="layui-select" name="push_switch" lay-filter="push_switch" lay-search><option value="0">否</option><option value="1">是</option></select></label><?php endif; ?></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="sponsor_id" id="sponsor_id" lay-filter="sponsor_id" lay-search><option value="0">请选择</option><?php foreach($sponsor_list as $vk=>$vv): ?><option <?php if(isset($vo['sponsor_id']) && $vo['sponsor_id'] == $vv['id']): ?>selected<?php endif; ?> data-vl_key="<?php echo htmlentities($vk); ?>" value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></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><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></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">热搜阅读量</span><input name="hot_nm" value='<?php echo htmlentities((isset($vo['hot_nm']) && ($vo['hot_nm'] !== '')?$vo['hot_nm']:"")); ?>' placeholder="请输入热搜阅读量" class="layui-input"><input name="hot_num_old" type="hidden" value='<?php echo htmlentities((isset($vo['hot_nm']) && ($vo['hot_nm'] !== '')?$vo['hot_nm']:"")); ?>' 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><input name="start_time" id="start_time" required class="layui-input" placeholder="请输入开始时间" value="<?php echo htmlentities((isset($vo['start_time']) && ($vo['start_time'] !== '')?$vo['start_time']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">结束时间</span><input name="end_time" id="end_time" required class="layui-input" placeholder="请输入结束时间" value="<?php echo htmlentities((isset($vo['end_time']) && ($vo['end_time'] !== '')?$vo['end_time']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">上架时间</span><input name="release_time" id="release_time" required 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-xs12 relative"><span class="color-green">关联资料</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><div class="layui-input-inline"><select name="datum_id" lay-filter ="datum_id" lay-search><option value="0">请选择</option><?php foreach($datum_list as $dk=>$dv): ?><option <?php if(isset($vo['datum_id']) && $vo['datum_id'] == $dv['id']): ?>selected<?php endif; ?> data-dl_key="<?php echo htmlentities($dk); ?>" value="<?php echo htmlentities($dv['id']); ?>"><?php echo htmlentities($dv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="datum_item" lay-filter ="datum_item" lay-search><option value="0">请选择</option><?php foreach($datum_list as $vk=>$vv): if(isset($vo['datum_id']) && $vo['datum_id'] == $vv['id']): foreach($vv['url_arr'] as $cln): ?><option <?php if(isset($vo['datum_item']) && $vo['datum_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">视频</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;"><div class="layui-input-inline"><select name="video_id" lay-filter ="video_id" lay-search><option value="0">请选择</option><?php foreach($video_list as $vk=>$vv): ?><option <?php if(isset($vo['video_id']) && $vo['video_id'] == $vv['id']): ?>selected<?php endif; ?> data-vl_key="<?php echo htmlentities($vk); ?>" value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="video_item" lay-filter ="video_item" lay-search><option value="0">请选择</option><?php foreach($video_list as $vk=>$vv): if(isset($vo['video_id']) && $vo['video_id'] == $vv['id']): foreach($vv['video_arr'] as $cln): ?><option <?php if(isset($vo['video_item']) && $vo['video_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">图文</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;"><div class="layui-input-inline"><select name="article_id" lay-filter ="article_id" lay-search><option value="0">请选择</option><?php foreach($article_list as $vk=>$vv): ?><option <?php if(isset($vo['article_id']) && $vo['article_id'] == $vv['id']): ?>selected<?php endif; ?> data-vl_key="<?php echo htmlentities($vk); ?>" value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="article_item" lay-filter ="article_item" lay-search><option value="0">请选择</option><?php foreach($article_list as $vk=>$vv): if(isset($vo['article_id']) && $vo['article_id'] == $vv['id']): foreach($vv['item_children'] as $cln): ?><option <?php if(isset($vo['article_item']) && $vo['article_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green label-required-prev">地址</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" required 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><div class="layui-tab-item"><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative" ><span class="color-green label-required-prev">报名价格设置</span><table class="layui-table" style="margin-right: 20px;"><thead><tr><th class="text-left">标题</th><th class="text-left">发行量</th><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><th class="text-left">剩余量</th><?php endif; ?><th class="text-left">价格</th><th class="text-left">满减张数</th><th class="text-left">满减优惠/张</th><th class="text-left">审核</th><th class="text-left">状态</th><th class="text-left">备注</th><th class="text-left">操作</th></tr><tbody class="no_html"></tbody></thead></table></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="pay_offline" id="pay_offline" lay-filter="pay_offline" lay-search><option <?php if(isset($vo['pay_offline']) && $vo['pay_offline'] == 0): ?>selected<?php endif; ?> value="0">关闭</option><option <?php if(isset($vo['pay_offline']) && $vo['pay_offline'] == 1): ?>selected<?php endif; ?> value="1">开启</option></select></label></div><div class="layui-form-item layui-row layui-col-space15 offline_div" <?php if(!isset($vo['pay_offline']) || !$vo['pay_offline']): ?>style="display:none"<?php endif; ?>><label class="layui-col-xs3 relative"><span class="color-green">户名</span><input name="offline_user" class="layui-input" value="<?php echo htmlentities((isset($vo['offline_user']) && ($vo['offline_user'] !== '')?$vo['offline_user']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">开户行</span><input name="offline_bank" class="layui-input" value="<?php echo htmlentities((isset($vo['offline_bank']) && ($vo['offline_bank'] !== '')?$vo['offline_bank']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">账号</span><input name="offline_card" class="layui-input" value="<?php echo htmlentities((isset($vo['offline_card']) && ($vo['offline_card'] !== '')?$vo['offline_card']:'')); ?>"></label></div><!-- 线下支付设置--><div class="layui-form-item layui-row layui-col-space9"><label class="layui-col-xs20 relative"><span class="color-green">详情</span><textarea id="demo" 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><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;})
  135. laydate.render({type: 'datetime', elem: '[name="regular_hot_end_time"]'})
  136. var longitude = "<?php echo htmlentities((isset($vo['longitude']) && ($vo['longitude'] !== '')?$vo['longitude']:'118.356655')); ?>";
  137. var latitude = "<?php echo htmlentities((isset($vo['latitude']) && ($vo['latitude'] !== '')?$vo['latitude']:'35.102929')); ?>";
  138. window._AMapSecurityConfig = {
  139. securityJsCode: "d9ec1c40b3aa3504369f304e359586b0",
  140. }
  141. var placeSearch , sel_list;
  142. window.init = function(){
  143. var marker, map = new AMap.Map('container', {
  144. center:[longitude,latitude],
  145. resizeEnable: true,
  146. zoom:13
  147. });
  148. AMap.service(["AMap.PlaceSearch"], function() {
  149. //构造地点查询类
  150. placeSearch = new AMap.PlaceSearch({
  151. pageSize: 5, // 单页显示结果条数
  152. pageIndex: 1, // 页码
  153. city: "", // 兴趣点城市
  154. citylimit: true, //是否强制限制在设置的城市内搜索
  155. map: map, // 展现结果的地图实例
  156. panel: "panel", // 结果列表将在此容器中进行展示。
  157. autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
  158. extensions: 'all' ,
  159. callback: 'aaa' ,
  160. });
  161. //关键字查询
  162. });
  163. addMark(longitude,latitude)
  164. map.on( 'click', function (e) {
  165. lnglatInput.value = e.lnglat.toString();
  166. var inputVal = lnglatInput.value.split(',');
  167. clearMarker();
  168. addMark(inputVal[0], inputVal[1])
  169. $("longitude").value =inputVal[0] ;
  170. $("latitude").value = inputVal[1];
  171. });
  172. var $ = function(elementId){
  173. return document.getElementById(elementId);
  174. };
  175. var lnglatInput = $('lnglat');
  176. var pixelInput = $('pixel');
  177. lnglat2container();
  178. // 经纬度坐标转成容器像素坐标
  179. function lnglat2container() {
  180. if(!lnglatInput.value) return
  181. var inputVal = lnglatInput.value.split(',');
  182. var lnglat = new AMap.LngLat(inputVal[0], inputVal[1]);
  183. var pixel = map.lngLatToContainer(lnglat);
  184. pixelInput.value = pixel.round();
  185. }
  186. // 添加mark
  187. function addMark(lng,pix) {
  188. console.log(lng,pix)
  189. if(!lng || !pix) return ;
  190. marker = new AMap.Marker({
  191. icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
  192. position: [lng, pix],
  193. offset: new AMap.Pixel(-13, -30)
  194. });
  195. marker.setMap(map);
  196. }
  197. // 清除 marker
  198. function clearMarker() {
  199. if (marker) {
  200. marker.setMap(null);
  201. marker = null;
  202. }
  203. }
  204. }
  205. $(document).on('click','.poibox',function (){
  206. var click_poi = $(".poibox").index(this);
  207. // console.log(sel_list[click_poi]);
  208. //console.log(sel_list[click_poi].location.lng);
  209. $("#longitude").val(sel_list[click_poi].location.lng);
  210. $("#latitude").val(sel_list[click_poi].location.lat);
  211. $("#lnglat").val(sel_list[click_poi].location.lng + ',' + sel_list[click_poi].location.lat ) ;
  212. })
  213. $("input[name='address']").on('change',function (e) {
  214. placeSearch.search( $("input[name='address']").val(),function (a,ls) {
  215. sel_list = ls.poiList.pois;
  216. }) ;
  217. })
  218. </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> // layui.use('layedit', function(){
  219. // var layedit = layui.layedit;
  220. // layedit.set({
  221. // uploadImage: {
  222. // url: '/api/upload/uploadlay' //接口url
  223. // ,type: '', //默认post
  224. // data: {
  225. // type: 1
  226. // }
  227. // }
  228. // });
  229. // var index= layedit.build('demo',{
  230. // height: 500
  231. // }); //建立编辑器
  232. // $("#LAY_layedit_"+index).contents().find("img").css("width","auto");
  233. // });
  234. </script><script> layui.form.render();
  235. require(['ckeditor', 'angular'], function () {
  236. window.createEditor('[name="content"]', {
  237. height: 500,
  238. });
  239. })
  240. layui.use('form', function () {
  241. var form = layui.form;
  242. //日期时间范围
  243. laydate.render({
  244. elem: '#start_time'
  245. ,type: 'datetime'
  246. });
  247. laydate.render({
  248. elem: '#end_time'
  249. ,type: 'datetime'
  250. });
  251. laydate.render({
  252. elem: '#release_time'
  253. ,type: 'datetime'
  254. });
  255. //监听指定开关
  256. form.on('select(pay_offline)', function(data) {
  257. if (data.value == 0) {
  258. $(".offline_div").hide();
  259. } else {
  260. $(".offline_div").show();
  261. }
  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. form.render();
  289. }else{
  290. var ladder = <?php echo json_encode($ladder); ?>;
  291. console.log(ladder);
  292. if(ladder && ladder.length > 0) {
  293. var no_html = '';
  294. $.each(ladder,function (lk,lv) {
  295. no_html += ' <tr class="no_detail change_del" data-dh ="'+lk+'">';
  296. no_html += "<td class='text-left nowrap'>" +
  297. "<input type='text' class='layui-input' name='ladder_title[]' value='"+lv.ladder_title+"'/>" +
  298. "<input type='hidden' name='ladder_id[]' value='"+lv.id+"'/>" +
  299. "</td>";
  300. no_html += "<td class='text-left nowrap'>" +
  301. "<input type='number'min='0' class='layui-input' name='ladder_num[]' value='"+lv.ladder_num+"'/>" +
  302. "</td>";
  303. if(!is_add) {
  304. no_html += "<td class='text-left nowrap'>" +
  305. "<input type='number'min='0' class='layui-input' name='stock[]' value='"+lv.stock+"'/>" +
  306. "</td>";
  307. }
  308. no_html += "<td class='text-left nowrap'>" +
  309. "<input type='' class='layui-input' name='ladder_price[]' value='"+lv.ladder_price+"'/>" +
  310. "</td>";
  311. no_html += "<td class='text-left nowrap'>" +
  312. "<input type='number' class='layui-input' name='fill_num[]' value='"+lv.fill_num+"'/>" +
  313. "</td>";
  314. no_html += "<td class='text-left nowrap'>" +
  315. "<input type='number' class='layui-input' name='sub_money[]' value='"+lv.sub_money+"'/>" +
  316. "</td>";
  317. if(lv.is_sh)
  318. {
  319. no_html += "<td class='text-left nowrap'>" +
  320. "<select name='is_sh[]'>" +
  321. "<option value='0'>否</option>"+
  322. "<option value='1' selected>是</option>"+
  323. "</select>"+
  324. "</td>";
  325. }else{
  326. no_html += "<td class='text-left nowrap'>" +
  327. "<select name='is_sh[]'>" +
  328. "<option value='0'>否</option>"+
  329. "<option value='1'>是</option>"+
  330. "</select>"+
  331. "</td>";
  332. }
  333. if(lv.ladder_status) {
  334. no_html += "<td class='text-left nowrap'>" +
  335. "<select name='ladder_status[]'>" +
  336. "<option value='1' selected>上架</option>"+
  337. "<option value='0'>下架</option>"+
  338. "</select>"+
  339. "</td>";
  340. }else{
  341. no_html += "<td class='text-left nowrap'>" +
  342. "<select name='ladder_status[]'>" +
  343. "<option value='1'>上架</option>"+
  344. "<option value='0'>下架</option>"+
  345. "</select>"+
  346. "</td>";
  347. }
  348. no_html += "<td class='text-left nowrap'>" +
  349. "<input type='' class='layui-input' name='ladder_remark[]' value='"+lv.ladder_remark+"'/>" +
  350. "</td>";
  351. no_html += "<td class='text-left nowrap'>" +
  352. "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
  353. "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
  354. "</td>"
  355. no_html += "</tr>";
  356. })
  357. $(".no_html").html(no_html);
  358. }else{
  359. $(".no_html").html(get_ht(0));
  360. }
  361. window.form.render();
  362. }
  363. function get_ht(k) {
  364. var award_length = $(".no_detail").length;
  365. var no_html = '';
  366. no_html += ' <tr class="no_detail change_del" data-dh ="'+k+'">';
  367. no_html += "<td class='text-left nowrap'>" +
  368. "<input type='text' class='layui-input' name='ladder_title[]' value=''/>" +
  369. "<input type='hidden' name='ladder_id[]' value='0'/>" +
  370. "</td>";
  371. no_html += "<td class='text-left nowrap'>" +
  372. "<input type='number' min='0' class='layui-input' name='ladder_num[]' value=''/>" +
  373. "</td>";
  374. if(!is_add) {
  375. no_html += "<td class='text-left nowrap'>" +
  376. "<input type='number'min='0' class='layui-input' name='stock[]' value=''/>" +
  377. "</td>";
  378. }
  379. no_html += "<td class='text-left nowrap'>" +
  380. "<input type='' class='layui-input' name='ladder_price[]' value=''/>" +
  381. "</td>";
  382. no_html += "<td class='text-left nowrap'>" +
  383. "<input type='number' class='layui-input' name='fill_num[]' value=''/>" +
  384. "</td>";
  385. no_html += "<td class='text-left nowrap'>" +
  386. "<input type='number' class='layui-input' name='sub_money[]' value=''/>" +
  387. "</td>";
  388. no_html += "<td class='text-left nowrap'>" +
  389. "<select name='is_sh[]'>" +
  390. "<option value='0'>否</option>"+
  391. "<option value='1'>是</option>"+
  392. "</select>"+
  393. "</td>";
  394. no_html += "<td class='text-left nowrap'>" +
  395. "<select name='ladder_status[]'>" +
  396. "<option value='1'>上架</option>"+
  397. "<option value='0'>下架</option>"+
  398. "</select>"+
  399. "</td>";
  400. no_html += "<td class='text-left nowrap'>" +
  401. "<input type='text' class='layui-input' name='ladder_remark[]' value=''/>" +
  402. "</td>";
  403. no_html += "<td class='text-left nowrap'>" +
  404. "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
  405. "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
  406. "</td>"
  407. no_html += "</tr>";
  408. return no_html;
  409. }
  410. // 文章监听
  411. form.on('select(article_id)', function(data){
  412. var cl_html = '<option value="0">请选择</option>';
  413. if(data.value == 0) {
  414. $("select[name='article_item']").html(cl_html);
  415. }else{
  416. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  417. var article_list = <?php echo json_encode($article_list); ?>;
  418. $.each(article_list[vl_key]['item_children'],function (ck,cv) {
  419. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  420. })
  421. $("select[name='article_item']").html(cl_html);
  422. }
  423. window.form.render();
  424. });
  425. // 关联视频监听
  426. form.on('select(video_id)', function(data){
  427. var cl_html = '<option value="0">请选择</option>';
  428. if(data.value == 0) {
  429. $("select[name='video_item']").html(cl_html);
  430. }else{
  431. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  432. var video_list = <?php echo json_encode($video_list); ?>;
  433. $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
  434. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  435. })
  436. $("select[name='video_item']").html(cl_html);
  437. }
  438. window.form.render();
  439. });
  440. // 关联资料监听
  441. form.on('select(datum_id)', function(data){
  442. var cl_html = '<option value="0">请选择</option>';
  443. if(data.value == 0) {
  444. $("select[name='datum_item']").html(cl_html);
  445. }else{
  446. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  447. var datum_list = <?php echo json_encode($datum_list); ?>;
  448. $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
  449. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  450. })
  451. $("select[name='datum_item']").html(cl_html);
  452. }
  453. window.form.render();
  454. });
  455. //地址监听
  456. var goods_spec = <?php echo json_encode($all_area); ?>;
  457. form.on('select(province)', function(data){
  458. var cl_html = '<option value="0">请选择</option>';
  459. if(data.value == 0) {
  460. $("select[name='city']").html(cl_html);
  461. $("select[name='county']").html(cl_html);
  462. }else{
  463. var cl_key = data.elem[data.elem.selectedIndex].dataset.al_key;
  464. $.each(goods_spec[cl_key]['children'],function (ck,cv) {
  465. cl_html +='<option data-bl_key="'+ck+'" value="'+cv.name+'">'+cv.name+'</option>';
  466. })
  467. $("select[name='city']").html(cl_html);
  468. }
  469. $("select[name='county']").html('');
  470. window.form.render();
  471. });
  472. form.on('select(city)', function(data){
  473. second()
  474. })
  475. function second() {
  476. var cl_html = '<option value="0">请选择</option>';
  477. var first_key = $("select[name='province']").find("option:selected").data("al_key");
  478. var second_key = $("select[name='city']").find("option:selected").data("bl_key");
  479. console.log(first_key,second_key)
  480. var to_each = goods_spec[first_key]['children'][second_key]['children'];
  481. console.log(to_each);
  482. $.each(to_each,function (ck,cv) {
  483. cl_html +='<option value="'+cv.name+'">'+cv.name+'</option>';
  484. })
  485. $("select[name='county']").html(cl_html);
  486. window.form.render();
  487. }
  488. </script></div>