|
@@ -80,7 +80,7 @@
|
|
|
<tr class="thead">
|
|
|
<th class="center w96">专题编号</th>
|
|
|
<th class="center w144">专题描述</th>
|
|
|
- <th class="center w400">专题搜索关键字</th>
|
|
|
+ <th class="center w400">设置专题搜索关键字和分享图片</th>
|
|
|
<th class="w200 align-center"><span><?php echo $lang['nc_handle']; ?></span></th>
|
|
|
</tr>
|
|
|
</thead>
|
|
@@ -94,17 +94,35 @@
|
|
|
title="<?php echo $lang['nc_editable']; ?>"
|
|
|
class="alignleft editable tooltip w270"><?php echo $value['special_desc']; ?></span>
|
|
|
</td>
|
|
|
- <td class="center"><input type="hidden" name="special_id"
|
|
|
- value="<?php echo $value['special_id']; ?>">
|
|
|
- <input type="text" name="search_keyword" placeholder="添加该专题的搜索关键字"
|
|
|
- value="<?php echo $value['keywords']; ?>">
|
|
|
- <a class="btn search_keyword"><span>添加</span></a></td>
|
|
|
+ <td>
|
|
|
+ <div class="share_img left" style="width: 100px;height: 100px;border: 1px solid #c7c7c7;display: flex;">
|
|
|
+ <?php if(empty($value['share_image'])){?>
|
|
|
+ <img class="dialog_item_image" src="" style="display: none;margin: auto;">
|
|
|
+ <?php }else{?>
|
|
|
+ <img class="dialog_item_image" style="margin: auto;" src="<?php echo $value['share_image']?>">
|
|
|
+ <?php };?>
|
|
|
+ </div>
|
|
|
+ <div class="floatleft">
|
|
|
+ <input type="hidden" name="special_id" value="<?php echo $value['special_id']; ?>">
|
|
|
+ <span>关键字:</span>
|
|
|
+ <input type="text" name="search_keyword" style="margin-bottom: 10px;" placeholder="添加该专题的搜索关键字"
|
|
|
+ value="<?php echo $value['keywords']; ?>">
|
|
|
+ <br>
|
|
|
+ <span>封面:</span>
|
|
|
+ <input type="file" name="special_image" style="width: 62px;" data-special-id="<?php echo $value['special_id'];?>" class="btn_upload_image">
|
|
|
+ <input type="hidden" class="dialog_bg_image_name" value="">
|
|
|
+ <span class="progress" style="display: none;"></span>
|
|
|
+ <br>
|
|
|
+ <a class="btn search_keyword" style="margin-top:10px; "><span>添加</span></a>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
<td class="nowrap align-center">
|
|
|
<a target="_blank"
|
|
|
href="<?php echo BASE_SITE_URL . "/mobile/index.php?act=special&op=index&special_id={$value['special_id']}&client_type=wap"; ?>">预览</a> |
|
|
|
<a href="<?php echo urlAdmin('mb_special', 'special_edit', array('special_id' => $value['special_id'])); ?>">编辑</a>
|
|
|
| <a href="javascript:;" nctype="btn_del"
|
|
|
- data-special-id="<?php echo $value['special_id']; ?>">删除</a></td>
|
|
|
+ data-special-id="<?php echo $value['special_id']; ?>">删除</a>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
<?php } ?>
|
|
|
<?php } else { ?>
|
|
@@ -158,6 +176,9 @@
|
|
|
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
|
|
|
charset="utf-8"></script>
|
|
|
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js"></script>
|
|
|
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
|
|
|
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
|
|
|
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
|
|
|
<script type="text/javascript">
|
|
|
$(document).ready(function () {
|
|
|
//添加专题
|
|
@@ -199,16 +220,18 @@
|
|
|
//编辑专题描述
|
|
|
$('span[nc_type="edit_special_desc"]').inline_edit({act: 'mb_special', op: 'update_special_desc'});
|
|
|
|
|
|
- //添加搜索关键字
|
|
|
+ //添加搜索关键字和图片
|
|
|
|
|
|
$('.search_keyword').on('click', function () {
|
|
|
+ var dialog_bg_image_name = $(this).siblings('.dialog_bg_image_name').val();
|
|
|
var keyword = $(this).siblings('input[name="search_keyword"]').val();
|
|
|
var special_id = $(this).siblings('input[name="special_id"]').val();
|
|
|
if (!keyword) {
|
|
|
alert('请输入关键字');
|
|
|
return;
|
|
|
}
|
|
|
- $.post('index.php?act=mb_special&op=search_keyword', {
|
|
|
+ $.post('index.php?act=mb_special&op=search_keyword_cover', {
|
|
|
+ cover_img:dialog_bg_image_name,
|
|
|
keyword: keyword,
|
|
|
special_id: special_id
|
|
|
}, function (res) {
|
|
@@ -217,5 +240,29 @@
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+ var url_upload_image = '<?php echo urlAdmin('mb_special', 'special_image_upload');?>';
|
|
|
+ //图片上传
|
|
|
+ $(".btn_upload_image").fileupload({
|
|
|
+ dataType: 'json',
|
|
|
+ url: url_upload_image,
|
|
|
+ formData: {special_id: $(this).attr('data-special-id')},
|
|
|
+ add: function (e, data) {
|
|
|
+ $(this).siblings('.progress').text('上传中...').show();
|
|
|
+ data.submit();
|
|
|
+ },
|
|
|
+ done: function (e, data) {
|
|
|
+ var result = data.result;
|
|
|
+ if (typeof result.error === 'undefined') {
|
|
|
+ $(this).siblings('.progress').text('').hide();
|
|
|
+ $(this).parent().siblings('.share_img').children('.dialog_item_image').attr('src', result.image_url);
|
|
|
+ $(this).parent().siblings('.share_img').children('.dialog_item_image').show();
|
|
|
+ $(this).siblings('.dialog_bg_image_name').val(result.image_url);
|
|
|
+ } else {
|
|
|
+ showError(result.error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
</script>
|