|
@@ -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,10 +94,23 @@
|
|
|
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"
|
|
|
+ <td><input type="hidden" name="special_id"
|
|
|
value="<?php echo $value['special_id']; ?>">
|
|
|
- <input type="text" name="search_keyword" placeholder="添加该专题的搜索关键字"
|
|
|
- value="<?php echo $value['keywords']; ?>">
|
|
|
+ <span>设置关键字:</span>
|
|
|
+ <br>
|
|
|
+ <input type="text" name="search_keyword" style="margin-bottom: 10px;" placeholder="添加该专题的搜索关键字"
|
|
|
+ value="<?php echo $value['keywords']; ?>">
|
|
|
+ <br>
|
|
|
+ <span>设置搜索封面:</span>
|
|
|
+ <?php if(empty($value['search_cover'])){?>
|
|
|
+ <img class="dialog_item_image" src="" style="display: none;">
|
|
|
+ <?php }else{?>
|
|
|
+ <br>
|
|
|
+ <img class="dialog_item_image" style="vertical-align: middle;" src="<?php echo UPLOAD_SITE_URL.'/mobile/special/s/'.$value['search_cover']?>">
|
|
|
+ <?php };?>
|
|
|
+ <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>
|
|
|
<a class="btn search_keyword"><span>添加</span></a></td>
|
|
|
<td class="nowrap align-center">
|
|
|
<a target="_blank"
|
|
@@ -158,6 +171,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 +215,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 +235,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).siblings('.dialog_item_image').attr('src', result.image_url);
|
|
|
+ $(this).siblings('.dialog_item_image').show();
|
|
|
+ $(this).siblings('.dialog_bg_image_name').val(result.image_name);
|
|
|
+ } else {
|
|
|
+ showError(result.error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
</script>
|