242 lines
8.5 KiB
HTML
242 lines
8.5 KiB
HTML
{extend name="public/base"/}
|
|
{block name="style"}
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
|
{/block}
|
|
{block name="body"}
|
|
<div class="main-box clearfix">
|
|
<header class="main-box-header clearfix">
|
|
<div class="pull-left">
|
|
<ul class="nav nav-tabs">
|
|
<li>
|
|
<a href="{:url('admin/config/themes')}">主题设置</a>
|
|
</li>
|
|
<li class="active">
|
|
<a href="{:url('admin/promotion/index')}">促销活动</a>
|
|
</li>
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<li >
|
|
<a href="{:url('admin/notice/index')}">通知公告</a>
|
|
</li>
|
|
<li >
|
|
<a href="{:url('feedback/index',array('model'=>1))}">小说评论</a>
|
|
</li>
|
|
<li>
|
|
<a href="{:url('admin/message/faceback')}">意见反馈</a>
|
|
</li>
|
|
<li>
|
|
<a href="{:url('admin/message/index')}">消息</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="{:url('admin/jubao/index')}">举报信息</a>
|
|
</li>
|
|
{/if}
|
|
</ul>
|
|
</div>
|
|
<div class="pull-right">
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<a class="btn btn-primary" href="{:url('admin/promotion/add?model_id='.$model_id)}">新 增</a>
|
|
<button class="btn btn-danger ajax-post confirm" url="{:url('admin/promotion/del?model_id='.$model_id)}" target-form="ids">删 除</button>
|
|
{/if}
|
|
</div>
|
|
</header>
|
|
<div class="main-box-body clearfix">
|
|
<div class="row">
|
|
<form method="get">
|
|
<div class="col-sm-12 col-md-4 col-lg-3">
|
|
<input type="text" class="form-control" name="keyword" value="{$keyword|default=''}" placeholder="请输入关键字">
|
|
</div>
|
|
{if isset($cate_list)}
|
|
<div class="col-sm-12 col-md-4 col-lg-3">
|
|
<select name="category" id="category" class="form-control">
|
|
<option value="">请选择栏目</option>
|
|
{volist name="cate_list" id="item"}
|
|
<option value="{$item['id']}" {if isset($category) && $item['id'] == $category}selected{/if}>{$item['title_show']}</option>
|
|
{/volist}
|
|
</select>
|
|
</div>
|
|
{/if}
|
|
<div class="col-sm-12 col-md-4">
|
|
<button class="btn btn-primary" type="submit">搜索</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="table-responsive clearfix">
|
|
|
|
<div class="table-responsive clearfix">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<th width="30"><input class="checkbox check-all" type="checkbox"></th>
|
|
{/if}
|
|
<th >ID</th>
|
|
<th>活动名称</th>
|
|
<th>生效时间</th>
|
|
<th>有效订单</th>
|
|
<th>充值金额</th>
|
|
<th>活动链接</th>
|
|
<th>活动开关</th>
|
|
<!--<th>链接</th>--->
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<th>操作</th>
|
|
{/if}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{if condition="empty($list)"}
|
|
{php}
|
|
$cow = count($grid['grids'])+2;
|
|
{/php}
|
|
<tr>
|
|
<td colspan="{$cow}" align="center">暂无数据!</td>
|
|
</tr>
|
|
{else/}
|
|
{volist name="list" id="item"}
|
|
<tr>
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></td>
|
|
{/if}
|
|
<td>{$item.id}</td>
|
|
<td>{$item.title}</td>
|
|
<td>{$item.starttime|date='Y-m-d H:i:s',###}<br/>{$item.endtime|date='Y-m-d H:i:s',###}</td>
|
|
<td>{$item.id|get_activity_paynum}</td>
|
|
<td>{$item.id|get_activity_amount}</td>
|
|
<td><a href="javascript:;" target="_blank" onclick="creatactivity({$item.id})">生成活动链接</a></td>
|
|
<td>
|
|
{if condition="$item['endtime']<time()"}
|
|
已结束
|
|
{else /}
|
|
进行中
|
|
{/if}
|
|
</td>
|
|
<!---
|
|
<td><a href="{:config('web_site_url')}/preferential" target="_blank">点击访问</a></td>
|
|
--->
|
|
{if session('user_auth.group')!=4&&session('user_auth.group')!=3}
|
|
<td>
|
|
{if isset($item['is_top'])}
|
|
{if $item['is_top']}
|
|
<a href="{:url('admin/promotion/settop?model_id='.$model_id,array('id'=>$item['id'],'is_top'=>'0'))}" class="ajax-get">取消置顶</a>
|
|
{else/}
|
|
<a href="{:url('admin/promotion/settop?model_id='.$model_id,array('id'=>$item['id'],'is_top'=>'1'))}" class="ajax-get">置顶</a>
|
|
{/if}
|
|
{/if}
|
|
{if isset($item['status'])}
|
|
{if $item['status']}
|
|
<a href="{:url('admin/promotion/status?model_id='.$model_id,array('id'=>$item['id'],'status'=>'0'))}" class="ajax-get">取消审核</a>
|
|
{else/}
|
|
<a href="{:url('admin/promotion/status?model_id='.$model_id,array('id'=>$item['id'],'status'=>'1'))}" class="ajax-get">审核</a>
|
|
{/if}
|
|
{/if}
|
|
<a href="{:url('admin/promotion/edit?model_id='.$model_id,array('id'=>$item['id']))}" >编辑</a>
|
|
<a href="{:url('admin/promotion/del?model_id='.$model_id,array('id'=>$item['id']))}" class="ajax-get confirm">删除</a>
|
|
</td>
|
|
{/if}
|
|
</tr>
|
|
{/volist}
|
|
{/if}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{$page}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="create-referral-link-modal">
|
|
<div class="modal-dialog" role="document">
|
|
<input type="hidden" name="activityid" id="activityid">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title">生成活动链接</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid">
|
|
<div class="form-group">
|
|
<label class="control-label col-sm-3"><span class="required">*</span>渠道名称</label>
|
|
<div class="col-sm-7">
|
|
<input type="text" class="form-control" maxlength="100" name="title" id="from-title"/>
|
|
<p class="help-block help-block-error"></p>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label col-sm-3"><span class="required">*</span>链接类型</label>
|
|
<div class="col-sm-7">
|
|
<label class="radio-inline">
|
|
<input type="radio" name="urltype" value="2"/>
|
|
<span>内推</span>
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="urltype" value="1"/>
|
|
<span>派单</span>
|
|
</label>
|
|
<p class="help-block help-block-error"></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-create">生成活动链接</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-editable.min.js"></script>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$.fn.editable.defaults.mode = 'popup';
|
|
$.fn.editableform.buttons = '<button type="submit" class="btn btn-success editable-submit btn-mini"><i class="fa fa-check-square-o fa-white"></i></button>' +
|
|
'<button type="button" class="btn editable-cancel btn-mini"><i class="fa fa-times"></i></button>';
|
|
$('.editable').editable();
|
|
})
|
|
function creatactivity(activityid){
|
|
var $modal = $('#create-referral-link-modal');
|
|
$modal.on('show.bs.modal', function (event) {
|
|
$modal.find('#activityid').val(activityid);
|
|
});
|
|
$modal.modal('show');
|
|
}
|
|
$(function () {
|
|
|
|
$('#create-referral-link-modal').find('.btn-create').click(function () {
|
|
var title = $('#from-title').val();
|
|
var activityid = $('#activityid').val();
|
|
if (!title)
|
|
{
|
|
updateAlert('渠道名称不能为空', 'error');
|
|
return false;
|
|
}
|
|
var urltype = $('input[name="urltype"]:checked').val();
|
|
if (!urltype)
|
|
{
|
|
updateAlert('链接类型不能为空', 'error');
|
|
return false;
|
|
}
|
|
|
|
$.ajax({
|
|
url: '{:url("admin/spread/api_save")}',
|
|
type: 'POST',
|
|
contentType: 'application/json',
|
|
data: JSON.stringify({
|
|
types: 5,
|
|
article_id: 0,
|
|
type: 1,
|
|
urltype: urltype,
|
|
title: title,
|
|
activityid: activityid,
|
|
})
|
|
})
|
|
.then(function (result) {
|
|
updateAlert('生成成功', 'info');
|
|
setTimeout(function () {
|
|
window.location.reload()
|
|
}, 1000);
|
|
|
|
})
|
|
});
|
|
})
|
|
</script>
|
|
{/block} |