记得上下班打卡 | git大法好,push需谨慎

Commit dfb30545 authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/0727RecommendActive' into 0727RecommendActive

parents b534b809 8a1e132a
......@@ -224,10 +224,15 @@
</div>
</div>
<div class="basis_data">
<a class="btn btn-primary btn-xs" href="javascript:void(0)">添加dom</a>
<span>
<em class="required"></em>
</span>
<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="addDom()">添加推荐</a>
</div>
<!-- -->
......@@ -253,7 +258,9 @@
let itemId = Number(getUrlParms('id'))
let affiliatedUrl = ['', 'goblin/common/sku', 'goblin/common/mix', 'kylin/performances/roadShow/performance/status', 'compilations/goodsList']
let isOneDom = $('#addClassify2').find($('.addAvatarItem')).length === 1 // 判断是否默认一组表单
let isOneDom = $('#addClassify2').find($('.addAvatarItem')).length // 判断是否默认一组表单
console.log('isOneDom', isOneDom)
// init
$(function() {
......@@ -272,6 +279,46 @@
});
});
// 监听 模糊搜索
let search = new searchSelect('#search', [], function(val) {
let _params = {}
if (activeTypeChangeVal === 1) {
_params['type'] = 1
_params['title'] = val
} else if (activeTypeChangeVal === 2) { // 组合购
_params['title'] = val
} else if (activeTypeChangeVal === 3) { // 演出
_params['status'] = '(3,6,7,9,10)'
_params['title'] = val
} else { // 商品
_params['name'] = 1
_params['title'] = val
}
$.ajax({
type: 'get',
url: ctx + currentUrl,
contentType: "application/json;charset=UTF-8",
data: _params,
success: function(res) {
let forData = activeTypeChangeVal === 3 ? res.value : res.data
let _data = forData.map(item => {
if (activeTypeChangeVal === 1) { // NFT
return { id: item.spuId, value: item.spuName }
} else if (activeTypeChangeVal === 2) {
return { id: item.mixId, value: item.name }
} else if (activeTypeChangeVal === 3) {
return { id: item.performancesId, value: item.title }
} else if (activeTypeChangeVal === 4) { // 商品
return { id: item.spuId, value: item.name }
}
})
search.update(_data)
}
})
})
search.search(true)
}) // init end
getPageData() // 最开始加载
......@@ -289,14 +336,35 @@
list = res.list
$('#activeName').attr('value', res.name)
$('#activeType').find(`option[value=${res.activeType}]`).attr('selected', true)
$('#search input').attr('value', res.activeBindId)
$('#status').find(`option[value=${res.status}]`).attr('selected', true)
$('#startTime').attr('value', res.startTime)
$('#endTime').attr('value', res.endTime)
assembleDom(list)
// 创建监听
setTimeout(() => {
for (let i = 0; i < list.length; i++) {
createListenerSearch(i + 1)
}
}, 500)
// 回显 search
setTimeout(() => {
for (let i = 0; i < list.length; i++) {
$('#listRemoteSearch' + (i + 1) + ' input').attr('value', list[i].recommendActiveId)
$('#listActiveType' + (i + 1)).find(`option[value=${list[i].type}]`).attr('selected', true)
}
}, 800)
} else {
......@@ -316,7 +384,7 @@
<span class="span-label"><i style="color: red;">*</i>推荐商品:</span>
<div class="search-wrapper">
<div class="search-wrapper" style="margin-bottom: 15px;">
<div id="listRemoteSearch${index + 1}" placeholder="请搜索" name="seaarchSelect${index + 1}"></div>
<div id="listRemoteSearch${index + 1}" placeholder="请搜索" name="seaarchSelect${index + 1}" class="weqewewe"></div>
</div>
</div>
</div>
......@@ -344,13 +412,13 @@
<span class="span-label"><i style="color: red;">*</i>推荐商品:</span>
<div class="search-wrapper">
<div class="search-wrapper" style="margin-bottom: 15px;">
<div id="listRemoteSearch${index}" placeholder="请搜索" name="seaarchSelect${index}"></div>
<div id="listRemoteSearch${isOneDom + 1}" placeholder="请搜索" name="seaarchSelect${isOneDom + 1}"></div>
</div>
</div>
</div>
<div class="selectClassifyOne">
<span class="span-label"><i style="color: red;">*</i>推荐类型:</span>
<select id="listActiveType${index}" class="form-control m-b" style="width: 170px;">
<select id="listActiveType${isOneDom + 1}" class="form-control m-b" style="width: 170px;">
<option value="">所有</option>
<option value="1">NFT</option>
<option value="2">组合购</option>
......@@ -361,8 +429,18 @@
// 只有一组,可添加
if (isOneDom) {
if (1) {
console.log('只有一组,可添加', isOneDom)
$('#addClassify2').append(dynamicAddDom)
setTimeout(() => {
// 监听 模糊搜索
new searchSelect(`#listRemoteSearch${isOneDom + 1}`, [], function(val) {
searchAjax(val, isOneDom + 1)
})
}, 500)
} else {
layer.msg('不能添加')
}
......@@ -378,46 +456,50 @@
new searchSelect(`#listRemoteSearch${index}`, [], function(val) {
searchAjax(val, index)
})
}
function searchAjax (val, index) {
let _selectVal = $("#listActiveType" + index).find("option:selected").val() // 当前子select
console.log('ajax', _selectVal)
let _params = {}
if (_selectVal === 1) {
_params['type'] = 1
_params['title'] = val
} else if (_selectVal === 2) { // 组合购
_params['title'] = val
} else if (_selectVal === 3) { // 演出
_params['status'] = '(3,6,7,9,10)'
_params['title'] = val
} else { // 商品
_params['name'] = 1
_params['title'] = val
}
$.ajax({
type: 'get',
url: ctx + affiliatedUrl[_selectVal - 1],
contentType: "application/json;charset=UTF-8",
data: _params,
success: function(res) {
let forData = _selectVal === 3 ? res.value : res.data
let _data = forData.map(item => {
if (_selectVal === 1) { // NFT
return { id: item.spuId, value: item.spuName }
} else if (_selectVal === 2) {
return { id: item.mixId, value: item.name }
} else if (_selectVal === 3) {
return { id: item.performancesId, value: item.title }
} else { // 商品
return { id: item.spuId, value: item.name }
}
})
search.update(_data)
let _selectVal = $("#listActiveType" + index).find("option:selected").val() // 当前子select val
if (_selectVal) {
let _params = {}
if (_selectVal === 1) {
_params['type'] = 1
_params['title'] = val
} else if (_selectVal === 2) { // 组合购
_params['title'] = val
} else if (_selectVal === 3) { // 演出
_params['status'] = '(3,6,7,9,10)'
_params['title'] = val
} else { // 商品
_params['name'] = 1
_params['title'] = val
}
})
$.ajax({
type: 'get',
url: ctx + affiliatedUrl[_selectVal],
contentType: "application/json;charset=UTF-8",
data: _params,
success: function(res) {
let forData = _selectVal === 3 ? res.value : res.data
let _data = forData.map(item => {
if (_selectVal === 1) { // NFT
return { id: item.spuId, value: item.spuName }
} else if (_selectVal === 2) {
return { id: item.mixId, value: item.name }
} else if (_selectVal === 3) {
return { id: item.performancesId, value: item.title }
} else { // 商品
return { id: item.spuId, value: item.name }
}
})
search.update(_data)
}
})
}
}
// 保存/更新
......
......@@ -7,6 +7,12 @@
body .layui-layer-btn {
display: none !important;
}
.datetimepicker {
z-index: 99999999 !important;
}
/*.layui-layer {*/
/* z-index: 900 !important;*/
/*}*/
#layui-layer1 {
z-index: 1001 !important;
}
......@@ -256,7 +262,7 @@
<div class="search-wrapper">
<div class="search-wrapper" style="margin-bottom: 15px;">
<!-- 关联 模糊搜索 -->
<div id="listRemoteSearch1" placeholder="请搜索" name="seaarchSelect"></div>
<div id="listRemoteSearch1" placeholder="请搜索" name="listSeaarchSelect"></div>
</div>
</div>
</div>
......@@ -407,7 +413,7 @@
return { id: item.mixId, value: item.name }
} else if (activeTypeChangeVal === 3) {
return { id: item.performancesId, value: item.title }
} else { // 商品
} else if (activeTypeChangeVal === 4) { // 商品
return { id: item.spuId, value: item.name }
}
})
......@@ -420,6 +426,8 @@
// 监听 模糊搜索 list
let listRemoteSearch1 = new searchSelect('#listRemoteSearch1', [], function(val) {
console.log('activeTypeChangeValChild', activeTypeChangeValChild)
let _params = {}
if (activeTypeChangeValChild === 1) {
_params['type'] = 1
......@@ -447,7 +455,7 @@
return { id: item.mixId, value: item.name }
} else if (activeTypeChangeValChild === 3) {
return { id: item.performancesId, value: item.title }
} else { // 商品
} else if (activeTypeChangeValChild === 4) { // 商品
return { id: item.spuId, value: item.name }
}
})
......@@ -499,7 +507,7 @@
// 保存关联活动内容
function saveListAffiliated() {
let _recommendBindId = document.getElementsByName("recommendBindId")[0].value
let _recommendBindId = document.getElementsByName("listSeaarchSelect")[0].value
let _type = $("#listActiveType1").find("option:selected").val() // 已经获取
listData.push({
recommendBindId: _recommendBindId,
......@@ -517,7 +525,7 @@
title: '增加活动', // 不显示标题
content: $('#addClassify'), // 捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
cancel: function(res){
$("#addClassify").empty()
// $("#addClassify").empty()
// layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', {time: 5000, icon:6});
}
});
......@@ -531,8 +539,8 @@
shade: .3,
title: '增加关联推荐', // 不显示标题
content: $('#addClassify2'), // 捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
cancel: function(res){
$("#addClassify2").empty()
cancel: function(res) {
// $("#addClassify2").empty()
// layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', {time: 5000, icon:6});
}
});
......@@ -540,6 +548,9 @@
// 设置 代入的 点击
$('#listActiveType1').find(`option[value=${index}]`).attr('selected', true)
activeTypeChangeValChild = index
currentChildUrl = affiliatedUrl[activeTypeChangeValChild]
}
......@@ -551,13 +562,11 @@
// 关闭模态框
function closeModal () {
$("#addClassify").empty()
$(".layui-layer-close1").click();
layer.close(layer.index)
}
// 关闭模态框2
function closeModal2 () {
$("#addClassify2").empty()
layer.close(layer.index)
}
......
......@@ -62,6 +62,7 @@ public class KylinRecommendActiveServiceImpl extends ServiceImpl<KylinRecommendA
r.setUpdatedAt(LocalDateTime.now());
r.setDelTag(0);
r.setRecommendActiveId(kylinRecommendActive.getRecommendId());
r.setRecommendRelationId(IDGenerator.nextSnowId());
kylinRecommendActiveRelationMapper.insert(r);
});
//更新redis数据
......
......@@ -148,7 +148,7 @@ public class GoblinMix implements Serializable {
/**
* 店铺id
*/
private Integer storeId;
private String storeId;
/**
* 补充字段
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment