This commit is contained in:
入门到放弃 2023-02-12 11:15:14 +08:00
parent 793b32779d
commit 0119afc874
11 changed files with 804 additions and 26 deletions

View File

@ -30,21 +30,22 @@ class Article extends BaseController
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where[] = ['village','=',$user_address['village_id']];
}elseif ($user_address['auth_range'] == 2){
$where[] = ['township','=',$user_address['street_id']];
}elseif ($user_address['auth_range'] == 3){
$where[] = ['county','=',$user_address['area_id']];
}else{
$where[] = ['village','=',$user_address['village_id']];
if ($user_address) {
if ($user_address['auth_range'] == 1) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
$mmm['village_id'] = $user_address['village_id'];
} elseif ($user_address['auth_range'] == 2) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 5) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
$mmm['village_id'] = $user_address['village_id'];
$mmm['brigade_id'] = $user_address['brigade_id'];
}
}else{
$where[] = ['village','=',''];
}
}
$category_id =$params['category_id'];
if($category_id){

View File

@ -53,15 +53,12 @@ class Maturity extends BaseController
}else{
$where[] = ['village_id','=',$user_address['village_id']];
}
}else{
$where[] = ['village_id','=',''];
}
}
$total = Db::table('cms_agriculture_products_traceability')
$total = Db::table('cms_agriculture_products')
->where($where)
->count();
$list = Db::table('cms_agriculture_products_traceability')
$list = Db::table('cms_agriculture_products')
->withAttr('status',function ($value,$data){
if($value == 1){
return '正常';
@ -77,9 +74,8 @@ class Maturity extends BaseController
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/maturity/index',['url'=>$this->url]);
}
return view('',['url'=>$this->url]);
}
public function add(){
@ -90,13 +86,15 @@ class Maturity extends BaseController
$param['street_id']=$adds['street_id'];
$param['village_id']=$adds['village_id'];
$param['add_time']=date('Y-m-d H:i:s');
$param['cycle']=json_encode(['start_time'=>$param['start_time'],'end_time'=>$param['end_time'],'zhouqi'=>$param['zhouqi']]);
$param['title'] = Db::table('fa_szxc_planting_type')->where('id',$param['szxc_planting_type_id'])->value('name');
$res=Db::table('cms_agriculture_products_traceability')->strict(false)->field(true)->insertGetId($param);
$res=Db::table('cms_agriculture_products')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('url', $this->url);
View::assign('editor', get_system_config('other','editor'));
$szxc_planting_type = Db::table('fa_szxc_planting_type')->select();
View::assign('szxc_planting_type', $szxc_planting_type);
@ -109,7 +107,8 @@ class Maturity extends BaseController
$param= get_params();
if (request()->isAjax()) {
$param['title'] = Db::table('fa_szxc_planting_type')->where('id',$param['szxc_planting_type_id'])->value('name');
$res=Db::table('cms_agriculture_products_traceability')->where('id',$param['id'])->strict(false)->field(true)->update($param);
$param['cycle']=json_encode(['start_time'=>$param['start_time'],'end_time'=>$param['end_time'],'zhouqi'=>$param['zhouqi']]);
$res=Db::table('cms_agriculture_products')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
@ -117,7 +116,11 @@ class Maturity extends BaseController
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('cms_agriculture_products_traceability')->where('id',$id)->find();
$detail = Db::table('cms_agriculture_products')
->withAttr('cycle',function($value,$data){
return json_decode($value,true);
})
->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
@ -137,7 +140,11 @@ class Maturity extends BaseController
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('cms_agriculture_products_traceability')->where('id',$id)->find();
$detail = Db::table('cms_agriculture_products')->where('id',$id)
->withAttr('cycle',function($value,$data){
return json_decode($value,true);
})
->find();
if (!empty($detail)) {
View::assign('detail', $detail);
$szxc_planting_type = Db::table('fa_szxc_planting_type')->select();
@ -156,7 +163,7 @@ class Maturity extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('cms_agriculture_products_traceability')->where('id',$id)->delete();
$res = Db::table('cms_agriculture_products')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -0,0 +1,145 @@
<?php
/*
* @Author: mkm
* @Date: 2023-02-12 10:38:40
* @LastEditTime: 2023-02-12 11:06:03
* @LastEditors: your name
* @Description:
* @FilePath: \nk-lihaink-cn\app\admin\controller\nk\StreetCulture.php
* 可以输入预定的版权声明、个性签名、空行等
*/
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 农旅文化
*
* @icon fa fa-circle-o
*/
class StreetCulture extends BaseController
{
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.street_culture/index',
'/admin/nk.street_culture/add',
'/admin/nk.street_culture/edit',
'/admin/nk.street_culture/del',
'/admin/nk.street_culture/read',
];
}
/**
* 查看
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where[]= ['status','=',1];
if (isset($params['keywords']) && !empty($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address) {
if ($user_address['auth_range'] == 1) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
$mmm['village_id'] = $user_address['village_id'];
} elseif ($user_address['auth_range'] == 2) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 5) {
$mmm['area_id'] = $user_address['area_id'];
$mmm['street_id'] = $user_address['street_id'];
$mmm['village_id'] = $user_address['village_id'];
$mmm['brigade_id'] = $user_address['brigade_id'];
}
}
}
$map[] = ['category_id','in',[307,308,309,310,311,312]];
$total = Db::table('fa_article')
->where($where)
->where($map)
->count();
$list = Db::table('fa_article')
->withAttr('nickname',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->where($where)
->where($map)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->field('id,title,user_id,county,township,village,image,view_time')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
return view('',['url'=>$this->url]);
}
/**
* 添加
*/
public function add()
{
if (request()->isAjax()) {
$params= get_params();
$params['category_id']=$this->category_id;
(new Article())->add($params);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('url', $this->url);
return view('nk/article/add');
}
}
/**
* 修改
*/
public function edit()
{
$params= get_params();
(new Article())->edit($params);
return view('nk/article/edit',['url'=>$this->url]);
}
/**
* 查看信息
*/
public function read()
{
$params = get_params();
(new Article())->read($params);
return view('nk/article/read',['url'=>$this->url]);
}
/**
* 修改
*/
public function del()
{
$params= get_params();
(new Article())->del($params);
}
}

View File

@ -0,0 +1,95 @@
<?php
/*
* @Author: mkm
* @Date: 2023-02-12 10:38:40
* @LastEditTime: 2023-02-12 11:09:35
* @LastEditors: your name
* @Description:
* @FilePath: \nk-lihaink-cn\app\admin\controller\nk\StreetElegant.php
* 可以输入预定的版权声明、个性签名、空行等
*/
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 乡镇风采
*
* @icon fa fa-circle-o
*/
class StreetElegant extends BaseController
{
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->category_id=305;
$this->url=[
'/admin/nk.street_elegant/index?category_id='.$this->category_id,
'/admin/nk.street_elegant/add',
'/admin/nk.street_elegant/edit',
'/admin/nk.street_elegant/del',
'/admin/nk.street_elegant/read',
];
}
/**
* 查看
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$params['category_id']=$this->category_id;
(new Article())->index($params);
}
return view('',['url'=>$this->url]);
}
/**
* 添加
*/
public function add()
{
if (request()->isAjax()) {
$params= get_params();
$params['category_id']=$this->category_id;
(new Article())->add($params);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('url', $this->url);
return view('nk/article/add');
}
}
/**
* 修改
*/
public function edit()
{
$params= get_params();
(new Article())->edit($params);
return view('nk/article/edit',['url'=>$this->url]);
}
/**
* 查看信息
*/
public function read()
{
$params = get_params();
(new Article())->read($params);
return view('nk/article/read',['url'=>$this->url]);
}
/**
* 修改
*/
public function del()
{
$params= get_params();
(new Article())->del($params);
}
}

View File

@ -32,6 +32,23 @@
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">成熟周期<font>*</font></td>
<td colspan="6">
<div class="layui-input-inline">
开始时间 <input type="text" name="start_time" autocomplete="off" class="layui-input" placeholder="请输入开始时间 例1970-1-1" >
</div>
<div class="layui-input-inline">
结束时间 <input type="text" name="end_time" autocomplete="off" class="layui-input" placeholder="请输入结束时间 例1970-1-1">
</div>
<div class="layui-input-inline">
几周 <input type="text" name="zhouqi" autocomplete="off" class="layui-input" placeholder="请输入成熟周期 例3">
</div>
<div class="layui-input-inline">
产量 <input type="text" name="yield" autocomplete="off" class="layui-input" placeholder="请输入产量 例 9">
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">简介<font>*</font></td>
<td colspan="6">
@ -83,7 +100,7 @@
}, 1000);
}
}
tool.post('/admin/nk.products/add', data.field, callback);
tool.post('{$url[1]}', data.field, callback);
return false;
});
//日期选择

