8b3a46fde6f6eed429096b4c56190d74.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '<?php echo ($_W['uniacid']); ?>',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '<?php echo ($_W['acid']); ?>',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '<?php echo ($_W['openid']); ?>',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '<?php echo ($_W['uid']); ?>',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '<?php echo ($_W['siteroot']); ?>',
  27. 'siteurl': '<?php echo ($_W['siteurl']); ?>',
  28. 'attachurl': '<?php echo ($_W['attachurl']); ?>',
  29. 'attachurl_local': '<?php echo ($_W['attachurl_local']); ?>',
  30. 'attachurl_remote': '<?php echo ($_W['attachurl_remote']); ?>',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : <?php echo json_encode($_W['account']);?>,
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  45. <script src="https://map.qq.com/api/js?v=2.exp&key=6R4BZ-WAB3W-JITRG-OE7GY-R2753-P3BZ2" type="text/javascript" charset="utf-8"></script>
  46. </head>
  47. <body layadmin-themealias="default">
  48. <div class="layui-fluid">
  49. <div class="layui-card">
  50. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>团长 <small><?php if( !empty($item['id'])){ ?>修改【<?php echo ($item['head_name']); ?>】<?php } ?></small></span></div>
  51. <div class="layui-card-body" style="padding:15px;">
  52. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  53. <input type="hidden" name="id" value="<?php echo ($item['id']); ?>">
  54. <div class="layui-form-item">
  55. <label class="layui-form-label must">关联会员</label>
  56. <div class="layui-input-block">
  57. <div class="input-group " style="margin: 0;">
  58. <input type="text" disabled value="<?php echo ($item['member_id']); ?>" class="form-control valid" name="member_id" placeholder="" id="member_id">
  59. <?php if(!empty($item['id'])){ ?>
  60. <span class="input-group-btn">
  61. <span class="btn btn-default">会员</span>
  62. </span>
  63. <?php }else{ ?>
  64. <span class="input-group-btn">
  65. <span data-input="#member_id" id="chose_member_id" class="btn btn-default">选择会员</span>
  66. </span>
  67. <?php } ?>
  68. </div>
  69. <?php if( $saler){ ?>
  70. <div class="input-group " style="margin: 0;">
  71. <div class="layadmin-text-center choose_user">
  72. <img style="" src="<?php echo ($saler['avatar']); ?>">
  73. <div class="layadmin-maillist-img" style=""><?php echo ($saler['nickname']); ?></div>
  74. <?php if(!empty($item['id'])){ ?>
  75. <?php }else{ ?>
  76. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'member_id')"><i class="layui-icon">&#xe640;</i></button>
  77. <?php } ?>
  78. </div>
  79. </div>
  80. <?php } ?>
  81. </div>
  82. </div>
  83. <div class="layui-form-item">
  84. <label class="layui-form-label must">上级团长</label>
  85. <div class="layui-input-block">
  86. <div class="input-group " style="margin: 0;">
  87. <input type="text" disabled value="<?php echo ($agent_saler['member_id']); ?>" class="form-control valid" name="agent_id" placeholder="" id="agent_id">
  88. <span class="input-group-btn">
  89. <span data-input="#agent_id" id="chose_agent_id" class="btn btn-default">选择团长</span>
  90. </span>
  91. </div>
  92. <?php if( $agent_saler){ ?>
  93. <div class="input-group " style="margin: 0;">
  94. <div class="layadmin-text-center choose_user">
  95. <img style="" src="<?php echo ($agent_saler['avatar']); ?>">
  96. <div class="layadmin-maillist-img" style=""><?php echo ($agent_saler['nickname']); ?></div>
  97. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'agent_id')"><i class="layui-icon">&#xe640;</i></button>
  98. </div>
  99. </div>
  100. <?php } ?>
  101. </div>
  102. </div>
  103. <div class="layui-form-item">
  104. <label class="layui-form-label must">团长名称</label>
  105. <div class="layui-input-block">
  106. <input type="text" name="head_name" class="form-control" value="<?php echo ($item['head_name']); ?>" data-rule-required="true" />
  107. <span class='layui-form-mid'></span>
  108. </div>
  109. </div>
  110. <div class="layui-form-item">
  111. <label class="layui-form-label must"> 团长手机号</label>
  112. <div class="layui-input-block">
  113. <input type="text" name="head_mobile" class="form-control" value="<?php echo ($item['head_mobile']); ?>" data-rule-required="true" />
  114. </div>
  115. </div>
  116. <div class="layui-form-item">
  117. <label class="layui-form-label must">小区名称</label>
  118. <div class="layui-input-block">
  119. <input type="text" name="community_name" class="form-control" value="<?php echo ($item['community_name']); ?>" data-rule-required="true" />
  120. <span class='layui-form-mid'></span>
  121. </div>
  122. </div>
  123. <div class="layui-form-item">
  124. <label class="layui-form-label">团长门头照片</label>
  125. <div class="layui-input-block">
  126. <?php echo tpl_form_field_image2('head_doorphoto', $item['head_doorphoto']);?>
  127. </div>
  128. </div>
  129. <div class="layui-form-item">
  130. <label class="layui-form-label must">团长等级</label>
  131. <div class="layui-input-block">
  132. <select lay-ignore name="level_id">
  133. <?php foreach($level_id_to_name as $key => $val){ ?>
  134. <option value="<?php echo $key; ?>" <?php if( !empty($item) && $item['level_id'] == $key ){ ?>selected="true" <?php } ?>><?php echo $val; ?></option>
  135. <?php } ?>
  136. </select>
  137. <span class='layui-form-mid'></span>
  138. </div>
  139. </div>
  140. <div class="layui-form-item">
  141. <label class="layui-form-label must">团长分组</label>
  142. <div class="layui-input-block">
  143. <select lay-ignore name="groupid">
  144. <?php foreach($keys_group as $key => $val){ ?>
  145. <option value="<?php echo $key; ?>" <?php if( !empty($item) && $item['groupid'] == $key ){ ?>selected="true" <?php } ?>><?php echo $val; ?></option>
  146. <?php } ?>
  147. </select>
  148. <span class='layui-form-mid'></span>
  149. </div>
  150. </div>
  151. <div class="layui-form-item">
  152. <label class="layui-form-label must">地址</label>
  153. <div class="layui-input-block">
  154. <p>
  155. <select id="sel-provance" lay-ignore name="province_id" onChange="selectCity();" style="width:130px;display:inline;">
  156. <option value="" selected="true">省/直辖市</option>
  157. </select>
  158. <select id="sel-city" lay-ignore name="city_id" onChange="selectcounty(0)" style="width:135px;display:inline;">
  159. <option value="" selected="true">请选择</option>
  160. </select>
  161. <select id="sel-area" lay-ignore name="area_id" onChange="selectstreet(0)" style="width:130px;display:inline;">
  162. <option value="" selected="true">请选择</option>
  163. </select>
  164. <select id="sel-street" lay-ignore name="country_id" style="width:130px;display:inline;">
  165. <option value="" selected="true">请选择</option>
  166. </select>
  167. </p>
  168. </div>
  169. </div>
  170. <div class="layui-form-item">
  171. <label class="layui-form-label must"> 提货详细地址</label>
  172. <div class="layui-input-block">
  173. <div class="dEdit_1">
  174. <div class="layui-inline">
  175. <div class="layui-input-inline" style="width: 200px;">
  176. <input type="text" style="width: 200px;" name="address" id="address" data-val="true" data-val-required="请填写社区店所在详细地址" class="form-control" value="<?php echo ($item['address']); ?>" data-rule-required="true" />
  177. </div>
  178. <div class="layui-input-inline" style="width: 100px;">
  179. <a class="btn btn-default" id="js_search_pos" onclick="getResult()">搜索地图</a>
  180. </div>
  181. <br />
  182. <div class="layui-form-mid layui-word-aux">地图搜索以后,请点击地图定位进行标记坐标,经纬度出来以后在进行保存,以防设置失效。</div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="layui-form-item">
  188. <label class="layui-form-label must"> 经纬度</label>
  189. <div class="layui-input-block">
  190. <div class="dEdit_1">
  191. <div class="layui-inline">
  192. <div class="layui-input-inline" style="width: 100px;">
  193. <input class="form-control input-sm" data-val="true" id="lon" name="lon" type="text" value="<?php echo ($item['lon']); ?>">
  194. </div>
  195. <div class="layui-input-inline" style="width: 100px;">
  196. <input class="form-control input-sm" data-val="true" id="lat" name="lat" type="text" value="<?php echo ($item['lat']); ?>">
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <div class="layui-form-item">
  203. <label class="layui-form-label must"> 地图定位</label>
  204. <div class="layui-input-block">
  205. <div class="map-box" id="container" style="width: 603px; height: 300px; float: left;"></div>
  206. <div class="des" id="map_des" style="display: none; float: left;">请选择一个地址并点击地图中的“导入经纬度”</div>
  207. <div class="info-box" id="infoDiv" style="display: none"></div>
  208. </div>
  209. </div>
  210. <?php if( $item['id'] == 0 ){ ?>
  211. <div class="layui-form-item">
  212. <label class="layui-form-label">申请状态</label>
  213. <div class="layui-input-block" >
  214. <label class="radio-inline coupon-radio">
  215. <input type="radio" name="state" value="1" <?php if( $item['state'] == 1 || empty($item)){ ?>checked="true"<?php } ?> title="通过" />
  216. </label>
  217. <label class="radio-inline coupon-radio">
  218. <input type="radio" name="state" value="0" <?php if( $item['state'] == 0 && !empty($item)){ ?>checked="true"<?php } ?> title="未审核" />
  219. </label>
  220. <label class="radio-inline coupon-radio">
  221. <input type="radio" name="state" value="2" <?php if( $item['state'] == 2 && !empty($item)){ ?>checked="true"<?php } ?> title="已拒绝" />
  222. </label>
  223. </div>
  224. </div>
  225. <?php }else{ ?>
  226. <div class="layui-form-item">
  227. <label class="layui-form-label">申请状态</label>
  228. <div class="layui-input-block" style="top:5px ">
  229. <td>
  230. <?php if( $item['state'] == 0 ){ ?>
  231. <p style="color: red; display:inline;padding-right: 15px;">待审核</p>
  232. <input type="hidden" name="state" value="0" />
  233. <a style="display:inline;" class='op layui-btn layui-btn-xs' data-toggle="ajaxModal" href="javascript:;" data-href="<?php echo U('communityhead/agent_check_first', array('id' => $item['id']));?>" >
  234. <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="点击审核,选择供应商类型" ></i>
  235. &nbsp;通&nbsp;过&nbsp;
  236. </a>
  237. <p style="color: red; display:inline;padding-right: 15px;"></p>
  238. <input type="checkbox" name="" lay-filter="statewsitchunable" data-href="<?php echo U('communityhead/agent_check', array('id'=>$item['id']));?>" <?php if($item['state']==1){ ?>checked<?php } ?> lay-skin="switch" lay-text="已拒绝|拒绝">
  239. <?php }else if( $item['state'] == 1 ){ ?>
  240. <p style="color: red; padding-right: 15px;" >已通过</p>
  241. <input type="hidden" name="state" value="1" />
  242. <?php }else if( $item['state'] == 2 ){ ?>
  243. <p style="color: red; display:inline;padding-right: 15px;">已拒绝</p>
  244. <input type="hidden" name="state" value="2" />
  245. <a style="display:inline;" data-toggle="ajaxModal" href="javascript:;" data-href="<?php echo U('communityhead/agent_check_first', array('id' => $item['id']));?>" >
  246. <p style="color: blue;display:inline; ">重新审核</p>
  247. </a>
  248. <?php } ?>
  249. </td>
  250. </div>
  251. </div>
  252. <?php } ?>
  253. <div class="layui-form-item">
  254. <label class="layui-form-label must"> <?php echo ($wechat_div); ?></label>
  255. <div class="layui-input-block">
  256. <input type="text" name="wechat" class="form-control" value="<?php echo ($item['wechat']); ?>"/>
  257. <span class='layui-form-mid'></span>
  258. <!--
  259. <?php if( !empty($item['wechat']) ){ ?>
  260. <span class='layui-form-mid'><?php echo ($item['wechat']); ?></span>
  261. <?php }else{ ?>
  262. <span class='layui-form-mid'>后台添加</span>
  263. <?php } ?>-->
  264. </div>
  265. </div>
  266. <div class="layui-form-item">
  267. <label class="layui-form-label ">银行卡名称</label>
  268. <div class="layui-input-block">
  269. <input type="text" name="bankname" class="form-control" value="<?php echo ($item['bankname']); ?>" />
  270. <span class='layui-form-mid'>例如农行、微信、支付宝,需有关联会员此处设置才有效</span>
  271. </div>
  272. </div>
  273. <div class="layui-form-item">
  274. <label class="layui-form-label ">卡号</label>
  275. <div class="layui-input-block">
  276. <input type="text" name="bankaccount" class="form-control" value="<?php echo ($item['bankaccount']); ?>" />
  277. <span class='layui-form-mid'>需有关联会员此处设置才有效</span>
  278. </div>
  279. </div>
  280. <div class="layui-form-item">
  281. <label class="layui-form-label ">持卡人姓名</label>
  282. <div class="layui-input-block">
  283. <input type="text" name="bankusername" class="form-control" value="<?php echo ($item['bankusername']); ?>" />
  284. <span class='layui-form-mid'>需有关联会员此处设置才有效</span>
  285. </div>
  286. </div>
  287. <div class="layui-form-item">
  288. <label class="layui-form-label">分享群图片</label>
  289. <div class="layui-input-block">
  290. <?php echo tpl_form_field_image2('share_wxcode', $item['share_wxcode']);?>
  291. <span class='layui-form-mid'>提示:带群或微信二维码的引导图</span>
  292. </div>
  293. </div>
  294. <div class="layui-form-item">
  295. <label class="layui-form-label"> </label>
  296. <div class="layui-input-block">
  297. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  298. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  299. </div>
  300. </div>
  301. </form>
  302. </div>
  303. </div>
  304. </div>
  305. <div id="ajaxModal" class="modal fade" style="display: none;">
  306. </div>
  307. <script src="/layuiadmin/layui/layui.js"></script>
  308. <script>
  309. layui.config({
  310. base: '/layuiadmin/' //静态资源所在路径
  311. }).extend({
  312. index: 'lib/index' //主入口模块
  313. }).use('index');
  314. </script>
  315. <script>
  316. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  317. var layer = layui.layer;
  318. var $;
  319. var cur_open_div;
  320. layui.use(['jquery', 'layer','form'], function(){
  321. $ = layui.$;
  322. var form = layui.form;
  323. form.on('radio(linktype)', function(data){
  324. if (data.value == 2) {
  325. $('#typeGroup').show();
  326. } else {
  327. $('#typeGroup').hide();
  328. }
  329. });
  330. $('#chose_member_id').click(function(){
  331. cur_open_div = $(this).attr('data-input');
  332. $.post("<?php echo U('user/zhenquery', array('ok' => 1));?>", {}, function(shtml){
  333. layer.open({
  334. type: 1,
  335. area: '930px',
  336. content: shtml //注意,如果str是object,那么需要字符拼接。
  337. });
  338. });
  339. })
  340. $('#chose_agent_id').click(function(){
  341. cur_open_div = $(this).attr('data-input');
  342. $.post("<?php echo U('communityhead/query_head_user_agent', array('ok' => 1));?>", {}, function(shtml){
  343. layer.open({
  344. type: 1,
  345. area: '930px',
  346. content: shtml //注意,如果str是object,那么需要字符拼接。
  347. });
  348. });
  349. })
  350. $('#chose_link').click(function(){
  351. cur_open_div = $(this).attr('data-input');
  352. $.post("<?php echo U('util.selecturl', array('ok' => 1));?>", {}, function(shtml){
  353. layer.open({
  354. type: 1,
  355. area: '930px',
  356. content: shtml //注意,如果str是object,那么需要字符拼接。
  357. });
  358. });
  359. })
  360. //监听提交
  361. form.on('submit(formDemo)', function(data){
  362. var loadingIndex = layer.load(); // 加载中动画遮罩层(1)
  363. $.ajax({
  364. url: data.form.action,
  365. type: data.form.method,
  366. data: data.field,
  367. dataType:'json',
  368. success: function (info) {
  369. layer.close(loadingIndex); // 提交成功失败都需要关闭
  370. if(info.status == 0)
  371. {
  372. layer.msg(info.result.message,{icon: 1,time: 2000});
  373. can_sub = true;
  374. }else if(info.status == 1){
  375. var go_url = location.href;
  376. if( info.result.hasOwnProperty("url") )
  377. {
  378. go_url = info.result.url;
  379. }
  380. layer.msg('操作成功',{time: 1000,
  381. end:function(){
  382. var backurl = "<?php echo U('communityhead/index',array('ok'=>'1'));?>";
  383. location.href = backurl;
  384. // location.href = info.result.url;
  385. }
  386. });
  387. can_sub = true;
  388. }
  389. }
  390. });
  391. return false;
  392. });
  393. form.on('switch(statewsitchunable)', function(data){
  394. var s_url = $(this).attr('data-href')
  395. var s_value = 2;
  396. $.ajax({
  397. url:s_url,
  398. type:'post',
  399. dataType:'json',
  400. data:{state:s_value},
  401. success:function(info){
  402. if(info.status == 0)
  403. {
  404. layer.msg(info.result.message,{icon: 1,time: 2000});
  405. }else if(info.status == 1){
  406. var go_url = location.href;
  407. if( info.result.hasOwnProperty("url") )
  408. {
  409. go_url = info.result.url;
  410. }
  411. layer.msg('操作成功',{time: 1000,
  412. end:function(){
  413. location.href = info.result.url;
  414. }
  415. });
  416. }
  417. }
  418. })
  419. });
  420. form.on('switch(statewsitch)', function(data){
  421. var s_url = $(this).attr('data-href')
  422. var s_value = 1;
  423. if(data.elem.checked)
  424. {
  425. s_value = 1;
  426. }else{
  427. s_value = 3;
  428. }
  429. $.ajax({
  430. url:s_url,
  431. type:'post',
  432. dataType:'json',
  433. data:{state:s_value},
  434. success:function(info){
  435. if(info.status == 3)
  436. {
  437. layer.msg(info.result.message,{icon: 1,time: 2000});
  438. }else if(info.status == 1){
  439. var go_url = location.href;
  440. if( info.result.hasOwnProperty("url") )
  441. {
  442. go_url = info.result.url;
  443. }
  444. layer.msg('操作成功',{time: 1000,
  445. end:function(){
  446. location.href = info.result.url;
  447. }
  448. });
  449. }
  450. }
  451. })
  452. });
  453. form.on('checkbox(checkboxall)', function(data){
  454. if(data.elem.checked)
  455. {
  456. $("input[name=item_checkbox]").each(function() {
  457. $(this).prop("checked", true);
  458. });
  459. $("input[name=checkall]").each(function() {
  460. $(this).prop("checked", true);
  461. });
  462. }else{
  463. $("input[name=item_checkbox]").each(function() {
  464. $(this).prop("checked", false);
  465. });
  466. $("input[name=checkall]").each(function() {
  467. $(this).prop("checked", false);
  468. });
  469. }
  470. form.render('checkbox');
  471. });
  472. })
  473. $("[data-toggle='ajaxModal']").click(function () {
  474. var s_url = $(this).attr('data-href');
  475. ajax_url = s_url;
  476. console.log(23);
  477. $.ajax({
  478. url:s_url,
  479. type:"get",
  480. success:function(shtml){
  481. $('#ajaxModal').html(shtml);
  482. $("#ajaxModal").modal();
  483. }
  484. })
  485. });
  486. $(document).delegate(".modal-footer .btn-primary","click",function(){
  487. var s_data = $('#ajaxModal form').serialize();
  488. $.ajax({
  489. url:ajax_url,
  490. type:'post',
  491. dataType:'json',
  492. data:s_data,
  493. success:function(info){
  494. if(info.status == 0)
  495. {
  496. layer.msg(info.result.message,{icon: 1,time: 2000});
  497. }else if(info.status == 1){
  498. var go_url = location.href;
  499. if( info.result.hasOwnProperty("url") )
  500. {
  501. go_url = info.result.url;
  502. }
  503. layer.msg('操作成功',{time: 1000,
  504. end:function(){
  505. location.href = info.result.url;
  506. }
  507. });
  508. }
  509. }
  510. })
  511. return false;
  512. })
  513. function cancle_bind(obj,sdiv)
  514. {
  515. $('#'+sdiv).val('');
  516. $(obj).parent().parent().remove();
  517. }
  518. </script>
  519. <script>
  520. var map, searchService, marker, markers = [], infoWin = null;
  521. var initMap = function () {
  522. <?php if( !empty($item['lat']) ){ ?>
  523. var center = new qq.maps.LatLng(<?php echo ($item['lat']); ?>,<?php echo ($item['lon']); ?>);
  524. <?php }else{?>
  525. var center = new qq.maps.LatLng(39.916527, 116.397128);
  526. <?php }?>
  527. map = new qq.maps.Map(document.getElementById('container'), {
  528. center: center,
  529. zoom: 13
  530. });
  531. var scaleControl = new qq.maps.ScaleControl({
  532. align: qq.maps.ALIGN.BOTTOM_LEFT,
  533. margin: qq.maps.Size(85, 15),
  534. map: map
  535. });
  536. //调用Poi检索类
  537. searchService = new qq.maps.SearchService({
  538. //检索成功的回调函数
  539. complete: function (results) {
  540. //设置回调函数参数
  541. var pois = results.detail.pois;
  542. infoWin = new qq.maps.InfoWindow({
  543. map: map
  544. });
  545. var latlngBounds = new qq.maps.LatLngBounds();
  546. for (var i = 0, l = pois.length; i < l; i++) {
  547. var poi = pois[i];
  548. //扩展边界范围,用来包含搜索到的Poi点
  549. latlngBounds.extend(poi.latLng);
  550. (function (n) {
  551. var marker = new qq.maps.Marker({
  552. map: map
  553. });
  554. marker.setPosition(pois[n].latLng);
  555. markers.push(marker);
  556. qq.maps.event.addListener(marker, 'click', function () {
  557. infoWin.open();
  558. infoWin.setContent('<div style = "width:200px;padding:10px 0;">' + pois[n].address + '<div class="map-import-btn"><input type="button" class="btn btn-xs btn-primary" value="导入经纬度" onclick="chooseShopLoc(this);" address=' + pois[n].address + ' lat =' + pois[n].latLng.getLat() + ' lng =' + pois[n].latLng.getLng() + ' /></div></div>');
  559. infoWin.setPosition(pois[n].latLng);
  560. });
  561. })(i);
  562. }
  563. //调整地图视野
  564. map.fitBounds(latlngBounds);
  565. },
  566. //若服务请求失败,则运行以下函数
  567. error: function () {
  568. alert("很抱歉,未搜索到此地址,请重新输入!");
  569. }
  570. });
  571. }
  572. function getSelectArea() {
  573. var storeArr = [];
  574. var s_province = $('#sel-provance').val();
  575. var s_city = $('#sel-city').val();
  576. var s_area = $('#sel-area').val();
  577. var s_street = $('#sel-street').val();
  578. if('请选择省份' != s_province)
  579. {
  580. storeArr.push(s_province);
  581. }
  582. if('请选择城市' != s_city)
  583. {
  584. storeArr.push(s_city);
  585. }
  586. if('请选择区域' != s_area)
  587. {
  588. storeArr.push(s_area);
  589. }
  590. if('请选择街道/镇' != s_street && '' != s_street)
  591. {
  592. storeArr.push(s_street);
  593. }
  594. $("#area-selector select").each(function (i) {
  595. if ($(this).find("option:selected").text() != '请选择') {
  596. storeArr.push($(this).find("option:selected").text());
  597. }
  598. });
  599. return storeArr;
  600. }
  601. //查询社区信息
  602. function chooseShopLoc(t) {
  603. var address = $(t).attr("address");
  604. var storeAreaArr = getSelectArea();
  605. for (var i = 3; i >= 0; i--) {
  606. if (i == 0)
  607. {
  608. address = address.replace(storeAreaArr[0] + "市", '');
  609. }
  610. address = address.replace(storeAreaArr[i], '');
  611. }
  612. var lat = $(t).attr("lat");
  613. var lng = $(t).attr("lng");
  614. this.clearMarkers();
  615. var position = new qq.maps.LatLng(lat, lng);
  616. marker = new qq.maps.Marker({
  617. map: map,
  618. position: position,
  619. draggable: true
  620. });
  621. map.panTo(position);
  622. map.zoomTo(18);
  623. $("#lon").val(lng);
  624. $("#lat").val(lat);
  625. qq.maps.event.addListener(marker, 'dragend', function () {
  626. if (marker.getPosition()) {
  627. $("#lon").val(marker.getPosition().getLng());
  628. $("#lat").val(marker.getPosition().getLat());
  629. }
  630. });
  631. if (infoWin) {
  632. infoWin.close();
  633. }
  634. $("#map_des").hide();
  635. }
  636. ////删除所有标记
  637. function clearMarkers() {
  638. if (markers) {
  639. for (i = 0; i < markers.length; i++) {
  640. markers[i].setMap(null);
  641. }
  642. markers.length = 0;
  643. }
  644. }
  645. //搜索地址,这里需要判断是否选择了省市区
  646. function getResult() {
  647. if ($.trim($("#sel-provance").val()) == '请选择省份') {
  648. layer.msg('请选择正确的省市区街道',{icon: 1,time: 2000});
  649. return;
  650. }
  651. if ($("#AddressId").val() <= 0) {
  652. // $.dialog.tips("请先选择店铺地址");
  653. return;
  654. }
  655. if ($.trim($("#address").val()).length == 0) {
  656. //tip.msgbox.err('请先输入详细地址');
  657. layer.msg('请先输入详细地址',{icon: 1,time: 2000});
  658. return;
  659. }
  660. if (marker != null) marker.setMap(null);
  661. clearMarkers();
  662. if (infoWin) {
  663. infoWin.close();
  664. }
  665. var storeArr = getSelectArea();
  666. var regions = storeArr[0] + storeArr[1] + storeArr[2];
  667. var regionText = storeArr.join(',');
  668. var poiText = regions + $.trim($("#address").val());
  669. searchService.setLocation(storeArr[1]);
  670. searchService.search(poiText);
  671. $("#map_des").show();
  672. }
  673. </script>
  674. <script language='javascript'>
  675. $(function(){
  676. cascdeInit("1","1","<?php echo ($item['province_name']); ?>","<?php echo ($item['city_name']); ?>","<?php echo ($item['area_name']); ?>","<?php echo ($item['country_name']); ?>");
  677. initMap();//初始化门店地图
  678. });
  679. require(['bootstrap'],function(){
  680. $('#myTab a').click(function (e) {
  681. e.preventDefault();
  682. $('#tab').val( $(this).attr('href'));
  683. $(this).tab('show');
  684. })
  685. });
  686. function showbacktype(type){
  687. $('.backtype').hide();
  688. $('.backtype' + type).show();
  689. }
  690. $(function(){
  691. })
  692. </script>
  693. </body>