caipan_shop_admin/view/manager/config/about.html

108 lines
5.2 KiB
HTML
Executable File

{layout name="manager/layout" /}
<div class="layui-card layui-col-md12">
<div class="layui-card-body">
<form class="layui-form " data-action="{:url('manager.config/'.$Request.action)}">
关于我们
<hr>
<div class="layui-form-item">
<label class="layui-form-label required">公司名称</label>
<div class="layui-input-block">
<input type="text" name="company_name" lay-verify="required" value="{$item.company_name ?? ''}" lay-reqtext="公司名称不能为空" placeholder="请输入详细地址" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">联系人</label>
<div class="layui-input-block">
<input type="text" name="contacts" lay-verify="required" value="{$item.contacts ?? ''}" lay-reqtext="联系人不能为空" placeholder="请输入详细地址" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">联系电话</label>
<div class="layui-input-block">
<input type="text" name="phone" lay-verify="required" value="{$item.phone ?? ''}" lay-reqtext="联系电话不能为空" placeholder="请输入详细地址" class="layui-input">
</div>
</div>
<!-- 详细地址 -->
<div class="layui-form-item">
<label class="layui-form-label required">地址</label>
<div class="layui-input-block">
<input type="text" name="address" lay-verify="required" value="{$item.address ?? ''}" lay-reqtext="详细地址不能为空" placeholder="请输入详细地址" class="layui-input">
</div>
</div>
<!-- 经纬度 -->
<div class="layui-form-item">
<label class="layui-form-label required">经纬度</label>
<div class="layui-input-block">
<div class="layui-input-inline">
<input type="number" name="lon" value="{$item.lon ?? ''}" id="longitude" placeholder="请填写经度" lay-reqtext="经度不能为空" lay-verify="required" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline">
<input type="number" name="lat" value="{$item.lat ?? ''}" id="latitude" placeholder="请填写纬度" lay-reqtext="纬度不能为空" lay-verify="required" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline"><button type="button" class="layui-btn-normal layui-btn" id="locationBtn">定位</button></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内容</label>
<div class="layui-input-block editor-text">
<div class="editor"></div>
<textarea name="content" class="layui-textarea layui-hide">{$item.content??''}</textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="button" class="layui-btn layui-btn-normal" data-url="/manager/config/{$Request.action}" lay-submit lay-filter="saveConfig">保存</button>
</div>
</div>
</form>
</div>
</div>
<script src="__STATIC__/js/iPicker/iPicker.min.js"></script>
<script src="__STATIC__/common/jquery-3.4.1.min.js"></script>
<script src="__MANAGER__/js/common/address.js?v={:mt_rand()}"></script>
<script>
layui.use(['layer','form','jquery','location'],function(){
let $ = layui.jquery;
let form = layui.form;
let location = layui.location;
let lng = $('#longitude').val();
let lat = $('#latitude').val();
lng = lng.length > 0 ? lng : '116.404';
lat = lat.length > 0 ? lat : '39.915';
let locationData = {lng: lng,lat: lat};
location.render("#locationBtn",{
type: 1,
apiType: "gaodeMap",
coordinate: "gaodeMap",
mapType: 0,
zoom: 15,
title: '区域定位',
init: function(){
// 打开地图时 延迟一定时间搜索
$('body').on('click', '#locationBtn', function () {
let address = $("input[name='address']").val();
setTimeout(function () {
$('#ew-map-select-input-search').val(address).trigger('input');
}, 1500)
})
return {longitude: $("#longitude").val()?$("#longitude").val():locationData.lng,latitude: $("#latitude").val()?$("#latitude").val():locationData.lat};
},
success: function (data) {
$("#longitude").val(data.lng);
$("#latitude").val(data.lat);
},
onClickTip: function (data) {
console.log(data);
}
});
});
</script>