383 lines
13 KiB
HTML
383 lines
13 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 -->
|
||
<style>
|
||
.textarea-wrapper_3voWh5Gd {
|
||
padding: 15px;
|
||
background: #eee;
|
||
}
|
||
.textarea_3u2YVyup {
|
||
position: relative;
|
||
height: 200px;
|
||
background: #fff;
|
||
padding-bottom: 30px;
|
||
}
|
||
.textarea_3u2YVyup .textarea-body_1ehix2My {
|
||
padding: 15px;
|
||
border: none;
|
||
resize: none;
|
||
width: 100%;
|
||
height: 100%;
|
||
outline: none;
|
||
overflow: auto;
|
||
word-break: break-all;
|
||
background: #fff;
|
||
}
|
||
.icon-link_2URw_QEz {
|
||
position: absolute;
|
||
bottom: 5px;
|
||
left: 15px;
|
||
cursor: pointer;
|
||
}
|
||
.mt-s {
|
||
margin-top: 10px;
|
||
}
|
||
</style>
|
||
{/block}
|
||
{block name="body"}
|
||
<div class="main-box clearfix">
|
||
<header class="main-box-header clearfix">
|
||
<div class="pull-left">
|
||
<h2>{$meta_title}</h2>
|
||
</div>
|
||
</header>
|
||
<div class="main-box-body clearfix">
|
||
<ul class="nav nav-tabs" style="margin-top:20px;">
|
||
<li >
|
||
<a href="{:url('admin/wxmp/menu')}">菜单栏配置</a>
|
||
</li>
|
||
<li class="active">
|
||
<a href="{:url('admin/wxmp/subscribe')}">被关注回复</a>
|
||
</li>
|
||
<!---
|
||
<li>
|
||
<a href="{:url('admin/wxmp/defaults')}">默认回复</a>
|
||
</li>
|
||
--->
|
||
<li >
|
||
<a href="{:url('admin/template/index')}">模板消息</a>
|
||
</li>
|
||
<li >
|
||
<a href="{:url('admin/customservice/text')}">文本消息</a>
|
||
</li>
|
||
<li >
|
||
<a href="{:url('admin/keys/index')}">关键字回复</a>
|
||
</li>
|
||
</ul>
|
||
<div class="row" style="margin-top:15px">
|
||
<div class='col-xs-12' style="margin-left:15px">
|
||
|
||
<div class='col-xs-6' >
|
||
<div class=" radio radio-nice radio-inline">
|
||
<input type="radio" name="type" id="type-1" value="1" {eq name="type" value="1"}checked{/eq}/>
|
||
<label for="type-1">默认模板</label>
|
||
</div>
|
||
<div class="textarea-wrapper_3voWh5Gd mt-s">
|
||
<div class="textarea_3u2YVyup"><textarea disabled="" class="textarea-body_1ehix2My">{$wxmp_reply}</textarea></div>
|
||
</div>
|
||
</div>
|
||
<div class='col-xs-6' >
|
||
<div class=" radio radio-nice radio-inline">
|
||
<input type="radio" name="type" id="type-2" value="2" {eq name="type" value="2"}checked{/eq}/>
|
||
<label for="type-2">自定义文案</label>
|
||
</div>
|
||
<form class="form-horizontal" role="form" data-auto="true" action="{:url('admin/wxmp/subscribe',array('model_id'=>18))}" method="post">
|
||
<input type="hidden" name="id" value="{$info.id}">
|
||
<input type="hidden" name="type" value="text">
|
||
<div class="textarea-wrapper_3voWh5Gd">
|
||
<div class="textarea_3u2YVyup">
|
||
<textarea name="content" id="content" class="textarea-body_1ehix2My">{$info.content}</textarea>
|
||
<div class="icon-link_2URw_QEz" style=""><i class="fa fa-link"></i></div>
|
||
<div class="count_1FhmyASt"></div>
|
||
</div>
|
||
<div class="clearfix mt-s">
|
||
<div class="pull-right">
|
||
<!---<button type="button" class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;"><span>返 回</span></button> ---><button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form-horizontal"><span>保 存</span></button></div>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="modal fade" id="edit-apply-info" role="dialog" aria-labelledby="myModalLabel">
|
||
<div class="modal-dialog" role="document">
|
||
<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" id="myModalLabel">添加链接</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal">
|
||
<div class="form-group">
|
||
<label class="control-label col-sm-3">链接文案</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" name="from-name" id="from-name">
|
||
<div class="help-block col-sm-10 no-padding-left" data-valmsg-for="novel_id" data-valmsg-replace="true"></div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">链接类型</label>
|
||
<div class="col-sm-7">
|
||
<div class="radio radio-nice">
|
||
<input type="radio" name="form-type" id="form-type-1" value="1" checked>
|
||
<label for="form-type-1">小说URL</label>
|
||
<input type="radio" name="form-type" id="form-type-2" value="2">
|
||
<label for="form-type-2">自定义</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" id="control-novel">
|
||
<label class="col-sm-3 control-label">小说</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control" name="form-novel" id="form-novel" style="width:auto;">
|
||
<option value="">未选择</option>
|
||
{volist name="novel" id="vo"}
|
||
<option value="{$vo.id}">{$vo.title}</option>
|
||
{/volist}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" id="control-chapter">
|
||
<label class="col-sm-3 control-label">章节</label>
|
||
<div class="col-sm-7">
|
||
<select class="form-control" name="form-chapter" id="form-chapter" style="width:auto;">
|
||
<option value="" selected>
|
||
<option value="">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" id="control-url">
|
||
<label class="control-label col-sm-3">自定义URL</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" name="from-url" id="from-url">
|
||
<div class="help-block col-sm-10 no-padding-left">请填写完整链接,需要带http://</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary btn-submit">保存</button>
|
||
</div>
|
||
</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 type="text/javascript" src="/public/js/clipboard.min.js"></script>
|
||
<script>
|
||
|
||
$(function () {
|
||
|
||
/*! 取消编辑 */
|
||
$('[data-cancel-edit]').on('click', function () {
|
||
$.msg.confirm('确定取消编辑吗?', function () {
|
||
history.back();
|
||
});
|
||
});
|
||
|
||
/*! 默认类型事件 */
|
||
$('body').off('change', 'select[name=type]').on('change', 'select[name=type]', function () {
|
||
var value = $(this).val(), $form = $(this).parents('form');
|
||
var $current = $form.find('[data-keys-type="' + value + '"]').removeClass('hide');
|
||
$form.find('[data-keys-type]').not($current).addClass('hide');
|
||
switch (value) {
|
||
case 'news':
|
||
return $('[name="news_id"]').trigger('change');
|
||
case 'text':
|
||
return $('[name="content"]').trigger('change');
|
||
case 'image':
|
||
return $('[name="image_url"]').trigger('change');
|
||
case 'video':
|
||
return $('[name="video_url"]').trigger('change');
|
||
case 'music':
|
||
return $('[name="music_url"]').trigger('change');
|
||
case 'voice':
|
||
return $('[name="voice_url"]').trigger('change');
|
||
}
|
||
});
|
||
|
||
function showReview(params) {
|
||
$('#phone-preview').attr('src', '/wechat/review.html?' + $.param(params || {}));
|
||
}
|
||
|
||
// 图文显示预览
|
||
$('body').off('change', '[name="news_id"]').on('change', '[name="news_id"]', function () {
|
||
showReview({type: 'news', content: this.value});
|
||
});
|
||
|
||
// 文字显示预览
|
||
$('body').off('change', '[name="content"]').on('change', '[name="content"]', function () {
|
||
showReview({type: 'text', content: this.value});
|
||
});
|
||
|
||
// 图片显示预览
|
||
$('body').off('change', '[name="image_url"]').on('change', '[name="image_url"]', function () {
|
||
showReview({type: 'image', content: this.value});
|
||
});
|
||
|
||
// 音乐显示预览
|
||
var musicSelector = '[name="music_url"],[name="music_title"],[name="music_desc"],[name="music_image"]';
|
||
$('body').off('change', musicSelector).on('change', musicSelector, function () {
|
||
var params = {type: 'music'}, $parent = $(this).parents('form');
|
||
params.title = $parent.find('[name="music_title"]').val();
|
||
params.url = $parent.find('[name="music_url"]').val();
|
||
params.image = $parent.find('[name="music_image"]').val();
|
||
params.desc = $parent.find('[name="music_desc"]').val();
|
||
showReview(params);
|
||
});
|
||
|
||
// 视频显示预览
|
||
var videoSelector = '[name="video_title"],[name="video_url"],[name="video_desc"]';
|
||
$('body').off('change', videoSelector).on('change', videoSelector, function () {
|
||
var params = {type: 'video'}, $parent = $(this).parents('form');
|
||
params.title = $parent.find('[name="video_title"]').val();
|
||
params.url = $parent.find('[name="video_url"]').val();
|
||
params.desc = $parent.find('[name="video_desc"]').val();
|
||
showReview(params);
|
||
});
|
||
|
||
// 默认事件触发
|
||
$('select[name=type]').map(function () {
|
||
$(this).trigger('change');
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
var url = "{$url}";
|
||
$(function () {
|
||
$('#edit-apply-info').find('#control-chapter').show();
|
||
$('#edit-apply-info').find('#control-novel').show();
|
||
$('#edit-apply-info').find('#control-url').hide();
|
||
|
||
$('.icon-link_2URw_QEz').on('click',function () {
|
||
console.log('okk');
|
||
$('#edit-apply-info').modal('show');
|
||
})
|
||
$('#edit-apply-info').find('.btn-submit').click(function () {
|
||
var fromName = $('#from-name').val();
|
||
var formType = $('input[name="form-type"]:checked').val();
|
||
var formNovel = $('#form-novel').val();
|
||
var formChapter = $('#form-chapter').val();
|
||
var fromUrl = $('#from-url').val();
|
||
var text = '';
|
||
if (!fromName)
|
||
{
|
||
updateAlert('链接文案不能为空', 'error');
|
||
return false;
|
||
}
|
||
|
||
if (formType==1&&formNovel.length==0&&formChapter.length==0)
|
||
{
|
||
updateAlert('小说不能为空', 'error');
|
||
return false;
|
||
}
|
||
if (formType==1&&formChapter.length==0)
|
||
{
|
||
updateAlert('章节不能为空', 'error');
|
||
return false;
|
||
}
|
||
if (formType==2&&fromUrl.length==0)
|
||
{
|
||
updateAlert('自定义URL不能为空', 'error');
|
||
return false;
|
||
}
|
||
|
||
if (formType==1)
|
||
{
|
||
text ='<a href="'+url+'/chapter/read/'+formNovel+'/'+formChapter+'">'+fromName+'</a>';
|
||
}else{
|
||
text ='<a href="'+fromUrl+'">'+fromName+'</a>';
|
||
}
|
||
insertText(document.getElementById('content'),text);
|
||
$('#edit-apply-info').modal('hide');
|
||
|
||
});
|
||
$('input[type=radio][name=form-type]').change(function() {
|
||
if (this.value==1)
|
||
{
|
||
$('#edit-apply-info').find('#control-chapter').show();
|
||
$('#edit-apply-info').find('#control-novel').show();
|
||
$('#edit-apply-info').find('#control-url').hide();
|
||
|
||
}else{
|
||
$('#edit-apply-info').find('#control-url').show();
|
||
$('#edit-apply-info').find('#control-chapter').hide();
|
||
$('#edit-apply-info').find('#control-novel').hide();
|
||
}
|
||
});
|
||
|
||
$('#edit-apply-info').find('#form-novel').change(function () {
|
||
var html="";
|
||
if ($(this).val())
|
||
{
|
||
$.ajax({
|
||
type: "GET",
|
||
url: "{:url('admin/keys/ajaxvolume')}?novel_id="+$(this).val(),
|
||
data: "",
|
||
dataType: "json",
|
||
success: function(json){
|
||
if(json.code == 200){
|
||
html += "<option value='' >未选择</option>";
|
||
$.each(json.content,function(index,v){
|
||
html += "<option value='"+v.id+"'>"+v.volumename+"</option>";
|
||
})
|
||
$('#edit-apply-info').find('#form-chapter').empty();
|
||
$('#edit-apply-info').find('#form-chapter').append(html);
|
||
}else{
|
||
$('#edit-apply-info').find('#form-chapter').empty();
|
||
}
|
||
},
|
||
error:function(){
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
function insertText(obj,str) {
|
||
if (document.selection) {
|
||
var sel = document.selection.createRange();
|
||
sel.text = str;
|
||
} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
|
||
var startPos = obj.selectionStart,
|
||
endPos = obj.selectionEnd,
|
||
cursorPos = startPos,
|
||
tmpStr = obj.value;
|
||
obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
|
||
cursorPos += str.length;
|
||
obj.selectionStart = obj.selectionEnd = cursorPos;
|
||
} else {
|
||
obj.value += str;
|
||
}
|
||
}
|
||
</script>
|
||
|
||
{/block} |