作者 曹东东
... ... @@ -295,4 +295,17 @@ return [
//API接口地址
'api_url' => 'https://api.fastadmin.net',
],
//公众号
'officialAccount'=>[
'app_id' => 'wx401d047673f1c578',
'secret' => '2f99955f1964d30d6e962c345c268274',
'token' => 'wlzj3',
'response_type' => 'array',
'aes_key' => 'fT6nItu6itza0uIvFngi1AocwITGqOEe6GUCoqgTFDz'
],
//公众号 模板消息 模板id
'templateMessage'=>[
//审核通知
'currency' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',
],
];
... ...
... ... @@ -7,11 +7,14 @@ use app\common\controller\TeacherBase;
use app\school\model\basic\Clazz;
use app\school\model\basic\College;
use app\school\model\basic\Specialty;
use EasyWeChat\Factory;
use fast\Random;
use Overtrue\Socialite\AuthorizeFailedException;
use think\addons\Service;
use think\Cache;
use think\Config;
use think\Db;
use think\Exception;
use think\Lang;
use Upyun\Upyun;
... ... @@ -22,7 +25,8 @@ use Upyun\Upyun;
class Ajax extends TeacherBase
{
protected $noNeedLogin = ['lang','canvas','upyun_upload'];
protected $noNeedLogin = ['lang'];
//'canvas','upyun_upload'
protected $noNeedRight = ['*'];
protected $layout = '';
... ... @@ -310,9 +314,13 @@ class Ajax extends TeacherBase
public function canvas(){
$id = input('id');
if ($this->request->isPost()){
if (!$id) $this->error('用户数据异常');
if (!$id) $this->error('用户项目数据异常');
if (!$this->auth) $this->error('当前登录用户数据异常');
$teacher_name = $this->auth['username'];
$teacher_id = $this->auth['id'];
$detail = Db::table('fa_project_register')->where(['review_stage' => 0,'project_approval_status' => 0,'item_id' => $id])->find();
$detail = Db::table('fa_project_register')->where(['id' => $id])->find();
if ($detail['review_stage'] != 0) $this->error('用户项目数据不在立项评审阶段');
if ($detail['project_approval_status'] != 0) $this->error('用户项目数据不在立项审核阶段');
if (!$detail) $this->error('项目数据异常');
//判断是否是审核成员
$member_ids = Db::table('fa_members')
... ... @@ -345,7 +353,6 @@ class Ajax extends TeacherBase
}
}
//通过:project_approval_status => 1 退回:project_status => 2
$data['signature_url'] = $file_url;
$data['updatetime'] = time();
if ($type == 2){
... ... @@ -356,6 +363,8 @@ class Ajax extends TeacherBase
$msg = '通过';
}
Db::table("fa_project_register")->where('id',$id)->update($data);
//项目类型
$project_type_name = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
//fa_register_log project_type_name => fa_project_register.project_type--fa_project_type
$log['register_id'] = $id;
$log['container_id'] = $detail['container_id'];
... ... @@ -366,13 +375,33 @@ class Ajax extends TeacherBase
$log['verify_stage'] = 0;
$log['project_name'] = $detail['project_name'];
$log['project_type'] = $detail['project_type'];
$log['project_type_name'] = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
$log['project_type_name'] = $project_type_name;
$log['created_time'] = datetime('Y-m-d H:i:s',time());
$log['teacher_name'] = $this->auth['teacher_name'];
$log['teacher_name'] = $teacher_name;
$log['job_num'] = $this->auth['job_num'];
$log['operation'] = '项目审核' . $msg;
$log['memo'] = '项目审核';
$log['memo'] = $opinion;
Db::table("fa_register_log")->insert($log);
$open_id = Db::table('fa_user')->where('id',$detail['user_id'])->value('open_id');
if ($open_id){
$config = Config::get('officialAccount');
$app = Factory::officialAccount($config);
$app->template_message->send([
'touser' => $open_id,
'template_id' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',
'data' => array(
'first' => array('value' => "项目审核结果通知", 'color' => ''),
'keyword1' => array('value' => $project_type_name, 'color' => ''),
'keyword2' => array('value' => $detail['project_name'], 'color' => ''),
'keyword3' => array('value' => $msg, 'color' => ''),
'keyword4' => array('value' => $teacher_name, 'color' => ''),
'keyword5' => array('value' => $opinion, 'color' => ''),
'remark' => array('value' => '【您报名参加的' . $detail['project_name'] . '】被' . $msg, 'color' => ''),
),
]);
}
$this->success('操作成功',$file_url);
}
$this->view->assign('id',$id);
... ...
... ... @@ -8,8 +8,9 @@
<script src="__CDN__/assets/js/jquery-3.4.1.min.js"></script>
</head>
<body>
<body style="margin: 0;">
<div class="popverBox">
<div class="titleBox">项目审核</div>
<div id="signSure" class="signSure">
<input type="hidden" name="id" id="id" value="{$id}">
<div class="topBtnBox">
... ... @@ -34,7 +35,7 @@
<script>
function sureWriteCallback(imageBase64){
// 签名完成后的的逻辑代码...
// 签名完成后的的逻辑代码
$.ajax({
type : "POST", //提交方式
url : "canvas",//路径
... ... @@ -45,7 +46,12 @@
'opinion' : $('#opinion').val()
},//数据,这里使用的是Json格式进行传输
success:function (data) {
layer.msg('签名成功');
console.log('成功');
alert(data.msg)
},
error:function (data) {
console.log('失败')
alert(data.msg)
}
})
}
... ... @@ -61,30 +67,38 @@
<style>
.popverBox{
background: #666;;
background: #f2f2f2;
position: relative;
font-size: 30px;
/*height: 900px;*/
display: flex;
align-items: center;
flex-direction: column;
height: 100vh;
}
.signSure{
position: absolute;
left: 9%;
top: 4%;
/*transform: translate(-50%, -50%);*/
width: 80%;
background: #fff;
width: 90%;
border-radius: 16px;
padding: 20px 12px 28px 12px;
}
.titleBox{
color: #fff;
background-color: #4285dc;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 7rem;
font-size: 2.5rem;
}
.topTitle{
margin: 20px 0 12px 12px;
font-size: 30px;
font-size: 2.3rem;
}
.whiteBord{
width: 100%;
height: 400px;
border: 1px solid #eee;
background: #f6f6f6;
border: 1px solid #000;
background: #fff;
margin: 0 auto;
border-radius: 4px;
margin-bottom: 12px;
... ... @@ -117,22 +131,22 @@
}
.opinion{
width: 100%;
height: 179px;
height: 235px;
font-size: 30px;
color: white;
border: 1px solid #000;
}
.opinion::-webkit-input-placeholder{
height: 179px;line-height: 179px
line-height: 235px;text-align: center;
}/* 使用webkit内核的浏览器 */
.opinion:-moz-placeholder{
height: 179px;line-height: 179px
line-height: 235px;text-align: center;
}/* Firefox版本4-18 */
.opinion::-moz-placeholder{
height: 179px;line-height: 179px
line-height: 235px;text-align: center;
}/* Firefox版本19+ */
.opinion:-ms-input-placeholder{
height: 179px;line-height: 179px
line-height: 235px;text-align: center;
}
</style>
... ...