更新4
This commit is contained in:
parent
124b0b42c2
commit
a7c538cea5
136
app/admin/controller/nk/Village.php
Normal file
136
app/admin/controller/nk/Village.php
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\nk;
|
||||||
|
|
||||||
|
use app\admin\BaseController;
|
||||||
|
use app\admin\controller\nk\Article;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\facade\Db;
|
||||||
|
use think\facade\View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Village extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->adminInfo = get_login_admin();
|
||||||
|
$this->url=[
|
||||||
|
'/admin/nk.village/index',
|
||||||
|
'/admin/nk.village/add',
|
||||||
|
'/admin/nk.village/edit',
|
||||||
|
'/admin/nk.village/del',
|
||||||
|
'/admin/nk.village/read',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
if (request()->isAjax()) {
|
||||||
|
$params= get_params();
|
||||||
|
$where[]=['status','=',1];
|
||||||
|
if (isset($params['keywords'])){
|
||||||
|
$where[]=['title','like','%'.$params['keywords'].'%'];
|
||||||
|
}
|
||||||
|
$total = Db::table('fa_szxc_village')
|
||||||
|
->where($where)->count();
|
||||||
|
$list = Db::table('fa_szxc_village')
|
||||||
|
->withAttr('is_hot',function ($value,$data){
|
||||||
|
return $value==1?'是':'否';
|
||||||
|
})
|
||||||
|
->withAttr('is_tourism',function ($value,$data){
|
||||||
|
return $value==1?'是':'否';
|
||||||
|
})
|
||||||
|
->where($where)
|
||||||
|
->page($params['page'])
|
||||||
|
->limit($params['limit'])
|
||||||
|
->order('id desc')
|
||||||
|
->select();
|
||||||
|
$result = ['total' => $total, 'data' => $list];
|
||||||
|
return table_assign(0, '', $result);
|
||||||
|
}
|
||||||
|
View::assign('url', $this->url);
|
||||||
|
return view();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
if (request()->isAjax()) {
|
||||||
|
$params= get_params();
|
||||||
|
if ($params['is_hot']=='on'){
|
||||||
|
$params['is_hot']=1;
|
||||||
|
}else{
|
||||||
|
$params['is_hot']=0;
|
||||||
|
}
|
||||||
|
if ($params['is_tourism']=='on'){
|
||||||
|
$params['is_tourism']=1;
|
||||||
|
}else{
|
||||||
|
$params['is_tourism']=0;
|
||||||
|
}
|
||||||
|
$res=Db::table('fa_szxc_village')->strict(false)->field(true)->insertGetId($params);
|
||||||
|
if ($res){
|
||||||
|
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||||
|
}
|
||||||
|
return to_assign(1, '操作失败,原因:'.$res);
|
||||||
|
}else{
|
||||||
|
View::assign('editor', get_system_config('other','editor'));
|
||||||
|
View::assign('url', $this->url);
|
||||||
|
return view();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params= get_params();
|
||||||
|
if (request()->isAjax()) {
|
||||||
|
$res=Db::table('fa_szxc_village')->where('id',$params['id'])->strict(false)->field(true)->update($params);
|
||||||
|
if ($res){
|
||||||
|
return to_assign();
|
||||||
|
}else{
|
||||||
|
return to_assign(1, '操作失败,原因:'.$res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$detail = Db::table('fa_szxc_village')->where('id',$params['id'])->find();
|
||||||
|
|
||||||
|
View::assign('detail', $detail);
|
||||||
|
View::assign('url', $this->url);
|
||||||
|
return view();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查看信息
|
||||||
|
*/
|
||||||
|
public function read()
|
||||||
|
{
|
||||||
|
$params = get_params();
|
||||||
|
$detail = Db::table('fa_szxc_village')->where('id',$params['id'])->find();
|
||||||
|
View::assign('url', $this->url);
|
||||||
|
View::assign('detail', $detail);
|
||||||
|
return view();
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
public function del()
|
||||||
|
{
|
||||||
|
$param= get_params();
|
||||||
|
$id = isset($param['id']) ? $param['id'] : 0;
|
||||||
|
$type = isset($param['type']) ? $param['type'] : 0;
|
||||||
|
$res = Db::table('fa_szxc_village')->where('id',$id)->update(['status'=>$type]);
|
||||||
|
if ($res){
|
||||||
|
return to_assign();
|
||||||
|
}else{
|
||||||
|
return to_assign(1, '操作失败,原因:'.$res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
124
app/admin/view/nk/village/add.html
Normal file
124
app/admin/view/nk/village/add.html
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
{block name="style"}
|
||||||
|
<style type="text/css">
|
||||||
|
.editormd-code-toolbar select {
|
||||||
|
display: inline-block
|
||||||
|
}
|
||||||
|
|
||||||
|
.editormd li {
|
||||||
|
list-style: inherit;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
<form class="layui-form p-4">
|
||||||
|
<h3 class="pb-3">添加内容</h3>
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">标题<font>*</font></td>
|
||||||
|
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
|
||||||
|
autocomplete="off" placeholder="请输入标题" class="layui-input"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">人数<font>*</font></td>
|
||||||
|
<td colspan="3">
|
||||||
|
<input type="text" name="people_num" lay-verify="required" lay-reqText="请输入人数"
|
||||||
|
autocomplete="off" placeholder="请输入人数" class="layui-input"></td>
|
||||||
|
<td class="layui-td-gray">标签(多选)<font>*</font></td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="is_hot" title="热门">
|
||||||
|
<input type="checkbox" name="is_tourism" title="文旅">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">简介</td>
|
||||||
|
<td colspan="3">
|
||||||
|
<textarea name="info" placeholder="请输入摘要,不能超过200个字" class="layui-textarea"></textarea>
|
||||||
|
</td>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
|
||||||
|
<td>
|
||||||
|
<div class="layui-upload">
|
||||||
|
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">
|
||||||
|
上传缩略图(尺寸:640x360)
|
||||||
|
</button>
|
||||||
|
<div class="layui-upload-list" id="upload_box_thumb"
|
||||||
|
style="width: 120px; height:66px; overflow: hidden;">
|
||||||
|
<img src=""
|
||||||
|
onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;"
|
||||||
|
width="100" style="max-width: 100%; height:66px;"/>
|
||||||
|
<input type="hidden" name="image" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<textarea class="layui-textarea" id="container_content"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<div class="pt-3">
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
const editorType = '{$editor}';
|
||||||
|
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||||
|
|
||||||
|
function gouguInit() {
|
||||||
|
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||||
|
|
||||||
|
//上传缩略图
|
||||||
|
var upload_thumb = layui.upload.render({
|
||||||
|
elem: '#upload_btn_thumb',
|
||||||
|
url: '/admin/api/upload',
|
||||||
|
done: function (res) {
|
||||||
|
//如果上传失败
|
||||||
|
if (res.code == 1) {
|
||||||
|
return layer.msg('上传失败');
|
||||||
|
}
|
||||||
|
//上传成功
|
||||||
|
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||||
|
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var editor = layui.tinymce;
|
||||||
|
var edit = editor.render({
|
||||||
|
selector: "#container_content",
|
||||||
|
height: 500
|
||||||
|
});
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(webform)', function (data) {
|
||||||
|
data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||||
|
if (data.field.content == '') {
|
||||||
|
layer.msg('请先完善文章内容');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let callback = function (e) {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
if (e.code == 0) {
|
||||||
|
tool.tabRefresh(71);
|
||||||
|
tool.sideClose(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tool.post('{$url[1]}', data.field, callback);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
122
app/admin/view/nk/village/edit.html
Normal file
122
app/admin/view/nk/village/edit.html
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
{block name="style"}
|
||||||
|
<style type="text/css">
|
||||||
|
.editormd-code-toolbar select {
|
||||||
|
display: inline-block
|
||||||
|
}
|
||||||
|
|
||||||
|
.editormd li {
|
||||||
|
list-style: inherit;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
<form class="layui-form p-4">
|
||||||
|
<h3 class="pb-3">编辑文章表</h3>
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">标题<font>*</font></td>
|
||||||
|
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
|
||||||
|
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">人数<font>*</font></td>
|
||||||
|
<td colspan="3">
|
||||||
|
<input type="text" name="people_num" lay-verify="required" lay-reqText="请输入人数"
|
||||||
|
autocomplete="off" placeholder="请输入人数" class="layui-input" value="{$detail.people_num}"></td>
|
||||||
|
<td class="layui-td-gray">标签(多选)<font>*</font></td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="is_hot" title="热门" {if $detail.is_hot==1} checked {/if}>
|
||||||
|
<input type="checkbox" name="is_tourism" title="文旅" {if $detail.is_tourism==1} checked {/if}>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">简介</td>
|
||||||
|
<td colspan="3">
|
||||||
|
<textarea name="info" placeholder="请输入摘要,不能超过200个字" class="layui-textarea">{$detail.info}</textarea>
|
||||||
|
</td>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
|
||||||
|
<td>
|
||||||
|
<div class="layui-upload">
|
||||||
|
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">
|
||||||
|
上传缩略图(尺寸:640x360)
|
||||||
|
</button>
|
||||||
|
<div class="layui-upload-list" id="upload_box_thumb"
|
||||||
|
style="width: 120px; height:66px; overflow: hidden;">
|
||||||
|
<img src="{$detail.images}"
|
||||||
|
onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;"
|
||||||
|
width="100" style="max-width: 100%; height:66px;"/>
|
||||||
|
<input type="hidden" name="images" value="{$detail.images}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<textarea class="layui-textarea" id="container_content">{$detail.introduce}</textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<div class="pt-3">
|
||||||
|
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||||
|
function gouguInit() {
|
||||||
|
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker;
|
||||||
|
|
||||||
|
//上传缩略图
|
||||||
|
var upload_thumb = layui.upload.render({
|
||||||
|
elem: '#upload_btn_thumb',
|
||||||
|
url: '/admin/api/upload',
|
||||||
|
done: function (res) {
|
||||||
|
//如果上传失败
|
||||||
|
if (res.code == 1) {
|
||||||
|
layer.msg('上传失败');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//上传成功
|
||||||
|
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||||
|
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var editor = layui.tinymce;
|
||||||
|
var edit = editor.render({
|
||||||
|
selector: "#container_content",
|
||||||
|
height: 500
|
||||||
|
});
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(webform)', function (data) {
|
||||||
|
data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||||
|
if (data.field.content == '') {
|
||||||
|
layer.msg('请先完善文章内容');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let callback = function (e) {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
if (e.code == 0) {
|
||||||
|
tool.sideClose(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tool.post("{$url[2]}", data.field, callback);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
152
app/admin/view/nk/village/index.html
Normal file
152
app/admin/view/nk/village/index.html
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
|
||||||
|
<div class="p-3">
|
||||||
|
<form class="layui-form gg-form-bar border-t border-x">
|
||||||
|
<div class="layui-input-inline" style="width:300px;">
|
||||||
|
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
|
||||||
|
</div>
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||||
|
</form>
|
||||||
|
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/html" id="status">
|
||||||
|
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="is_home">
|
||||||
|
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="toolbarDemo">
|
||||||
|
<div class="layui-btn-container">
|
||||||
|
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
const moduleInit = ['tool'];
|
||||||
|
function gouguInit() {
|
||||||
|
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||||
|
layui.pageTable = table.render({
|
||||||
|
elem: '#article',
|
||||||
|
title: '文章表列表',
|
||||||
|
toolbar: '#toolbarDemo',
|
||||||
|
url: '{$url[0]}',
|
||||||
|
page: true,
|
||||||
|
limit: 20,
|
||||||
|
cellMinWidth: 300,
|
||||||
|
cols: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
fixed: 'left',
|
||||||
|
field: 'id',
|
||||||
|
title: '编号',
|
||||||
|
align: 'center',
|
||||||
|
width:120,
|
||||||
|
},{
|
||||||
|
field: 'title',
|
||||||
|
title: '标题',
|
||||||
|
},{
|
||||||
|
field: 'address',
|
||||||
|
title: '具体地址',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
field: 'people_num',
|
||||||
|
title: '村庄人数',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
field: 'images',
|
||||||
|
title: '村庄图片',
|
||||||
|
align: 'center',
|
||||||
|
templet: '<div><img src="{{ d.images }}" style="width:30px; height:30px;"></div>',
|
||||||
|
|
||||||
|
},{
|
||||||
|
field: 'views',
|
||||||
|
title: '浏览量',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
field: 'likes',
|
||||||
|
title: '点赞数',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
field: 'is_hot',
|
||||||
|
title: '是否热门',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
field: 'is_tourism',
|
||||||
|
title: '是否文旅',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
fixed: 'right',
|
||||||
|
field: 'right',
|
||||||
|
title: '操作',
|
||||||
|
toolbar: '#barDemo',
|
||||||
|
align: 'center'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听表头工具栏事件
|
||||||
|
table.on('toolbar(article)', function(obj){
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
tool.side('{$url[1]}');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听表格行工具事件
|
||||||
|
table.on('tool(article)', function(obj) {
|
||||||
|
var data = obj.data;
|
||||||
|
if (obj.event === 'read') {
|
||||||
|
tool.side('{$url[4]}?id='+obj.data.id);
|
||||||
|
}
|
||||||
|
else if (obj.event === 'edit') {
|
||||||
|
tool.side('{$url[2]}?id='+obj.data.id);
|
||||||
|
}
|
||||||
|
else if (obj.event === 'del') {
|
||||||
|
layer.confirm('确定要删除该记录吗?', {
|
||||||
|
icon: 3,
|
||||||
|
title: '提示'
|
||||||
|
}, function(index) {
|
||||||
|
let callback = function (e) {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
if (e.code == 0) {
|
||||||
|
obj.del();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tool.delete('{$url[3]}', { id: data.id }, callback);
|
||||||
|
layer.close(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听搜索提交
|
||||||
|
form.on('submit(searchform)', function(data) {
|
||||||
|
layui.pageTable.reload({
|
||||||
|
where: {
|
||||||
|
keywords: data.field.keywords,
|
||||||
|
cate_id: data.field.cate_id
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
55
app/admin/view/nk/village/read.html
Normal file
55
app/admin/view/nk/village/read.html
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
{block name="style"}
|
||||||
|
<style>
|
||||||
|
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
<div class="layui-form p-4">
|
||||||
|
<h3 class="pb-3">文章详情</h3>
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">标题<font>*</font></td>
|
||||||
|
<td colspan="7">{$detail.title}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">人数<font>*</font></td>
|
||||||
|
<td colspan="3">{$detail.people_num}</td>
|
||||||
|
<td class="layui-td-gray">标签(多选)<font>*</font></td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" name="is_hot" title="热门" {if $detail.is_hot==1} checked {/if}>
|
||||||
|
<input type="checkbox" name="is_tourism" title="文旅" {if $detail.is_hot==1} checked {/if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">简介</td>
|
||||||
|
<td colspan="3">
|
||||||
|
{$detail.info}
|
||||||
|
</td>
|
||||||
|
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
|
||||||
|
<td>
|
||||||
|
<div class="layui-upload">
|
||||||
|
|
||||||
|
<div class="layui-upload-list" id="upload_box_thumb"
|
||||||
|
style="width: 120px; height:66px; overflow: hidden;">
|
||||||
|
<img src="{$detail.images}"
|
||||||
|
width="100" style="max-width: 100%; height:66px;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
{$detail.introduce|raw}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
Loading…
x
Reference in New Issue
Block a user