2021-05-21

This commit is contained in:
ly19960718 2021-05-24 18:24:04 +08:00
parent 88671da61e
commit a598f5a873
12 changed files with 437 additions and 206 deletions

View File

@ -71,10 +71,6 @@ public class ShopAppController extends DefaultBaseController {
}
@ApiOperation(value = "我的店铺分页列表", notes = "我的店铺分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),

View File

@ -40,6 +40,7 @@ public class TemplateForwardingRecordAppController extends DefaultBaseController
@ApiOperation(value = "新增", notes = "新增接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")

View File

@ -34,6 +34,22 @@ public class TemplateViewRecordAppController extends DefaultBaseController {
@Autowired
private ITemplateViewRecordService templateViewRecordService;
@ApiOperation(value = "根据模板使用ID获取其查看信息", notes = "根据模板使用ID获取其查看信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "templateUseId", value = "模板使用ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getByTemplateUseId/{templateUseId}")
public Map<String, Object> getByTemplateUseId(@PathVariable("templateUseId") String templateUseId){
return templateViewRecordService.getByTemplateUseId(templateUseId);
}
@ApiOperation(value = "新增", notes = "新增接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")

View File

@ -20,16 +20,8 @@ public class TemplateViewRecordDTO {
private String templateUseId;
@ApiModelProperty(name = "cardTemplateViewUserId", value = "查看人员Id")
private String cardTemplateViewUserId;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ApiModelProperty(name = "gmtCreate", value = "")
private String gmtCreate;
@ApiModelProperty(name = "modifier", value = "")
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "")
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
@ApiModelProperty(name = "cardTemplateViewUserIdPhoto", value = "查看人员头像")
private String cardTemplateViewUserIdPhoto;
public String getCardTemplateViewRecordId() {
return cardTemplateViewRecordId == null ? "" : cardTemplateViewRecordId.trim();
@ -55,45 +47,12 @@ public class TemplateViewRecordDTO {
this.cardTemplateViewUserId = cardTemplateViewUserId;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
public String getCardTemplateViewUserIdPhoto() {
return cardTemplateViewUserIdPhoto;
}
public void setCreator(String creator) {
this.creator = creator;
public void setCardTemplateViewUserIdPhoto(String cardTemplateViewUserIdPhoto) {
this.cardTemplateViewUserIdPhoto = cardTemplateViewUserIdPhoto;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -212,7 +212,7 @@ public class DynamicServiceImpl extends DefaultBaseService implements IDynamicSe
dto.setUserIcon(userPO.getUserAvatar());
}
dto.setUserName("董博");
dto.setUserIcon("f416ce36-2cc4-4eb0-8a38-224da7bac7de");
dto.setUserIcon("e453eddd-f7cd-4ddc-a23c-56e6223649d8");
}else{
ShopDTO shop = shopService.get(dto.getDynamicShopId());
if(shop != null) {
@ -220,9 +220,9 @@ public class DynamicServiceImpl extends DefaultBaseService implements IDynamicSe
dto.setShopIcon(shop.getShopLogo());
}
dto.setShopName("董博的店");
dto.setShopIcon("f416ce36-2cc4-4eb0-8a38-224da7bac7de");
dto.setShopIcon("e453eddd-f7cd-4ddc-a23c-56e6223649d8");
}
dto.setDynamicFile("f416ce36-2cc4-4eb0-8a38-224da7bac7de,ecaef298-7998-41cf-8773-4b9395b989c2,f416ce36-2cc4-4eb0-8a38-224da7bac7de,ecaef298-7998-41cf-8773-4b9395b989c2");
//dto.setDynamicFile("f416ce36-2cc4-4eb0-8a38-224da7bac7de,ecaef298-7998-41cf-8773-4b9395b989c2,f416ce36-2cc4-4eb0-8a38-224da7bac7de,ecaef298-7998-41cf-8773-4b9395b989c2");
}
PageInfo<DynamicDTO> pageInfo = new PageInfo<>(dynamicDTOs);
return new SuccessResultList<>(dynamicDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -162,6 +162,7 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService
@Override
public ShopDTO get(Map<String, Object> params) {
ShopDTO shopDTO = shopDao.get(params);
if(shopDTO != null){
// 通过店铺ID获取店铺行业信息
List<ShopDTO> shopDTOS = shopDao.getIndustry(params);
if(null != shopDTOS && shopDTOS.size() > 0) {
@ -180,6 +181,7 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService
shopDTO.setShopCertificationId(shopCertificationDTO.getShopCertificationId());
shopDTO.setAuditStatus(shopCertificationDTO.getAuditStatus());
}
}
return shopDTO;
}

View File

@ -19,6 +19,14 @@ import java.util.Map;
**/
public interface ITemplateViewRecordService {
/**
* 根据模板使用ID获取其查看信息
* @param templateUseId
* @return
*/
Map<String,Object> getByTemplateUseId(String templateUseId);
/**
* 新增
*

View File

@ -33,6 +33,26 @@ public class TemplateViewRecordServiceImpl extends DefaultBaseService implements
@Autowired
private ITemplateViewRecordDao templateViewRecordDao;
public Map<String,Object> getByTemplateUseId(String templateUseId){
Map<String,Object> map = new HashMap<>();
map.put("templateUseId",templateUseId);
Integer total = this.count(map);
ListPage page = new ListPage();
page.setParams(map);
page.setPage(1);
page.setRows(5);
SuccessResultList<List<TemplateViewRecordDTO>> list = this.listPage(page);
map.clear();
map.put("total",total);
map.put("list",list);
return map;
}
@Override
public void save(TemplateViewRecordVO templateViewRecordVO) {
saveReturnId(templateViewRecordVO);

View File

@ -279,6 +279,10 @@
card_template_forwarding_record t1
WHERE
t1.is_delete = 0
<if test="templateUseId != null and templateUseId != ''">
AND t1.template_use_id = #{templateUseId}
</if>
</select>

View File

@ -6,11 +6,6 @@
<result column="card_template_view_record_id" property="cardTemplateViewRecordId"/>
<result column="template_use_id" property="templateUseId"/>
<result column="card_template_view_user_id" property="cardTemplateViewUserId"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="templateViewRecordBO" type="cn.com.tenlion.pojo.bos.templateviewrecord.TemplateViewRecordBO">
@ -150,12 +145,7 @@
SELECT
t1.card_template_view_record_id,
t1.template_use_id,
t1.card_template_view_user_id,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
t1.card_template_view_user_id
FROM
card_template_view_record t1
WHERE
@ -174,6 +164,10 @@
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="templateUseId != null and templateUseId != ''">
AND t1.template_use_id = #{templateUseId}
</if>
ORDER BY t1.creator DESC
</select>
<!-- 列表 -->
@ -246,6 +240,10 @@
card_template_view_record t1
WHERE
t1.is_delete = 0
<if test="templateUseId != null and templateUseId != ''">
AND t1.template_use_id = #{templateUseId}
</if>
</select>
</mapper>

View File

@ -73,7 +73,7 @@
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">商品视频</label>
<label class="layui-form-label">店铺视频</label>
<div class="layui-input-block">
<input type="hidden" id="shopVideo" name="shopVideo">
<div class="layui-btn-container" id="shopVideoFileBox" style="border: 1px solid #e6e6e6;"></div>
@ -92,7 +92,7 @@
{{# } }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="商品视频最多1个" data-name="shopVideo" lay-filter="shopVideoUploadFile">
<a href="javascript:void(0);" lay-form-button data-explain="店铺视频最多1个" data-name="shopVideo" lay-filter="shopVideoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
@ -153,18 +153,12 @@
<div class="layui-form-item">
<label class="layui-form-label">店铺地址</label>
<div class="layui-input-block">
<input type="hidden" id="shopLongitude" name="shopLongitude" value="">
<input type="hidden" id="shopLatitude" name="shopLatitude" value="">
<input type="text" id="shopAddress" name="shopAddress" class="layui-input" value="" placeholder="请输入店铺详细地址" maxlength="255" lay-verify="required">
</div>
</div>
<input type="hidden" id="shopLongitude" name="shopLongitude" value="">
<input type="hidden" id="shopLatitude" name="shopLatitude" value="">
<div class="layui-row">
<div class="layui-inline">
<input type="text" class="layui-input search-item" name="searchMapId" id="searchMapId" value="">
</div>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id = "searchMap">
<i class="fa fa-lg fa-search"></i>
</button>
<div class="layui-col-md12 layui-col-sm12" style="padding: 0 0px;">
<div id="mapContainer" style="width: 100%;height: 350px;"></div>
</div>
@ -198,7 +192,12 @@
var laydate = layui.laydate;
var map;
var viewerObj = {};
var initLongitude = '109.85017859252311';
var initLatitude = '40.66017700460503';
//行业信息单击事件
$(document).on('click', '#industryNames', function() {
top.dialog.dialogData.industryIds = '';
top.dialog.dialogData.industryNames = '';
@ -228,14 +227,7 @@
});
});
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#openDate',
format: 'yyyy-MM-dd'
});
}
// 初始化营业执照图片上传
function initBusinessLicenseUploadFile() {
@ -386,6 +378,7 @@
});
}
//初始化百度地图
function initMap(longitude, latitude) {
map = new BMap.Map("mapContainer", {enableMapClick: false,});
var point = new BMap.Point(longitude, latitude);
@ -395,6 +388,8 @@
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
map.addControl(new BMap.MapTypeControl());
map.enableScrollWheelZoom();//启用地图滚轮放大缩小
map.enableContinuousZoom();//开启缩放平滑
// 点击获取地址
var geocoder= new BMap.Geocoder();
mapMarkPoint(map, point);
@ -405,51 +400,15 @@
point = new BMap.Point(e.point.lng, e.point.lat);
mapMarkPoint(map, point);
geocoder.getLocation(e.point, function(rs) {
$('#address').val(rs.address);
$('#shopAddress').val(rs.address);
});
});
}
initMap('109.85017859252311', '40.66017700460503');
function mapMarkPoint(map, point) {
var marker = new BMap.Marker(point);
map.addOverlay(marker);
}
$("#searchMap").on('click',function(){
var searchInput = $('#searchMapId').val();
if (!searchInput) {
layer.msg("查询内容不能为空");
return false;
}
var localSearch = new BMap.LocalSearch(map);
localSearch.setSearchCompleteCallback(function (msg) {
if (localSearch.getStatus() == BMAP_STATUS_SUCCESS) {
var poi = msg.getPoi(0);
if (poi) {
initNewMap(poi.point.lng, poi.point.lat);
$('#longitude').val(poi.point.lng);
$('#latitude').val(poi.point.lat);
}
} else {
layer.msg("没有查询结果");
}
});
localSearch.search(searchInput);
});
function initNewMap(x, y) {
createMap(x, y);
}
//创建地图函数:
function createMap(x, y) {
initMap(x, y);
}
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
function refreshDownloadTemplet(fileName, file) {
var dataRander = {};
@ -501,38 +460,29 @@
}
}
// 初始化审核时间时间戳
function initAuditDateDateTime() {
laydate.render({
elem: '#auditDate',
type: 'datetime',
value: new Date(),
trigger: 'click'
});
}
// 初始化开业时间日期
function initOpenDateDate() {
laydate.render({
elem: '#openDate',
type: 'date',
value: new Date(),
trigger: 'click'
format: 'yyyy-MM-dd'
});
}
// 初始化内容
function initData() {
initDate();
initBusinessLicenseUploadFile();
initShopLogoUploadFile();
initShopVideoUploadFile();
initAuditDateDateTime();
initOpenDateDate();
initMap(initLongitude, initLatitude);
}
initData();
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 提交表单
form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) {

View File

@ -22,12 +22,7 @@
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item">
<label class="layui-form-label">主键</label>
<div class="layui-input-block">
<input type="text" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入主键" maxlength="36">
</div>
</div>
<input type="hidden" id="shopTemplateId" name="shopTemplateId" value="">
<div class="layui-form-item">
<label class="layui-form-label">店铺名称</label>
<div class="layui-input-block">
@ -41,69 +36,137 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">店铺星级最高5星通过用户评价自动计算</label>
<label class="layui-form-label">店铺行业</label>
<div class="layui-input-block">
<input type="number" step="0.01" id="shopStar" name="shopStar" class="layui-input" value="" placeholder="请输入店铺星级最高5星通过用户评价自动计算" lay-verify="required">
<input type="hidden" id="industryIds" name="industryIds" class="layui-input" value="" maxlength="255">
<input type="text" id="industryNames" name="industryNames" class="layui-input" value="" placeholder="点击选择店铺行业" maxlength="255">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">店铺LOGO文件ID</label>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">店铺LOGO</label>
<div class="layui-input-block">
<input type="text" id="shopLogo" name="shopLogo" class="layui-input" value="" placeholder="请输入店铺LOGO文件ID" maxlength="36">
<input type="hidden" id="shopLogo" name="shopLogo">
<div class="layui-btn-container" id="shopLogoFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="shopLogoFileDownload" type="text/html">
{{# var fileName = 'shopLogo'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="shopLogoRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="商品LOGO" data-name="shopLogo" lay-filter="shopLogoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">用户评价分数满分10分通过用户对商品的满意度计算</label>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">商品视频</label>
<div class="layui-input-block">
<input type="number" step="0.01" id="userEvaluate" name="userEvaluate" class="layui-input" value="" placeholder="请输入用户评价分数满分10分通过用户对商品的满意度计算" lay-verify="required">
<input type="hidden" id="shopVideo" name="shopVideo">
<div class="layui-btn-container" id="shopVideoFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="shopVideoFileDownload" type="text/html">
{{# var fileName = 'shopVideo' }}
{{# if(d[fileName] != '') { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-video-box">
<div id="{{fileName}}{{i}}" style="width:300px; height:200px;"></div>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-video" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="shopVideoRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="商品视频最多1个" data-name="shopVideo" lay-filter="shopVideoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">营业执照文件ID</label>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">营业执照</label>
<div class="layui-input-block">
<input type="text" id="businessLicense" name="businessLicense" class="layui-input" value="" placeholder="请输入营业执照文件ID" maxlength="36">
<input type="hidden" id="businessLicense" name="businessLicense">
<div class="layui-btn-container" id="businessLicenseFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="businessLicenseFileDownload" type="text/html">
{{# var fileName = 'businessLicense'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="businessLicenseRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="营业执照" data-name="businessLicense" lay-filter="businessLicenseUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核状态 0:待审核1:审核通过,-1:审核不通过</label>
<div class="layui-input-block">
<input type="number" id="auditStatus" name="auditStatus" class="layui-input" value="" placeholder="请输入审核状态0:待审核1:审核通过,-1:审核不通过" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核时间</label>
<div class="layui-input-block">
<input type="text" id="auditDate" name="auditDate" class="layui-input" value="" placeholder="请选择审核时间" lay-verify="required" readonly style="cursor: pointer;">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核结果,审核失败原因</label>
<div class="layui-input-block">
<input type="text" id="auditResult" name="auditResult" class="layui-input" value="" placeholder="请输入审核结果,审核失败原因" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否营业0:未开业1:开业中</label>
<div class="layui-input-block">
<input type="number" id="isOpen" name="isOpen" class="layui-input" value="" placeholder="请输入是否营业0:未开业1:开业中" lay-verify="required">
<div class="layui-form-item" pane>
<label class="layui-form-label">是否营业</label>
<div class="layui-input-block layui-form">
<input type="radio" name="isOpen" value="0" title="未开业">
<input type="radio" name="isOpen" value="1" title="开业中" checked>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">开业时间</label>
<div class="layui-input-block">
<input type="text" id="openDate" name="openDate" class="layui-input" value="" placeholder="请选择开业时间" lay-verify="required" readonly style="cursor: pointer;">
<input type="text" id="openDate" name="openDate" class="layui-input" value="" placeholder="请选择开业时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label">是否注销</label>
<div class="layui-input-block layui-form">
<input type="radio" name="isLogOff" value="0" title="未注销">
<input type="radio" name="isLogOff" value="1" title="已注销" checked>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否注销0:未注销1:已注销</label>
<label class="layui-form-label">店铺地址</label>
<div class="layui-input-block">
<input type="number" id="isLogOff" name="isLogOff" class="layui-input" value="" placeholder="请输入是否注销0:未注销1:已注销" lay-verify="required">
<input type="hidden" id="shopLongitude" name="shopLongitude" value="">
<input type="hidden" id="shopLatitude" name="shopLatitude" value="">
<input type="text" id="shopAddress" name="shopAddress" class="layui-input" value="" placeholder="请输入店铺详细地址" maxlength="255" lay-verify="required">
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12" style="padding: 0 0px;">
<div id="mapContainer" style="width: 100%;height: 350px;"></div>
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
@ -112,6 +175,7 @@
</div>
</div>
</div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=oWU9RD4ihDHAafexgI6XOrTK8lDatRju"></script>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
@ -131,6 +195,39 @@
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
var initLongitude= '109.85017859252311';
var initLatitude= '40.66017700460503'
//行业点击事件
$(document).on('click', '#industryNames', function() {
top.dialog.dialogData.industryIds = '';
top.dialog.dialogData.industryNames = '';
top.dialog.open({
url: top.restAjax.path('route/industry/industry-tree-check.html', []),
title: '选择行业信息',
width: '1040px',
height: '98%',
onClose: function(data) {
var ids = '';
var names = '';
var selectArray = top.dialog.dialogData.selectArray;
if(selectArray != null && selectArray.length > 0) {
var selectedIds = '';
for (var i = 0, item; item = selectArray[i++];) {
if(ids.length > 0) {
ids += ',';
names += ',';
}
ids += item.id;
names += item.name;
}
}
$("#industryIds").val(ids);
$("#industryNames").val(names);
}
});
});
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
@ -171,6 +268,156 @@
});
}
// 初始化营业执照图片上传
function initBusinessLicenseUploadFile() {
var files = $('#businessLicense').val();
initFileList('businessLicense', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(businessLicenseUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(businessLicenseRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化店铺LOGO图片上传
function initShopLogoUploadFile() {
var files = $('#shopLogo').val();
initFileList('shopLogo', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(shopLogoUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(shopLogoRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化店铺视频最多1个视频上传
function initShopVideoUploadFile() {
var files = $('#shopVideo').val();
initFileList('shopVideo', files, initVideo);
form.on('button(shopVideoUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'video',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, initVideo);
}
}
});
});
form.on('button(shopVideoRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, initVideo);
});
}
// 初始化视频
function initVideo(fileName, data) {
for(var i = 0, item; item = data[i++];) {
@ -186,26 +433,55 @@
}
}
// 初始化审核时间时间戳
function initAuditDateDateTime() {
laydate.render({
elem: '#auditDate',
type: 'datetime',
value: new Date(),
trigger: 'click'
});
}
// 初始化开业时间日期
function initOpenDateDate() {
laydate.render({
elem: '#openDate',
type: 'date',
value: new Date(),
trigger: 'click'
});
}
function initMap(longitude, latitude) {
if(longitude == '' || latitude == ''){
longitude = initLongitude;
latitude = initLatitude;
}
map = new BMap.Map("mapContainer", {enableMapClick: false,});
var point = new BMap.Point(longitude, latitude);
map.centerAndZoom(point, 13);
map.disableDoubleClickZoom();
map.addControl(new BMap.NavigationControl());
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
map.addControl(new BMap.MapTypeControl());
map.enableScrollWheelZoom();//启用地图滚轮放大缩小
map.enableContinuousZoom();//开启缩放平滑
// 点击获取地址
var geocoder= new BMap.Geocoder();
mapMarkPoint(map, point);
map.addEventListener("click", function(e) {
map.clearOverlays();
$('#shopLongitude').val(e.point.lng);
$('#shopLatitude').val(e.point.lat);
point = new BMap.Point(e.point.lng, e.point.lat);
mapMarkPoint(map, point);
geocoder.getLocation(e.point, function(rs) {
$('#shopAddress').val(rs.address);
});
});
}
function mapMarkPoint(map, point) {
var marker = new BMap.Marker(point);
map.addOverlay(marker);
}
// 初始化内容
function initData() {
@ -215,10 +491,11 @@
for(var i in data) {
dataFormData[i] = data[i] +'';
}
dataFormData['industryNames'] = data['industryName']
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
initAuditDateDateTime();
initOpenDateDate();
initMap(data.shopLongitude, data.shopLatitude);
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {