新增实名认证接口,后台文章回复,文章评论管理,文章投诉管理,轮播图管理,实名认证管理

This commit is contained in:
彭桃 2023-02-03 11:21:28 +08:00
parent 370f26fe70
commit d679a2c884
30 changed files with 1991 additions and 12 deletions

View File

@ -354,4 +354,32 @@ class Api extends BaseController
return to_assign(0, '', $list);
}
public function reply(){
$data= get_params();
$this->adminInfo = get_admin($data['admin_id']);
if ($this->adminInfo['user_id']>0){
$useraddress = Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->where('status', 1)->find();
$input=[];
if ($useraddress) {
$input['county'] = $useraddress['area_id'];
$input['township'] = $useraddress['street_id'];
$input['village'] = $useraddress['village_id'];
}
$input['user_id']=$this->adminInfo['user_id'];
$input['add_time']=date('Y-m-d H:i:s');
$input['content']=$data['reply'];
$input['vote_id']=$data['id'];
$res=Db::table('fa_article_comment')->strict(false)->field(true)->insert($input);
if ($res){
Db::table('fa_article')->where('id',$input['vote_id'])->update(['is_solve'=>1]);
return to_assign();
}else{
return to_assign(1, '操作失败');
}
}else{
return to_assign(1, '没有绑定前端用户,无法回复');
}
}
}

View File

