supply_localtownconfig.html 31 KB

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