113 lines
5.0 KiB
HTML
Executable File
113 lines
5.0 KiB
HTML
Executable File
<style>
|
|
.map-item{display: none}
|
|
.layui-card-body{padding-bottom: 150px}
|
|
</style>
|
|
<div class="layui-card layui-col-md12">
|
|
<div class="layui-card-body" style="overflow: auto;">
|
|
<form class="layui-form" style="margin-top: 0" data-action="{:url('manager.page/map')}" >
|
|
<input type="hidden" name="__token__" value="{$_token}" />
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">标题</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" class="layui-input" name="item[title]" value="{$item.title??''}"/>
|
|
</div>
|
|
</div>
|
|
{if $groupId == 1}
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">键值</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" class="layui-input" name="item[keyword]" value="{$item.keyword??''}"/>
|
|
</div>
|
|
</div>
|
|
{else /}
|
|
<input type="hidden" class="layui-input" name="item[keyword]" value="{$item.keyword??''}" />
|
|
{/if}
|
|
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">地图类型</label>
|
|
<div class="layui-input-block">
|
|
<select name="value[map_type]" id="map_type" lay-filter="map_type">
|
|
<option ></option>
|
|
{foreach $mapType as $key =>$tItem}
|
|
<option value="{$key}" {if ($item.value.map_type??'')==$key} selected{/if}>{$tItem}</option>
|
|
{/foreach}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">公司名称</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" class="layui-input" name="value[company_name]" value="{$item.value.company_name??''}"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">公司名称-英文</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" class="layui-input" name="value[company_name_en]" value="{$item.value.company_name_en??''}"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">地址</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="address" class="layui-input" name="value[address]" value="{$item.value.address??''}"/>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">经度:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="lng" class="layui-input" name="value[lng]" value="{$item.value.lng??''}"/>
|
|
</div>
|
|
<label class="layui-form-label">纬度:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="lat" class="layui-input" name="value[lat]" value="{$item.value.lat??''}"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item map-item" id="tengxun_map">
|
|
<iframe src="/manager.page/mapPlugin?template=tengxun&lng={$item.value.lng??''}&&lat={$item.value.lat??''}" style="width: 70%;height: 600px"></iframe>
|
|
</div>
|
|
|
|
<div class="layui-form-item map-item" id="gaode_map">
|
|
<iframe src="/manager.page/mapPlugin?template=gaode&lng={$item.value.lng??''}&&lat={$item.value.lat??''}" style="width: 70%;height: 600px"></iframe>
|
|
</div>
|
|
<div class="layui-form-item map-item" id="baidu_map">
|
|
<iframe src="/manager.page/mapPlugin?template=baidu&lng={$item.value.lng??''}&&lat={$item.value.lat??''}" style="width: 70%;height: 600px"></iframe>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="submitAll">保存</button>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" class="layui-input" name="category_id" value="{$categoryId??0}" />
|
|
<input type="hidden" class="layui-input" name="id" value="{$item.id??0}" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function setLngLat(lng,lat){
|
|
$("#lng").val(lng)
|
|
$("#lat").val(lat)
|
|
}
|
|
layui.use(["form"], function(){
|
|
|
|
form = layui.form;
|
|
$("#{$item.value.map_type??''}_map").show();
|
|
form.on("select(map_type)",function (data) {
|
|
console.log(data.value)
|
|
$(".map-item").hide()
|
|
$("#"+data.value+"_map").show()
|
|
})
|
|
{if empty($item)}
|
|
$("#map_type").val("tengxun")
|
|
{/if}
|
|
})
|
|
|
|
</script> |