View File

@ -32,6 +32,23 @@
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">成熟周期<font>*</font></td>
<td colspan="6">
<div class="layui-input-inline">
开始时间 <input type="text" name="start_time" autocomplete="off" class="layui-input" placeholder="请输入开始时间 例1970-1-1" value="{$detail.cycle.start_time|default=''}" >
</div>
<div class="layui-input-inline">
结束时间 <input type="text" name="end_time" autocomplete="off" class="layui-input" placeholder="请输入结束时间 例1970-1-1" value="{$detail.cycle.end_time|default=''}">
</div>
<div class="layui-input-inline">
几周 <input type="text" name="zhouqi" autocomplete="off" class="layui-input" placeholder="请输入成熟周期 例3" value="{$detail.cycle.zhouqi|default=''}">
</div>
<div class="layui-input-inline">
产量 <input type="text" name="yield" autocomplete="off" class="layui-input" placeholder="请输入产量 例 9" value="{$detail.yield|default=''}">
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">简介<font>*</font></td>
<td colspan="6">

View File

@ -1,3 +1,12 @@
<!--
* @Author: mkm
* @Date: 2023-02-12 09:24:08
* @LastEditTime: 2023-02-12 10:35:15
* @LastEditors: your name
* @Description:
* @FilePath: \nk-lihaink-cn\app\admin\view\nk\maturity\read.html
* 可以输入预定的版权声明、个性签名、空行等
-->
{extend name="common/base"/}
{block name="style"}
<style>
@ -26,6 +35,23 @@
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">成熟周期<font>*</font></td>
<td colspan="6">
<div class="layui-input-inline">
开始时间 <input type="text" name="start_time" autocomplete="off" class="layui-input" placeholder="请输入开始时间 例1970-1-1" disabled value="{$detail.cycle.start_time|default=''}" >
</div>
<div class="layui-input-inline">
结束时间 <input type="text" name="end_time" autocomplete="off" class="layui-input" placeholder="请输入结束时间 例1970-1-1" disabled value="{$detail.cycle.end_time|default=''}">
</div>
<div class="layui-input-inline">
几周 <input type="text" name="zhouqi" autocomplete="off" class="layui-input" placeholder="请输入成熟周期 例3" disabled value="{$detail.cycle.zhouqi|default=''}">
</div>
<div class="layui-input-inline">
产量 <input type="text" name="yield" autocomplete="off" class="layui-input" placeholder="请输入产量 例 9" disabled value="{$detail.yield|default=''}">
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">简介<font>*</font></td>
<td colspan="6">