@ -0,0 +1,135 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use app\admin\model\SzxcUserAuthentication as SzxcUserAuthenticationModel;
use app\admin\validate\SzxcUserAuthenticationValidate;
use think\exception\ValidateException;
use think\facade\Db;
use think\facade\View;
class SzxcUserAuthentication extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->model = new SzxcUserAuthenticationModel();
$this->uid = get_login_admin('id');
}
/**
* 数据列表
*/
public function datalist()
{
if (request()->isAjax()) {
$param = get_params();
$where = [];
$list = $this->model->getSzxcUserAuthenticationList($where,$param);
foreach ($list as $k=>$v){
$list[$k]['sh_time'] = date('Y-m-d H:i:s',$v['sh_time']);
$list[$k]['admin_id'] = Db::table('cms_admin')->where('id',$v['id'])->value('nickname');
}
return table_assign(0, '', $list);
}
else{
return view();
}
}
/**
* 添加
*/
public function add()
{
if (request()->isAjax()) {
$param = get_params();
// 检验完整性
try {
validate(SzxcUserAuthenticationValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$this->model->addSzxcUserAuthentication($param);
}else{
return view();
}
}
/**
* 编辑
*/
public function edit()
{
$param = get_params();
if (request()->isAjax()) {
// 检验完整性
try {
validate(SzxcUserAuthenticationValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$this->model->editSzxcUserAuthentication($param);
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = $this->model->getSzxcUserAuthenticationById($id);
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param = get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = $this->model->getSzxcUserAuthenticationById($id);
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
* type=0,逻辑删除,默认
* type=1,物理删除
*/
public function del()
{
$param = get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$this->model->delSzxcUserAuthenticationById($id,$type);
}
}

View File

@ -136,7 +136,14 @@ class Article extends BaseController
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_article')->where('id',$id)->find();
if (!empty($detail)) {
$detail['comment'] = Db::table('fa_article_comment')
->where('vote_id',$id)
->withAttr('user_info',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->select();
View::assign('detail', $detail);
View::assign('admin_id', $this->adminInfo['id']);
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
@ -149,7 +156,7 @@ class Article extends BaseController
{
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_article')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_article')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -170,7 +170,7 @@ class Comment extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_article_comment')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_article_comment')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -177,7 +177,7 @@ class Complaint extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_article_complaint')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_article_complaint')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -0,0 +1,168 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 轮播位置管理
*
* @icon fa fa-circle-o
*/
class Slide extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.slide/index',
'/admin/nk.slide/add',
'/admin/nk.slide/edit',
'/admin/nk.slide/del',
'/admin/nk.slide/read',
];
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
// $where['status']=1;
$where = [];
if (isset($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){
$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'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_slide')
->where($where)
->count();
$list = Db::table('fa_slide')
->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');
})
->withAttr('create_time',function ($value,$data){
return date('Y-m-d H:i:s',$data['create_time']);
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/slide/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$param['create_time']= time();
$res=Db::table('fa_slide')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$param['update_time']= time();
$res=Db::table('fa_slide')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_slide')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_slide')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_slide')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,172 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 轮播图管理
*
* @icon fa fa-circle-o
*/
class Slideinfo extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.slideinfo/index',
'/admin/nk.slideinfo/add',
'/admin/nk.slideinfo/edit',
'/admin/nk.slideinfo/del',
'/admin/nk.slideinfo/read',
];
// 获取轮播位置
$this->slide = Db::table('fa_slide')->where('status',1)->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
// $where['status']=1;
$where = [];
if (isset($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){
$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'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_slide_info')
->where($where)
->count();
$list = Db::table('fa_slide_info')
->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');
})
->withAttr('create_time',function ($value,$data){
return date('Y-m-d H:i:s',$data['create_time']);
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/slideinfo/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$param['create_time']= time();
$res=Db::table('fa_slide_info')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('slide', $this->slide);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$param['update_time']= time();
$res=Db::table('fa_slide_info')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_slide_info')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('slide', $this->slide);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_slide_info')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('slide', $this->slide);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_slide_info')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -164,7 +164,7 @@ class Article extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_article')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_article')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -160,7 +160,7 @@ class Branch extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_branch')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -168,7 +168,7 @@ class BranchPayList extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch_pay_list')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_branch_pay_list')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -175,7 +175,7 @@ class BranchPayUser extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch_pay_user')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_branch_pay_user')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -199,7 +199,7 @@ class Info extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_info')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_info')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -163,7 +163,7 @@ class Vote extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_vote')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_vote')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -161,7 +161,7 @@ class VoteComment extends BaseController
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_vote_comment')->where('id',$id)->update(['status'=>$type]);
$res = Db::table('fa_szxc_party_vote_comment')->where('id',$id)->delete();
if ($res){
return to_assign();
}else{

View File

@ -0,0 +1,102 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\model;
use think\model;
class SzxcUserAuthentication extends Model
{
/**
* 获取分页列表
* @param $where
* @param $param
*/
public function getSzxcUserAuthenticationList($where, $param)
{
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
$order = empty($param['order']) ? 'id desc' : $param['order'];
$list = self::where($where)->field('id,user_id,name,idcard,pic_z,pic_f,status,create_time,update_time,admin_id')->order($order)->paginate($rows, false, ['query' => $param]);
return $list;
}
/**
* 添加数据
* @param $param
*/
public function addSzxcUserAuthentication($param)
{
$insertId = 0;
try {
$param['create_time'] = time();
$insertId = self::strict(false)->field(true)->insertGetId($param);
add_log('add', $insertId, $param);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
return to_assign(0,'操作成功',['aid'=>$insertId]);
}
/**
* 编辑信息
* @param $param
*/
public function editSzxcUserAuthentication($param)
{
try {
$param['update_time'] = time();
$find = self::where('id', $param['id'])->find();
if($param['status'] != $find['status']){
$param['sh_time'] = time();
$param['admin_id'] = get_login_admin('id');
}
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
add_log('edit', $param['id'], $param);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
return to_assign();
}
/**
* 根据id获取信息
* @param $id
*/
public function getSzxcUserAuthenticationById($id)
{
$info = self::where('id', $id)->find();
return $info;
}
/**
* 删除信息
* @param $id
* @return array
*/
public function delSzxcUserAuthenticationById($id,$type=0)
{
if($type==0){
//逻辑删除
try {
$param['delete_time'] = time();
self::where('id', $id)->update(['delete_time'=>time()]);
add_log('delete', $id);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
}
else{
//物理删除
try {
self::where('id', $id)->delete();
add_log('delete', $id);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
}
return to_assign();
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\validate;
use think\Validate;
class SzxcUserAuthenticationValidate extends Validate
{
protected $rule = [
'name' => 'require',
'idcard' => 'require',
'pic_z' => 'require',
'pic_f' => 'require',
'status' => 'require',
];
protected $message = [
'name.require' => '姓名不能为空',
'idcard.require' => '身份证号不能为空',
'pic_z.require' => '身份证正面不能为空',
'pic_f.require' => '身份证反面不能为空',
'status.require' => '审核状态不能为空',
];
}

View File

@ -33,7 +33,61 @@
{$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,81 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</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="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入标识"
autocomplete="off" placeholder="请输入标识" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input"></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,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.slide/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,86 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</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="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入标识"
autocomplete="off" placeholder="请输入标识" class="layui-input" value="{$detail.name}"></td>
</tr>
<tr>
<td class="layui-td-gray">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input" value="{$detail.desc}"></td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" title="正常" {if $detail.status==1} checked {/if}>
<input type="radio" name="status" value="0" title="禁用" {if $detail.status==0} checked {/if}>
</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,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/nk.slide/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,147 @@
{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:100,
},{
field: 'title',
title: '标题',
align: 'center',
width:120,
},{
field: 'name',
title: '标识',
align: 'center',
width:80,
},{
field: 'desc',
title: '描述',
align: 'center',
width:300,
},{
field: 'create_time',
title: '添加时间',
align: 'center',
width:150,
},{
field: 'status', width: 100, title: '状态', align: 'center', templet: function (d) {
var html = '<span style="color:#fbbc05">禁用</span>';
if (d.status == '1') {
html = '<span style="color:#12bb37">正常</span>';
}
return html;
}
},{
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,44 @@
{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;}
.layui-td-gray{
width: 110px;
}
</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"><input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">标识<font>*</font></td>
<td colspan="7"><input type="text" name="name" lay-verify="required" lay-reqText="请输入标识"
autocomplete="off" placeholder="请输入标识" class="layui-input" value="{$detail.name}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input" value="{$detail.desc}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" disabled title="正常" {if $detail.status==1} checked {/if}>
<input type="radio" name="status" value="0" disabled title="禁用" {if $detail.status==0} checked {/if}>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View 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;
}
.layui-td-gray{
width: 110px;
}
</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="3">
<div class="layui-col-md6">
<select name="slide_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='slide' id='vo'}
<option value="{$vo.id}" >{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<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">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray">图片</td>
<td colspan="7">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传图片</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="150" style="max-width: 100%; height:66px;"/>
<input type="hidden" name="img" value="">
</div>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">跳转路径<font>*</font></td>
<td colspan="7"><input type="text" name="src" lay-verify="required" lay-reqText="请输入跳转路径"
autocomplete="off" placeholder="请输入跳转路径" class="layui-input"></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 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 form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.slideinfo/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,105 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</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="3">
<div class="layui-col-md6">
<select name="slide_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='slide' id='vo'}
<option value="{$vo.id}" {if $detail.slide_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<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">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input" value="{$detail.desc}"></td>
</tr>
<tr>
<td class="layui-td-gray">图片</td>
<td colspan="7">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传图片</button>
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
<img src="{$detail.img}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="150" style="max-width: 100%; height:66px;"/>
<input type="hidden" name="img" value="{$detail.img}">
</div>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">跳转路径<font>*</font></td>
<td colspan="7"><input type="text" name="src" lay-verify="required" lay-reqText="请输入跳转路径"
autocomplete="off" placeholder="请输入跳转路径" class="layui-input" value="{$detail.src}"></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,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/nk.slideinfo/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,175 @@
{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="thumb">
<img src="{{d.img}}" />
</script>
<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:80,
},{
field: 'slide_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: '标题',
align: 'center',
width:120,
},{
field: 'desc',
title: '描述',
align: 'center',
width:120,
},{
field: 'img',
title: '图片',
align: 'center',
toolbar: '#thumb',
width:200,
},{
field: 'src',
title: '跳转路径',
align: 'center',
width:180,
},{
field: 'create_time',
title: '添加时间',
align: 'center',
width:150,
},{
field: 'status', width: 100, title: '状态', align: 'center', templet: function (d) {
var html = '<span style="color:#fbbc05">禁用</span>';
if (d.status == '1') {
html = '<span style="color:#12bb37">正常</span>';
}
return html;
}
},{
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,62 @@
{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;}
.layui-td-gray{
width: 110px;
}
</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="3">
<div class="layui-col-md6">
<select name="slide_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='slide' id='vo'}
<option value="{$vo.id}" {if $detail.slide_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<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}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">描述</td>
<td colspan="7"><input type="text" name="desc" autocomplete="off" class="layui-input" value="{$detail.desc}" readonly></td>
</tr>
<tr>
<td class="layui-td-gray">图片</td>
<td colspan="7">
<div class="layui-upload">
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
<img src="{$detail.img}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="150" style="max-width: 100%; height:66px;"/>
<input type="hidden" name="img" value="{$detail.img}">
</div>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">跳转路径<font>*</font></td>
<td colspan="7"><input type="text" name="src" lay-verify="required" lay-reqText="请输入跳转路径"
autocomplete="off" placeholder="请输入跳转路径" class="layui-input" value="{$detail.src}" readonly></td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,97 @@
{extend name="common/base"/}
<!-- 主体 -->
{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-2">姓名<font>*</font></td>
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善姓名" value="" autocomplete="off" placeholder="请输入姓名" class="layui-input"></td><td class="layui-td-gray-2">身份证号<font>*</font></td>
<td><input type="text" name="idcard" lay-verify="required" lay-reqText="请完善身份证号" value="" autocomplete="off" placeholder="请输入身份证号" class="layui-input"></td><td class="layui-td-gray-2">审核状态<font>*</font></td>
<td>
<input type="radio" name="status" value="0" title="选项一">
<input type="radio" name="status" value="1" title="选项二">
</td>
</tr>
<tr><td class="layui-td-gray-2">身份证正面<font>*</font></td>
<td colspan="5" style="vertical-align:top">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_pic_z">选择上传图片</button>
<div class="layui-upload-list" id="upload_box_pic_z">
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px;max-width:200px" />
<input type="hidden" name="pic_z" value="" lay-verify="required" lay-reqText="请完善身份证正面">
</div>
</div>
</td>
</tr><tr><td class="layui-td-gray-2">身份证反面<font>*</font></td>
<td colspan="5" style="vertical-align:top">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_pic_f">选择上传图片</button>
<div class="layui-upload-list" id="upload_box_pic_f">
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px;max-width:200px" />
<input type="hidden" name="pic_f" value="" lay-verify="required" lay-reqText="请完善身份证反面">
</div>
</div>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="0"/>
<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'];
function gouguInit() {
var form = layui.form, tool = layui.tool;
//上传身份证正面
var upload_pic_z = layui.upload.render({
elem: '#upload_btn_pic_z',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_pic_z input').attr('value', res.data.filepath);
$('#upload_box_pic_z img').attr('src', res.data.filepath);
}
});//上传身份证反面
var upload_pic_f = layui.upload.render({
elem: '#upload_btn_pic_f',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_pic_f input').attr('value', res.data.filepath);
$('#upload_box_pic_f img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/szxc_user_authentication/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,175 @@
{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="szxc_user_authentication" lay-filter="szxc_user_authentication"></table>
</div>
<script type="text/html" id="pic_z">
<img src="{{d.pic_z}}" />
</script>
<script type="text/html" id="pic_f">
<img src="{{d.pic_f}}"/>
</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: '#szxc_user_authentication',
title: '列表',
toolbar: '#toolbarDemo',
url: '/admin/szxc_user_authentication/datalist',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width: 80
},{
field: 'user_id',
title: '用户id',
align: 'center',
width: 100
},{
field: 'name',
title: '姓名',
align: 'center',
width: 100
},{
field: 'idcard',
title: '身份证号',
align: 'center',
width: 150
},{
field: 'pic_z',
title: '身份证正面',
align: 'center',
width: 200,
toolbar: '#pic_z',
},{
field: 'pic_f',
title: '身份证反面',
align: 'center',
width: 200,
toolbar: '#pic_f',
},{
field: 'status',
title: '审核状态',
align: 'center',
width: 100,
templet: function (d) {
var html = '<span style="color:#fbbc05">审核中</span>';
if (d.status == '1') {
html = '<span style="color:#12bb37">通过</span>';
}
if (d.status == '2') {
html = '<span style="color:#EE5757">不通过</span>';
}
return html;
}
},{
field: 'create_time',
title: '提交时间',
align: 'center',
width: 150
},{
field: 'sh_time',
title: '审核时间',
align: 'center',
width: 150
},{
field: 'admin_id',
title: '审核人',
align: 'center',
width: 100
},
{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(szxc_user_authentication)', function(obj){
if (obj.event === 'add') {
tool.side("/admin/szxc_user_authentication/add");
return false;
}
});
//监听表格行工具事件
table.on('tool(szxc_user_authentication)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/szxc_user_authentication/read?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('/admin/szxc_user_authentication/edit?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("/admin/szxc_user_authentication/del", { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,103 @@
{extend name="common/base"/}
<!-- 主体 -->
{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-2">姓名<font>*</font></td>
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善姓名" value="{$detail.name}" autocomplete="off" placeholder="请输入姓名" class="layui-input"></td><td class="layui-td-gray-2">身份证号<font>*</font></td>
<td><input type="text" name="idcard" lay-verify="required" lay-reqText="请完善身份证号" value="{$detail.idcard}" autocomplete="off" placeholder="请输入身份证号" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray-2">审核状态<font>*</font></td>
<td>
<input type="radio" name="status" value="0" title="审核中" {eq name="$detail.status" value="0"} checked{/eq}>
<input type="radio" name="status" value="1" title="通过" {eq name="$detail.status" value="1"} checked{/eq}>
<input type="radio" name="status" value="2" title="不通过" {eq name="$detail.status" value="2"} checked{/eq}>
</td>
</tr>
<tr>
<td class="layui-td-gray-2">身份证正面<font>*</font></td>
<td colspan="5" style="vertical-align:top">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_pic_z">选择上传图片</button>
<div class="layui-upload-list" id="upload_box_pic_z">
<img src="{$detail.pic_z}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px;max-width:200px" />
<input type="hidden" name="pic_z" value="{$detail.pic_z}" lay-verify="required" lay-reqText="请完善身份证正面">
</div>
</div>
</td>
</tr><tr><td class="layui-td-gray-2">身份证反面<font>*</font></td>
<td colspan="5" style="vertical-align:top">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_pic_f">选择上传图片</button>
<div class="layui-upload-list" id="upload_box_pic_f">
<img src="{$detail.pic_f}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px;max-width:200px" />
<input type="hidden" name="pic_f" value="{$detail.pic_f}" lay-verify="required" lay-reqText="请完善身份证反面">
</div>
</div>
</td>
</tr>
</table>
<div class="py-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'];
function gouguInit() {
var form = layui.form, tool = layui.tool;
//上传身份证正面
var upload_pic_z = layui.upload.render({
elem: '#upload_btn_pic_z',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_pic_z input').attr('value', res.data.filepath);
$('#upload_box_pic_z img').attr('src', res.data.filepath);
}
});//上传身份证反面
var upload_pic_f = layui.upload.render({
elem: '#upload_btn_pic_f',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_pic_f input').attr('value', res.data.filepath);
$('#upload_box_pic_f img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/szxc_user_authentication/edit", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,35 @@
{extend name="common/base"/}
<!-- 主体 -->
{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-2">用户id</td>
<td>{$detail.user_id}</td><td class="layui-td-gray-2">姓名</td>
<td>{$detail.name}</td><td class="layui-td-gray-2">身份证号</td>
<td>{$detail.idcard}</td>
</tr><tr><td class="layui-td-gray-2">审核状态</td>
<td>
{eq name="$detail.status" value="0"}选项一{/eq}
{eq name="$detail.status" value="1"}选项二{/eq}
</td><td class="layui-td-gray-2">提交时间</td>
<td>{$detail.create_time|time_format=###,'Y-m-d'}</td><td class="layui-td-gray-2">审核时间</td>
<td>{$detail.update_time|time_format=###,'Y-m-d'}</td>
</tr><tr><td class="layui-td-gray-2">审核人</td>
<td>
{eq name="$detail.admin_id" value="1"}选项一{/eq}
{eq name="$detail.admin_id" value="2"}选项二{/eq}
</td><td colspan='4'></td>
</tr><tr><td class="layui-td-gray-2">身份证正面</td>
<td colspan="5">
<img src="{$detail.pic_z}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px; max-width:200px" />
</td>
</tr><tr><td class="layui-td-gray-2">身份证反面</td>
<td colspan="5">
<img src="{$detail.pic_f}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" style="width:200px; max-width:200px" />
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -32,7 +32,13 @@ class User extends BaseController
{
$user = Db::table('fa_user')->where('id',JWT_UID)->find();
$user_msg = Db::table('fa_szxc_information_usermsg')->where('user_id',JWT_UID)->field('id,name,address_name,phone')->find();
$this->apiSuccess('', ['nickname' => $user['nickname'],'phone'=>$user_msg['phone'],'avatar'=>$user['avatar'],'address_name'=>$user_msg['address_name'],'name'=>$user_msg['name']]);
$this->apiSuccess('', [
'nickname' => $user['nickname'],
'phone'=>$user_msg['phone'],
'avatar'=>$user['avatar'],
'address_name'=>$user_msg['address_name'],
'name'=>$user_msg['name']
]);
}
/**
@ -423,4 +429,51 @@ class User extends BaseController
$this->apiError($this->auth->getError());
}
}
// 用户实名认证
public function realname(){
$params = get_params();
$uid = JWT_UID;
$params['user_id'] = $uid;
$is_have = Db::table('cms_szxc_user_authentication')->where('user_id',$uid)->find();
if($is_have){
if($is_have['status'] == 0){
$this->apiError('您的实名认证正在审核中','您的实名认证正在审核中');
}elseif ($is_have['status'] == 1){
$this->apiError('您的实名认证已通过','您的实名认证已通过');
}elseif ($is_have['status'] == 2){
$params['status'] = 0;
$params['create_time'] = time();
$res = Db::table('cms_szxc_user_authentication')->where('user_id',$uid)->strict(false)->field(true)->update($params);
if($res){
$this->apiSuccess('提交成功');
}else {
$this->apiError('提交失败');
}
}else{
$this->apiError('数据出错了','数据出错了');
}
}else{
$params['create_time'] = time();
$res = Db::table('cms_szxc_user_authentication')->strict(false)->field(true)->insert($params);
if($res){
$this->apiSuccess('提交成功');
}else {
$this->apiError('提交失败');
}
}
}
// 获取实名认证信息
public function get_shiming(){
$uid = JWT_UID;
$is_have = Db::table('cms_szxc_user_authentication')->where('user_id',$uid)->find();
if($is_have){
$this->apiSuccess('获取成功',$is_have);
}else{
$this->apiError('您还没有提交实名认证','您还没有提交实名认证');
}
}
}