addhead.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <extend name="Public:base_new" />
  2. <block name="content">
  3. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  4. <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>
  5. <style>
  6. .table-hd {
  7. margin: 0;
  8. line-height: 30px;
  9. background: #f8f8f8;
  10. padding: 0 20px;
  11. font-size: 14px;
  12. margin-top: 20px;
  13. font-weight: bold;
  14. }
  15. .table-hd {
  16. margin-bottom: 20px;
  17. }
  18. </style>
  19. <div class="page-header">
  20. 当前位置:<span class="text-primary"><?php if( !empty($item['id']) ){ ?>编辑<?php }else{ ?>添加<?php } ?>团长 <small><?php if(!empty($item['id'])){ ?>修改【{$item['headname']}】<?php } ?></small></span>
  21. </div>
  22. <div class="page-content">
  23. <form action="" method='post' class='form-horizontal form-validate'>
  24. <input type="hidden" name="id" value="{$item['id']}">
  25. <div class="page-content">
  26. <div class="page-content">
  27. <div class="form-group">
  28. <label class="col-lg control-label must">关联会员</label>
  29. <div class="col-sm-9 col-xs-12">
  30. {:tpl_selector('member_id',array('key'=>'member_id', 'text'=>'nickname', 'thumb'=>'avatar','placeholder'=>'昵称','buttontext'=>'选择会员 ', 'items'=>$saler,'url'=>U('member/zhenquery') ))}
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <label class="col-lg control-label must">团长名称</label>
  35. <div class="col-sm-9 col-xs-12">
  36. <input type="text" name="head_name" class="form-control" value="{$item['head_name']}" data-rule-required="true" />
  37. <span class='help-block'></span>
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. <label class="col-lg control-label must"> 团长手机号</label>
  42. <div class="col-sm-9 col-xs-12">
  43. <input type="text" name="head_mobile" class="form-control" value="{$item['head_mobile']}" data-rule-required="true" />
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-lg control-label must">小区名称</label>
  48. <div class="col-sm-9 col-xs-12">
  49. <input type="text" name="community_name" class="form-control" value="{$item['community_name']}" data-rule-required="true" />
  50. <span class='help-block'></span>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-lg control-label must">微信号</label>
  55. <div class="col-sm-9 col-xs-12">
  56. <input type="text" name="wechat" class="form-control" value="{$item['wechat']}" data-rule-required="true" />
  57. <span class='help-block'></span>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label class="col-lg control-label must">地址</label>
  62. <div class="col-sm-9 col-xs-12">
  63. <p>
  64. <select id="sel-provance" name="province_id" onChange="selectCity();" class="select form-control" style="width:130px;display:inline;">
  65. <option value="" selected="true">省/直辖市</option>
  66. </select>
  67. <select id="sel-city" name="city_id" onChange="selectcounty(0)" class="select form-control" style="width:135px;display:inline;">
  68. <option value="" selected="true">请选择</option>
  69. </select>
  70. <select id="sel-area" name="area_id" onChange="selectstreet(0)" class="select form-control" style="width:130px;display:inline;">
  71. <option value="" selected="true">请选择</option>
  72. </select>
  73. <select id="sel-street" name="country_id" class="select form-control" style="width:130px;display:inline;">
  74. <option value="" selected="true">请选择</option>
  75. </select>
  76. </p>
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-lg control-label must"> 提货详细地址</label>
  81. <div class="col-sm-9 col-xs-12">
  82. <div class="dEdit_1">
  83. <div class="col-sm-6 input-num-show" style="padding-right:0;margin-right:15px">
  84. <input type="text" name="address" id="address" data-val="true" data-val-required="请填写社区店所在详细地址" class="form-control" value="{$item['address']}" data-rule-required="true" />
  85. </div>
  86. <div class="col-sm-2" style="padding-left: 0;">
  87. <a class="btn btn-default" id="js_search_pos" onclick="getResult()">搜索地图</a>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="col-lg control-label must"> 经纬度</label>
  94. <div class="col-sm-9 col-xs-12">
  95. <div class="dEdit_1">
  96. <div class="col-sm-3">
  97. <input class="form-control input-sm" data-val="true" id="lon" name="lon" readonly="readonly" type="text" value="{$item['lon']}">
  98. </div>
  99. <div class="col-sm-3">
  100. <input class="form-control input-sm" data-val="true" id="lat" name="lat" readonly="readonly" type="text" value="{$item['lat']}">
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <label class="col-lg control-label must"> 地图定位</label>
  107. <div class="col-sm-9 col-xs-12">
  108. <div class="map-box" id="container" style="width: 603px; height: 300px; float: left;"></div>
  109. <div class="des" id="map_des" style="display: none; float: left;">请选择一个地址并点击地图中的“导入经纬度”</div>
  110. <div class="info-box" id="infoDiv" style="display: none"></div>
  111. </div>
  112. </div>
  113. <div class="form-group">
  114. <label class="col-lg control-label">申请状态</label>
  115. <div class="col-sm-9 col-xs-12" >
  116. <label class="radio-inline coupon-radio">
  117. <input type="radio" name="state" value="1" <?php if($item['state'] == 1 || empty($item)){ ?> checked="true"<?php } ?> /> 通过
  118. </label>
  119. <label class="radio-inline coupon-radio">
  120. <input type="radio" name="state" value="0" <?php if($item['state'] == 0 && !empty($item)){ ?>checked="true"<?php } ?> /> 未审核
  121. </label>
  122. <label class="radio-inline coupon-radio">
  123. <input type="radio" name="state" value="2" <?php if( $item['state'] == 2 && !empty($item) ){ ?>checked="true"<?php } ?> /> 已拒绝
  124. </label>
  125. </div>
  126. </div>
  127. <h3 class="table-hd">财务信息</h3>
  128. <div class="form-group">
  129. <label class="col-lg control-label must">银行卡名称</label>
  130. <div class="col-sm-9 col-xs-12">
  131. <input type="text" name="bankname" class="form-control" value="{$item['bankname']}" />
  132. <span class='help-block'>例如农行、微信、支付宝,需有关联会员此处设置才有效</span>
  133. </div>
  134. </div>
  135. <div class="form-group">
  136. <label class="col-lg control-label must">卡号</label>
  137. <div class="col-sm-9 col-xs-12">
  138. <input type="text" name="bankaccount" class="form-control" value="{$item['bankaccount']}" />
  139. <span class='help-block'>需有关联会员此处设置才有效</span>
  140. </div>
  141. </div>
  142. <div class="form-group">
  143. <label class="col-lg control-label must">持卡人姓名</label>
  144. <div class="col-sm-9 col-xs-12">
  145. <input type="text" name="bankusername" class="form-control" value="{$item['bankusername']}" />
  146. <span class='help-block'>需有关联会员此处设置才有效</span>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="form-group"></div>
  152. <div class="form-group">
  153. <label class="col-lg control-label"></label>
  154. <div class="col-sm-9 col-xs-12">
  155. <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
  156. <input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default" />
  157. </div>
  158. </div>
  159. </form>
  160. </div>
  161. <script>
  162. var map, searchService, marker, markers = [], infoWin = null;
  163. var initMap = function () {
  164. var center = new qq.maps.LatLng(39.916527, 116.397128);
  165. map = new qq.maps.Map(document.getElementById('container'), {
  166. center: center,
  167. zoom: 13
  168. });
  169. var scaleControl = new qq.maps.ScaleControl({
  170. align: qq.maps.ALIGN.BOTTOM_LEFT,
  171. margin: qq.maps.Size(85, 15),
  172. map: map
  173. });
  174. //调用Poi检索类
  175. searchService = new qq.maps.SearchService({
  176. //检索成功的回调函数
  177. complete: function (results) {
  178. //设置回调函数参数
  179. var pois = results.detail.pois;
  180. infoWin = new qq.maps.InfoWindow({
  181. map: map
  182. });
  183. var latlngBounds = new qq.maps.LatLngBounds();
  184. for (var i = 0, l = pois.length; i < l; i++) {
  185. var poi = pois[i];
  186. //扩展边界范围,用来包含搜索到的Poi点
  187. latlngBounds.extend(poi.latLng);
  188. (function (n) {
  189. var marker = new qq.maps.Marker({
  190. map: map
  191. });
  192. marker.setPosition(pois[n].latLng);
  193. markers.push(marker);
  194. qq.maps.event.addListener(marker, 'click', function () {
  195. infoWin.open();
  196. 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>');
  197. infoWin.setPosition(pois[n].latLng);
  198. });
  199. })(i);
  200. }
  201. //调整地图视野
  202. map.fitBounds(latlngBounds);
  203. },
  204. //若服务请求失败,则运行以下函数
  205. error: function () {
  206. alert("很抱歉,未搜索到此地址,请重新输入!");
  207. }
  208. });
  209. }
  210. function getSelectArea() {
  211. var storeArr = [];
  212. var s_province = $('#sel-provance').val();
  213. var s_city = $('#sel-city').val();
  214. var s_area = $('#sel-area').val();
  215. var s_street = $('#sel-street').val();
  216. if('请选择省份' != s_province)
  217. {
  218. storeArr.push(s_province);
  219. }
  220. if('请选择城市' != s_city)
  221. {
  222. storeArr.push(s_city);
  223. }
  224. if('请选择区域' != s_area)
  225. {
  226. storeArr.push(s_area);
  227. }
  228. if('请选择街道/镇' != s_street && '' != s_street)
  229. {
  230. storeArr.push(s_street);
  231. }
  232. $("#area-selector select").each(function (i) {
  233. if ($(this).find("option:selected").text() != '请选择') {
  234. storeArr.push($(this).find("option:selected").text());
  235. }
  236. });
  237. return storeArr;
  238. }
  239. //查询社区信息
  240. function chooseShopLoc(t) {
  241. var address = $(t).attr("address");
  242. var storeAreaArr = getSelectArea();
  243. for (var i = 3; i >= 0; i--) {
  244. if (i == 0)
  245. {
  246. address = address.replace(storeAreaArr[0] + "市", '');
  247. }
  248. address = address.replace(storeAreaArr[i], '');
  249. }
  250. var lat = $(t).attr("lat");
  251. var lng = $(t).attr("lng");
  252. this.clearMarkers();
  253. var position = new qq.maps.LatLng(lat, lng);
  254. marker = new qq.maps.Marker({
  255. map: map,
  256. position: position,
  257. draggable: true
  258. });
  259. map.panTo(position);
  260. map.zoomTo(18);
  261. $("#lon").val(lng);
  262. $("#lat").val(lat);
  263. qq.maps.event.addListener(marker, 'dragend', function () {
  264. if (marker.getPosition()) {
  265. $("#lon").val(marker.getPosition().getLng());
  266. $("#lat").val(marker.getPosition().getLat());
  267. }
  268. });
  269. if (infoWin) {
  270. infoWin.close();
  271. }
  272. $("#map_des").hide();
  273. }
  274. ////删除所有标记
  275. function clearMarkers() {
  276. if (markers) {
  277. for (i = 0; i < markers.length; i++) {
  278. markers[i].setMap(null);
  279. }
  280. markers.length = 0;
  281. }
  282. }
  283. //搜索地址,这里需要判断是否选择了省市区
  284. function getResult() {
  285. if ($("#AddressId").val() <= 0) {
  286. // $.dialog.tips("请先选择店铺地址");
  287. return;
  288. }
  289. if ($.trim($("#address").val()).length == 0) {
  290. tip.msgbox.err('请先输入详细地址');
  291. return;
  292. }
  293. if (marker != null) marker.setMap(null);
  294. clearMarkers();
  295. if (infoWin) {
  296. infoWin.close();
  297. }
  298. var storeArr = getSelectArea();
  299. var regions = storeArr[0] + storeArr[1] + storeArr[2];
  300. var regionText = storeArr.join(',');
  301. var poiText = regions + $.trim($("#address").val());
  302. //searchService.setLocation(regionText);
  303. searchService.setLocation(storeArr[1]);
  304. searchService.search(poiText);
  305. $("#map_des").show();
  306. }
  307. </script>
  308. <script language='javascript'>
  309. $(function(){
  310. cascdeInit("1","1","{$item['province_name']}","{$item['city_name']}","{$item['area_name']}","{$item['country_name']}");
  311. initMap();//初始化门店地图
  312. });
  313. require(['bootstrap'],function(){
  314. $('#myTab a').click(function (e) {
  315. e.preventDefault();
  316. $('#tab').val( $(this).attr('href'));
  317. $(this).tab('show');
  318. })
  319. });
  320. function showbacktype(type){
  321. $('.backtype').hide();
  322. $('.backtype' + type).show();
  323. }
  324. $(function(){
  325. })
  326. </script>
  327. </block>