View File

@ -0,0 +1,142 @@
{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">
</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></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,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:120,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:120,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:120,
},{
field: 'title',
title: '文章标题',
},{
field: 'nickname',
title: '用户',
align: 'center',
},{
field: 'view_time',
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}
<!-- /脚本 -->

View File

@ -0,0 +1,93 @@
{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">文章标题</td>
<td colspan="3">{$detail.title}</td>
</tr>
<tr>
<td class="layui-td-gray">创建时间</td>
<td>{$detail.view_time}</td>
<td class="layui-td-gray">状态</td>
<td>
{eq name="$detail.status" value="1"}正常{/eq}
{eq name="$detail.status" value="0"}下架{/eq}
</td>
</tr>
<tr>
<td class="layui-td-gray">文章摘要</td>
<td colspan="3">{$detail.describe}</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容</td>
<td colspan="5" class="content-article">
{$detail.content|raw}
</td>
</tr>
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<tr >
<td class="layui-td-gray">回复内容:</td>
<td colspan="6">
{volist name="$detail.comment" id="vo"}
{$vo.user_info}的回复:{$vo.content}<br>
{/volist}
</td>
</tr>
{/if}
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<tr >
<td class="layui-td-gray">回复:</td>
<td colspan="6">
<textarea class="layui-textarea" name="reply" ></textarea>
</td>
</tr>
{/if}
</table>
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<input type="hidden" name="admin_id" value="{$admin_id}"/>
<input type="hidden" name="content" value="{$detail.content}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即回复</button>
</div>
{/if}
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/api/reply", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,142 @@
{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">
</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></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,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:120,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:120,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:120,
},{
field: 'title',
title: '文章标题',
},{
field: 'nickname',
title: '用户',
align: 'center',
},{
field: 'view_time',
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}
<!-- /脚本 -->

View File

@ -0,0 +1,93 @@
{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">文章标题</td>
<td colspan="3">{$detail.title}</td>
</tr>
<tr>
<td class="layui-td-gray">创建时间</td>
<td>{$detail.view_time}</td>
<td class="layui-td-gray">状态</td>
<td>
{eq name="$detail.status" value="1"}正常{/eq}
{eq name="$detail.status" value="0"}下架{/eq}
</td>
</tr>
<tr>
<td class="layui-td-gray">文章摘要</td>
<td colspan="3">{$detail.describe}</td>
</tr>
<tr>
<td class="layui-td-gray">文章内容</td>
<td colspan="5" class="content-article">
{$detail.content|raw}
</td>
</tr>
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<tr >
<td class="layui-td-gray">回复内容:</td>
<td colspan="6">
{volist name="$detail.comment" id="vo"}
{$vo.user_info}的回复:{$vo.content}<br>
{/volist}
</td>
</tr>
{/if}
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<tr >
<td class="layui-td-gray">回复:</td>
<td colspan="6">
<textarea class="layui-textarea" name="reply" ></textarea>
</td>
</tr>
{/if}
</table>
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<input type="hidden" name="admin_id" value="{$admin_id}"/>
<input type="hidden" name="content" value="{$detail.content}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即回复</button>
</div>
{/if}
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/api/reply", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->