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

Commit 0c602c72 authored by dongchun's avatar dongchun

新增正在下单删除店铺功能

parent 367d1d2c
......@@ -5,7 +5,10 @@
<th:block th:include="include :: select2-css" />
<link rel="stylesheet" href="">
<style>
input {
height: 34PX;
line-height: 34PX;
}
.required {
font-style: normal;
color: red;
......@@ -56,6 +59,11 @@
line-height: 45px;
padding-left: 60px;
}
.form-control,.layui-input {
height: 34PX;
line-height: 34PX;
}
</style>
</head>
<body>
......@@ -222,7 +230,7 @@
count++;
let body = '';
if (item) {
body+=`<div class="activityStore_item" data-newTag="">
body+=`<div class="activityStore_item" id="activityStore_item${count}" data-newTag="">
<div class="input-group" style="margin-right: 12px;">
<input type="text" class="form-control storeList item${count} itemDisabled" data-id="${item.storeId}" value="${item.storeName}" placeholder="搜索店铺名称">
<div class="input-group-btn">
......@@ -231,9 +239,10 @@
</div>
</div>
<input type="text" class="layui-input form-control timeSp startTime${count} itemDisabled" id="startTime" value="${item.showTime}" autocomplete="off" placeholder="配置活动时间">
<button type="button" class="btn btn-danger" onclick="delItem('${count}')">删除</button>
</div>`
} else {
body+=`<div class="activityStore_item" data-newTag="1">
body+=`<div class="activityStore_item" id="activityStore_item${count}" data-newTag="1">
<div class="input-group" style="margin-right: 12px;">
<input type="text" class="form-control storeList item${count}" placeholder="搜索店铺名称">
<div class="input-group-btn">
......@@ -242,6 +251,7 @@
</div>
</div>
<input type="text" class="layui-input form-control timeSp startTime${count}" id="startTime" autocomplete="off" placeholder="配置活动时间">
<button type="button" class="btn btn-danger" onclick="delItem('${count}')">删除</button>
</div>`
}
$(".activityStore").append(body)
......@@ -256,6 +266,12 @@
});
});
}
function delItem (num) {
// let domData = $(".activityStore_item");
// console.log(domData.length)
$('#activityStore_item'+num+'').attr('data-id', 1);
$('#activityStore_item'+num+'').css('display', 'none');
}
function nextBtn (params) {
if (!$("#selectShow").attr('data-id')) {
return layer.msg('请选择演出进行创建!')
......@@ -275,6 +291,8 @@
promiseMethods('/goblin/marketing/zhengzai/change','post',data).then(res => {
if (res.code == 0) {
layer.msg('修改活动成功,请配置活动对应店铺!')
} else {
layer.msg(res.message)
}
})
......@@ -285,6 +303,8 @@
layer.msg('添加活动成功,请配置活动对应店铺!')
$(".content_item").show();
$(".add_footer").show();
} else {
layer.msg(res.message)
}
})
}
......@@ -297,13 +317,26 @@
let domData = $(".activityStore_item");
let flag = false;
Array.prototype.forEach.call(domData,function(item,index){
console.log(item)
obj['marketId'] = marketId;
obj['showTime'] = item.querySelector('.timeSp').value;
obj['storeId'] = item.querySelector('.storeList').getAttribute('data-id');
if (obj['storeId']) {
console.log(item.getAttribute('data-id'), 'dasasd')
if (item.getAttribute('data-id')) {
console.log('??????????')
obj['delTag'] = 1;
} else {
obj['delTag'] = 0;
}
} else {
obj['delTag'] = 0;
}
if (!item.querySelector('.timeSp').value || !item.querySelector('.storeList').getAttribute('data-id')) {
flag = true;
}
obj['delTag'] = 0;
// obj['delTag'] = 0;
if (item.getAttribute('data-newTag')) {
obj['newTag'] = 1;
} else {
......@@ -324,7 +357,7 @@
}
promiseMethods('/goblin/marketing/zhengzai/store','post', JSON.stringify(data), 'application/json').then(res => {
if (res.code == 0) {
$.operate.successCallback(res);
// $.operate.successCallback(res);
} else {
layer.msg(res.message)
}
......
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