之前给大家讲过ai关键词获客,同行博主获客,精准视频获客,今天给大家讲讲你创建完的任务都会保存起来方便你下次创建,即我们关键词库;
这里能统计出你每一个关键词获客任务里获取的视频,评论和意向客户数
<div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">关键词库列表</h6>
</div>
<div class="card-body">
<div style="margin-bottom: 10px;overflow: hidden;">
<div style="float: left;">
<a href="javascript:;" class="btn btn-success btn-add-keywords" data-id="0">添加关键词</a>
<button class="btn btn-danger" onclick="batchDelete()">批量删除</button>
</div>
<div style="float: right;">
<form class="form-inline" role="form">
<div class="form-group" style="margin-right: 10px;">
<label class="" style="margin-right: 10px;">添加时间</label>
<input name="time_range" type="text" id="time-range" class="form-control" placeholder="请选择添加时间" value="<{$time_range}>" style="width: 190px;" autocomplete="off">
</div>
<div class="form-group">
<label class="" style="margin-right: 10px;">关键词</label>
<input name="keyword" type="text" class="form-control" placeholder="请输入关键字" value="<{$keyword}>">
</div>
<button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜索</button>
</form>
</div>
</div>
<table class="table">
<thead>
<tr>
<th><input type="checkbox" class="table-select-all-input" value="0"></th>
<th>关键词</th>
<th>运行状态</th>
<th>数据漏斗</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<{foreach $keywords_list as $list}>
<tr>
<td>
<input type="checkbox" class="table-select-input" value="<{$list['k_id']}>">
</td>
<td><{$list['k_name']}></td>
<td>
<p>运行次数:<{$list['k_open_num']}></p>
<p>上次分析时间:<{if $list['k_last_jk_time']}><{date('m-d H:i',$list['k_last_jk_time'])}><{else}>--<{/if}></p>
<p>添加时间:<{date('m-d H:i:s',$list['k_create_time'])}></p>
</td>
<td>
<p>
1、视频挖掘:<br/>
单次:<{$list['k_video_dig_last']}> || 总计:<{$list['k_video_dig_total']}>
</p>
<p>
2、评论挖掘:<br/>
单次:<{$list['k_comment_dig_last']}> || 总计:<{$list['k_comment_dig_total']}>
</p>
<p>
3、用户挖掘:<br/>
单次:<{$list['k_user_dig_last']}> || 总计:<{$list['k_user_dig_total']}>
</p>
</td>
<!--
<td>
获取询盘数:<a href="/dydqtshoppc/scane/pinglunList?key_id=<{$list['k_id']}>"><{$list['monitor_pinglun_count']}></a><br/>
检索视频数:<a href="/dydqtshoppc/scane/videoList?key_id=<{$list['k_id']}>"><{$list['monitor_video_count']}></a>
</td>
-->
<td>
<{if $list['task']}>
<a href="javascript:;" class="btn btn-info btn-sm " onclick="addEditTask(this)" data-id="<{$list['task']['t_id']}>" data-tip="<{$list['k_name']}>" data-rid="<{$list['k_id']}>">编辑任务</a>
<{else}>
<a href="javascript:;" class="btn btn-success btn-sm " onclick="addEditTask(this)" data-id="0" data-tip="<{$list['k_name']}>" data-rid="<{$list['k_id']}>">创建任务</a>
<{/if}>
<a href="javascript:;" class="btn btn-danger btn-sm " onclick="confirmDelete(this)" data-id="<{$list['k_id']}>">删除</a>
</td>
</tr>
<{/foreach}>
</tbody>
</table>
<div>
<{$pageHtml}>
</div>
</div>
</div>
</div>
<script>
layui.use(['laydate'],function () {
var laydate = layui.laydate;
//日期范围选择
laydate.render({
elem: '#time-range',
range: '~'
});
});
/**
* 添加/编辑关键词
*/
$('.btn-add-keywords').on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '添加/编辑关键词',
content: '/dydqtshoppc/scane/addKeywords?id=' + id,
area: '500px',
success: function(layero, index) {
//找到当前弹出层的iframe元素
let iframe = layui.$(layero).find('iframe');
//设定iframe的高度为当前iframe内body的高度
let iheight = Math.min(window.innerHeight-50, 750, iframe[0].contentDocument.body.offsetHeight);
iframe.css('height', iheight);
//重新调整弹出层的位置,保证弹出层在当前屏幕的中间位置
$(layero).css('top', (window.innerHeight - iheight -42) / 2);
}
});
});
/**
* 添加关键词
*/
$('.xl_to_keywords').on('click', function () {
var id = $(this).data('id');
window.location.href = '/dydqtshoppc/scane/xlToKeywords?id=' + id;
/*layer.open({
type: 2,
title: '添加关键词',
content: '/dydqtshoppc/scane/xlToKeywords?id=' + id,
area: ['800px']
});*/
});
function addEditTask(ele) {
let tid = $(ele).data('id');
let tip = encodeURIComponent($(ele).data('tip'));
let rid = $(ele).data('rid');
layer.open({
type: 2,
title: '添加/编辑任务',
content: '/dydqtshoppc/task/addTask?type=keyword&platform=<{$platform_type}>&tid=' + tid+"&rid="+rid+"&tip="+tip,
area: '700px',
success: function(layero, index) {
//找到当前弹出层的iframe元素
let iframe = layui.$(layero).find('iframe');
//设定iframe的高度为当前iframe内body的高度
let iheight = Math.min(window.innerHeight-50, 750, iframe[0].contentDocument.body.offsetHeight);
iframe.css('height', iheight);
//重新调整弹出层的位置,保证弹出层在当前屏幕的中间位置
$(layero).css('top', (window.innerHeight - iheight -42) / 2);
}
});
}
/**
* 删除关键词
*/
function confirmDelete(ele) {
layer.confirm('确定删除当前关键词?', {
title:'提示',
btn: ['确定','取消'] //按钮
}, function(){
var id = $(ele).data('id');
if (id.length <1){
layer.msg('请选择要删除关键词');
return false;
}
layer.load(1);
$.ajax({
url: '/dydqtshoppc/scane/deleteKeywords',
type: 'post',
data: {
id
},
dataType: 'json',
success: function (res) {
layer.closeAll();
layer.msg(res.em, {time: 2000}, function () {
if (res.ec == 200) {
window.location.reload();
}
});
},
})
});
}
//批量删除
function batchDelete(){
var ids = [];//批量id数组
$("input[class='table-select-input']:checked").each(function() {
ids.push($(this).val());
});
if(ids.length==0){
layer.msg("请选择关键词数据");
return false;
}
layer.confirm('确定要删除吗', {icon: 3, title:'温馨提醒'}, function(index){
layer.load(1);
$.ajax({
url: '/dydqtshoppc/scane/batchDelKeyword',
type: 'post',
data: {
ids:ids,
},
dataType: 'json',
success: function (res) {
layer.closeAll();
layer.msg(res.em, {time: 2000}, function () {
if (res.ec == 200) {
layer.close(index);
window.location.reload();
}
});
},
})
});
}
</script>