localtownconfig.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <!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': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_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' : {: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. <style>
  45. body.dragging, body.dragging * {
  46. cursor: move !important;
  47. }
  48. .dragged {
  49. position: absolute;
  50. opacity: 0.5;
  51. z-index: 2000;
  52. border: 1px solid #ccc;
  53. border-radius: 5px;
  54. background: #fff;
  55. }
  56. #sortable li {
  57. border-top: 1px solid #c5c5c5;
  58. padding-top: 20px;
  59. }
  60. #sortable li:first-child {
  61. border: 0;
  62. }
  63. #sortable li.placeholder {
  64. position: relative;
  65. }
  66. #sortable li.placeholder:before {
  67. position: absolute;
  68. }
  69. </style>
  70. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  71. <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>
  72. </head>
  73. <body layadmin-themealias="default">
  74. <div class="layui-fluid">
  75. <div class="layui-card">
  76. <div class="layui-card-header layui-elem-quote">同城配送设置</div>
  77. <div class="layui-card-body" style="padding:15px;">
  78. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  79. <ul class="layui-tab-title">
  80. <li class="layui-this">商家配送</li>
  81. <li><a href="{:U('express/localtown_imdada_config')}">达达配送平台</a></li>
  82. <li><a href="{:U('express/localtown_sf_config')}">顺丰同城</a></li>
  83. <li><a href="{:U('express/localtown_mk_config')}">码科跑腿</a></li>
  84. <li><a href="{:U('express/localtown_ele_config')}">蜂鸟即配</a></li>
  85. </ul>
  86. <div class="layui-tab-content" style="height: 100%;">
  87. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  88. <div class="layui-form-item">
  89. <label class="layui-form-label">
  90. 同城配送
  91. </label>
  92. <div class="layui-input-block">
  93. <label class='radio-inline'>
  94. <input type='radio' title="关闭" lay-filter="formopenlocaltowndelivery" name='parameter[isopen_localtown_delivery]' value='0' <?php if(!isset($data['isopen_localtown_delivery']) || $data['isopen_localtown_delivery'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  95. </label>
  96. <label class='radio-inline'>
  97. <input type='radio' title="开启" lay-filter="formexpress" name='parameter[isopen_localtown_delivery]' value='1' <?php if( isset($data['isopen_localtown_delivery']) && $data['isopen_localtown_delivery'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  98. </label>
  99. </div>
  100. <span class='layui-form-mid' style="margin-left: 30px;">同城配送需要开启 <a href="{:U('order/config')}" style="color:red;">redis</a> 才能正常使用。</span>
  101. </div>
  102. <div class="layui-form-item layui-hide">
  103. <label class="layui-form-label">
  104. <i class="fa fa-arrows-alt text-primary"></i>
  105. 配送模式
  106. </label>
  107. <div class="layui-input-block">
  108. <label class='radio-inline'>
  109. <input type='radio' title="平台配送" name='parameter[localtown_delivery_type]' value='0' <?php if(!isset($data['localtown_delivery_type']) || $data['localtown_delivery_type'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  110. </label>
  111. <label class='radio-inline'>
  112. <input type='radio' title="商家配送" name='parameter[localtown_delivery_type]' value='1' <?php if( isset($data['localtown_delivery_type']) && $data['localtown_delivery_type'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  113. </label>
  114. </div>
  115. </div>
  116. <div class="layui-form-item">
  117. <label class="layui-form-label">
  118. 出单时长
  119. </label>
  120. <div class="layui-input-block">
  121. <div class="input-group fixsingle-input-group">
  122. <input class="form-control" name="parameter[localtown_outorder_time]" type="text" placeholder="" value="{$data['localtown_outorder_time']}">
  123. <div class="input-group-addon">分</div>
  124. </div>
  125. <span class='layui-form-mid'>订单制作时长或者订单打包时长</span>
  126. </div>
  127. </div>
  128. <div class="layui-form-item">
  129. <label class="layui-form-label">
  130. 配送时长
  131. </label>
  132. <div class="layui-input-block">
  133. <div class="input-group fixsingle-input-group">
  134. <input class="form-control" name="parameter[localtown_delivery_time]" type="text" placeholder="" value="{$data['localtown_delivery_time']}">
  135. <div class="input-group-addon">分</div>
  136. </div>
  137. <span class='layui-form-mid'>订单从商家到达用户手中的时长</span>
  138. </div>
  139. </div>
  140. <div class="layui-form-item layui-hide">
  141. <label class="layui-form-label">
  142. <i class="fa fa-arrows-alt text-primary"></i>
  143. 订单自动派单
  144. </label>
  145. <div class="layui-input-block">
  146. <label class='radio-inline'>
  147. <input type='radio' title="开启" name='parameter[localtown_auto_dispatch]' value='0' <?php if(!isset($data['localtown_auto_dispatch']) || $data['localtown_auto_dispatch'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  148. </label>
  149. <label class='radio-inline'>
  150. <input type='radio' title="关闭" name='parameter[localtown_auto_dispatch]' value='1' <?php if( isset($data['localtown_auto_dispatch']) && $data['localtown_auto_dispatch'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  151. </label>
  152. </div>
  153. </div>
  154. <!--
  155. <div class="layui-form-item">
  156. <label class="layui-form-label">包装费</label>
  157. <div class='layui-input-block'>
  158. <div class="input-group fixsingle-input-group">
  159. <input class="form-control" name="parameter[localtown_delivery_packingmoney]" type="text" placeholder="" value="{$data['localtown_delivery_packingmoney']}">
  160. <div class="input-group-addon">元</div>
  161. </div>
  162. <div class="layui-form-mid layui-word-aux">设置商品统一包装费</div>
  163. </div>
  164. </div>
  165. -->
  166. <div class="layui-form-item" >
  167. <label class="layui-form-label">包装费自定义名称</label>
  168. <div class='layui-input-block'>
  169. <div class="radio-inline">
  170. <div class="layui-input-inline">
  171. <input type="text" name="parameter[localtown_modifypickingname]" value="{$data['localtown_modifypickingname']}" class="layui-input" />
  172. </div>
  173. <div class="layui-form-mid layui-word-aux">默认:包装费</div>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="layui-form-item layui-hide">
  178. <label class="layui-form-label">
  179. <i class="fa fa-arrows-alt text-primary"></i>
  180. 同城配送距离外是否允许下单
  181. </label>
  182. <div class="layui-input-block">
  183. <label class='radio-inline'>
  184. <input type='radio' title="允许" lay-filter="formlocaltownisallowmaxdistancebuy" name='parameter[localtown_isallow_maxdistancebuy]' value='0' <?php if(!isset($data['localtown_isallow_maxdistancebuy']) || $data['localtown_isallow_maxdistancebuy'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  185. </label>
  186. <label class='radio-inline'>
  187. <input type='radio' title="不允许" lay-filter="formlocaltownisallowmaxdistancebuy" name='parameter[localtown_isallow_maxdistancebuy]' value='1' <?php if( isset($data['localtown_isallow_maxdistancebuy']) && $data['localtown_isallow_maxdistancebuy'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  188. </label>
  189. <div class="layui-form-mid layui-word-aux">距离大于服务距离时是否允许下单,注意:手机定位精确性受天气、用户终端设备是否开启GPS以及硬件配置等影响很大,若此项设置为不允许下单</div>
  190. </div>
  191. </div>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label">服务距离</label>
  194. <div class='layui-input-block'>
  195. <div class="input-group fixsingle-input-group">
  196. <input class="form-control" name="parameter[localtown_servvice_maxdistance]" id="servvice_maxdistance" type="text" placeholder="" value="{$data['localtown_servvice_maxdistance'] }">
  197. <div class="input-group-addon">KM</div>
  198. </div>
  199. <div class="layui-form-mid layui-word-aux">用户与商家的距离</div>
  200. </div>
  201. </div>
  202. <div class="layui-form-item ">
  203. <label class="layui-form-label">
  204. 配送费
  205. </label>
  206. <div class="layui-input-block">
  207. <label class='radio-inline'>
  208. <input type='radio' title="固定金额" lay-filter="formlocaltowndeliverymoneytype" name='parameter[localtown_delivery_moneytype]' value='0' <?php if(!isset($data['localtown_delivery_moneytype']) || $data['localtown_delivery_moneytype'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  209. </label>
  210. <label class='radio-inline'>
  211. <input type='radio' title="按距离收取" lay-filter="formlocaltowndeliverymoneytype" name='parameter[localtown_delivery_moneytype]' value='1' <?php if( isset($data['localtown_delivery_moneytype']) && $data['localtown_delivery_moneytype'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  212. </label>
  213. <div class="layui-form-mid layui-word-aux"></div>
  214. </div>
  215. </div>
  216. <div class="layui-form-item" id="fixed_deliverymoney_set" <?php if( isset($data['localtown_delivery_moneytype']) && $data['localtown_delivery_moneytype'] ==1 ){ ?> style="display:none; <?php } ?>>
  217. <label class="layui-form-label"></label>
  218. <div class="layui-input-block">
  219. <div class="input-group fixsingle-input-group">
  220. <div class="input-group-addon">配送费</div>
  221. <input class="form-control" id="fixed_money" name="parameter[localtown_moneytype_fixed_money]" type="text" placeholder="" value="{$data['localtown_moneytype_fixed_money']}">
  222. <div class="input-group-addon">起送价格</div>
  223. <input class="form-control" id="fixed_deliverymoney" name="parameter[localtown_moneytype_fixed_deliverymoney]" type="text" placeholder="" value="{$data['localtown_moneytype_fixed_deliverymoney']}">
  224. <div class="input-group-addon">元,达到</div>
  225. <input class="form-control" id="fixed_freemoney" name="parameter[localtown_moneytype_fixed_freemoney]" type="text" placeholder="" value="{$data['localtown_moneytype_fixed_freemoney']}">
  226. <div class="input-group-addon">元 免配送费</div>
  227. </div>
  228. <span class='layui-form-mid'>同城配送订单的起送价格以及配送价格(免配送费条件设置 0 的时候,表示不减免配送费)</span>
  229. </div>
  230. </div>
  231. <div class="layui-form-item" id="basedistance_deliverymoney_set" <?php if(!isset($data['localtown_delivery_moneytype']) || $data['localtown_delivery_moneytype'] ==0){ ?> style="display:none;" <?php } ?>>
  232. <label class="layui-form-label"></label>
  233. <div class="layui-input-block">
  234. <div class="input-group fixsingle-input-group">
  235. <div class="input-group-addon">起步价</div>
  236. <input class="form-control" name="parameter[localtown_moneytype_basedistance_deliverymoney]" type="text" placeholder="" value="{$data['localtown_moneytype_basedistance_deliverymoney']}">
  237. <div class="input-group-addon">元,超过</div>
  238. <input class="form-control" name="parameter[localtown_moneytype_basedistance]" type="text" placeholder="" value="{$data['localtown_moneytype_basedistance']}">
  239. <div class="input-group-addon">KM , 超过每KM增加</div>
  240. <input class="form-control" name="parameter[localtown_moneytype_base_perkmaddmoney]" type="text" placeholder="" value="{$data['localtown_moneytype_base_perkmaddmoney']}">
  241. <div class="input-group-addon">元 , 最高收取</div>
  242. <input class="form-control" name="parameter[localtown_moneytype_base_maxdeliverymoney]" type="text" placeholder="" value="{$data['localtown_moneytype_base_maxdeliverymoney']}">
  243. <div class="input-group-addon">元</div>
  244. </div>
  245. <span class='layui-form-mid'>计费规则:例如设置 起步3km内5元,每增加 1km 加 1 元,超过6km,每增加 1km 加 2 元。如果配送距离5km,配送费:5 + (5-3)X 1 = 7元;配送距离8km,配送费:5 + (8-3)X 2 = 15元。</span>
  246. </div>
  247. </div>
  248. <div class="layui-form-item">
  249. <label class="layui-form-label">确认送达距离</label>
  250. <div class='layui-input-block'>
  251. <div class="input-group fixsingle-input-group">
  252. <input class="form-control" name="parameter[localtown_confirm_delivery_distance]" type="text" placeholder="" value="{$data['localtown_confirm_delivery_distance']}">
  253. <div class="input-group-addon">m</div>
  254. </div>
  255. <div class="layui-form-mid layui-word-aux">配送员与用户间距离在此范围内时可以点击送达,最小10米</div>
  256. </div>
  257. </div>
  258. <div class="layui-form-item">
  259. <label class="layui-form-label">配送员抢单距离</label>
  260. <div class='layui-input-block'>
  261. <div class="input-group fixsingle-input-group">
  262. <input class="form-control" name="parameter[localtown_grabbing_distance]" type="text" placeholder="" value="{$data['localtown_grabbing_distance']}">
  263. <div class="input-group-addon">m</div>
  264. </div>
  265. <div class="layui-form-mid layui-word-aux">配送员与商家间距离在此范围内时可以点击抢单,最小10米</div>
  266. </div>
  267. </div>
  268. <div class="layui-form-item">
  269. <label class="layui-form-label">
  270. 购买多件商品时包装费
  271. </label>
  272. <div class="layui-input-block">
  273. <label class='radio-inline'>
  274. <input type='radio' title="叠加" name='parameter[localtown_superposition_pickingmoney]' value='0' <?php if(!isset($data['localtown_superposition_pickingmoney']) || $data['localtown_superposition_pickingmoney'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  275. </label>
  276. <label class='radio-inline'>
  277. <input type='radio' title="不叠加" name='parameter[localtown_superposition_pickingmoney]' value='1' <?php if( isset($data['localtown_superposition_pickingmoney']) && $data['localtown_superposition_pickingmoney'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  278. </label>
  279. </div>
  280. <div class="layui-form-mid layui-word-aux">如果开启了同城配送,并且在同城配送范围内,选择叠加时购买多件商品的包装费等于每件商品包装费的总和, 选择不叠加,则使用其中商品包装费(包含统一运费)的最大值</div>
  281. </div>
  282. <!--<div class="layui-form-item" id="localtown_jiajia_delivery" <?php if(!isset($data['localtown_delivery_moneytype']) || $data['localtown_delivery_moneytype'] == 1){ ?> style="display:none;" <?php } ?>>-->
  283. <div class="layui-form-item" style="display:none;">
  284. <label class="layui-form-label">加价配送</label>
  285. <div class='layui-input-block'>
  286. <div class="input-group fixsingle-input-group">
  287. <input class="form-control" name="parameter[localtown_makeup_delivery_money]" type="text" placeholder="" value="{$data['localtown_makeup_delivery_money']}">
  288. <div class="input-group-addon">元</div>
  289. </div>
  290. <div class="layui-form-mid layui-word-aux">当订单的价格没有达到起送价加的时候加价也可以配送</div>
  291. </div>
  292. </div>
  293. <!--
  294. <div class="layui-form-item ">
  295. <label class="layui-form-label">
  296. 订单免配送费谁出
  297. </label>
  298. <div class="layui-input-block">
  299. <label class='radio-inline'>
  300. <input type='radio' title="平台" name='parameter[localtown_deliverymoney_burdentype]' value='0' <?php if(!isset($data['localtown_deliverymoney_burdentype']) || $data['localtown_deliverymoney_burdentype'] ==0){ ?> checked<?php }else{ ?> <?php } ?> />
  301. </label>
  302. <label class='radio-inline'>
  303. <input type='radio' title="商家" name='parameter[localtown_deliverymoney_burdentype]' value='1' <?php if( isset($data['localtown_deliverymoney_burdentype']) && $data['localtown_deliverymoney_burdentype'] ==1 ){ ?> checked<?php }else{ ?> <?php } ?> />
  304. </label>
  305. </div>
  306. </div>
  307. -->
  308. <div class="layui-form-item">
  309. <label class="layui-form-label">店铺联系方式</label>
  310. <div class='layui-input-block'>
  311. <div class="radio-inline">
  312. <div class="layui-input-inline">
  313. <input type="text" name="parameter[localtown_shop_telephone]" value="{$data['localtown_shop_telephone']}" class="layui-input" />
  314. </div>
  315. <div class="layui-form-mid layui-word-aux">设置服务电话,骑手端在抢单成功的时候,可以联系商家进行沟通</div>
  316. </div>
  317. </div>
  318. </div>
  319. <div class="layui-form-item">
  320. <label class="layui-form-label must">店铺地址</label>
  321. <div class="layui-input-block">
  322. <p>
  323. <select id="sel-provance" lay-ignore name="parameter[localtown_shop_province_id]" onChange="selectCity();" style="width:130px;display:inline;">
  324. <option value="" selected="true">省/直辖市</option>
  325. </select>
  326. <select id="sel-city" lay-ignore name="parameter[localtown_shop_city_id]" onChange="selectcounty(0)" style="width:135px;display:inline;">
  327. <option value="" selected="true">请选择</option>
  328. </select>
  329. <select id="sel-area" lay-ignore name="parameter[localtown_shop_area_id]" onChange="selectstreet(0)" style="width:130px;display:inline;">
  330. <option value="" selected="true">请选择</option>
  331. </select>
  332. <select id="sel-street" lay-ignore name="parameter[localtown_shop_country_id]" style="width:130px;display:inline;">
  333. <option value="" selected="true">请选择</option>
  334. </select>
  335. </p>
  336. </div>
  337. </div>
  338. <div class="layui-form-item">
  339. <label class="layui-form-label must"> 店铺详细地址</label>
  340. <div class="layui-input-block">
  341. <div class="dEdit_1">
  342. <div class="layui-inline">
  343. <div class="layui-input-inline" style="width: 200px;">
  344. <input type="text" style="width: 200px;" name="parameter[localtown_shop_address]" id="address" data-val="true" data-val-required="请填写店铺所在详细地址" class="form-control" value="{$data['localtown_shop_address']}" data-rule-required="true" />
  345. </div>
  346. <div class="layui-input-inline" style="width: 100px;">
  347. <a class="btn btn-default" id="js_search_pos" onclick="getResult()">搜索地图</a>
  348. </div>
  349. <br />
  350. <div class="layui-form-mid layui-word-aux">地图搜索以后,请点击地图定位进行标记坐标,经纬度出来以后在进行保存,以防设置失效。</div>
  351. </div>
  352. </div>
  353. </div>
  354. </div>
  355. <div class="layui-form-item">
  356. <label class="layui-form-label must"> 经纬度</label>
  357. <div class="layui-input-block">
  358. <div class="dEdit_1">
  359. <div class="layui-inline">
  360. <div class="layui-input-inline" style="width: 100px;">
  361. <input class="form-control input-sm" data-val="true" id="lon" name="parameter[localtown_shop_lon]" readonly="readonly" type="text" value="{$data['localtown_shop_lon']}">
  362. </div>
  363. <div class="layui-input-inline" style="width: 100px;">
  364. <input class="form-control input-sm" data-val="true" id="lat" name="parameter[localtown_shop_lat]" readonly="readonly" type="text" value="{$data['localtown_shop_lat']}">
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. <div class="layui-form-item">
  371. <label class="layui-form-label must"> 地图定位</label>
  372. <div class="layui-input-block">
  373. <div class="map-box" id="container" style="width: 603px; height: 300px; float: left;"></div>
  374. <div class="des" id="map_des" style="display: none; float: left;">请选择一个地址并点击地图中的“导入经纬度”</div>
  375. <div class="info-box" id="infoDiv" style="display: none"></div>
  376. </div>
  377. </div>
  378. <div class="layui-form-item <?php if($is_supply == 1){ ?>layui-hide<?php } ?>" >
  379. <label class="layui-form-label">营业时间段</label>
  380. <div class="layui-input-block">
  381. <label class='radio-inline'>
  382. <input type='radio' title="开启" name='parameter[localtown_business_hours_status]' value='1' <?php if(isset($data['localtown_business_hours_status']) && $data['localtown_business_hours_status'] == 1){ ?> checked<?php }else{ ?> <?php } ?> />
  383. </label>
  384. <label class='radio-inline'>
  385. <input type='radio' title="关闭" name='parameter[localtown_business_hours_status]' value='0' <?php if( !isset($data['localtown_business_hours_status']) || $data['localtown_business_hours_status'] == 0 ){ ?> checked<?php }else{ ?> <?php } ?> />
  386. </label>
  387. </div>
  388. <div class="layui-form-mid layui-word-aux">开启后商城同城配送商品根据设置的营业时间段进行配送,其余时间段不进行配送</div>
  389. </div>
  390. <div class="layui-form-item <?php if($is_supply == 1){ ?>layui-hide<?php } ?>"">
  391. <label class="layui-form-label"></label>
  392. <div class="layui-input-block">
  393. <div class="input-group fixsingle-input-group">
  394. <div class="layui-input-inline">
  395. <input type="text" class="layui-input" name='parameter[localtown_business_hours_begin]' value='<?php echo $data[localtown_business_hours_begin];?>' id="business_hour_1" placeholder="HH:mm" lay-key="5">
  396. </div>
  397. <div class="layui-input-inline" style="width: 20px;">
  398. </div>
  399. <div class="layui-input-inline">
  400. <input type="text" class="layui-input" name='parameter[localtown_business_hours_end]' value='<?php echo $data[localtown_business_hours_end];?>' id="business_hour_2" placeholder="HH:mm" lay-key="6">
  401. </div>
  402. </div>
  403. <span class='layui-form-mid layui-word-aux'>请完善营业时间信息。如果开始时间大于结束时间:例如06:00至2:00,则系统会默认营业时间为当天6:00至下一天2:00。</span>
  404. </div>
  405. </div>
  406. <div class="layui-form-item <?php if($is_supply == 1){ ?>layui-hide<?php } ?>" >
  407. <label class="layui-form-label">预计送达时间段</label>
  408. <div class="layui-input-block">
  409. <label class='radio-inline'>
  410. <input type='radio' title="开启" name='parameter[localtown_expected_delivery_status]' value='1' <?php if(isset($data['localtown_expected_delivery_status']) && $data['localtown_expected_delivery_status'] == 1){ ?> checked<?php }else{ ?> <?php } ?> />
  411. </label>
  412. <label class='radio-inline'>
  413. <input type='radio' title="关闭" name='parameter[localtown_expected_delivery_status]' value='0' <?php if( !isset($data['localtown_expected_delivery_status']) || $data['localtown_expected_delivery_status'] == 0 ){ ?> checked<?php }else{ ?> <?php } ?> />
  414. </label>
  415. </div>
  416. <div class="layui-form-mid layui-word-aux">开启后订单结算页面用户可以选择指定时间送达</div>
  417. </div>
  418. <div class="layui-form-item <?php if($is_supply == 1){ ?>layui-hide<?php } ?>"">
  419. <label class="layui-form-label"></label>
  420. <div class="layui-input-block">
  421. <div class="input-group fixsingle-input-group">
  422. <div class="input-group-addon">间隔</div>
  423. <input class="form-control" name="parameter[localtown_delivery_space_time]" type="text" placeholder="" value="{$data['localtown_delivery_space_time']}">
  424. <div class="input-group-addon">分钟</div>
  425. </div>
  426. <span class='layui-form-mid layui-word-aux'>配送时间段间隔不小于15分钟,设置成功后,用户下单可以选择设定好的时间段进行收货</span>
  427. </div>
  428. </div>
  429. <div class="layui-form-item">
  430. <label class="layui-form-label"> </label>
  431. <div class="layui-input-block">
  432. <input type="hidden" value="{$data['delivery_diy_sort']}" name="parameter[delivery_diy_sort]" id="sortIpt" />
  433. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  434. </div>
  435. </div>
  436. </form>
  437. </div>
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. <script src="/layuiadmin/layui/layui.js"></script>
  443. <script src="/static/js/jquery-sortable.js"></script>
  444. <script>
  445. layui.config({
  446. base: '/layuiadmin/' //静态资源所在路径
  447. }).extend({
  448. index: 'lib/index' //主入口模块
  449. }).use('index');
  450. </script>
  451. <script>
  452. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  453. var layer = layui.layer;
  454. var $;
  455. var cur_open_div;
  456. layui.use(['jquery', 'layer','form','laydate'], function(){
  457. $ = layui.$;
  458. var form = layui.form;
  459. var laydate = layui.laydate;
  460. //时间选择器
  461. laydate.render({
  462. elem: '#business_hour_1'
  463. ,type: 'time'
  464. ,format: 'HH:mm'
  465. });
  466. //时间选择器
  467. laydate.render({
  468. elem: '#business_hour_2'
  469. ,type: 'time'
  470. ,format: 'HH:mm'
  471. });
  472. form.on('radio(formlocaltowndeliverymoneytype)', function(data){
  473. if (data.value == 1) {
  474. $('#fixed_deliverymoney_set').hide();
  475. $('#basedistance_deliverymoney_set').show();
  476. //$('#localtown_jiajia_delivery').hide();
  477. } else {
  478. $('#basedistance_deliverymoney_set').hide();
  479. $('#fixed_deliverymoney_set').show();
  480. //$('#localtown_jiajia_delivery').show();
  481. }
  482. });
  483. form.on('radio(formexpress)', function(data){
  484. if (data.value == 1) {
  485. $('#man_free_shipping').show();
  486. } else {
  487. $('#man_free_shipping').hide();
  488. }
  489. });
  490. form.on('radio(formordernote)', function(data){
  491. if (data.value == 1) {
  492. $('#ordernotename').show();
  493. } else {
  494. $('#ordernotename').hide();
  495. }
  496. });
  497. $('#close_tuanz').click(function(){
  498. $('#txtPickupDateTip').hide();
  499. $('#free_tuanz_free').hide();
  500. })
  501. $('#open_tuanz').click(function(){
  502. $('#txtPickupDateTip').css('display','inline-block');
  503. $('#free_tuanz_free').css('display','inline-block');
  504. })
  505. $('#chose_link').click(function(){
  506. cur_open_div = $(this).attr('data-input');
  507. $.post("{php echo shopUrl('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  508. layer.open({
  509. type: 1,
  510. area: '930px',
  511. content: shtml //注意,如果str是object,那么需要字符拼接。
  512. });
  513. });
  514. })
  515. //监听提交
  516. form.on('submit(formDemo)', function(data){
  517. value = $('#servvice_maxdistance').val();
  518. if (value == '' || value<1){
  519. layer.msg('服务距离不能为空,最小值是1',{icon: 2,time: 2000});
  520. return false;
  521. }
  522. //res = $('#fixed_deliverymoney,#fixed_money,#fixed_freemoney').val();
  523. fixed_money = $('#fixed_money').val();
  524. if (fixed_money == '' ) {
  525. layer.msg('配送费不能为空',{icon: 2,time: 2000});
  526. return false;
  527. }
  528. fixed_deliverymoney = $('#fixed_deliverymoney').val();
  529. if (fixed_deliverymoney == '' ) {
  530. layer.msg('起送价格不能为空',{icon: 2,time: 2000});
  531. return false;
  532. }
  533. var reg = /^(?!0+$)(?!0*\.0*$)\d{1,8}(\.\d{1,2})?$/;
  534. if(!reg.test( fixed_deliverymoney )){
  535. layer.msg('起送价格最多使用小数点后两位',{icon: 2,time: 2000});
  536. return false;
  537. }
  538. fixed_freemoney = $('#fixed_freemoney').val();
  539. if (fixed_freemoney == '' ) {
  540. layer.msg('免配送费不能为空',{icon: 2,time: 2000});
  541. return false;
  542. }
  543. $.ajax({
  544. url: data.form.action,
  545. type: data.form.method,
  546. data: data.field,
  547. dataType:'json',
  548. success: function (info) {
  549. if(info.status == 0)
  550. {
  551. layer.msg(info.result.message,{icon: 1,time: 2000});
  552. }else if(info.status == 1){
  553. var go_url = location.href;
  554. if( info.result.hasOwnProperty("url") )
  555. {
  556. go_url = info.result.url;
  557. }
  558. layer.msg('操作成功',{time: 1000,
  559. end:function(){
  560. location.href = info.result.url;
  561. }
  562. });
  563. }
  564. }
  565. });
  566. return false;
  567. });
  568. })
  569. $(function () {
  570. var group = $("#sortable").sortable({
  571. group: 'limited_drop_targets',
  572. handle: 'i.fa-arrows-alt',
  573. onDrop: function ($item, container, _super) {
  574. console.log(group.sortable("serialize").get().join("\n"));
  575. $('#sortIpt').val(group.sortable("serialize").get().join("\n"));
  576. _super($item, container);
  577. },
  578. serialize: function (parent, children, isContainer) {
  579. return isContainer ? children.join() : $(parent).data('id');
  580. },
  581. tolerance: 6,
  582. distance: 10
  583. })
  584. })
  585. </script>
  586. <script>
  587. var map, searchService, marker, markers = [], infoWin = null;
  588. var initMap = function () {
  589. <?php if( !empty($data['localtown_shop_lat']) ){ ?>
  590. var center = new qq.maps.LatLng({$data['localtown_shop_lat']},{$data['localtown_shop_lon']});
  591. <?php }else{?>
  592. var center = new qq.maps.LatLng(39.916527, 116.397128);
  593. <?php }?>
  594. map = new qq.maps.Map(document.getElementById('container'), {
  595. center: center,
  596. zoom: 13
  597. });
  598. var scaleControl = new qq.maps.ScaleControl({
  599. align: qq.maps.ALIGN.BOTTOM_LEFT,
  600. margin: qq.maps.Size(85, 15),
  601. map: map
  602. });
  603. //调用Poi检索类
  604. searchService = new qq.maps.SearchService({
  605. //检索成功的回调函数
  606. complete: function (results) {
  607. //设置回调函数参数
  608. var pois = results.detail.pois;
  609. infoWin = new qq.maps.InfoWindow({
  610. map: map
  611. });
  612. var latlngBounds = new qq.maps.LatLngBounds();
  613. for (var i = 0, l = pois.length; i < l; i++) {
  614. var poi = pois[i];
  615. //扩展边界范围,用来包含搜索到的Poi点
  616. latlngBounds.extend(poi.latLng);
  617. (function (n) {
  618. var marker = new qq.maps.Marker({
  619. map: map
  620. });
  621. marker.setPosition(pois[n].latLng);
  622. markers.push(marker);
  623. qq.maps.event.addListener(marker, 'click', function () {
  624. infoWin.open();
  625. 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>');
  626. infoWin.setPosition(pois[n].latLng);
  627. });
  628. })(i);
  629. }
  630. //调整地图视野
  631. map.fitBounds(latlngBounds);
  632. },
  633. //若服务请求失败,则运行以下函数
  634. error: function () {
  635. alert("很抱歉,未搜索到此地址,请重新输入!");
  636. }
  637. });
  638. }
  639. function getSelectArea() {
  640. var storeArr = [];
  641. var s_province = $('#sel-provance').val();
  642. var s_city = $('#sel-city').val();
  643. var s_area = $('#sel-area').val();
  644. var s_street = $('#sel-street').val();
  645. if('请选择省份' != s_province)
  646. {
  647. storeArr.push(s_province);
  648. }
  649. if('请选择城市' != s_city)
  650. {
  651. storeArr.push(s_city);
  652. }
  653. if('请选择区域' != s_area)
  654. {
  655. storeArr.push(s_area);
  656. }
  657. if('请选择街道/镇' != s_street && '' != s_street)
  658. {
  659. storeArr.push(s_street);
  660. }
  661. $("#area-selector select").each(function (i) {
  662. if ($(this).find("option:selected").text() != '请选择') {
  663. storeArr.push($(this).find("option:selected").text());
  664. }
  665. });
  666. return storeArr;
  667. }
  668. //查询社区信息
  669. function chooseShopLoc(t) {
  670. var address = $(t).attr("address");
  671. var storeAreaArr = getSelectArea();
  672. for (var i = 3; i >= 0; i--) {
  673. if (i == 0)
  674. {
  675. address = address.replace(storeAreaArr[0] + "市", '');
  676. }
  677. address = address.replace(storeAreaArr[i], '');
  678. }
  679. var lat = $(t).attr("lat");
  680. var lng = $(t).attr("lng");
  681. this.clearMarkers();
  682. var position = new qq.maps.LatLng(lat, lng);
  683. marker = new qq.maps.Marker({
  684. map: map,
  685. position: position,
  686. draggable: true
  687. });
  688. map.panTo(position);
  689. map.zoomTo(18);
  690. $("#lon").val(lng);
  691. $("#lat").val(lat);
  692. qq.maps.event.addListener(marker, 'dragend', function () {
  693. if (marker.getPosition()) {
  694. $("#lon").val(marker.getPosition().getLng());
  695. $("#lat").val(marker.getPosition().getLat());
  696. }
  697. });
  698. if (infoWin) {
  699. infoWin.close();
  700. }
  701. $("#map_des").hide();
  702. }
  703. ////删除所有标记
  704. function clearMarkers() {
  705. if (markers) {
  706. for (i = 0; i < markers.length; i++) {
  707. markers[i].setMap(null);
  708. }
  709. markers.length = 0;
  710. }
  711. }
  712. //搜索地址,这里需要判断是否选择了省市区
  713. function getResult() {
  714. if ($("#AddressId").val() <= 0) {
  715. // $.dialog.tips("请先选择店铺地址");
  716. return;
  717. }
  718. if ($.trim($("#address").val()).length == 0) {
  719. //tip.msgbox.err('请先输入详细地址');
  720. layer.msg('请先输入详细地址',{icon: 1,time: 2000});
  721. return;
  722. }
  723. if (marker != null) marker.setMap(null);
  724. clearMarkers();
  725. if (infoWin) {
  726. infoWin.close();
  727. }
  728. var storeArr = getSelectArea();
  729. var regions = storeArr[0] + storeArr[1] + storeArr[2];
  730. var regionText = storeArr.join(',');
  731. var poiText = regions + $.trim($("#address").val());
  732. //searchService.setLocation(regionText);
  733. searchService.setLocation(storeArr[1]);
  734. searchService.search(poiText);
  735. $("#map_des").show();
  736. }
  737. </script>
  738. <script language='javascript'>
  739. $(function(){
  740. cascdeInit("1","1","{$data['province_name']}","{$data['city_name']}","{$data['area_name']}","{$data['country_name']}");
  741. initMap();//初始化门店地图
  742. });
  743. require(['bootstrap'],function(){
  744. $('#myTab a').click(function (e) {
  745. e.preventDefault();
  746. $('#tab').val( $(this).attr('href'));
  747. $(this).tab('show');
  748. })
  749. });
  750. function showbacktype(type){
  751. $('.backtype').hide();
  752. $('.backtype' + type).show();
  753. }
  754. $(function(){
  755. })
  756. </script>
  757. </body>