|
@@ -41,6 +41,31 @@ |
|
@@ -41,6 +41,31 @@ |
41
|
<script type="text/plain" id="content" name="content"></script>
|
41
|
<script type="text/plain" id="content" name="content"></script>
|
42
|
</td>
|
42
|
</td>
|
43
|
</tr>
|
43
|
</tr>
|
|
|
44
|
+
|
|
|
45
|
+ <tr>
|
|
|
46
|
+ <th width="100">活动地点<span class="form-required">*</span></th>
|
|
|
47
|
+ <td>
|
|
|
48
|
+ <input class="form-control" type="text" name="address_name"
|
|
|
49
|
+ id="address_name" value="{$data.address_name|default=''}" placeholder="请输入标题"/>
|
|
|
50
|
+ </td>
|
|
|
51
|
+ </tr>
|
|
|
52
|
+
|
|
|
53
|
+ <tr>
|
|
|
54
|
+ <th width="100">经度<span class="form-required">*</span></th>
|
|
|
55
|
+ <td>
|
|
|
56
|
+ <input class="form-control" type="text" name="long"
|
|
|
57
|
+ type="text" id="lng" value="{$data.long|default=''}" placeholder="请输入"/>
|
|
|
58
|
+ <text id="selectBtn">点击地图选择坐标</text>
|
|
|
59
|
+ </td>
|
|
|
60
|
+ </tr>
|
|
|
61
|
+ <tr>
|
|
|
62
|
+ <th width="100">纬度<span class="form-required">*</span></th>
|
|
|
63
|
+ <td>
|
|
|
64
|
+ <input class="form-control" type="text" name="lat"
|
|
|
65
|
+ type="text" id="lat" value="{$data.lat|default=''}" placeholder="请输入"/>
|
|
|
66
|
+ </td>
|
|
|
67
|
+ </tr>
|
|
|
68
|
+
|
44
|
<!--<tr>-->
|
69
|
<!--<tr>-->
|
45
|
<!--<th>相册</th>-->
|
70
|
<!--<th>相册</th>-->
|
46
|
<!--<td>-->
|
71
|
<!--<td>-->
|
|
@@ -177,5 +202,184 @@ |
|
@@ -177,5 +202,184 @@ |
177
|
|
202
|
|
178
|
});
|
203
|
});
|
179
|
</script>
|
204
|
</script>
|
|
|
205
|
+<script type="text/javascript">
|
|
|
206
|
+
|
|
|
207
|
+ $('.btn-cancel-thumbnail').click(function () {
|
|
|
208
|
+ $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
|
|
|
209
|
+ $('#thumbnail').val('');
|
|
|
210
|
+ });
|
|
|
211
|
+ $('.btn-cancel-thumbnail2').click(function () {
|
|
|
212
|
+ $('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
|
|
|
213
|
+ $('#thumbnail2').val('');
|
|
|
214
|
+ });
|
|
|
215
|
+ $('.btn-cancel-thumbnail3').click(function () {
|
|
|
216
|
+ $('#thumbnail3-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
|
|
|
217
|
+ $('#thumbnail3').val('');
|
|
|
218
|
+ });
|
|
|
219
|
+
|
|
|
220
|
+ // 百度地图API功能
|
|
|
221
|
+ var center = new BMap.Point({$data.long|default='116.404'}, {$data.lat|default='39.915'});
|
|
|
222
|
+
|
|
|
223
|
+ var map = new BMap.Map("allmap");
|
|
|
224
|
+ map.centerAndZoom(new BMap.Point(116.404, 39.915), 8);
|
|
|
225
|
+ map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用
|
|
|
226
|
+ map.enableContinuousZoom();
|
|
|
227
|
+
|
|
|
228
|
+ var map_ac = new BMap.Autocomplete( //建立一个自动完成的对象
|
|
|
229
|
+ {
|
|
|
230
|
+ "input": "aaa",
|
|
|
231
|
+ "location": map
|
|
|
232
|
+ });
|
|
|
233
|
+
|
|
|
234
|
+ var marker = new BMap.Marker(center); // 创建标注
|
|
|
235
|
+ map.addOverlay(marker); // 将标注添加到地图中
|
|
|
236
|
+ marker.enableDragging(); //可拖拽
|
|
|
237
|
+ //marker.setAnimation(BMAP_ANIMATION_BOUNCE);
|
|
|
238
|
+
|
|
|
239
|
+ map_ac.addEventListener("onconfirm", function (e) { //鼠标点击下拉列表后的事件
|
|
|
240
|
+ var _value = e.item.value;
|
|
|
241
|
+
|
|
|
242
|
+ function myFun() {
|
|
|
243
|
+ var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
|
|
|
244
|
+ map.centerAndZoom(pp, 8);
|
|
|
245
|
+ marker.setPosition(pp);
|
|
|
246
|
+ mgetLocation(pp);
|
|
|
247
|
+ }
|
|
|
248
|
+
|
|
|
249
|
+ myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
|
|
|
250
|
+ var local = new BMap.LocalSearch(map, { //智能搜索
|
|
|
251
|
+ onSearchComplete: myFun
|
|
|
252
|
+ });
|
|
|
253
|
+ local.search(myValue);
|
|
|
254
|
+ });
|
|
|
255
|
+
|
|
|
256
|
+
|
|
|
257
|
+ var opts = {
|
|
|
258
|
+ width: 200, // 信息窗口宽度
|
|
|
259
|
+ height: 30, // 信息窗口高度
|
|
|
260
|
+ title: "", // 信息窗口标题
|
|
|
261
|
+ enableMessage: false,//设置允许信息窗发送短息
|
|
|
262
|
+
|
|
|
263
|
+ }
|
|
|
264
|
+ var infoWindow = new BMap.InfoWindow("拖动我设置你的位置", opts); // 创建信息窗口对象
|
|
|
265
|
+ marker.openInfoWindow(infoWindow);
|
|
|
266
|
+
|
|
|
267
|
+ var gc = new BMap.Geocoder();
|
|
|
268
|
+
|
|
|
269
|
+ function msetpoint(e) {
|
|
|
270
|
+ document.getElementById("lng_input").value = e.point.lng;
|
|
|
271
|
+ document.getElementById("lat_input").value = e.point.lat;
|
|
|
272
|
+ marker.setPosition(new BMap.Point(e.point.lng, e.point.lat));
|
|
|
273
|
+ mgetLocation(e.point);
|
|
|
274
|
+ }
|
|
|
275
|
+
|
|
|
276
|
+ function mgetLocation(point) {
|
|
|
277
|
+ gc.getLocation(point, function (rs) {
|
|
|
278
|
+ console.log(rs);
|
|
|
279
|
+ var addComp = rs.addressComponents;
|
|
|
280
|
+ marker.openInfoWindow(new BMap.InfoWindow(rs.address, opts));
|
|
|
281
|
+ document.getElementById("address_input").value = rs.address;
|
|
|
282
|
+ document.getElementById("city_input").value = addComp.city;
|
|
|
283
|
+ document.getElementById("province_input").value = addComp.province;
|
|
|
284
|
+ document.getElementById("district_input").value = addComp.district;
|
|
|
285
|
+ document.getElementById("lng_input").value = rs.point.lng;
|
|
|
286
|
+ document.getElementById("lat_input").value = rs.point.lat;
|
|
|
287
|
+ //alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
|
|
|
288
|
+ });
|
|
|
289
|
+ }
|
|
|
290
|
+ marker.addEventListener("dragend", msetpoint)
|
|
|
291
|
+
|
|
|
292
|
+ map.addEventListener("click", msetpoint);
|
|
|
293
|
+
|
|
|
294
|
+
|
|
|
295
|
+ function tilesloaded() {
|
|
|
296
|
+ map.setCenter(center); //设置地图中心点。center除了可以为坐标点以外,还支持城市名
|
|
|
297
|
+ mgetLocation(center);
|
|
|
298
|
+ // map.setZoom(8); //将视图切换到指定的缩放等级,中心点坐标不变
|
|
|
299
|
+ map.removeEventListener("tilesloaded", tilesloaded);
|
|
|
300
|
+ }
|
|
|
301
|
+ map.addEventListener("tilesloaded", tilesloaded);
|
|
|
302
|
+
|
|
|
303
|
+
|
|
|
304
|
+ function confirm() {
|
|
|
305
|
+ var data = {};
|
|
|
306
|
+ data.lng = document.getElementById("lng_input").value;
|
|
|
307
|
+ data.lat = document.getElementById("lat_input").value;
|
|
|
308
|
+ data.address = document.getElementById("address_input").value;
|
|
|
309
|
+ data.city = document.getElementById("city_input").value;
|
|
|
310
|
+ data.province = document.getElementById("province_input").value;
|
|
|
311
|
+ data.district = document.getElementById("district_input").value;
|
|
|
312
|
+ return data;
|
|
|
313
|
+ }
|
|
|
314
|
+
|
|
|
315
|
+</script>
|
|
|
316
|
+
|
|
|
317
|
+<script type="text/javascript">
|
|
|
318
|
+ //编辑器路径定义
|
|
|
319
|
+ var editorURL = GV.WEB_ROOT;
|
|
|
320
|
+
|
|
|
321
|
+
|
|
|
322
|
+
|
|
|
323
|
+ var SelectLocation = {
|
|
|
324
|
+
|
|
|
325
|
+ init:function(config){
|
|
|
326
|
+ var eleId = config.id;
|
|
|
327
|
+ var mapUrl = config.url;
|
|
|
328
|
+ var winHeight = config.height || 800;
|
|
|
329
|
+ var winWidth = config.width || 1024;
|
|
|
330
|
+ var winTop = config.top || 50;
|
|
|
331
|
+ var winLeft = config.left || 100;
|
|
|
332
|
+ this.callbackFun = config.callback;
|
|
|
333
|
+
|
|
|
334
|
+ if(!eleId){
|
|
|
335
|
+ alert('元素id不能为空');
|
|
|
336
|
+ return;
|
|
|
337
|
+ }
|
|
|
338
|
+
|
|
|
339
|
+ if(!mapUrl){
|
|
|
340
|
+ alert('地图url不能为空');
|
|
|
341
|
+ return;
|
|
|
342
|
+ }
|
|
|
343
|
+
|
|
|
344
|
+ var ele = document.getElementById(eleId);
|
|
|
345
|
+ ele.addEventListener('click',function(){
|
|
|
346
|
+ window.open(mapUrl,'selectLocation','fullscreen=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,' +
|
|
|
347
|
+ 'height='+winHeight+',width='+winWidth+',top='+winTop+',left='+winLeft+'');
|
|
|
348
|
+ });
|
|
|
349
|
+ },
|
|
|
350
|
+
|
|
|
351
|
+ callbackFun:null,
|
|
|
352
|
+
|
|
|
353
|
+ selectCallback:function(selectedLocation){
|
|
|
354
|
+ console.log('12121212');
|
|
|
355
|
+ if(this.callbackFun){
|
|
|
356
|
+ this.callbackFun(selectedLocation);
|
|
|
357
|
+ }
|
|
|
358
|
+ }
|
|
|
359
|
+ }
|
|
|
360
|
+</script>
|
|
|
361
|
+
|
|
|
362
|
+<script type="text/javascript">
|
|
|
363
|
+ SelectLocation.init({
|
|
|
364
|
+ id:'selectBtn', //打开地图窗口按钮的ID
|
|
|
365
|
+ url:'/txmap.html', //地图页面的地址
|
|
|
366
|
+// width:'1024', //打开地图窗口的宽度,可不传
|
|
|
367
|
+// height:'800', //打开地图窗口的高度,可不传
|
|
|
368
|
+// top:'50', //打开地图窗口距显示器顶部的距离,可不传
|
|
|
369
|
+// left:'100', //打开地图窗口显示器左边的距离,可不传
|
|
|
370
|
+ callback:function(selectedLocation){
|
|
|
371
|
+ var lat = document.getElementById('lat');
|
|
|
372
|
+ var lng = document.getElementById('lng');
|
|
|
373
|
+ console.log(selectedLocation);
|
|
|
374
|
+ var gps=selectedLocation.location.split(",");
|
|
|
375
|
+ if (gps==''){
|
|
|
376
|
+ return false;
|
|
|
377
|
+ }
|
|
|
378
|
+ console.log(gps)
|
|
|
379
|
+ lat.value =gps['1'];
|
|
|
380
|
+ lng.value =gps['0'];
|
|
|
381
|
+ }
|
|
|
382
|
+ });
|
|
|
383
|
+</script>
|
180
|
</body>
|
384
|
</body>
|
181
|
</html> |
385
|
</html> |