Commit bae9eb62 authored by 杨培's avatar 杨培

修改提交课堂申请后的提示文字,并自动跳转

parent be66c8fb
...@@ -90,7 +90,11 @@ class ClassesInfoController extends \yii\web\Controller ...@@ -90,7 +90,11 @@ class ClassesInfoController extends \yii\web\Controller
if (!$agreement) { if (!$agreement) {
$model->addError('agreement', '必须同意使用协议'); $model->addError('agreement', '必须同意使用协议');
} elseif ($model->validate() && $model->save()) { } elseif ($model->validate() && $model->save()) {
return $this->render('@app/views/site/success', ['message'=>'您已成功提交课堂申请,我们将尽快为您审核通过。']); return $this->render('@app/views/site/success', [
'message'=>'您已成功提交课堂申请,审核结果将以短信形式通知您。',
'redirect' => \yii\helpers\Url::to(['/user-center/info']),
'timer' => '2500'
]);
} }
} }
......
<?php <?php
/** /**
* Created by PhpStorm. * @var $message string
* User: pader * @var $redirect string
* Date: 2016/10/20 * @var $timer int
* Time: 19:02
*/ */
use frontend\assets\AppAsset; use frontend\assets\AppAsset;
...@@ -46,6 +45,16 @@ body{ ...@@ -46,6 +45,16 @@ body{
} }
CSS; CSS;
if (!empty($redirect)) {
$jumpJs = <<<EOD
setTimeout(function() {
location.href = "$redirect";
}, $timer);
EOD;
$this->registerJs($jumpJs);
}
$this->registerCss($css); $this->registerCss($css);
$this->title = '提示'; $this->title = '提示';
?> ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment