216 lines
6.4 KiB
HTML
216 lines
6.4 KiB
HTML
{extend name="public/base" /}
|
|
{block name="body"}
|
|
<style>
|
|
.clinhei{width:100%;height:25px;}
|
|
.inp{width:200px;}
|
|
.inpdiv{width:25%;float:left;}
|
|
.inpdivbut{width:10%;float:left;}
|
|
.so{width:80px;height:30px;border:0;margin-top:25px;text-align:center;line-height:30px;cursor: pointer;}
|
|
.tdinp{width:100%;border:0;}
|
|
.up{border:0;cursor: pointer;}
|
|
</style>
|
|
<div class="alert alert-danger alert-dismissable" id="alertmgs" style="display:none;position:fixed;top:10;">
|
|
<button type="button" class="close" data-dismiss="alert"
|
|
aria-hidden="true">
|
|
×
|
|
</button>
|
|
<p>错误!请进行一些更改。</p>
|
|
</div>
|
|
<div class="alert alert-success alert-dismissable" id="alertyes" style="display:none;position:fixed;top:10;">
|
|
<button type="button" class="close" data-dismiss="alert"
|
|
aria-hidden="true">
|
|
×
|
|
</button>
|
|
成功!
|
|
</div>
|
|
<div class="main-box clearfix">
|
|
<header class="main-box-header clearfix">
|
|
<div class="pull-left">
|
|
<h2>抖音链接配置</h2>
|
|
</div>
|
|
|
|
</header>
|
|
<div class="main-box-body clearfix">
|
|
<div class="container">
|
|
<form id="forms" enctype="multipart/form-data">
|
|
|
|
<div class="inpdiv">
|
|
<label for="name">推广链接ID</label>
|
|
<input type="text" class="form-control inp" id="tid" name="tid" placeholder="推广链接ID">
|
|
</div>
|
|
|
|
<div class="inpdiv">
|
|
<label for="name">抖音口令</label>
|
|
<input type="text" class="form-control inp" id="url" name="url">
|
|
</div>
|
|
<div class="inpdiv">
|
|
<label for="name">分类</label>
|
|
<select name="tag" id="tag" class="form-control inp">
|
|
<option value="现代言情">现代言情</option>
|
|
<option value="古代言情">古代言情</option>
|
|
<option value="仙侠奇缘">仙侠奇缘</option>
|
|
<option value="历史军事">历史军事</option>
|
|
<option value="民国奇缘">民国奇缘</option>
|
|
<option value="民国情缘">民国情缘</option>
|
|
<option value="都市生活">都市生活</option>
|
|
<option value="都市系统">都市系统</option>
|
|
</select>
|
|
</div>
|
|
<div class="inpdiv">
|
|
<label for="name">排序</label>
|
|
<input type="text" class="form-control inp" id="sort" name="sort">
|
|
</div>
|
|
|
|
<div class="inpdivbut">
|
|
<div class="btn-info so" onclick="formsub('add')">新增</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<div class="clinhei"></div>
|
|
<div class="container">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>推广链接ID</th>
|
|
<th>抖音口令</th>
|
|
<th>分类</th>
|
|
<th>推送排序</th>
|
|
<th>自动复制次数</th>
|
|
<th>推送人群</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody id="tables">
|
|
{volist name="res" id="v"}
|
|
<tr data-id="{$v.id}">
|
|
<td><input type="text" class="tdinp" value="{$v.id}" disabled="disabled"></td>
|
|
<td><input type="text" class="tdinp" value="{$v.tid}" disabled="disabled"></td>
|
|
<td><input type="text" class="tdinp" value="{$v.url}" disabled="disabled"></td>
|
|
<td><input type="text" class="tdinp" value="{$v.tag}" disabled="disabled"></td>
|
|
<td><input type="text" class="tdinp" value="{$v.sort}" disabled="disabled"></td>
|
|
<td><input type="text" class="tdinp" value="{$v.num}" disabled="disabled"></td>
|
|
{if $v.type==1}
|
|
<td><div class="btn btn-success btn-jun" onclick="generate('{$v.id}',0)">中高净值用户</div></td>
|
|
{else}
|
|
<td><div class="btn btn-success btn-jun" onclick="generate('{$v.id}',1)">全部用户</div></td>
|
|
{/if}
|
|
<td class="btn-danger" style="cursor:pointer;" onclick="del('{$v.id}')">删除</td>
|
|
</tr>
|
|
{/volist}
|
|
</tbody>
|
|
</table>
|
|
{$page}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script>
|
|
|
|
function alertmgs(mgs){
|
|
$('#alertmgs').show();
|
|
$('#alertmgs').children('p').html(mgs);
|
|
setTimeout(function(){ gb('no'); }, 3000);
|
|
}
|
|
function alertyes(mgs){
|
|
$('#alertyes').show();
|
|
$('#alertyes').children('p').html(mgs);
|
|
setTimeout(function(){ gb('yes'); }, 3000);
|
|
}
|
|
function gb(type){
|
|
if(type=='yes'){
|
|
$('#alertyes').css('display','none');
|
|
|
|
}else{
|
|
$('#alertmgs').css('display','none');
|
|
}
|
|
}
|
|
|
|
function generate(id,type){
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:url('tiktokurl/up')}",
|
|
data: {
|
|
id:id,
|
|
type:type
|
|
},
|
|
dataType: "json",
|
|
success: function(data){
|
|
alertyes('成功')
|
|
window.location.href=""
|
|
}
|
|
});
|
|
}
|
|
function del(id){
|
|
if(confirm("确定删除这项配置吗?")){
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:url('tiktokurl/del')}",
|
|
data: {id:id},
|
|
dataType: "json",
|
|
success: function(data){
|
|
if(data==1){
|
|
alertyes('删除成功')
|
|
setTimeout(function(){ window.location = ''; }, 1500);
|
|
}else{
|
|
alertmgs('删除失败')
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function formsub(type){
|
|
|
|
var tid = $('#tid').val();
|
|
var url = $('#url').val();
|
|
var tag = $('#tag').val();
|
|
var sort = $('#sort').val();
|
|
|
|
if(tid==''){
|
|
alertmgs('推广链接ID不能为空')
|
|
}else if(url==''){
|
|
alertmgs('抖音链接不能为空')
|
|
}else if(sort==''){
|
|
alertmgs('请填写排序')
|
|
}else{
|
|
var formData = new FormData();
|
|
formData.append("tid", tid);
|
|
formData.append("url",url);
|
|
formData.append("tag",tag);
|
|
formData.append("sort",sort);
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('tiktokurl/add')}",
|
|
data: formData,
|
|
async: false,
|
|
cache: false,
|
|
processData:false,
|
|
contentType:false,
|
|
dataType:"json",
|
|
error: function(request) {
|
|
|
|
},
|
|
success: function(data) {
|
|
console.log(data)
|
|
if(data==1){
|
|
alertyes('添加成功')
|
|
window.location.href=""
|
|
}
|
|
if(data==3){
|
|
alertmgs('该推广ID分类已添加')
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
</script>
|
|
{/block}
|