coupon-admin/view/manager/business/business_detail.html

410 lines
20 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{layout name="manager/layout" /}
<div class="layuimini-container location-operate-page">
<div class="layuimini-main">
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">商家全称</label>
<div class="layui-input-block">
<input type="text" name="business_name" lay-verify="required" value="{$item.business_name??''}" 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="business_subtitle" value="{$item.business_subtitle??''}" placeholder="请输入商家简称" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">商家类型</label>
<div class="layui-input-block">
<select name="type" >
<option value="">请选择</option>
{foreach $type as $value}
<option value="{$value['id']}" {if $item['type'] ==$value['id'] } selected {/if}>{$value['name']} </option>
{if !empty($value['children'])}
{foreach $value['children'] as $ckey => $cvalue}
<option value="{$cvalue['id']}" {if $item['type'] ==$cvalue['id'] } selected {/if}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$value['name']}</option>
{/foreach}
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item layui-row field-div current-field-cover" >
<label class="layui-form-label">执照:</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="business_license" type="text" value="{$item.business_license??''}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger upload-btn">
<i class="fa fa-upload"></i> 上传
</button>
</span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- 地址 -->
<div class="layui-form-item">
<label class="layui-form-label required">地址</label>
<div class="layui-input-block">
<input type="hidden" id="input-province" name="province" value="{$item.province ?? 0}">
<input type="hidden" id="input-city" name="city" value="{$item.city ?? 0}">
<input type="hidden" id="input-county" name="county" value="{$item.county ?? 0}">
<input type="hidden" id="input-province-text" name="province_text" value="{$item.province_text ?? ''}">
<input type="hidden" id="input-city-text" name="city_text" value="{$item.city_text ?? ''}">
<input type="hidden" id="input-county-text" name="county_text" value="{$item.county_text ?? ''}">
<div id="target" style="z-index: 898"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">详细地址</label>
<div class="layui-input-block">
<input type="text" name="business_address" lay-verify="required" value="{$item.business_address??''}" 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="lng" value="{$item.lng ?? ''}" 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 class="layui-btn-normal layui-btn" id="locationBtn">定位</button></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">联系人</label>
<div class="layui-input-block">
<input type="text" name="contact_name" lay-verify="required" value="{$item.contact_name??''}" 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="contact_phone" lay-verify="required" value="{$item.contact_phone??''}" 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="radio" if $item['state']==0 } disabled {/if} {if $item['state']==0 } checked="checked" {/if} name="state" value="0" title="审核中" />
<input type="radio" if $item['state']==0 } disabled {/if} {if $item['state']==1 } checked="checked" {/if} name="state" value="1" title="审核通过" />
<input type="radio" if $item['state']==0 } disabled {/if} {if $item['state']==2 } checked="checked" {/if} name="state" value="2" title="拒绝" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label ">驳回原因</label>
<div class="layui-input-block">
<input type="text" name="reason" value="{$item.reason??''}" 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="radio" {if $item['enable']==0 } checked="checked" {/if} name="enable" value="0" title="正常" />
<input type="radio" {if $item['enable']==1 } checked="checked" {/if} name="enable" value="1" title="禁用" />
</div>
</div>
<!-- <div class="layui-form-item">-->
<!-- <label class="layui-form-label required">特 色</label>-->
<!-- <div class="layui-input-block">-->
<!-- <textarea class="layui-textarea" name="characteristic">{ $item['characteristic']}</textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="layui-form-item">-->
<!-- <label class="layui-form-label required">介绍</label>-->
<!-- <div class="layui-input-block">-->
<!-- <div class="editor"></div>-->
<!-- <textarea class="layui-textarea" name="intro" style="display:none;">{$item['intro']}</textarea>-->
<!-- </div>-->
<!-- </div>-->
<div class="layui-form-item layui-row field-div current-field-cover" >
<label class="layui-form-label">介绍组图:</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="intro" type="text" value="{$item['intro']}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger upload-btn" data-multiple="true">
<i class="fa fa-upload"></i> 上传
</button>
</span>
<!-- <span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn" data-url="/manager/attachment/image"-->
<!-- data-type="image"-->
<!-- data-multiple="true"-->
<!-- ><i class="fa fa-list"></i> 选择</button></span>-->
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">商圈</label>
<div class="layui-input-block">
<select name="business_circle_id">
<option value="">请选择</option>
{foreach $businessCircle as $bkey => $bvalue}
<option value="{$bvalue['id']}" {if $item['business_circle_id'] == $bvalue['id'] } selected {/if}>{$bvalue['name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item layui-row field-div current-field-cover" >
<label class="layui-form-label">商家背景图:</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="background" type="text" value="{$item.background??''}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger upload-btn">
<i class="fa fa-upload"></i> 上传
</button>
</span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- <div class="layui-form-item">-->
<!-- <label class="layui-form-label required">商家评分</label>-->
<!-- <div class="layui-input-block">-->
<!-- <input type="radio" { if $item['score']==1 } checked="checked" {/if} name="score" value="1" title="1星" />-->
<!-- <input type="radio" { if $item['score']==2 } checked="checked" {/if} name="score" value="2" title="2星" />-->
<!-- <input type="radio" { if $item['score']==3 } checked="checked" {/if} name="score" value="3" title="3星" />-->
<!-- <input type="radio" { if $item['score']==4 } checked="checked" {/if} name="score" value="4" title="4星" />-->
<!-- <input type="radio" { if $item['score']==5 } checked="checked" {/if} name="score" value="5" title="5星" />-->
<!-- </div>-->
<!-- </div>-->
<fieldset class="layui-elem-field layui-field-title site-title">
<legend><a name="compatibility">时限商家 当商家在有效期内发布签到券次数达到设置次数,或者超出有效期,商家类型自动变成普通商家</a></legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label required">商家模式</label>
<div class="layui-input-block">
<select name="model" lay-filter="model">
{foreach $model as $key=> $value}
<option value="{$key}" {if $item['model'] == $key } selected {/if}>{$value}</option>
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item time_limit_model {if $item['model'] == $model_ordinary } layui-hide {/if}">
<label class="layui-form-label required">时限-开始时间</label>
<div class="layui-input-block">
<input type="text" name="time_limit_start" id="time_limit_start"
{if strtotime($item.time_limit_start)>0}
value="{$item.time_limit_start??''}"
{/if}
class="layui-input">
</div>
</div>
<div class="layui-form-item time_limit_model {if $item['model'] == $model_ordinary } layui-hide {/if}">
<label class="layui-form-label required">时限-结束时间</label>
<div class="layui-input-block">
<input type="text" name="time_limit_end" id="time_limit_end"
{if strtotime($item.time_limit_end)>0}
value="{$item.time_limit_end??''}"
{/if}
class="layui-input">
</div>
</div>
<div class="layui-form-item time_limit_model {if $item['model'] == $model_ordinary } layui-hide {/if}">
<label class="layui-form-label required">时限-发布个数</label>
<div class="layui-input-block">
<input type="number" name="time_limit_release_count"
value="{$item.time_limit_release_count??0}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" data-url="/manager/business/business-detail?business_code={$item.code}" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
</div>
</div>
<script src="__STATIC__/js/iPicker/iPicker.min.js"></script>
<script src="__STATIC__/common/jquery-3.4.1.min.js"></script>
<script>
let province = $('#input-province').val();
let city = $('#input-city').val();
let county = $('#input-county').val();
let _width = 200;
let _height = 34;
province = province ? province : '110000';
city = city ? city : '110100';
county = county ? county : '110101';
if ($('#target').length > 0) {
if ($('#target').data('width') != undefined) {
_width = $('#target').data('width');
}
if ($('#target').data('height') != undefined) {
_height = $('#target').data('height');
}
}
var picker =iPicker.create("#target", {
width: _width,
height: _height,
data: {
// 此处以通过 jquery 库获取本地数据源为例
//source: Promise.resolve($.getJSON("/static/js/iPicker/area.json"))
// 此处以通过 jquery 库获取数据为例
// 示例代码中使用的 "http://www.abcddcba.com/api/area" 是模拟地址,实际应用中替换成真实地址即可
// code 参数值就是相应地区对应的行政区划代码
// ----------------------------------------------------------------------------------------------------------
// 使用自定义数据源时,必须保证 source 属性值是 Function 类型
// iPicker 会自动执行此函数,同时要确保此函数的执行结果返回的是标准的 Promise 对象
// iPicker 会自动调用 then 方法,同时要确保 then 方法的参数就是返回的数据Array 类型)
// ----------------------------------------------------------------------------------------------------------
// 初始状态下iPicker 会自动执行一次 source 函数来获取 “省份” 数据,此时传入的 code 参数值为 null
// 因此,开发者可能需要给 code 参数设置一个默认值来获取 “省份” 数据(如示例代码中 code 为 null 时默认取零)
source: code => $.get( "/api/area/index.html?areaId=" + ( code || 86 ) )
},
onSelect: (code, name, all) => {
// 返回参数均为数组形式
// console.log( code );
// console.log( name );
// console.log( all );
let len = code.length;
if (len === 3) {
$('#input-province').val(code[0]);
$('#input-city').val(code[1]);
$('#input-county').val(code[2]);
$('#input-province-text').val(name[0]);
$('#input-city-text').val(name[1]);
$('#input-county-text').val(name[2]);
}
},
selected: [province, city, county],
})
</script>
<script>
layui.use(['layer','form','jquery','location',"laydate"],function(){
let $ = layui.jquery;
let form = layui.form;
let location = layui.location;
let laydate = layui.laydate;
//日期时间选择器
laydate.render({
elem: '#time_limit_start'
,type: 'datetime'
});
//日期时间选择器
laydate.render({
elem: '#time_limit_end'
,type: 'datetime'
});
form.on('select(model)', function(data){
//console.log(data.elem); //得到select原始DOM对象
//console.log(data.value); //得到被选中的值
//console.log(data.othis); //得到美化后的DOM对象
if(data.value == {$model_time_limit}){
$(".time_limit_model").removeClass("layui-hide").show()
}else{
$(".time_limit_model").addClass("layui-hide").hide()
}
});
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>