303 lines
12 KiB
HTML
303 lines
12 KiB
HTML
{extend name="public/base"/}
|
|
{block name="style"}
|
|
|
|
<link rel="stylesheet" href="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.css">
|
|
<script src="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/webuploader/webuploader.css">
|
|
<!-- 配置文件 -->
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/ueditor/ueditor.config.js"></script>
|
|
<!-- 编辑器源码文件 -->
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/ueditor/ueditor.all.min.js"></script>
|
|
<!-- datepicker statr -->
|
|
<link href="__PUBLIC__/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
|
|
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.js"></script>
|
|
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.zh-CN.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/board/board.min.css">
|
|
<!-- datepicker end -->
|
|
|
|
{/block}
|
|
{block name="body"}
|
|
<div class="main-box clearfix">
|
|
<header class="main-box-header clearfix">
|
|
<div class="pull-left">
|
|
<h2>{$meta_title}</h2>
|
|
</div>
|
|
<div class="pull-right">
|
|
{if condition="in_array($group,$access)"}
|
|
<a class="btn btn-primary" href="{:url('admin/volume/add',array('model_id'=>17,'cartoonid'=>$cartoonid))}">新 增</a>
|
|
<a class="btn btn-primary"><input class="check-all" type="checkbox">全选</a>
|
|
<button class="btn btn-danger ajax-post confirm" url="{:url('admin/volume/del?model_id=17',array('cartoonid'=>$cartoonid))}" target-form="ids">删 除</button>
|
|
{/if}
|
|
</div>
|
|
</header>
|
|
<div class="main-box-body clearfix">
|
|
|
|
<div class="col-sm-3">
|
|
<img src="{$info.cartoonspic|get_cover=###,'path'}" style="max-width:100%" />
|
|
<h4>{$info.name}</h4>
|
|
<div style="line-height: 1.7em;margin-top:10px;" class="text-muted">
|
|
|
|
</div>
|
|
<div class="text-muted" style="margin-top:10px;line-height: 1.7em;">
|
|
{$info.intro}
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
<ul class="list-group" style="margin-left:0">
|
|
{volist name="chapterlist" id="item" key="k"}
|
|
<li class="list-group-item chapter-item">
|
|
<input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}">
|
|
<span style="display:inline-block;min-width:26px;">{$item.volumeorder}</span>
|
|
<a href="{:url('admin/volume/edit?model_id=17',array('id'=>$item['id'],'cartoonid'=>$cartoonid))}" >{$item.volumename}</a>
|
|
<span style="font-size:12px;margin-left:5px">
|
|
<span style="color:forestgreen">{$item['isvip']==1?"VIP":"免费"}</span>
|
|
</span>
|
|
<span class="pull-right">
|
|
{if $k <6}
|
|
|
|
<a target="_blank" data-toggle="tooltip" title="文案内容到当前章节,原文链接为下一章" href="{:url('articles/editor',array('model_id'=>23,'cartoonid'=>$cartoonid,'volumeid'=>$item['id'],'mode'=>'img','model'=>2))}">
|
|
<i class="fa fa-link"></i> 生成推广文案
|
|
</a>
|
|
<a title="原文链接为当前章节" href="{:url('spread/add',array('model_id'=>7,'volumeid'=>$item['id'],'modelid'=>2))}">
|
|
<i class="fa fa-link"></i> 获取推广链接
|
|
</a>
|
|
|
|
<a href="#"
|
|
data-toggle="set-force-follow-chapter"
|
|
data-article-id="{$cartoonid}"
|
|
data-volumeorder="{$item['volumeorder']}"
|
|
data-is-paid-article="{if condition="$item['isvip'] eq 1"}true{else}false{/if}">
|
|
设为关注章节
|
|
</a>
|
|
|
|
{/if}
|
|
{if condition="in_array($group,$access)"}
|
|
<a href="{:url('admin/volume/edit?model_id=17',array('id'=>$item['id'],'cartoonid'=>$cartoonid))}">编辑</a>
|
|
<a href="{:url('admin/volume/del?model_id=17',array('id'=>$item['id'],'cartoonid'=>$cartoonid))}" class="ajax-get confirm">删除</a>
|
|
|
|
{/if}
|
|
</span>
|
|
</li>
|
|
{/volist}
|
|
</ul>
|
|
{$chapterlist->render()}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.min.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.custom.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/js/droppable.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/board/board.min.js"></script>
|
|
|
|
<script>
|
|
$(function () {
|
|
var novelId = 29 ;
|
|
var verifiedStatus = 1;
|
|
|
|
$('[data-toggle="tooltip"], [data-toggle="create-referral-link"]').tooltip();
|
|
|
|
$('#view-chapter-modal .chapter-content').css('height', Math.floor($(window).height() * 0.75) + 'px');
|
|
|
|
$(document).on('click', '[data-toggle="view-chapter"]', function () {
|
|
var id = $(this).data('id');
|
|
viewChapter(id);
|
|
return false;
|
|
});
|
|
|
|
$(document).on('click', '[data-toggle="set-force-follow-chapter"]', function () {
|
|
var id = $(this).data('article-id');
|
|
var volumeorder = $(this).data('volumeorder');
|
|
var isPaidArticle = $(this).data('is-paid-article');
|
|
|
|
var promise = null;
|
|
|
|
if (isPaidArticle) {
|
|
updateAlert('<span style="color:red">设置收费章节为关注章节可能导致低关注率</span>');
|
|
setTimeout(function() {
|
|
promise = $.Deferred().resolve();
|
|
promise.then(function () {
|
|
var url = "{:url('volume/setfocuschapter',array('cartoonid'=>$cartoonid))}"
|
|
$.ajax({
|
|
url: url+'?model_id=16&volumeorder='+volumeorder,
|
|
type: 'POST',
|
|
contentType: 'application/json'
|
|
})
|
|
.then(function () {
|
|
updateAlert('设置成功', 'success');
|
|
reloadPage(500);
|
|
})
|
|
.fail(function () {
|
|
updateAlert('设置失败', 'error');
|
|
});
|
|
});
|
|
return false;
|
|
}, 1500);
|
|
} else {
|
|
promise = $.Deferred().resolve();
|
|
}
|
|
|
|
|
|
|
|
promise.then(function () {
|
|
var url = "{:url('volume/setfocuschapter',array('cartoonid'=>$cartoonid))}"
|
|
$.ajax({
|
|
url: url+'?model_id=16&volumeorder='+volumeorder,
|
|
type: 'POST',
|
|
contentType: 'application/json'
|
|
})
|
|
.then(function () {
|
|
updateAlert('设置成功', 'success');
|
|
reloadPage(500);
|
|
})
|
|
.fail(function () {
|
|
updateAlert('设置失败', 'error');
|
|
});
|
|
});
|
|
|
|
return false;
|
|
});
|
|
|
|
$(document).on('click', '[data-toggle="delete-article"]', function () {
|
|
var $item = $(this).closest('.chapter-item');
|
|
var id = $(this).data('id');
|
|
var title = $item.find('.chapter-title').text().trim();
|
|
if (!confirm('确定要删除章节《' + title + '》吗?')) {
|
|
return false;
|
|
}
|
|
|
|
$.ajax({
|
|
url: '/backend/articles/api_delete/' + id,
|
|
type: 'POST',
|
|
contentType: 'application/json'
|
|
})
|
|
.then(function () {
|
|
toastr.success('删除成功');
|
|
reloadPage(500);
|
|
})
|
|
.fail(handleAjaxError);
|
|
|
|
return false;
|
|
});
|
|
|
|
$(document).on('click', '[data-toggle="set-all-verified"]', function () {
|
|
Modal.confirm({
|
|
title: '全部标记已审核',
|
|
message: '确定要将本书所有章节标记为已审核吗?'
|
|
})
|
|
.then(function () {
|
|
$.ajax({
|
|
url: '/backend/articles/api_set_all_verified/' + novelId,
|
|
type: 'POST',
|
|
contentType: 'application/json'
|
|
})
|
|
.then(function () {
|
|
toastr.success('操作成功');
|
|
reloadPage(500);
|
|
})
|
|
.fail(handleAjaxError);
|
|
});
|
|
|
|
return false;
|
|
});
|
|
|
|
/**
|
|
* 批量删除选中的未审核章节
|
|
*/
|
|
$(document).on('click', '[data-toggle="delete-multi-unverified"]', function () {
|
|
|
|
var $articles = $('[name="article-checkbox"]:checked');
|
|
var count = $articles.length;
|
|
if (verifiedStatus || count === 0) {
|
|
Modal.alert({
|
|
title: '请选择章节',
|
|
message: '请先勾选要删除的未审核章节'
|
|
});
|
|
return false;
|
|
}
|
|
|
|
Modal.confirm({
|
|
title: '批量删除未审核章节',
|
|
message: '确定要将选中的未审核章节都删除吗? 已选中 '+count+' 章节'
|
|
})
|
|
.then(function () {
|
|
|
|
var articleIds = [];
|
|
$articles.each(function () {
|
|
articleIds.push($(this).data('article-id'));
|
|
});
|
|
|
|
$.ajax({
|
|
url: '/backend/articles/api_batch_delete_unverified',
|
|
type: 'POST',
|
|
contentType: 'application/json',
|
|
data: JSON.stringify({
|
|
'ids' :articleIds
|
|
})
|
|
})
|
|
.then(function () {
|
|
toastr.success('操作成功');
|
|
reloadPage(500);
|
|
})
|
|
.fail(handleAjaxError);
|
|
});
|
|
|
|
return false;
|
|
});
|
|
|
|
function viewChapter(id) {
|
|
var $current = $('.list-group-item [data-toggle="view-chapter"][data-id="' + id + '"]');
|
|
var prevId = $current.closest('li').prev().find('[data-toggle="view-chapter"]').data('id');
|
|
var nextId = $current.closest('li').next().find('[data-toggle="view-chapter"]').data('id');
|
|
|
|
$.get('/backend/comics/api_get_chapter', { id: id }, function (data) {
|
|
var images = _.map(data.images, function (image) {
|
|
return data.image_cdn + '/' + image;
|
|
});
|
|
var html = _.map(images, function(img) {
|
|
var url = img + '?x-oss-process=image/resize,w_750/format,jpeg/quality,q_70';
|
|
return '<img class="b-lazy" data-src="' + url + '" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" style="display: block; width: 100%; height: 800px" />';
|
|
})
|
|
.join("\n");
|
|
|
|
$('#view-chapter-modal .modal-title').html(data.title);
|
|
$('#view-chapter-modal .chapter-content').html(html);
|
|
|
|
var $prevButton = $('#view-chapter-modal .btn-prev-chapter');
|
|
var $nextButton = $('#view-chapter-modal .btn-next-chapter');
|
|
|
|
if (prevId) {
|
|
$prevButton.data('id', prevId).show();
|
|
} else {
|
|
$prevButton.hide();
|
|
}
|
|
|
|
if (nextId) {
|
|
$nextButton.data('id', nextId).show();
|
|
} else {
|
|
$nextButton.hide();
|
|
}
|
|
var $modal = $('#view-chapter-modal');
|
|
$modal.off('shown.bs.modal').on('shown.bs.modal', createBLazy);
|
|
if ($modal.data('bs.modal') && $modal.data('bs.modal').isShown) {
|
|
$modal.find('.chapter-content').scrollTop(0);
|
|
createBLazy();
|
|
} else {
|
|
$modal.modal('show');
|
|
}
|
|
});
|
|
}
|
|
|
|
function createBLazy() {
|
|
return new Blazy({
|
|
success: function (img) {
|
|
$(img).css('height', 'unset');
|
|
},
|
|
container: '#view-chapter-modal .chapter-content'
|
|
});
|
|
}
|
|
})
|
|
</script>
|
|
{/block} |